Bug 3230 - Search - Too many type references for query ending with * (1GAZVGI)
Summary: Search - Too many type references for query ending with * (1GAZVGI)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:51 EDT by Jerome Lanneluc CLA
Modified: 2002-01-11 09:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2001-10-10 22:51:40 EDT
If you search for type references using the query 'x.y.*' it finds too many type references.
	To reproduce:
		1. Add source for batch compiler in a Java project
		2. Search for reference to type 'x.y.*'
	You will get references even if there is no such package in your workspace.

NOTES:

JBL (3/22/2001 6:17:12 PM)
	One reproducable test case:
	1. In package p1, create X.java: 
[package p1;
public class X {
}]
	and Y.java:
[package p1;
public class Y {
	X f[];
}]
	2. In package p2, create X.java:
[package p2;
public class X {
}]
	and Z.java:
[package p2;
public class Z {
	X f[];
}
]
	3. Search for references to p1.X
	It finds references in p1.Y (right) and p2.Z (wrong)

JBL (6/18/2001 3:49:05 PM)
	Problem is still present in 125.

JBL (6/18/2001 4:27:25 PM)
	The binding for type reference X is null, where the binding for array type reference X[] isn't.
Comment 1 Philipe Mulet CLA 2001-10-12 06:29:37 EDT
Is this one still a problem ? I think we did persist the binding inside a type 
reference for refactoring purpose since then.
Comment 2 Jerome Lanneluc CLA 2001-10-12 10:22:17 EDT
Added JavaSearchTests.testTypeReferenceInArray2()
Comment 3 Jerome Lanneluc CLA 2001-10-12 10:39:30 EDT
Problem was that a SingleTypeReference was created and identified as a 
potential match, but the parser noticed that it was an array and put an 
ArrayTypeReference in place.

Changed Parser to do it through copyDims(TypeReference, int) and changed 
MatchLocatorParser to override this method and replace the SingleTypeReference 
with the ArrayTypeReference in the match set.
Comment 4 DJ Houghton CLA 2001-10-23 23:52:12 EDT
PRODUCT VERSION:
	JT 035