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 96617 Details for
Bug 209149
[1.7][compiler] 1.7 compliance allows type params to be declared in any order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch with testcase
patch.txt (text/plain), 2.69 KB, created by
Kent Johnson
on 2008-04-18 12:13:53 EDT
(
hide
)
Description:
Proposed patch with testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2008-04-18 12:13:53 EDT
Size:
2.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >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.697 >diff -u -r1.697 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 14 Apr 2008 17:21:23 -0000 1.697 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 18 Apr 2008 16:11:15 -0000 >@@ -43550,4 +43550,24 @@ > "Class is a raw type. References to generic type Class<T> should be parameterized\n" + > "----------\n"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209149 >+public void test1311() { >+ String[] test = new String[] { >+ "X.java", >+ "class MyClass1<E, D extends E> {}\n" + >+ "class MyClass2<E extends D, D> {}" >+ }; >+ if (this.complianceLevel < ClassFileConstants.JDK1_7) { >+ this.runNegativeTest( >+ test, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " class MyClass2<E extends D, D> {}\n" + >+ " ^\n" + >+ "Illegal forward reference to type parameter D\n" + >+ "----------\n"); >+ } else { >+ this.runConformTest(test, ""); >+ } >+} > } >\ No newline at end of file >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.326 >diff -u -r1.326 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 17 Apr 2008 15:26:43 -0000 1.326 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 18 Apr 2008 16:11:17 -0000 >@@ -482,9 +482,11 @@ > isFirstBoundTypeVariable = true; > TypeVariableBinding varSuperType = (TypeVariableBinding) superType; > if (varSuperType.rank >= typeVariable.rank && varSuperType.declaringElement == typeVariable.declaringElement) { >- problemReporter().forwardTypeVariableReference(typeParameter, varSuperType); >- typeVariable.tagBits |= TagBits.HierarchyHasProblems; >- break firstBound; // do not keep first bound >+ if (compilerOptions().complianceLevel <= ClassFileConstants.JDK1_6) { >+ problemReporter().forwardTypeVariableReference(typeParameter, varSuperType); >+ typeVariable.tagBits |= TagBits.HierarchyHasProblems; >+ break firstBound; // do not keep first bound >+ } > } > break; > default :
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 209149
: 96617