Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Search Engine default behavior for while searching generic types references



Hi,

We're about to release for milestone 4 full search support
for generic _types_.

In milestone 3, we already released initial support for it
using search dialog. User was able to find references to
parameterized types as List<String>.

User we'll be now able to perform search directly from
Editor, Package Explorer or Outline view.

However, with generic types, there's now three different
ways for search engine to decide whether a reference in the
code matches a pattern or not:
1. Reference must be exactly the same than the pattern.
   For example, if user select List<Exception>, only
   List<Exception> will be reported. List <Object>,
   List (raw type), List<? super RuntimeException> will not.
2. Reference may be equivalent to the given pattern.
   With List<Exception> example, List (raw type),
   List<? extends Throwable>, etc... will be reported,
   but List <Object> will still not be.
3. Reference only have to have the same erasure than the
   pattern. Then all previous references will match.
   For example, refactoring will use this mode to refactor
   a type starting from a parameterized type.

To be able to specify how search engine has to behave while
performing the search, new matchRule bit pattern values have
been added on SearchPattern: R_EQUIVALENT_MATCH and
R_ERASURE_MATCH.
They can be combined with all previous values of matchRule
(ie. R_EXACT_MATCH, R_CASE_SENSITIVE, etc...).

Search engine will perform mode 1 search if none of these
bits is set, mode 2 if R_EQUIVALENT_MATCH is set and
finally mode 3 if R_ERASURE_MATCH is set.
Note that set both of these bits will be equivalent to
mode 3.

So, now we need to decide what should be the default mode
for search engine and the debate is still not closed...
Currently we would like to have mode 1 as default due to the
fact that the current default is to find perfect match (when
foo method is selected, SE does not find Foo methods).
But this mode may have some impact if there's already
clients using Search Engine with 1.5.

If you're interested in this, please let us know what's your
feeling/desire about that and we'll try to merge them and
find the most consensual agreement...


Cordialement/Regards,

Frédéric




Back to the top