Community
Participate
Working Groups
I20100608-0911 While looking at bug 303617, I found that we have a few bugs in enablement and precondition checking of Extract... refactorings with certain selections. E.g. if you select a package name or an annotation, the refactorings are available in the quick menu and don't even stop in the initial condition checking. Same problem for Extract Local and Extract Method for selections in an annotation's arguments.
When bug 303617 is fixed, JavaTextSelection#resolveInAnnotation() can be used to hide some refactorings for annotations and annotation arguments. Test class: package xy; import java.util.ArrayList; @Annotation("all") //@Annotation({"all", "rawtypes"}) //@Annotation(value= "all") //@Annotation(value= {"all", "rawtypes"}) public class Try extends ArrayList { @Annotation("all" + "a") java.util.Vector v= new Bla(); void m() { @Annotation(value= "all" + "a") final java.util.Vector v= new Bla(); } } @interface Annotation { String[] value(); }
Created attachment 172240 [details] Fix
Fixed in HEAD.
Created attachment 172595 [details] Additional fix for failing test