Bug 86901

Summary: [1.5][search] Static import method references not found in unused import
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for the implementation of this functionality none

Description Frederic Fusier CLA 2005-03-01 07:50:19 EST
Using HEAD.

Unused method static import are not found by search engine.

Use following test case:
A.java:
    package s2;
    import static s2.pack.age.S.*;
    import static s2.pack.age.S.out;
    import static s2.pack.age.S.M.in;
    public class A {}
S.java:
    package s2.pack.age;
    public class S {
        public final static String out() { return "out"; }
        public static class M {
	    public final static String in() { return "in"; }
        }
    }

And find references to out or in methods => no match will be found...
Comment 1 Frederic Fusier CLA 2005-03-01 12:29:02 EST
Fixed.

Now search engine fine also unused static method import declarations.

Problem was coming from indexing in fact. On import, only unknown reference to
method selector was stored in index (ie. without method parameters number). So,
while searching to method reference, number of parameters does not exist and
indexer failed to return this result.
To avoid this, SourceElementParser now accept both field, method and type
reference  on single static import declaration.
Also make indexer and locator not filtering on parameter count when method is
static (as for varargs...)

[jdt-core-internal]
I'll attach patch file to describe all changes done
No new test case added, only modify existing ones testStaticImportMethod02 and
testStaticImportMethod04 in JavaSearchTests

Comment 2 Frederic Fusier CLA 2005-03-01 12:29:26 EST
Created attachment 18384 [details]
Patch for the implementation of this functionality
Comment 3 Olivier Thomann CLA 2005-03-30 16:27:47 EST
Verified in I20050330-0500