View | Details | Raw Unified | Return to bug 77151
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (+2 lines)
Lines 1002-1007 Link Here
1002
	int IllegalModifierForMemberEnum = TypeRelated + 753;
1002
	int IllegalModifierForMemberEnum = TypeRelated + 753;
1003
	/** @since 3.1 */
1003
	/** @since 3.1 */
1004
	int CannotDeclareEnumSpecialMethod = MethodRelated + 754;
1004
	int CannotDeclareEnumSpecialMethod = MethodRelated + 754;
1005
	/** @since 3.1 */
1006
	int CannotUseQualifiedEnumConstantInCaseLabe = FieldRelated + 755;
1005
1007
1006
	/**
1008
	/**
1007
	 * Var args
1009
	 * Var args
(-)compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java (+3 lines)
Lines 105-110 Link Here
105
				this.isEnumConstant = true;
105
				this.isEnumConstant = true;
106
				if (constantExpression instanceof NameReference
106
				if (constantExpression instanceof NameReference
107
						&& (constantExpression.bits & RestrictiveFlagMASK) == Binding.FIELD) {
107
						&& (constantExpression.bits & RestrictiveFlagMASK) == Binding.FIELD) {
108
					if (constantExpression instanceof QualifiedNameReference) {
109
						 scope.problemReporter().cannotUseQualifiedEnumConstantInCaseLabel(constantExpression);
110
					}
108
					return Constant.fromValue(((NameReference)constantExpression).fieldBinding().id); // ordinal value
111
					return Constant.fromValue(((NameReference)constantExpression).fieldBinding().id); // ordinal value
109
				}
112
				}
110
			} else {
113
			} else {
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (+8 lines)
Lines 353-358 Link Here
353
		reference.sourceStart,
353
		reference.sourceStart,
354
		reference.sourceEnd);
354
		reference.sourceEnd);
355
}
355
}
356
public void cannotUseQualifiedEnumConstantInCaseLabel(Expression expression) {
357
	this.handle(
358
			IProblem.CannotUseQualifiedEnumConstantInCaseLabe,
359
			NoArgument,
360
			NoArgument,
361
			expression.sourceStart,
362
			expression.sourceEnd);	
363
}
356
public void caseExpressionMustBeConstant(Expression expression) {
364
public void caseExpressionMustBeConstant(Expression expression) {
357
	this.handle(
365
	this.handle(
358
		IProblem.NonConstantExpression,
366
		IProblem.NonConstantExpression,
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-1 / +1 lines)
Lines 474-480 Link Here
474
752 = Illegal modifier for the local enum {0}; only one of abstract or final is permitted
474
752 = Illegal modifier for the local enum {0}; only one of abstract or final is permitted
475
753 = Illegal modifier for the member enum {0}; only public, protected, private, static, abstract & final are permitted
475
753 = Illegal modifier for the member enum {0}; only public, protected, private, static, abstract & final are permitted
476
754 = The enum {1} already defines the method {0}({2}) implicitly
476
754 = The enum {1} already defines the method {0}({2}) implicitly
477
477
755 = An case label must not be the qualified name of an enumeration constant
478
### VARARGS
478
### VARARGS
479
800 = Extended dimensions are illegal for a variable argument
479
800 = Extended dimensions are illegal for a variable argument
480
801 = Varargs argument {0} should be cast to {1} when passed to the method {2}({3}) from type {4}
480
801 = Varargs argument {0} should be cast to {1} when passed to the method {2}({3}) from type {4}

Return to bug 77151