Bug 97606 - [1.5][search] Raw type reference is reported as exact match for qualified names
Summary: [1.5][search] Raw type reference is reported as exact match for qualified names
Status: CLOSED 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 RC2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 13:30 EDT by Frederic Fusier CLA
Modified: 2005-06-10 08:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2005-05-31 13:30:42 EDT
Using 3.1 RC1.

Consider following test case:
pack/def/LL.java:
  package pack.def;
  public class LL<E> implements L<E> {
	public Object clone() {
		return null;
	}
  }
pack/def/L.java:
  package pack.def;
  public interface L<E> {}

pack/ref/K.java:
  package pack.ref;
  public interface K {}
pack/ref/X.java:
  package pack.ref;
  public class X implements K {
      private pack.def.LL sg;
      protected synchronized pack.def.L<K> getSG() {
          return (sg != null) 
        	? (pack.def.L) sg.clone()
        	: null;
      }
  }

Search for references of interface L in project.
3 matches are found (OK), 2 of them are erasure ones and last one is an exact
match (KO). 3 erasure matches are expected in this case...
Comment 1 Frederic Fusier CLA 2005-05-31 13:33:00 EDT
Problem comes from method matchReportReference(QualifiedNameReference,...) in
TypeReferenceLocator. It should call matchReportReference(Expression, int,
TypeBinding, MatchLocator) as matchReportReference(QualifiedTypeReference,...) does.
Comment 2 Philipe Mulet CLA 2005-06-03 05:02:05 EDT
+1 for RC2
Comment 3 Frederic Fusier CLA 2005-06-03 11:41:02 EDT
Fixed and released in HEAD.

Match rule is now correctly set to erasure on qualified name references.

[jdt-core internal]
Changes done in
TypeReferenceLocator.matchReportReference(QualifiedNameReference, ...)

Test case added in JavaSearchBugsTests
Comment 4 Olivier Thomann CLA 2005-06-06 16:48:27 EDT
The 3 references are reported as inexact match.

Verified using N20050606-0010 + JDT/Core HEAD
Comment 5 Jerome Lanneluc CLA 2005-06-10 08:00:53 EDT
Verified with I20050610-0010