| Summary: | [1.8][organize imports] Unused static import for Character::isUpperCase added | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Timo Kinnunen <timo.kinnunen> | ||||||||
| Component: | UI | Assignee: | Noopur Gupta <noopur_gupta> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | jarthana, markus.kell.r, noopur_gupta | ||||||||
| Version: | 4.4 | ||||||||||
| Target Milestone: | BETA J8 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 238392 [details]
Patch
Comment on attachment 238392 [details]
Patch
Attached a patch to prevent the addition of static import in case of method references. Markus, please review.
Created attachment 238395 [details]
Patch + Test
Updated patch with test
Created attachment 238849 [details]
Patch + Test
Updated patch based on mmathew/BETA_JAVA8 branch.
Released test with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=5e66e8472e34be92037ee14a97b8af1a4339af50 and a better fix with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=57f21feee55057978300e56a0cc1fea109c4b518 We already have that nice ASTVisitor, so we better add the missing visit(*) methods rather than adding this logic after the binding resolution already happened. Verified as working for Eclipse + Java 8 RC2 using Kepler SR2 + Eclipse Java Development Tools Patch for Java 8 Support (BETA) 1.0.0.v20140306-1935 |
This program: import java.util.function.IntPredicate; class UnusedStaticImport { boolean value = match(Character::isUpperCase, 'A'); public static boolean match(IntPredicate matcher, int codePoint) { return matcher.test(codePoint); } } Organize imports adds an unused line, leading to a warning: import static java.lang.Character.isUpperCase; This happens when organize imports is executed from save actions, clean up or organize imports menu item. Tested with Eclipse R4.3.1+BETA_JAVA8 binaries updated yesterday.