Bug 97809

Summary: Ambiguous method reference wrongly reported
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: philippe_mulet
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jerome Lanneluc CLA 2005-06-01 05:55:15 EDT
3.1 RC1 with latest JDT Core

The following doesn't compile any longer:
public class X {
   public static String bind(String message, Object binding) {
      return null;
   }
   public static String bind(String message, Object[] bindings) {
      return null;
   }
}
class Y extends X {
   public static String bind(String message, Object binding) {
      return null;
   }
   public static String bind(String message, Object[] bindings) {
      return null;
   }
}
class Z {
   void bar() {
      Y.bind("", new String[] {""});
   }
}

It reports an ambiguous method reference to Y.bind(...).
Comment 1 Philipe Mulet CLA 2005-06-01 05:57:23 EDT
Consequence of change for bug 97161.

Kent - pls redo proper fix.

Added MethodVerifyTest#test056
Comment 2 Philipe Mulet CLA 2005-06-01 06:07:48 EDT
Disabled latest check in Scope#mostSpecificMethodBinding.
Also disabled consequently failing test: MethodVerifyTest#test043a
Comment 3 Jerome Lanneluc CLA 2005-06-01 07:08:16 EDT
Note that StaticImportTests#test024 is currently failing with what's in HEAD. I
disabled it for now.
Comment 4 Kent Johnson CLA 2005-06-01 11:15:40 EDT
The fix for bug 97161 is not the problem.

In Scope.findMethod(), the code to skip over equal inherited methods was 
buggy. It would miss comparing the second matching method if the first one was 
equal since it decremented the length & exited the loop early.
Comment 5 Jerome Lanneluc CLA 2005-06-01 12:03:20 EDT
Kent, I'm not seeing your changes in HEAD. Did I miss something ?
Comment 6 Olivier Thomann CLA 2005-06-06 17:09:14 EDT
Verified using N20050606-0010 + JDT/Core HEAD
Comment 7 Maxime Daniel CLA 2005-06-10 10:06:01 EDT
Verified for 3.1 RC2 using build I20050610-0010
Comment 8 Frederic Fusier CLA 2005-06-10 10:27:50 EDT
close