EditorContainer ... the method looks like a mistake: it is commented "do
not use"!
-- Jon
On 6/5/20 9:13 AM, Hannes Wallnoefer wrote:
Please review:
JBS: https://bugs.openjdk.java.net/browse/JDK-8198705
Webrev: http://cr.openjdk.java.net/~hannesw/8198705/webrev.00/
This adds code in AbstractIndexBuilder to detect search index items that
display the same label in the search result. If there are, the module
information is added to the index item in an attempt to keep them apart.
Unfortunately, this catches a few „false positives“ where equal labels are not
caused by same name types in different modules. For example in JDK there is
javax.swing.tree.DefaultTreeCellEditor.EditorContainer.EditorContainer() which
is both a constructor and a method. (Would be interesting to know the history
of that method.)
I have tried working around this by trying to detect only identical labels that
actually reside in diffferent modules, but the code got so complex that I
thought it wasn’t worth the effort, especially since this is such a corner case
and the effect is rather harmless (the module name being displayed in search
results).
The module name is displayed simply by prepending it to the fully qualified
type or member name separated by a slash character, e.g. module/package.Class
or module/package.Class.member(). I did not use the extra module label approach
since it looked odd when mixed with results without module label.
An example of API docs using this can be viewed here (enter „c“ in the search
field):
http://cr.openjdk.java.net/~hannesw/8198705/out.00/
Thanks,
Hannes