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 192207 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-30 12:23:21 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-03-30 12:23:21 EDT
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.4 >diff -u -r1.133.2.4 Expression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 15 Mar 2011 12:06:21 -0000 1.133.2.4 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 30 Mar 2011 16:23:08 -0000 >@@ -387,8 +387,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 >@@ -428,7 +433,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; > } > } >@@ -475,8 +484,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