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 15425 Details for
Bug 77151
[1.5] Enum constant cannot be qualified when used as a case label
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD
patch_77151.txt (text/plain), 3.76 KB, created by
Olivier Thomann
on 2004-10-27 16:55:55 EDT
(
hide
)
Description:
Apply on HEAD
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2004-10-27 16:55:55 EDT
Size:
3.76 KB
patch
obsolete
>Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.107 >diff -u -r1.107 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 21 Oct 2004 21:31:23 -0000 1.107 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 27 Oct 2004 20:42:13 -0000 >@@ -1002,6 +1002,8 @@ > int IllegalModifierForMemberEnum = TypeRelated + 753; > /** @since 3.1 */ > int CannotDeclareEnumSpecialMethod = MethodRelated + 754; >+ /** @since 3.1 */ >+ int CannotUseQualifiedEnumConstantInCaseLabe = FieldRelated + 755; > > /** > * Var args >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v >retrieving revision 1.9 >diff -u -r1.9 CaseStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 21 Oct 2004 13:34:43 -0000 1.9 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 27 Oct 2004 20:42:13 -0000 >@@ -105,6 +105,9 @@ > this.isEnumConstant = true; > if (constantExpression instanceof NameReference > && (constantExpression.bits & RestrictiveFlagMASK) == Binding.FIELD) { >+ if (constantExpression instanceof QualifiedNameReference) { >+ scope.problemReporter().cannotUseQualifiedEnumConstantInCaseLabel(constantExpression); >+ } > return Constant.fromValue(((NameReference)constantExpression).fieldBinding().id); // ordinal value > } > } else { >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.185 >diff -u -r1.185 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 25 Oct 2004 15:53:55 -0000 1.185 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 27 Oct 2004 20:42:14 -0000 >@@ -353,6 +353,14 @@ > reference.sourceStart, > reference.sourceEnd); > } >+public void cannotUseQualifiedEnumConstantInCaseLabel(Expression expression) { >+ this.handle( >+ IProblem.CannotUseQualifiedEnumConstantInCaseLabe, >+ NoArgument, >+ NoArgument, >+ expression.sourceStart, >+ expression.sourceEnd); >+} > public void caseExpressionMustBeConstant(Expression expression) { > this.handle( > IProblem.NonConstantExpression, >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.130 >diff -u -r1.130 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 25 Oct 2004 15:53:55 -0000 1.130 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 27 Oct 2004 20:42:14 -0000 >@@ -474,7 +474,7 @@ > 752 = Illegal modifier for the local enum {0}; only one of abstract or final is permitted > 753 = Illegal modifier for the member enum {0}; only public, protected, private, static, abstract & final are permitted > 754 = The enum {1} already defines the method {0}({2}) implicitly >- >+755 = An case label must not be the qualified name of an enumeration constant > ### VARARGS > 800 = Extended dimensions are illegal for a variable argument > 801 = Varargs argument {0} should be cast to {1} when passed to the method {2}({3}) from type {4}
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 77151
: 15425