You are here

Add new comment

Error message

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.

Efficient use of Eclipse Java Search

The documentation for Eclipse Java Search is quite brief; bellow is a guide for efficient use.

There is no search filter for private, package, private or public access and also no filter for static and instance methods. Fortunately the result view shows icons and can be partially filtered.

Searching for methods (Case sensitive: yes, Search for: Method, Limit to: Declarations):

Search string Result
myMethod all unqualified myMethod methods with any number of parameters
myMethod() all unqualified myMethod methods without parameters
myMethod(Object) all unqualified myMethod methods with single parameter of unqualified type Object, it means that myMethod(Integer) will not match
myMethod(Integer) all unqualified myMethod methods with single parameter of unqualified type Integer, it means that for instance myMethod(MyClass.Integer) will match too
myMethod(java.lang.Integer) all unqualified myMethod methods with single parameter of qualified type java.lang.Integer, it means that for instance myMethod(MyClass.Integer) will not match
MyClass.myMethod all partially qualified MyClass.myMethod methods with any number of parameters
mypkg.MyClass.myMethod all fully qualified mypkg.MyClass.myMethod methods with any number of parameters
myMetho*(double, *) all unqualified myMetho* methods with 2 parameters, first parameter of type double, second parameter of any type
* List Select Method and Declaration - search for method declaration returning List (but not ArrayList)
* *List Select Method and Declaration - search for method declaration returning List, ArrayList or anything ending in List

When you search for method references, the above table applies too but Eclipse will take into account type hierarchy, so myMethod(new Integer()) will be matched by search for myMethod(Object).

Note that the search is not case sensitive by default.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.