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 44809 Details for
Bug 147381
[1.5][compiler] Generics discrepancy between Eclipse compiler and Sun compiler.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
147381.txt (text/plain), 2.65 KB, created by
Philipe Mulet
on 2006-06-19 07:20:59 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2006-06-19 07:20:59 EDT
Size:
2.65 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.497 >diff -u -r1.497 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 14 Jun 2006 11:38:30 -0000 1.497 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 19 Jun 2006 11:23:51 -0000 >@@ -31748,4 +31748,26 @@ > }, > ""); > } >+// >+public void test1007() { >+ this.runNegativeTest( >+ new String[] { >+ "GenericsProblem.java", >+ "public class GenericsProblem {\n" + >+ " public <T> void test(T val) {\n" + >+ " GenericsProblem gp = new GenericsProblem();\n" + >+ " // this is fine with both\n" + >+ " Class<? extends GenericsProblem> cl2 = gp.getClass();\n" + >+ " // This fails on Sun\'s compiler\n" + >+ " Class<? extends T> cl = val.getClass();\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in GenericsProblem.java (at line 7)\n" + >+ " Class<? extends T> cl = val.getClass();\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Class<capture-of ? extends Object> to Class<? extends T>\n" + >+ "----------\n"); >+} > } >\ No newline at end of file >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java,v >retrieving revision 1.20 >diff -u -r1.20 ParameterizedMethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java 29 Mar 2006 02:45:27 -0000 1.20 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java 19 Jun 2006 11:23:53 -0000 >@@ -216,7 +216,7 @@ > method.thrownExceptions = originalMethod.thrownExceptions; > ReferenceBinding genericClassType = scope.getJavaLangClass(); > LookupEnvironment environment = scope.environment(); >- TypeBinding rawType = environment.convertToRawType(receiverType); >+ TypeBinding rawType = environment.convertToRawType(receiverType.erasure()); > method.returnType = environment.createParameterizedType( > genericClassType, > new TypeBinding[] { environment.createWildcard(genericClassType, 0, rawType, null /*no extra bound*/, Wildcard.EXTENDS) },
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 147381
: 44809