Bug 132191

Summary: IMethodBinding.overrides(IMethodBinding) returns true even if the given argument is private.
Product: [Eclipse Project] JDT Reporter: David Green <greensopinion>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: kent_johnson
Version: 3.2   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch and regression test none

Description David Green CLA 2006-03-16 11:32:46 EST
Private methods cannot be overriden as specified in section 8.4.8.1 of The Java Language Specification, Third Edition (JLS3):


8.4.8.1 Overriding (by Instance Methods)
An instance method m1 declared in a class C overrides another instance method, m2, declared in class A iff all of the following are true:

   1. C is a subclass of A.
   2. The signature of m1 is a subsignature (ยง8.4.2) of the signature of m2.
   3. Either
          * m2 is public, protected or declared with default access in the same package as C, or
          * m1 overrides a method m3, m3 distinct from m1, m3 distinct from m2, such that m3 overrides m2. 

Moreover, if m1 is not abstract, then m1 is said to implement any and all declarations of abstract methods that it overrides.
Comment 1 Philipe Mulet CLA 2006-03-16 15:47:22 EST
Kent - We may exhibit same behavior in compiler when checking for presence of @Overrides. We may try to tag less methods with AccOverriding.
What about default ones from different package, etc... I think we special cases static ones in the @Overrides diagnostic, but it starts feeling like we tag too many methods with AccOverriding.
Comment 2 Jerome Lanneluc CLA 2006-04-06 06:04:37 EDT
Created attachment 37859 [details]
Proposed patch and regression test
Comment 3 Philipe Mulet CLA 2006-04-06 08:53:05 EDT
+1 for 3.2RC1, DOM change only.
Comment 4 Jerome Lanneluc CLA 2006-04-06 11:20:29 EDT
Released patch and regression tests.
Comment 5 Frederic Fusier CLA 2006-04-13 14:03:48 EDT
Verified for 3.2 RC1 using build I20060413-0010.