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 38781 Details for
Bug 136946
[1.5][compiler] internal compiler error -- ArrayOutOfBoundException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better fix
136946.txt (text/plain), 7.28 KB, created by
Philipe Mulet
on 2006-04-18 06:58:40 EDT
(
hide
)
Description:
Better fix
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2006-04-18 06:58:40 EDT
Size:
7.28 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.477 >diff -u -r1.477 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 17 Apr 2006 19:43:24 -0000 1.477 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 18 Apr 2006 10:47:34 -0000 >@@ -30434,12 +30434,96 @@ > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=133071 > public void test0969() { > this.runConformTest( >- new String[] { >- "B.java", //================================ >- "class B<T extends C> extends A<T> {}\n" + >- "class C extends B<C> {}\n" + >- "class A<T extends C> {}" >- }, >- ""); >+ new String[] { >+ "B.java", //================================ >+ "class B<T extends C> extends A<T> {}\n" + >+ "class C extends B<C> {}\n" + >+ "class A<T extends C> {}" >+ }, >+ ""); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=136946 >+public void test0970() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //================================ >+ "public interface X<T> { \n" + >+ " interface I1<T> extends X<T> {\n" + >+ " interface I2<T> extends I1<T> {\n" + >+ " }\n" + >+ "\n" + >+ " interface I3<T> extends I1<T> {\n" + >+ " }\n" + >+ "\n" + >+ " interface I4<T> extends I1.I2<T>, I1.I3<T> { \n" + >+ " }\n" + >+ " }\n" + >+ "}\n" + >+ "class XSub<E> implements X<E> {\n" + >+ " I1<E> i1 = null;\n" + >+ " I1.I2<E> i2 = null;\n" + >+ " I1<E>.I2<E> i1i2 = null;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 16)\n" + >+ " I1<E>.I2<E> i1i2 = null;\n" + >+ " ^^^^^^^^\n" + >+ "The member type X.I1<E>.I2 cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.I1<E>\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=136946 - variation >+public void test0971() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //================================ >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " interface I1<T> extends X {\n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T> should be parameterized\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 3)\n" + >+ " interface I2<T> extends I1 {\n" + >+ " ^^\n" + >+ "X.I1 is a raw type. References to generic type X<T>.I1<T> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 6)\n" + >+ " interface I3<T> extends I1 {\n" + >+ " ^^\n" + >+ "X.I1 is a raw type. References to generic type X<T>.I1<T> should be parameterized\n" + >+ "----------\n" + >+ "4. WARNING in X.java (at line 9)\n" + >+ " interface I4<T> extends I1.I2, I1.I3 { \n" + >+ " ^^^^^\n" + >+ "X.I1.I2 is a raw type. References to generic type X<T>.I1<T>.I2<T> should be parameterized\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 9)\n" + >+ " interface I4<T> extends I1.I2, I1.I3 { \n" + >+ " ^^^^^\n" + >+ "X.I1.I3 is a raw type. References to generic type X<T>.I1<T>.I3<T> should be parameterized\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 14)\n" + >+ " I1 i1 = null;\n" + >+ " ^^\n" + >+ "X.I1 is a raw type. References to generic type X<T>.I1<T> should be parameterized\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 15)\n" + >+ " I1.I2 i2 = null;\n" + >+ " ^^^^^\n" + >+ "X.I1.I2 is a raw type. References to generic type X<T>.I1<T>.I2<T> should be parameterized\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 16)\n" + >+ " I1<E>.I2 i1i2 = null;\n" + >+ " ^^^^^^^^\n" + >+ "The member type X.I1<E>.I2 cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.I1<E>\n" + >+ "----------\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 16)\n" + >+ " I1<E>.I2<E> i1i2 = null;\n" + >+ " ^^^^^^^^\n" + >+ "The member type X.I1<E>.I2 cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.I1<E>\n" + >+ "----------\n"); > } > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java,v >retrieving revision 1.34 >diff -u -r1.34 ParameterizedQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 28 Mar 2006 20:29:56 -0000 1.34 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 18 Apr 2006 10:47:35 -0000 >@@ -43,9 +43,10 @@ > this.typeArguments.length - 1); > } > public void checkBounds(ReferenceBinding type, Scope scope, int index) { >- if (type.enclosingType() != null) >+ // recurse on enclosing type if any, and assuming explictly part of the reference (index>0) >+ if (index > 0 && type.enclosingType() != null) { > checkBounds(type.enclosingType(), scope, index - 1); >- >+ } > if (type.isParameterizedType()) { > ParameterizedTypeBinding parameterizedType = (ParameterizedTypeBinding) type; > ReferenceBinding currentType = parameterizedType.type; >@@ -201,15 +202,16 @@ > if (isClassScope) > if (((ClassScope) scope).detectHierarchyCycle(currentType, this, null)) > return null; >- if (currentType.isGenericType()) { >+ ReferenceBinding currentErasure = (ReferenceBinding)currentType.erasure(); >+ if (currentErasure.isGenericType()) { > if (typeIsConsistent && qualifiedType != null && qualifiedType.isParameterizedType()) { >- scope.problemReporter().parameterizedMemberTypeMissingArguments(this, scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), null, qualifiedType)); >+ scope.problemReporter().parameterizedMemberTypeMissingArguments(this, scope.environment().createParameterizedType(currentErasure, null, qualifiedType)); > typeIsConsistent = false; > } >- qualifiedType = scope.environment().createRawType(currentType, qualifiedType); // raw type >+ qualifiedType = scope.environment().createRawType(currentErasure, qualifiedType); // raw type > } else { > qualifiedType = (qualifiedType != null && qualifiedType.isParameterizedType()) >- ? scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), null, qualifiedType) >+ ? scope.environment().createParameterizedType(currentErasure, null, qualifiedType) > : currentType; > } > }
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 136946
:
38651
|
38652
|
38780
| 38781