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 41547 Details for
Bug 141810
[1.5][compiler] Enum switch tables incorrectly generated by the compiler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_141810.txt (text/plain), 2.94 KB, created by
Olivier Thomann
on 2006-05-15 23:11:54 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-05-15 23:11:54 EDT
Size:
2.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java,v >retrieving revision 1.67 >diff -u -r1.67 SwitchStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java 3 Apr 2006 13:51:36 -0000 1.67 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java 15 May 2006 19:31:52 -0000 >@@ -349,7 +349,8 @@ > if ((enumConstant.modifiers & ClassFileConstants.AccEnum) == 0) continue; > findConstant : { > for (int j = 0; j < caseCount; j++) { >- if (enumConstant.id == this.constants[j]) break findConstant; >+ if ((enumConstant.id + 1) == this.constants[j]) // zero should not be returned see bug 141810 >+ break findConstant; > } > // enum constant did not get referenced from switch > upperScope.problemReporter().missingEnumConstantCase(this, enumConstant); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v >retrieving revision 1.25 >diff -u -r1.25 CaseStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 28 Mar 2006 20:29:56 -0000 1.25 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 15 May 2006 19:31:52 -0000 >@@ -118,7 +118,7 @@ > } else if (reference instanceof QualifiedNameReference) { > scope.problemReporter().cannotUseQualifiedEnumConstantInCaseLabel(reference, field); > } >- return IntConstant.fromValue(field.original().id); // ordinal value >+ return IntConstant.fromValue(field.original().id + 1); // (ordinal value + 1) zero should not be returned see bug 141810 > } > } else { > return constantExpression.constant; >Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v >retrieving revision 1.133 >diff -u -r1.133 CodeStream.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 20 Apr 2006 14:53:23 -0000 1.133 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 15 May 2006 19:31:52 -0000 >@@ -2552,7 +2552,7 @@ > this.aload_0(); > this.getstatic(fieldBinding); > this.invokeEnumOrdinal(enumBinding.constantPoolName()); >- this.generateInlinedValue(fieldBinding.id); >+ this.generateInlinedValue(fieldBinding.id + 1); // zero should not be returned see bug 141810 > this.iastore(); > anyExceptionHandler.placeEnd(); > this.goto_(endLabel);
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 141810
:
41544
| 41547