Bug 97809 - Ambiguous method reference wrongly reported
Summary: Ambiguous method reference wrongly reported
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-01 05:55 EDT by Jerome Lanneluc CLA
Modified: 2005-06-10 10:27 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 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