Community
Participate
Working Groups
I have a little complex scenario in which search for references fails. I have some source files in a java project. These source files along with other files are compiled outside Eclipse (because they use preprocessor) into a jar file. The jar file is then added to the project as "external jar file" library. Some of the source files in the project depend on (e.g., extend) classes that are only found in the jar file. (This poses a small bootstrapping problem, which requires me to initially generate the jar file outside eclipse). This also means that the same class appears both as source file and packaged into a jar file. The problem is as follows: I have class "jar_only.ExternalClass" that extends "source.MyClass" (that is an external class extends my source class) Another class "source.UtilityClass" calls a final method "coolMethod" on a variable of type "jar_only.ExternalClass" while the method is defined in "source.MyClass". When I try to search for all references to this method, no results are displayed (i.e, 0 references found). However, when I open "source.UtilityClass" and press "F3" on the method invocation, the correct file is opened (that is source.MyClass) and the correct method is selected. The behavior is consistent and reproducible.
Would it possible that you zip your project and attach it to this bug? Thanks
It seems that it's a ClasspathSourceDirectory issue. There's a Plan.java in excluded org/mmtk/vm folder of source folder src which have SemiSpace as superclass. While resolve import of Plan, method findClass(String, String, String) of ClasspathSourceDirectory class does not skip excluded folder while getting file. Superclasses hierarchy of Plan is invalid and that's explain why Search cannot find correct references. Jerome, I'll send you all necessary files to reproduce the problem...
Created attachment 16897 [details] Proposed patch I was able to reproduce. Indeed the exclusion pattern was not taken into account. Attached is a proposed fix.
Moving back to Frederic to add a regression test.
Released in HEAD. Test case added in JavaSearchBugsTests
Verifid in I20050214-0927 for 3.1M5