Community
Participate
Working Groups
All of the subclasses of AllocationExpression need to be inspected to see if they need to change suitably for <> With the patch posted at bug 339478 comment 33 (this patch addresses, AE and QAE fully) compiler support is fully in place, but code select fails in the following test case: public class X<T> { T field1; public X(T param) { field1 = param; } public static void testFunction(String param){ System.out.println(1); } public static void testFunction(Object Param) { System.out.println(2); } public T getField() { return field1; } public static void main(String[] args) { X.testFunction(new X<>("hello").getField()); } } Clicking on the X just before the <> takes me to the class rather than to the constructor. If the type was not elided, it takes me to the constructor. The subclasses around javadoc, completion, selection and code snippet evaluation needs to change suitably. Ayush, please engage Satyam as needed. Please mark me as reviewer - Thanks.
I will look into this.
Created attachment 196413 [details] A Patch This patch fixes the selection problems, but code snippet evaluator still has problems. CodeSnippetAllocationExpression overrides AllocationExpression#resolvedType and this function has to take care of the new changes that has happened. I am currently looking into it.
Created attachment 196426 [details] Proposed patch + regression tests I missed out the changes in SelectionParser in my last patch :( This patch also fixes the problem in code snippet processing also - some more testing need to be done here.
All tests pass. Srikanth, Please review.
Patch looks good to me.
Srikanth found one problem while trying to call the constructor of an inner class of a parameterized outer type through the display view. This happens even without diamond case and happens on older versions also and hence filed 347274 to track that.
Thanks Srikanth for the review. Released the patch in the Java7 branch
Verified using patch feature 1.0.0-20110623-0900