Bug 132191 - IMethodBinding.overrides(IMethodBinding) returns true even if the given argument is private.
Summary: IMethodBinding.overrides(IMethodBinding) returns true even if the given argum...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-16 11:32 EST by David Green CLA
Modified: 2006-04-13 14:03 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch and regression test (3.41 KB, patch)
2006-04-06 06:04 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.