Community
Participate
Working Groups
Given a class X<T> the Java search dialog lets me search for references to type "X<String>", but the search result includes all references to X regardless their actual type parameters. Is this a feature, a UI bug, a Core bug?
> Is this a feature, a UI bug, a Core bug? I think this is a Core bug/feature :) Satyam ?
JDT/Core search returns all matches but sets the rule flag. The rule flag is set to Exact when there is an exact match and set to Erasure when the type parameter doesn't match. JDT/UI should probably provide a way to filter the Erasure types.
Yeah, it does not make much sense to show all matches while searching for X<String>. But we should probably show all matches while searching for X<T>, where T is the type parameter used in the type declaration. Not sure if doing the two things is possible.
So I just ran into this problem. I wanted to search for all methods returning a "List<MyClass>". So I selected the "Method" search type, and used the search pattern: "* List<MyClass>". But the results were for methods that returned any type of List. I also tried the "Type" search type, and under "Match locations" selected "Method return types", and used the pattern: "List<MyClass>". I got the same result, all methods that returned any type of List, not just those that were specifically "MyClass". This seems like a large bug. The "Java Search Tab" help even specifically gives the example of "List<String>" for a type pattern. I don't think you'd need or want to have "X<T>" show all generic matches, the match patterns already have wildcards, and you could just do "X" by itself if you wanted all matches. I opened this stackoverflow before realizing that this was already a bug: http://stackoverflow.com/questions/39754974/how-to-search-for-methods-that-return-a-list-of-a-specific-class-in-eclipse
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.