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 67130 Details for
Bug 186833
[1.5][compiler] Should detect member supertype cycle when resolved thru static import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 3.65 KB, created by
Kent Johnson
on 2007-05-14 16:37:46 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2007-05-14 16:37:46 EDT
Size:
3.65 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v >retrieving revision 1.629 >diff -u -r1.629 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 14 May 2007 16:39:50 -0000 1.629 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 14 May 2007 20:36:30 -0000 >@@ -32767,7 +32767,7 @@ > ); > } > public void test1021b() { // should this case be allowed? >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "p/SomeClass2.java", > "package p;\n" + >@@ -32780,7 +32780,12 @@ > " }\n" + > "}\n", > }, >- "" >+ "----------\n" + >+ "1. ERROR in p\\SomeClass2.java (at line 3)\n" + >+ " public abstract class SomeClass2<T> extends M {\n" + >+ " ^\n" + >+ "Cycle detected: the type SomeClass2<T> cannot extend/implement itself or one of its own member types\n" + >+ "----------\n" > ); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=151410 (duplicate of 149376) >@@ -37936,7 +37941,7 @@ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186833 > public void test1139() { >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "p/X.java", > "package p;\n" + >@@ -37952,7 +37957,13 @@ > " }\n" + > "}", // ================= > }, >- ""); >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 9)\r\n" + >+ " public class X extends Super<A<X>> {\r\n" + >+ " ^^^^^\n" + >+ "Cycle detected: the type X cannot extend/implement itself or one of its own member types\n" + >+ "----------\n" >+ ); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186788 > public void test1140() { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v >retrieving revision 1.148 >diff -u -r1.148 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 9 May 2007 17:18:18 -0000 1.148 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 14 May 2007 20:36:34 -0000 >@@ -1029,18 +1029,17 @@ > return true; > } > >-// No longer believe this code is necessary, since we changed supertype lookup to use TypeReference resolution >-// if (superType.isMemberType()) { >-// ReferenceBinding current = superType.enclosingType(); >-// do { >-// if (current.isHierarchyBeingConnected()) { >-// problemReporter().hierarchyCircularity(sourceType, current, reference); >-// sourceType.tagBits |= TagBits.HierarchyHasProblems; >-// current.tagBits |= TagBits.HierarchyHasProblems; >-// return true; >-// } >-// } while ((current = current.enclosingType()) != null); >-// } >+ if (superType.isMemberType()) { >+ ReferenceBinding current = superType.enclosingType(); >+ do { >+ if (current.isHierarchyBeingConnected() && current == sourceType) { >+ problemReporter().hierarchyCircularity(sourceType, current, reference); >+ sourceType.tagBits |= TagBits.HierarchyHasProblems; >+ current.tagBits |= TagBits.HierarchyHasProblems; >+ return true; >+ } >+ } while ((current = current.enclosingType()) != null); >+ } > > if (superType.isBinaryBinding()) { > // force its superclass & superinterfaces to be found... 2 possibilities exist - the source type is included in the hierarchy of:
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 186833
: 67130