Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 131026 Details for
Bug 271303
[1.5][compiler] Override and package visibility issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and testcase
patch.txt (text/plain), 3.26 KB, created by
Kent Johnson
on 2009-04-06 13:47:45 EDT
(
hide
)
Description:
Proposed patch and testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-04-06 13:47:45 EDT
Size:
3.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v >retrieving revision 1.176 >diff -u -r1.176 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 5 Mar 2009 16:47:02 -0000 1.176 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 6 Apr 2009 17:47:54 -0000 >@@ -9478,4 +9478,32 @@ > "----------\n" > ); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=271303 >+public void test186() { >+ this.runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A { void m() {} }\n", >+ "p2/B.java", >+ "package p2;\n" + >+ "public class B extends p1.A { void m() {} }\n", >+ "p1/C.java", >+ "package p1;\n" + >+ "public class C extends p2.B { @Override void m() {} }" >+ }, >+ "----------\n" + >+ "1. WARNING in p2\\B.java (at line 2)\n" + >+ " public class B extends p1.A { void m() {} }\n" + >+ " ^^^\n" + >+ "The method B.m() does not override the inherited method from A since it is private to a different package\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p1\\C.java (at line 2)\n" + >+ " public class C extends p2.B { @Override void m() {} }\n" + >+ " ^^^\n" + >+ "The method C.m() does not override the inherited method from B since it is private to a different package\n" + >+ "----------\n" >+ ); >+} > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v >retrieving revision 1.104 >diff -u -r1.104 MethodVerifier.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 7 Mar 2009 00:59:02 -0000 1.104 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 6 Apr 2009 17:47:55 -0000 >@@ -576,11 +576,6 @@ > } > } > } >- MethodBinding[] nonVisible = (MethodBinding[]) nonVisibleDefaultMethods.get(inheritedMethod.selector); >- if (nonVisible != null) >- for (int i = 0, l = nonVisible.length; i < l; i++) >- if (areMethodsCompatible(nonVisible[i], inheritedMethod)) >- continue nextMethod; > > if (!inheritedMethod.isDefault() || inheritedMethod.declaringClass.fPackage == this.type.fPackage) { > if (existingMethods == null) { >@@ -592,6 +587,11 @@ > } > this.inheritedMethods.put(inheritedMethod.selector, existingMethods); > } else { >+ MethodBinding[] nonVisible = (MethodBinding[]) nonVisibleDefaultMethods.get(inheritedMethod.selector); >+ if (nonVisible != null) >+ for (int i = 0, l = nonVisible.length; i < l; i++) >+ if (areMethodsCompatible(nonVisible[i], inheritedMethod)) >+ continue nextMethod; > if (nonVisible == null) { > nonVisible = new MethodBinding[] {inheritedMethod}; > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 271303
: 131026