Bug 86901 - [1.5][search] Static import method references not found in unused import
Summary: [1.5][search] Static import method references not found in unused import
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-01 07:50 EST by Frederic Fusier CLA
Modified: 2005-03-30 16:27 EST (History)
0 users

See Also:


Attachments
Patch for the implementation of this functionality (15.88 KB, patch)
2005-03-01 12:29 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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