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

(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (+2 lines)
Lines 1060-1065 Link Here
1060
	int EnumAbstractMethodMustBeImplemented = MethodRelated + 758;
1060
	int EnumAbstractMethodMustBeImplemented = MethodRelated + 758;
1061
	/** @since 3.1 */
1061
	/** @since 3.1 */
1062
	int EnumSwitchCannotTargetField = FieldRelated + 759;
1062
	int EnumSwitchCannotTargetField = FieldRelated + 759;
1063
	/** @since 3.1 */
1064
	int IllegalModifierForEnumConstructor = MethodRelated + 760;
1063
1065
1064
	/**
1066
	/**
1065
	 * Var args
1067
	 * Var args
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java (-1 / +6 lines)
Lines 84-90 Link Here
84
		// check for abnormal modifiers
84
		// check for abnormal modifiers
85
		int unexpectedModifiers =
85
		int unexpectedModifiers =
86
			~(AccPublic | AccPrivate | AccProtected | AccStrictfp);
86
			~(AccPublic | AccPrivate | AccProtected | AccStrictfp);
87
		if ((realModifiers & unexpectedModifiers) != 0)
87
88
		if (methodBinding.declaringClass.isEnum()) {
89
			unexpectedModifiers = ~AccPrivate;
90
			if ((realModifiers & unexpectedModifiers) != 0)
91
				problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) referenceContext);
92
		} else if ((realModifiers & unexpectedModifiers) != 0)
88
			problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) referenceContext);
93
			problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) referenceContext);
89
		else if (
94
		else if (
90
			(((AbstractMethodDeclaration) referenceContext).modifiers & AccStrictfp) != 0)
95
			(((AbstractMethodDeclaration) referenceContext).modifiers & AccStrictfp) != 0)
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (+8 lines)
Lines 1590-1595 Link Here
1590
		type.sourceStart(),
1590
		type.sourceStart(),
1591
		type.sourceEnd());
1591
		type.sourceEnd());
1592
}
1592
}
1593
public void illegalModifierForEnumConstructor(AbstractMethodDeclaration constructor) {
1594
	this.handle(
1595
		IProblem.IllegalModifierForEnumConstructor,
1596
		NoArgument,		
1597
		NoArgument,	
1598
		constructor.sourceStart,
1599
		constructor.sourceEnd);
1600
}
1593
public void illegalModifierForLocalEnum(SourceTypeBinding type) {
1601
public void illegalModifierForLocalEnum(SourceTypeBinding type) {
1594
	String[] arguments = new String[] {new String(type.sourceName())};
1602
	String[] arguments = new String[] {new String(type.sourceName())};
1595
	this.handle(
1603
	this.handle(
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-1 / +2 lines)
Lines 271-277 Link Here
271
355 = Duplicate method {0}({2}) in type {1}
271
355 = Duplicate method {0}({2}) in type {1}
272
356 = Illegal modifier for parameter {0}; only final is permitted
272
356 = Illegal modifier for parameter {0}; only final is permitted
273
357 = Duplicate modifier for the method {1} in type {0}
273
357 = Duplicate modifier for the method {1} in type {0}
274
358 = Illegal modifier for the method {0}.{1}({2})
274
358 = Illegal modifier for the method {0}.{2}({1})
275
359 = Illegal modifier for the interface method {0}.{1}({2}); only public & abstract are permitted
275
359 = Illegal modifier for the interface method {0}.{1}({2}); only public & abstract are permitted
276
360 = The method {1} in type {0} can only set one of public / protected / private
276
360 = The method {1} in type {0} can only set one of public / protected / private
277
361 = The method {1} cannot be declared static; static methods can only be declared in a static or top level type
277
361 = The method {1} cannot be declared static; static methods can only be declared in a static or top level type
Lines 515-520 Link Here
515
757 = Cannot invoke super constructor from enum constructor {0}({1})
515
757 = Cannot invoke super constructor from enum constructor {0}({1})
516
758 = The enum {2} can only define the abstract method {0}({1}) if it also defines enum constants with corresponding implementations
516
758 = The enum {2} can only define the abstract method {0}({1}) if it also defines enum constants with corresponding implementations
517
759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch
517
759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch
518
760 = Illegal modifier for the enum constructor; only private is permitted.
518
519
519
### VARARGS
520
### VARARGS
520
800 = Extended dimensions are illegal for a variable argument
521
800 = Extended dimensions are illegal for a variable argument

Return to bug 83648