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 142290 Details for
Bug 282869
[compiler] Unnecessary cast warning for cast from char to int
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and testcase
patch.txt (text/plain), 2.41 KB, created by
Kent Johnson
on 2009-07-22 11:49:04 EDT
(
hide
)
Description:
Proposed patch and testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-07-22 11:49:04 EDT
Size:
2.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java,v >retrieving revision 1.59 >diff -u -r1.59 CompoundAssignment.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java 30 Jun 2009 14:24:18 -0000 1.59 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java 22 Jul 2009 15:50:02 -0000 >@@ -107,6 +107,9 @@ > scope.problemReporter().expressionShouldBeAVariable(this.lhs); > return null; > } >+ boolean expressionIsCast = this.expression instanceof CastExpression; >+ if (expressionIsCast) >+ this.expression.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on > TypeBinding originalLhsType = this.lhs.resolveType(scope); > TypeBinding originalExpressionType = this.expression.resolveType(scope); > if (originalLhsType == null || originalExpressionType == null) >@@ -181,6 +184,8 @@ > this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 8) & 0x0000F), originalExpressionType); > this.preAssignImplicitConversion = (unboxedLhs ? BOXING : 0) | (lhsID << 4) | (result & 0x0000F); > if (unboxedLhs) scope.problemReporter().autoboxing(this, lhsType, originalLhsType); >+ if (expressionIsCast) >+ CastExpression.checkNeedForArgumentCasts(scope, this.operator, result, this.lhs, originalLhsType.id, false, this.expression, originalExpressionType.id, true); > return this.resolvedType = originalLhsType; > } > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java,v >retrieving revision 1.47 >diff -u -r1.47 CastTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java 15 Jul 2009 18:10:26 -0000 1.47 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java 22 Jul 2009 15:50:03 -0000 >@@ -1719,7 +1719,7 @@ > "3"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=282869 >-public void _test046() { >+public void test046() { > this.runConformTest( > true, > new String[] {
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 282869
:
141671
| 142290