Community
Participate
Working Groups
Method and constructor references should be understood by the formatter and processed properly.
Srinkanth, I'm ready to submit the patch for this -- would you prefer this as a cumulative patch to the patches in bug 402173 (formatter for lambda), or do you want an independent patch for this. (Silly me, I'd clumped all of the formatting for 1.8 into one test case, so now I'm picking it apart).
(In reply to comment #1) > Srinkanth, I'm ready to submit the patch for this -- would you prefer this > as a cumulative patch to the patches in bug 402173 (formatter for lambda), > or do you want an independent patch for this. > (Silly me, I'd clumped all of the formatting for 1.8 into one test case, so > now I'm picking it apart). Sorry, I didn't see this question earlier. But it is answered by the fact that the lambda work is released already. If you post a patch for reference expressions alone, I'll take it forward.
Created attachment 228178 [details] Format support for method and constructor references This is extracted from the patch posted by Jesper (https://bugs.eclipse.org/bugs/attachment.cgi?id=227503) at https://bugs.eclipse.org/bugs/show_bug.cgi?id=400830. I did not extract the tests from there since all of the tests involve 308 annotations. I'll add fresh tests to verify the functionality.
(In reply to comment #3) > Created attachment 228178 [details] > Format support for method and constructor references I made the following changes and released the fix here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=c4e062ebcfc48b14b7c36c591e88d44ce5b3b5c0 - Thanks Jesper. Tests will follow in a separate patch. (1) Since the posting of the patch at (https://bugs.eclipse.org/bugs/attachment.cgi?id=227503) at https://bugs.eclipse.org/bugs/show_bug.cgi?id=400830, the fields of ReferenceExpression have undergone a change. The field method which used to be a SingleNameReference does not exist any more and has been replaced with 'selector' which a char [] that stores the identifier. Adjusted the patch accordingly. (2) The type argument printing code appears to be copied from PSTR/PQTR processing code - this is incorrect. We should adapt it from formatMessageSend.
Tests released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=4da206fbf61a10e973b62f504ebc9e4e8671589b Thanks Jesper. Please include the tests that combine 335 and 308 as part of type annotations formatting work.