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 190755 Details for
Bug 334493
[1.7][compiler] Difference in behavior with Javac7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_334493.txt (text/plain), 2.95 KB, created by
Olivier Thomann
on 2011-03-09 09:20:32 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-03-09 09:20:32 EST
Size:
2.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java,v >retrieving revision 1.133.2.2 >diff -u -r1.133.2.2 Expression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 1 Mar 2011 17:29:59 -0000 1.133.2.2 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 6 Mar 2011 19:54:40 -0000 >@@ -386,8 +386,13 @@ > if (use15specifics) { > checkUnsafeCast(scope, castType, expressionType, null /*no match*/, true); > // ensure there is no collision between both interfaces: i.e. I1 extends List<String>, I2 extends List<Object> >- if (interfaceType.hasIncompatibleSuperType((ReferenceBinding)castType)) >+ if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK1_7) { >+ if (interfaceType.hasIncompatibleSuperType((ReferenceBinding) castType)) { >+ return false; >+ } >+ } else if (!castType.isRawType() && interfaceType.hasIncompatibleSuperType((ReferenceBinding) castType)) { > return false; >+ } > } else { > // pre1.5 semantics - no covariance allowed (even if 1.5 compliant, but 1.4 source) > // look at original methods rather than the parameterized variants at 1.4 to detect >@@ -427,7 +432,11 @@ > if (use15specifics) { > checkUnsafeCast(scope, castType, expressionType, null /*no match*/, true); > // ensure there is no collision between both interfaces: i.e. I1 extends List<String>, I2 extends List<Object> >- if (((ReferenceBinding)castType).hasIncompatibleSuperType((ReferenceBinding) expressionType)) { >+ if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK1_7) { >+ if (((ReferenceBinding)castType).hasIncompatibleSuperType((ReferenceBinding) expressionType)) { >+ return false; >+ } >+ } else if (!castType.isRawType() && ((ReferenceBinding)castType).hasIncompatibleSuperType((ReferenceBinding) expressionType)) { > return false; > } > } >@@ -474,8 +483,13 @@ > if (use15specifics) { > checkUnsafeCast(scope, castType, expressionType, null /*no match*/, true); > // ensure there is no collision between both interfaces: i.e. I1 extends List<String>, I2 extends List<Object> >- if (refExprType.hasIncompatibleSuperType((ReferenceBinding) castType)) >+ if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK1_7) { >+ if (refExprType.hasIncompatibleSuperType((ReferenceBinding) castType)) { >+ return false; >+ } >+ } else if (!castType.isRawType() && refExprType.hasIncompatibleSuperType((ReferenceBinding) castType)) { > return false; >+ } > } > return true; > } else {
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 334493
:
190755
|
192207