Project: JDT
Bug 155013 [search] [DCR] More finegrained options for Java search
Reported: 2006-08-24 06:09:07 | Status: verified fixed

20060824 A first step toward more advanced searching would be to offer more finegrained search criterias. Currently it is only possible to find all type references of 'X'. It would be nice to distinguish the references by the AST-location where they were used. For example inside as a cast type ((X) a).foo()) or as a variable type. (X var;) type reference locations: - reference in field type - reference in variable type - reference in method return type - reference in method parameters - reference in throws declaration - reference in super class - reference in super interface declaration - reference in catch block - reference in cast - reference in static member access (X.foo()) - reference in class instance creation (new X()) - reference in class literal access (foo(X.class)) - reference in type variable bounds (class A<E extends X>) - reference in import declaration (import p.X;) - reference in annotation (@X void foo()) - reference in annotation argument (@A(arg=@X)) void foo()) - reference as parameterized type argument (List<X>) - reference as wild card bound (? extends X) The last 2 options could probably be combined with the other bits ('A<X> foo;' X matches if 'parameterized type argument' and 'variable type' are set) method reference locations: - as super invocation (super.x()) - with qualifier (a.x()) - with this (this.x() or x()) - as annotation argument (@A(x="Hello")) field reference locations: - with qualifier (a.x()) - with this (this.x() or x()) - read access - write access This information would best be returned when a match is found. Or/and a mask is passed on search so only those references are reported.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java