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 121691 Details for
Bug 259633
[1.5][compiler] Bound of type parameter of class in method not checked
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.38 KB, created by
Kent Johnson
on 2009-01-06 15:52:58 EST
(
hide
)
Description:
Proposed patch and testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-01-06 15:52:58 EST
Size:
3.38 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.167 >diff -u -r1.167 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 21 Nov 2008 20:03:08 -0000 1.167 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 6 Jan 2009 20:51:49 -0000 >@@ -202,6 +202,10 @@ > > LocalTypeBinding localType = buildLocalType(enclosingType, null /* anonymous super type*/, enclosingType.fPackage); > connectTypeHierarchy(); >+ if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { >+ checkParameterizedTypeBounds(); >+ checkParameterizedSuperTypeCollisions(); >+ } > buildFieldsAndMethods(); > localType.faultInTypesForFieldsAndMethods(); > >#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.780 >diff -u -r1.780 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 15 Dec 2008 11:11:54 -0000 1.780 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 6 Jan 2009 20:51:54 -0000 >@@ -48399,4 +48399,44 @@ > "Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + > "----------\n"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039 >+public void test1431() throws Exception { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //================================= >+ "public class X {\n" + >+ " void foo() {\n" + >+ " class M<T extends Number> {}\n" + >+ " class N extends M<String> {}\n" + >+ " class O implements I<String>, I<Number> {}\n" + >+ " }\n" + >+ " class MM<T extends Number> {}\n" + >+ " class NN extends MM<String> {}\n" + >+ " class OO implements I<String>, I<Number> {}\n" + >+ "}\n" + >+ "interface I<T> {}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " class N extends M<String> {}\n" + >+ " ^^^^^^\n" + >+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " class O implements I<String>, I<Number> {}\n" + >+ " ^\n" + >+ "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 8)\n" + >+ " class NN extends MM<String> {}\n" + >+ " ^^^^^^\n" + >+ "Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 9)\n" + >+ " class OO implements I<String>, I<Number> {}\n" + >+ " ^^\n" + >+ "The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + >+ "----------\n" >+ ); >+} > } >\ No newline at end of file
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 259633
: 121691