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 40688 Details for
Bug 139931
[1.5][compiler] Unnecessary cast warning and varargs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better patch
139931.txt (text/plain), 2.37 KB, created by
Philipe Mulet
on 2006-05-09 04:43:00 EDT
(
hide
)
Description:
Better patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2006-05-09 04:43:00 EDT
Size:
2.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java,v >retrieving revision 1.70 >diff -u -r1.70 ASTNode.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 28 Mar 2006 20:29:56 -0000 1.70 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 9 May 2006 08:45:29 -0000 >@@ -253,7 +253,7 @@ > if (varargsType.dimensions < dimensions) { > scope.problemReporter().varargsArgumentNeedCast(method, lastArgType, invocationSite); > } else if (varargsType.dimensions == dimensions >- && varargsType.leafComponentType != lastArgType.leafComponentType() >+ && varargsType.leafComponentType.erasure() != lastArgType.leafComponentType().erasure() > && lastArgType.isCompatibleWith(varargsType)) { > scope.problemReporter().varargsArgumentNeedCast(method, lastArgType, invocationSite); > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java,v >retrieving revision 1.99 >diff -u -r1.99 CastExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 31 Mar 2006 22:13:25 -0000 1.99 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 9 May 2006 08:45:30 -0000 >@@ -253,8 +253,15 @@ > ArrayBinding varargsType = (ArrayBinding) binding.parameters[varargsIndex]; > TypeBinding lastArgType = alternateArgumentTypes[varargsIndex]; > // originalType may be compatible already, but cast mandated to clarify between varargs/non-varargs call >- if (lastArgType.isCompatibleWith(varargsType.elementsType())) >+ int dimensions = lastArgType.dimensions(); >+ if (varargsType.dimensions < dimensions) { > return; >+ } else if (varargsType.dimensions == dimensions) { >+ if (lastArgType.isCompatibleWith(varargsType.elementsType()) >+ && lastArgType.isCompatibleWith(varargsType)) { >+ return; >+ } >+ } > } > } > for (int i = 0; i < argumentLength; i++) {
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 139931
:
40256
|
40311
| 40688