Bug 97322 - [search] Search for method references sometimes reports potential match with differing argument count
Summary: [search] Search for method references sometimes reports potential match with ...
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: 97324
  Show dependency tree
 
Reported: 2005-05-30 13:23 EDT by Markus Keller CLA
Modified: 2005-06-10 07:12 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-05-30 13:23:12 EDT
I20050527-1300

Search for references to myMethod(..) reports a potential match in this example:

class Tester {
	static void myMethod(int a, String b) {}
	void call() {
		myMethod(12);
	}
}

But when I make the method non-static, no potential match is returned. This is
inconsistent. JDT/UI assumed that potential matches are only reported for build
path problems, visibility problems, or non-matching parameter/argument types,
but not for references with differing argument counts.
Comment 1 Dirk Baeumer CLA 2005-05-30 13:50:17 EDT
I agree that potentional matches should not be reported for different argument
counts.
Comment 2 Philipe Mulet CLA 2005-06-06 03:51:02 EDT
+1 for RC2
Comment 3 Frederic Fusier CLA 2005-06-06 04:09:01 EDT
Fixed and released in HEAD.

When message send was flagged as error, its resolved type may be null if problem
reason is "not found". In this case search engine did return systematically an
inaccurate match although it has to verify first that arguments number matches
the pattern.

[jdt-core internal]
Change done in MethodLocator.resolve(MessageSend).
Test case added in JavaSearchBugsTests
Comment 4 Olivier Thomann CLA 2005-06-06 16:44:32 EDT
Verified using N20050606-0010 + JDT/Core HEAD
Comment 5 Jerome Lanneluc CLA 2005-06-10 07:12:39 EDT
Verified with I20050610-0010