View | Details | Raw Unified | Return to bug 268542 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/internal/ui/fix/Java50CleanUp.java (-10 lines)
Lines 156-171 Link Here
156
	public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) {
156
	public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) {
157
		int result= 0;
157
		int result= 0;
158
		IProblem[] problems= compilationUnit.getProblems();
158
		IProblem[] problems= compilationUnit.getProblems();
159
		if (isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS) && isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE)) {
160
			result+= getNumberOfProblems(problems, IProblem.MissingOverrideAnnotation);
161
		}
162
		if (isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS) && isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS_DEPRECATED)) {
163
			for (int i=0;i<problems.length;i++) {
164
				int id= problems[i].getID();
165
				if (id == IProblem.FieldMissingDeprecatedAnnotation || id == IProblem.MethodMissingDeprecatedAnnotation || id == IProblem.TypeMissingDeprecatedAnnotation)
166
					result++;
167
			}
168
		}
169
		if (isEnabled(CleanUpConstants.VARIABLE_DECLARATION_USE_TYPE_ARGUMENTS_FOR_RAW_TYPE_REFERENCES)) {
159
		if (isEnabled(CleanUpConstants.VARIABLE_DECLARATION_USE_TYPE_ARGUMENTS_FOR_RAW_TYPE_REFERENCES)) {
170
			for (int i=0;i<problems.length;i++) {
160
			for (int i=0;i<problems.length;i++) {
171
				int id= problems[i].getID();
161
				int id= problems[i].getID();
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java (-45 lines)
Lines 639-668 Link Here
639
			proposals.add(new ModifierChangeCompletionProposal(label, cu, binding, selectedNode, Modifier.FINAL, 0, 5, image));
639
			proposals.add(new ModifierChangeCompletionProposal(label, cu, binding, selectedNode, Modifier.FINAL, 0, 5, image));
640
		}
640
		}
641
	}
641
	}
642
//	
643
//	public static void addOverrideAnnotationProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
644
//		IFix fix= Java50Fix.createAddOverrideAnnotationFix(context.getASTRoot(), problem);
645
//		if (fix != null) {
646
//			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
647
//			Map options= new Hashtable();
648
//			options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpConstants.TRUE);
649
//			options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE, CleanUpConstants.TRUE);
650
//			FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new Java50CleanUp(options), 5, image, context);
651
//			proposals.add(proposal);
652
//		}
653
//	}
654
//	
655
//	public static void addDeprecatedAnnotationProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
656
//		IFix fix= Java50Fix.createAddDeprectatedAnnotation(context.getASTRoot(), problem);
657
//		if (fix != null) {
658
//			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
659
//			Map options= new Hashtable();
660
//			options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpConstants.TRUE);
661
//			options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS_DEPRECATED, CleanUpConstants.TRUE);
662
//			FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new Java50CleanUp(options), 5, image, context);
663
//			proposals.add(proposal);
664
//		}
665
//	}
666
	
642
	
667
	public static void addOverridingDeprecatedMethodProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
643
	public static void addOverridingDeprecatedMethodProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
668
		
644
		
Lines 692-718 Link Here
692
		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 15, image);
668
		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 15, image);
693
		proposals.add(proposal);
669
		proposals.add(proposal);
694
	}
670
	}
695
		
696
	public static void removeOverrideAnnotationProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
697
//		IJavaScriptUnit cu= context.getCompilationUnit();
698
//
699
//		ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
700
//		if (!(selectedNode instanceof FunctionDeclaration)) {
701
//			return;
702
//		}
703
//		FunctionDeclaration methodDecl= (FunctionDeclaration) selectedNode;
704
//		Annotation annot= findAnnotation("java.lang.Override", methodDecl.modifiers()); //$NON-NLS-1$
705
//		if (annot != null) {
706
//			ASTRewrite rewrite= ASTRewrite.create(annot.getAST());
707
//			rewrite.remove(annot, null);
708
//			String label= CorrectionMessages.ModifierCorrectionSubProcessor_remove_override;
709
//			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
710
//			ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 6, image);
711
//			proposals.add(proposal);
712
//			
713
//			QuickAssistProcessor.getCreateInSuperClassProposals(context, methodDecl.getName(), proposals);
714
//		}
715
	}
716
671
717
	private static final String KEY_MODIFIER= "modifier"; //$NON-NLS-1$
672
	private static final String KEY_MODIFIER= "modifier"; //$NON-NLS-1$
718
	
673
	
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java (-33 lines)
Lines 157-176 Link Here
157
			case IProblem.RedefinedArgument:
157
			case IProblem.RedefinedArgument:
158
			case IProblem.CodeCannotBeReached:
158
			case IProblem.CodeCannotBeReached:
159
			case IProblem.InvalidUsageOfTypeParameters:
159
			case IProblem.InvalidUsageOfTypeParameters:
160
			case IProblem.InvalidUsageOfStaticImports:
161
			case IProblem.InvalidUsageOfForeachStatements:
160
			case IProblem.InvalidUsageOfForeachStatements:
162
			case IProblem.InvalidUsageOfTypeArguments:
163
			case IProblem.InvalidUsageOfEnumDeclarations:
164
			case IProblem.InvalidUsageOfVarargs:
165
			case IProblem.InvalidUsageOfAnnotations:
166
			case IProblem.InvalidUsageOfAnnotationDeclarations:
167
			case IProblem.FieldMissingDeprecatedAnnotation:
168
			case IProblem.OverridingDeprecatedMethod:
161
			case IProblem.OverridingDeprecatedMethod:
169
			case IProblem.MethodMissingDeprecatedAnnotation:
170
			case IProblem.TypeMissingDeprecatedAnnotation:
171
			case IProblem.MissingOverrideAnnotation:
172
			case IProblem.MethodMustOverride:
173
			case IProblem.MethodMustOverrideOrImplement:
174
			case IProblem.IsClassPathCorrect:
162
			case IProblem.IsClassPathCorrect:
175
			case IProblem.MethodReturnsVoid:
163
			case IProblem.MethodReturnsVoid:
176
			case IProblem.ForbiddenReference:
164
			case IProblem.ForbiddenReference:
Lines 178-188 Link Here
178
			case IProblem.UnnecessaryNLSTag:
166
			case IProblem.UnnecessaryNLSTag:
179
			case IProblem.AssignmentHasNoEffect:
167
			case IProblem.AssignmentHasNoEffect:
180
			case IProblem.UnsafeTypeConversion:
168
			case IProblem.UnsafeTypeConversion:
181
			case IProblem.UndefinedAnnotationMember:
182
			case IProblem.MissingValueForAnnotationMember:
183
			case IProblem.FallthroughCase:
169
			case IProblem.FallthroughCase:
184
			case IProblem.NonGenericType:
170
			case IProblem.NonGenericType:
185
			case IProblem.UnhandledWarningToken:
186
				return true;
171
				return true;
187
			default:
172
			default:
188
//				if (JavaModelUtil.is50OrHigher(cu.getJavaScriptProject())) {
173
//				if (JavaModelUtil.is50OrHigher(cu.getJavaScriptProject())) {
Lines 483-512 Link Here
483
				LocalCorrectionsSubProcessor.getUnreachableCodeProposals(context, problem, proposals);
468
				LocalCorrectionsSubProcessor.getUnreachableCodeProposals(context, problem, proposals);
484
				break;
469
				break;
485
			case IProblem.InvalidUsageOfTypeParameters:
470
			case IProblem.InvalidUsageOfTypeParameters:
486
			case IProblem.InvalidUsageOfStaticImports:
487
			case IProblem.InvalidUsageOfForeachStatements:
471
			case IProblem.InvalidUsageOfForeachStatements:
488
			case IProblem.InvalidUsageOfTypeArguments:
489
			case IProblem.InvalidUsageOfEnumDeclarations:
490
			case IProblem.InvalidUsageOfVarargs:
491
			case IProblem.InvalidUsageOfAnnotations:
492
			case IProblem.InvalidUsageOfAnnotationDeclarations:
493
				ReorgCorrectionsSubProcessor.getNeed50ComplianceProposals(context, problem, proposals);
472
				ReorgCorrectionsSubProcessor.getNeed50ComplianceProposals(context, problem, proposals);
494
				break;
473
				break;
495
			case IProblem.NonGenericType:
474
			case IProblem.NonGenericType:
496
				TypeParameterMismatchSubProcessor.removeMismatchedParameters(context, problem, proposals);
475
				TypeParameterMismatchSubProcessor.removeMismatchedParameters(context, problem, proposals);
497
				break;
476
				break;
498
//			case IProblem.MissingOverrideAnnotation:
499
//				ModifierCorrectionSubProcessor.addOverrideAnnotationProposal(context, problem, proposals);
500
//				break;
501
			case IProblem.MethodMustOverride:
502
			case IProblem.MethodMustOverrideOrImplement:
503
				ModifierCorrectionSubProcessor.removeOverrideAnnotationProposal(context, problem, proposals);
504
				break;
505
			case IProblem.FieldMissingDeprecatedAnnotation:
506
			case IProblem.MethodMissingDeprecatedAnnotation:
507
			case IProblem.TypeMissingDeprecatedAnnotation:
508
//				ModifierCorrectionSubProcessor.addDeprecatedAnnotationProposal(context, problem, proposals);
509
				break;
510
			case IProblem.OverridingDeprecatedMethod:
477
			case IProblem.OverridingDeprecatedMethod:
511
				ModifierCorrectionSubProcessor.addOverridingDeprecatedMethodProposal(context, problem, proposals);
478
				ModifierCorrectionSubProcessor.addOverridingDeprecatedMethodProposal(context, problem, proposals);
512
				break;
479
				break;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java (-21 lines)
Lines 220-246 Link Here
220
					upperScope.problemReporter().undocumentedEmptyBlock(this.blockStart, this.sourceEnd);
220
					upperScope.problemReporter().undocumentedEmptyBlock(this.blockStart, this.sourceEnd);
221
				}
221
				}
222
			}
222
			}
223
			// for enum switch, check if all constants are accounted for (if no default)
224
//			if (isEnumSwitch && defaultCase == null
225
//					&& upperScope.compilerOptions().getSeverity(CompilerOptions.IncompleteEnumSwitch) != ProblemSeverities.Ignore) {
226
//				int constantCount = this.constants == null ? 0 : this.constants.length; // could be null if no case statement
227
//				if (constantCount == caseCount // ignore diagnosis if unresolved constants
228
//						&& caseCount != ((ReferenceBinding)expressionType).enumConstantCount()) {
229
//					FieldBinding[] enumFields = ((ReferenceBinding)expressionType.erasure()).fields();
230
//					for (int i = 0, max = enumFields.length; i <max; i++) {
231
//						FieldBinding enumConstant = enumFields[i];
232
//						if ((enumConstant.modifiers & ClassFileConstants.AccEnum) == 0) continue;
233
//						findConstant : {
234
//							for (int j = 0; j < caseCount; j++) {
235
//								if ((enumConstant.id + 1) == this.constants[j]) // zero should not be returned see bug 141810
236
//									break findConstant;
237
//							}
238
//							// enum constant did not get referenced from switch
239
//							upperScope.problemReporter().missingEnumConstantCase(this, enumConstant);
240
//						}
241
//					}
242
//				}
243
//			}
244
	    } finally {
223
	    } finally {
245
	        if (this.scope != null) this.scope.enclosingCase = null; // no longer inside switch case block
224
	        if (this.scope != null) this.scope.enclosingCase = null; // no longer inside switch case block
246
	    }
225
	    }
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedNameReference.java (-28 / +1 lines)
Lines 67-87 Link Here
67
			if (needValue || complyTo14) {
67
			if (needValue || complyTo14) {
68
				manageSyntheticAccessIfNecessary(currentScope, lastFieldBinding, this.actualReceiverType, 0, flowInfo);
68
				manageSyntheticAccessIfNecessary(currentScope, lastFieldBinding, this.actualReceiverType, 0, flowInfo);
69
			}
69
			}
70
			if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
71
				ReferenceBinding declaringClass = lastFieldBinding.declaringClass;
72
				// check if accessing enum static field in initializer
73
				if (declaringClass.isEnum()) {
74
					MethodScope methodScope = currentScope.methodScope();
75
					SourceTypeBinding sourceType = methodScope.enclosingSourceType();
76
					if (lastFieldBinding.isStatic()
77
							&& (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
78
							&& lastFieldBinding.constant() == Constant.NotAConstant
79
							&& !methodScope.isStatic
80
							&& methodScope.isInsideInitializerOrConstructor()) {
81
						currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(lastFieldBinding, this);
82
					}
83
				}
84
			}
85
			// check if final blank field
70
			// check if final blank field
86
			if (lastFieldBinding.isBlankFinal()
71
			if (lastFieldBinding.isBlankFinal()
87
				    && this.otherBindings != null // the last field binding is only assigned
72
				    && this.otherBindings != null // the last field binding is only assigned
Lines 222-240 Link Here
222
			}
207
			}
223
			if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
208
			if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
224
				FieldBinding fieldBinding = (FieldBinding) this.binding;
209
				FieldBinding fieldBinding = (FieldBinding) this.binding;
225
				ReferenceBinding declaringClass = fieldBinding.declaringClass;
210
226
				// check if accessing enum static field in initializer
227
				if (declaringClass.isEnum()) {
228
					MethodScope methodScope = currentScope.methodScope();
229
					SourceTypeBinding sourceType = methodScope.enclosingSourceType();
230
					if (fieldBinding.isStatic()
231
							&& (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
232
							&& fieldBinding.constant() == Constant.NotAConstant
233
							&& !methodScope.isStatic
234
							&& methodScope.isInsideInitializerOrConstructor()) {
235
						currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(fieldBinding, this);
236
					}
237
				}
238
				// check if reading a final blank field
211
				// check if reading a final blank field
239
				if (fieldBinding.isBlankFinal()
212
				if (fieldBinding.isBlankFinal()
240
						&& currentScope.allowBlankFinalFieldAssignment(fieldBinding)
213
						&& currentScope.allowBlankFinalFieldAssignment(fieldBinding)
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/InstanceOfExpression.java (-3 / +1 lines)
Lines 70-78 Link Here
70
		if (expressionType == null || checkedType == null)
70
		if (expressionType == null || checkedType == null)
71
			return null;
71
			return null;
72
72
73
		if (!checkedType.isReifiable()) {
73
		if ((expressionType != TypeBinding.NULL && expressionType.isBaseType()) // disallow autoboxing
74
			scope.problemReporter().illegalInstanceOfGenericType(checkedType, this);
75
		} else if ((expressionType != TypeBinding.NULL && expressionType.isBaseType()) // disallow autoboxing
76
				|| !checkCastTypesCompatibility(scope, checkedType, expressionType, null)) {
74
				|| !checkCastTypesCompatibility(scope, checkedType, expressionType, null)) {
77
			scope.problemReporter().notCompatibleTypesError(this, expressionType, checkedType);
75
			scope.problemReporter().notCompatibleTypesError(this, expressionType, checkedType);
78
		}
76
		}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedAllocationExpression.java (-11 lines)
Lines 27-36 Link Here
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.RawTypeBinding;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.RawTypeBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
32
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeConstants;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeConstants;
33
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeIds;
34
32
35
/**
33
/**
36
 * Variation on allocation, where can optionally be specified any of:
34
 * Variation on allocation, where can optionally be specified any of:
Lines 232-240 Link Here
232
				TypeReference typeReference = this.typeArguments[i];
230
				TypeReference typeReference = this.typeArguments[i];
233
				TypeBinding argType = typeReference.resolveType(scope, true /* check bounds*/);
231
				TypeBinding argType = typeReference.resolveType(scope, true /* check bounds*/);
234
				if (argType == null) {
232
				if (argType == null) {
235
					if (typeReference instanceof Wildcard) {
236
						scope.problemReporter().illegalUsageOfWildcard(typeReference);
237
					}
238
					return null; // error already reported
233
					return null; // error already reported
239
				}
234
				}
240
				this.genericTypeArguments[i] = argType;
235
				this.genericTypeArguments[i] = argType;
Lines 333-345 Link Here
333
		// insert anonymous type in scope
328
		// insert anonymous type in scope
334
		scope.addAnonymousType(this.anonymousType, (ReferenceBinding) receiverType);
329
		scope.addAnonymousType(this.anonymousType, (ReferenceBinding) receiverType);
335
		this.anonymousType.resolve(scope);
330
		this.anonymousType.resolve(scope);
336
		if (this.superTypeBinding.erasure().id == TypeIds.T_JavaLangEnum) {
337
			scope.problemReporter().cannotExtendEnum(this.anonymousType.binding, this.type, this.superTypeBinding);
338
		}
339
331
340
		if ((receiverType.tagBits & TagBits.HasDirectWildcard) != 0) {
341
			scope.problemReporter().superTypeCannotUseWildcard(this.anonymousType.binding, this.type, receiverType);
342
		}
343
		// find anonymous super constructor
332
		// find anonymous super constructor
344
		MethodBinding inheritedBinding = scope.getConstructor(this.superTypeBinding, argumentTypes, this);
333
		MethodBinding inheritedBinding = scope.getConstructor(this.superTypeBinding, argumentTypes, this);
345
		if (!inheritedBinding.isValidBinding()) {
334
		if (!inheritedBinding.isValidBinding()) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java (-7 lines)
Lines 26-32 Link Here
26
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
26
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
31
30
32
public class FieldDeclaration extends AbstractVariableDeclaration implements IFieldDeclaration {
31
public class FieldDeclaration extends AbstractVariableDeclaration implements IFieldDeclaration {
Lines 169-180 Link Here
169
		initializationScope.lastVisibleFieldID = this.binding.id;
168
		initializationScope.lastVisibleFieldID = this.binding.id;
170
169
171
//		resolveAnnotations(initializationScope, this.annotations, this.binding);
170
//		resolveAnnotations(initializationScope, this.annotations, this.binding);
172
		// check @Deprecated annotation presence
173
		if ((this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
174
				&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
175
				&& initializationScope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
176
			initializationScope.problemReporter().missingDeprecatedAnnotationForField(this);
177
		}
178
		// the resolution of the initialization hasn't been done
171
		// the resolution of the initialization hasn't been done
179
		if (this.initialization == null) {
172
		if (this.initialization == null) {
180
			this.binding.setConstant(Constant.NotAConstant);
173
			this.binding.setConstant(Constant.NotAConstant);
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/AnnotationMethodDeclaration.java (-10 lines)
Lines 93-107 Link Here
93
	public void resolveStatements() {
93
	public void resolveStatements() {
94
94
95
		super.resolveStatements();
95
		super.resolveStatements();
96
		if (this.arguments != null) {
97
			scope.problemReporter().annotationMembersCannotHaveParameters(this);
98
		}
99
		if (this.typeParameters != null) {
100
			scope.problemReporter().annotationMembersCannotHaveTypeParameters(this);
101
		}
102
		if (this.extendedDimensions != 0) {
103
			scope.problemReporter().illegalExtendedDimensions(this);
104
		}
105
		if (this.binding == null) return;
96
		if (this.binding == null) return;
106
		TypeBinding returnTypeBinding = this.binding.returnType;
97
		TypeBinding returnTypeBinding = this.binding.returnType;
107
		if (returnTypeBinding != null) {
98
		if (returnTypeBinding != null) {
Lines 126-132 Link Here
126
					if (leafReturnType.isEnum() || leafReturnType.isAnnotationType())
117
					if (leafReturnType.isEnum() || leafReturnType.isAnnotationType())
127
						break checkAnnotationMethodType;
118
						break checkAnnotationMethodType;
128
				}
119
				}
129
				scope.problemReporter().invalidAnnotationMemberType(this);
130
			}
120
			}
131
			if (this.defaultValue != null) {
121
			if (this.defaultValue != null) {
132
				MemberValuePair pair = new MemberValuePair(this.selector, this.sourceStart, this.sourceEnd, this.defaultValue);
122
				MemberValuePair pair = new MemberValuePair(this.selector, this.sourceStart, this.sourceEnd, this.defaultValue);
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/ExplicitConstructorCall.java (-7 lines)
Lines 235-244 Link Here
235
			if (receiverType == null) {
235
			if (receiverType == null) {
236
				return;
236
				return;
237
			}
237
			}
238
			// prevent (explicit) super constructor invocation from within enum
239
			if (this.accessMode == Super && receiverType.erasure().id == T_JavaLangEnum) {
240
				scope.problemReporter().cannotInvokeSuperConstructorInEnum(this, methodScope.referenceMethod().binding);
241
			}
242
			// qualification should be from the type of the enclosingType
238
			// qualification should be from the type of the enclosingType
243
			if (qualification != null) {
239
			if (qualification != null) {
244
				if (accessMode != Super) {
240
				if (accessMode != Super) {
Lines 267-275 Link Here
267
					if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
263
					if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
268
						argHasError = true;
264
						argHasError = true;
269
					}
265
					}
270
					if (argHasError && typeReference instanceof Wildcard) {
271
						scope.problemReporter().illegalUsageOfWildcard(typeReference);
272
					}
273
				}
266
				}
274
				if (argHasError) {
267
				if (argHasError) {
275
					return;
268
					return;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/CaseStatement.java (-8 lines)
Lines 41-49 Link Here
41
		FlowInfo flowInfo) {
41
		FlowInfo flowInfo) {
42
42
43
		if (constantExpression != null) {
43
		if (constantExpression != null) {
44
			if (!this.isEnumConstant && constantExpression.constant == Constant.NotAConstant) {
45
				currentScope.problemReporter().caseExpressionMustBeConstant(constantExpression);
46
			}
47
			this.constantExpression.analyseCode(currentScope, flowContext, flowInfo);
44
			this.constantExpression.analyseCode(currentScope, flowContext, flowInfo);
48
		}
45
		}
49
		return flowInfo;
46
		return flowInfo;
Lines 106-116 Link Here
106
						&& (constantExpression.bits & RestrictiveFlagMASK) == Binding.FIELD) {
103
						&& (constantExpression.bits & RestrictiveFlagMASK) == Binding.FIELD) {
107
					NameReference reference = (NameReference) constantExpression;
104
					NameReference reference = (NameReference) constantExpression;
108
					FieldBinding field = reference.fieldBinding();
105
					FieldBinding field = reference.fieldBinding();
109
					if ((field.modifiers & ClassFileConstants.AccEnum) == 0) {
110
						 scope.problemReporter().enumSwitchCannotTargetField(reference, field);
111
					} else 	if (reference instanceof QualifiedNameReference) {
112
						 scope.problemReporter().cannotUseQualifiedEnumConstantInCaseLabel(reference, field);
113
					}
114
					return IntConstant.fromValue(field.original().id + 1); // (ordinal value + 1) zero should not be returned see bug 141810
106
					return IntConstant.fromValue(field.original().id + 1); // (ordinal value + 1) zero should not be returned see bug 141810
115
				}
107
				}
116
			} else {
108
			} else {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java (-10 lines)
Lines 37-43 Link Here
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
38
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
38
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
39
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
39
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
40
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
41
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
40
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
42
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
41
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
43
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
42
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
Lines 376-391 Link Here
376
			if (JavaScriptCore.IS_ECMASCRIPT4)
375
			if (JavaScriptCore.IS_ECMASCRIPT4)
377
				bindThrownExceptions();
376
				bindThrownExceptions();
378
			resolveJavadoc();
377
			resolveJavadoc();
379
//			if (JavaScriptCore.IS_ECMASCRIPT4)
380
//				resolveAnnotations(scope, this.annotations, this.binding);
381
			resolveStatements();
378
			resolveStatements();
382
			// check @Deprecated annotation presence
383
			if (this.binding != null
384
					&& (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
385
					&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
386
					&& this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
387
				this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this);
388
			}
389
		} catch (AbortMethod e) {	// ========= abort on fatal error =============
379
		} catch (AbortMethod e) {	// ========= abort on fatal error =============
390
			this.ignoreFurtherInvestigation = true;
380
			this.ignoreFurtherInvestigation = true;
391
		}
381
		}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java (-34 lines)
Lines 310-319 Link Here
310
							// report the problem and continue the parsing
310
							// report the problem and continue the parsing
311
							parser.problemReporter().interfaceCannotHaveConstructors((ConstructorDeclaration) am);
311
							parser.problemReporter().interfaceCannotHaveConstructors((ConstructorDeclaration) am);
312
							break;
312
							break;
313
						case TypeDeclaration.ANNOTATION_TYPE_DECL :
314
							// report the problem and continue the parsing
315
							parser.problemReporter().annotationTypeDeclarationCannotHaveConstructor((ConstructorDeclaration) am);
316
							break;
317
313
318
					}
314
					}
319
					hasConstructor = true;
315
					hasConstructor = true;
Lines 862-873 Link Here
862
//		} finally {
858
//		} finally {
863
//			this.staticInitializerScope.insideTypeAnnotation = old;
859
//			this.staticInitializerScope.insideTypeAnnotation = old;
864
//		}
860
//		}
865
		// check @Deprecated annotation
866
		if ((sourceType.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
867
				&& (sourceType.modifiers & ClassFileConstants.AccDeprecated) != 0
868
				&& this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
869
			this.scope.problemReporter().missingDeprecatedAnnotationForType(this);
870
		}
871
		if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0) {
861
		if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0) {
872
			this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd);
862
			this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd);
873
		}
863
		}
Lines 985-1014 Link Here
985
		if (needSerialVersion) {
975
		if (needSerialVersion) {
986
			this.scope.problemReporter().missingSerialVersion(this);
976
			this.scope.problemReporter().missingSerialVersion(this);
987
		}
977
		}
988
		// check extends/implements for annotation type
989
		switch(kind(this.modifiers)) {
990
			case TypeDeclaration.ANNOTATION_TYPE_DECL :
991
				if (this.superclass != null) {
992
					this.scope.problemReporter().annotationTypeDeclarationCannotHaveSuperclass(this);
993
				}
994
				if (this.superInterfaces != null) {
995
					this.scope.problemReporter().annotationTypeDeclarationCannotHaveSuperinterfaces(this);
996
				}
997
				break;
998
			case TypeDeclaration.ENUM_DECL :
999
				// check enum abstract methods
1000
				if (this.binding.isAbstract()) {
1001
					if (!hasEnumConstants || hasEnumConstantsWithoutBody) {
1002
						for (int i = 0, count = this.methods.length; i < count; i++) {
1003
							final AbstractMethodDeclaration methodDeclaration = this.methods[i];
1004
							if (methodDeclaration.isAbstract() && methodDeclaration.binding != null) {
1005
								this.scope.problemReporter().enumAbstractMethodMustBeImplemented(methodDeclaration);
1006
							}
1007
						}
1008
					}
1009
				}
1010
				break;
1011
		}
1012
978
1013
		int missingAbstractMethodslength = this.missingAbstractMethods == null ? 0 : this.missingAbstractMethods.length;
979
		int missingAbstractMethodslength = this.missingAbstractMethods == null ? 0 : this.missingAbstractMethods.length;
1014
		int methodsLength = this.methods == null ? 0 : this.methods.length;
980
		int methodsLength = this.methods == null ? 0 : this.methods.length;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java (-13 / +1 lines)
Lines 308-329 Link Here
308
					ArrayBinding varargsType = (ArrayBinding) params[varargsIndex];
308
					ArrayBinding varargsType = (ArrayBinding) params[varargsIndex];
309
					TypeBinding lastArgType = argumentTypes[varargsIndex];
309
					TypeBinding lastArgType = argumentTypes[varargsIndex];
310
					int dimensions;
310
					int dimensions;
311
					if (lastArgType == TypeBinding.NULL) {
311
					if (lastArgType != TypeBinding.NULL && (varargsType.dimensions <= (dimensions = lastArgType.dimensions()))) {
312
						if (!(varargsType.leafComponentType().isBaseType() && varargsType.dimensions() == 1))
313
							scope.problemReporter().varargsArgumentNeedCast(method, lastArgType, invocationSite);
314
					} else if (varargsType.dimensions <= (dimensions = lastArgType.dimensions())) {
315
						if (lastArgType.leafComponentType().isBaseType()) {
312
						if (lastArgType.leafComponentType().isBaseType()) {
316
							dimensions--;
313
							dimensions--;
317
						}
314
						}
318
						if (varargsType.dimensions < dimensions) {
319
							scope.problemReporter().varargsArgumentNeedCast(method, lastArgType, invocationSite);
320
						} else if (varargsType.dimensions == dimensions
321
										&& lastArgType != varargsType
322
										&& lastArgType.leafComponentType().erasure() != varargsType.leafComponentType.erasure()
323
										&& lastArgType.isCompatibleWith(varargsType.elementsType())
324
										&& lastArgType.isCompatibleWith(varargsType)) {
325
							scope.problemReporter().varargsArgumentNeedCast(method, lastArgType, invocationSite);
326
						}
327
					}
315
					}
328
				}
316
				}
329
			} else {
317
			} else {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/MemberValuePair.java (-90 / +1 lines)
Lines 13-24 Link Here
13
import org.eclipse.wst.jsdt.core.ast.IASTNode;
13
import org.eclipse.wst.jsdt.core.ast.IASTNode;
14
import org.eclipse.wst.jsdt.core.ast.IMemberValuePair;
14
import org.eclipse.wst.jsdt.core.ast.IMemberValuePair;
15
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
15
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
16
import org.eclipse.wst.jsdt.internal.compiler.impl.Constant;
17
import org.eclipse.wst.jsdt.internal.compiler.lookup.BaseTypeBinding;
16
import org.eclipse.wst.jsdt.internal.compiler.lookup.BaseTypeBinding;
18
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
17
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.ElementValuePair;
18
import org.eclipse.wst.jsdt.internal.compiler.lookup.ElementValuePair;
21
import org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding;
22
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
23
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
24
21
Lines 79-85 Link Here
79
			ArrayInitializer initializer = (ArrayInitializer) this.value;
76
			ArrayInitializer initializer = (ArrayInitializer) this.value;
80
			valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
77
			valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
81
		} else if (this.value instanceof ArrayAllocationExpression) {
78
		} else if (this.value instanceof ArrayAllocationExpression) {
82
			scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
83
			this.value.resolveType(scope);
79
			this.value.resolveType(scope);
84
			valueType = null; // no need to pursue
80
			valueType = null; // no need to pursue
85
		} else {
81
		} else {
Lines 100-108 Link Here
100
							|| (leafType.isBaseType() && BaseTypeBinding.isWidening(leafType.id, valueType.id)))
96
							|| (leafType.isBaseType() && BaseTypeBinding.isWidening(leafType.id, valueType.id)))
101
							|| valueType.isCompatibleWith(leafType))) {
97
							|| valueType.isCompatibleWith(leafType))) {
102
98
103
				if (leafType.isAnnotationType() && !valueType.isAnnotationType()) {
99
				if (!leafType.isAnnotationType() || valueType.isAnnotationType()) {
104
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
105
				} else {
106
					scope.problemReporter().typeMismatchError(valueType, requiredType, this.value);
100
					scope.problemReporter().typeMismatchError(valueType, requiredType, this.value);
107
				}
101
				}
108
				return; // may allow to proceed to find more errors at once
102
				return; // may allow to proceed to find more errors at once
Lines 124-220 Link Here
124
				case T_double :
118
				case T_double :
125
				case T_boolean :
119
				case T_boolean :
126
				case T_JavaLangString :
120
				case T_JavaLangString :
127
					if (this.value instanceof ArrayInitializer) {
128
						ArrayInitializer initializer = (ArrayInitializer) this.value;
129
						final Expression[] expressions = initializer.expressions;
130
						if (expressions != null) {
131
							for (int i =0, max = expressions.length; i < max; i++) {
132
								if (expressions[i].constant == Constant.NotAConstant) {
133
									scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, expressions[i], false);
134
								}
135
							}
136
						}
137
					} else if (this.value.constant == Constant.NotAConstant) {
138
						if (valueType.isArrayType()) {
139
							scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
140
						} else {
141
							scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, this.value, false);
142
						}
143
					}
144
					break checkAnnotationMethodType;
121
					break checkAnnotationMethodType;
145
				case T_JavaLangClass :
122
				case T_JavaLangClass :
146
					if (this.value instanceof ArrayInitializer) {
147
						ArrayInitializer initializer = (ArrayInitializer) this.value;
148
						final Expression[] expressions = initializer.expressions;
149
						if (expressions != null) {
150
							for (int i =0, max = expressions.length; i < max; i++) {
151
								Expression currentExpression = expressions[i];
152
								if (!(currentExpression instanceof ClassLiteralAccess)) {
153
									scope.problemReporter().annotationValueMustBeClassLiteral(this.binding.declaringClass, this.name, currentExpression);
154
								}
155
							}
156
						}
157
					} else if (!(this.value instanceof ClassLiteralAccess)) {
158
						scope.problemReporter().annotationValueMustBeClassLiteral(this.binding.declaringClass, this.name, this.value);
159
					}
160
					break checkAnnotationMethodType;
123
					break checkAnnotationMethodType;
161
			}
124
			}
162
			if (leafType.isEnum()) {
125
			if (leafType.isEnum()) {
163
				if (this.value instanceof NullLiteral) {
164
					scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, this.value, true);
165
				} else if (this.value instanceof ArrayInitializer) {
166
					ArrayInitializer initializer = (ArrayInitializer) this.value;
167
					final Expression[] expressions = initializer.expressions;
168
					if (expressions != null) {
169
						for (int i =0, max = expressions.length; i < max; i++) {
170
							Expression currentExpression = expressions[i];
171
							if (currentExpression instanceof NullLiteral) {
172
								scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, currentExpression, true);
173
							} else if (currentExpression instanceof NameReference) {
174
								NameReference nameReference = (NameReference) currentExpression;
175
								final Binding nameReferenceBinding = nameReference.binding;
176
								if (nameReferenceBinding.kind() == Binding.FIELD) {
177
									FieldBinding fieldBinding = (FieldBinding) nameReferenceBinding;
178
									if (!fieldBinding.declaringClass.isEnum()) {
179
										scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, currentExpression, true);
180
									}
181
								}
182
							}
183
						}
184
					}
185
				} else if (this.value instanceof NameReference) {
186
					NameReference nameReference = (NameReference) this.value;
187
					final Binding nameReferenceBinding = nameReference.binding;
188
					if (nameReferenceBinding.kind() == Binding.FIELD) {
189
						FieldBinding fieldBinding = (FieldBinding) nameReferenceBinding;
190
						if (!fieldBinding.declaringClass.isEnum()) {
191
							if (!fieldBinding.type.isArrayType()) {
192
								scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, this.value, true);
193
							} else {
194
								scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
195
							}
196
						}
197
					}
198
				}
199
				break checkAnnotationMethodType;
126
				break checkAnnotationMethodType;
200
			}
127
			}
201
			if (leafType.isAnnotationType()) {
128
			if (leafType.isAnnotationType()) {
202
				if (!valueType.leafComponentType().isAnnotationType()) { // check annotation type and also reject null literal
203
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
204
				} else if (this.value instanceof ArrayInitializer) {
205
					ArrayInitializer initializer = (ArrayInitializer) this.value;
206
					final Expression[] expressions = initializer.expressions;
207
					if (expressions != null) {
208
						for (int i =0, max = expressions.length; i < max; i++) {
209
							Expression currentExpression = expressions[i];
210
							if (currentExpression instanceof NullLiteral || !(currentExpression instanceof Annotation)) {
211
								scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, currentExpression, leafType);
212
							}
213
						}
214
					}
215
				} else if (!(this.value instanceof Annotation)) {
216
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
217
				}
218
				break checkAnnotationMethodType;
129
				break checkAnnotationMethodType;
219
			}
130
			}
220
		}
131
		}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/MethodDeclaration.java (-26 lines)
Lines 15-21 Link Here
15
import org.eclipse.wst.jsdt.core.ast.IFunctionDeclaration;
15
import org.eclipse.wst.jsdt.core.ast.IFunctionDeclaration;
16
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
16
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
17
import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
17
import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
18
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
19
import org.eclipse.wst.jsdt.internal.compiler.flow.ExceptionHandlingFlowContext;
18
import org.eclipse.wst.jsdt.internal.compiler.flow.ExceptionHandlingFlowContext;
20
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowContext;
19
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowContext;
21
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowInfo;
20
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowInfo;
Lines 155-186 Link Here
155
			}
154
			}
156
		}
155
		}
157
156
158
		// check @Override annotation
159
		final CompilerOptions compilerOptions = this.scope.compilerOptions();
157
		final CompilerOptions compilerOptions = this.scope.compilerOptions();
160
		checkOverride: {
161
			if (this.binding == null) break checkOverride;
162
			long sourceLevel = compilerOptions.sourceLevel;
163
			if (sourceLevel < ClassFileConstants.JDK1_5) break checkOverride;
164
			int bindingModifiers = this.binding.modifiers;
165
			boolean hasOverrideAnnotation = (this.binding.tagBits & TagBits.AnnotationOverride) != 0;
166
			boolean isInterfaceMethod = this.binding.declaringClass.isInterface();
167
			if (hasOverrideAnnotation) {
168
				// no static method is considered overriding
169
				if (!isInterfaceMethod && (bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding)
170
					break checkOverride;
171
				//	in 1.5, strictly for overriding superclass method
172
				//	in 1.6 and above, also tolerate implementing interface method
173
				if (sourceLevel >= ClassFileConstants.JDK1_6
174
						&& ((bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccImplementing)) == ExtraCompilerModifiers.AccImplementing))
175
					break checkOverride;
176
				// claims to override, and doesn't actually do so
177
				this.scope.problemReporter().methodMustOverride(this);
178
			} else if (!isInterfaceMethod
179
						&& (bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding) {
180
				// actually overrides, but did not claim to do so
181
				this.scope.problemReporter().missingOverrideAnnotation(this);
182
			}
183
		}
184
158
185
		// by grammatical construction, interface methods are always abstract
159
		// by grammatical construction, interface methods are always abstract
186
//		switch (TypeDeclaration.kind(this.scope.referenceType().modifiers)) {
160
//		switch (TypeDeclaration.kind(this.scope.referenceType().modifiers)) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java (-15 / +1 lines)
Lines 14-20 Link Here
14
import org.eclipse.wst.jsdt.core.ast.IAnnotation;
14
import org.eclipse.wst.jsdt.core.ast.IAnnotation;
15
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
15
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
16
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
16
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
17
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
18
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
17
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
19
import org.eclipse.wst.jsdt.internal.compiler.impl.Constant;
18
import org.eclipse.wst.jsdt.internal.compiler.impl.Constant;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding;
Lines 143-151 Link Here
143
									FieldBinding field = ((Reference) initExpr).fieldBinding();
142
									FieldBinding field = ((Reference) initExpr).fieldBinding();
144
									if (field != null && field.declaringClass.id == T_JavaLangAnnotationElementType) {
143
									if (field != null && field.declaringClass.id == T_JavaLangAnnotationElementType) {
145
										long element = getTargetElementType(field.name);
144
										long element = getTargetElementType(field.name);
146
										if ((tagBits & element) != 0) {
145
										if ((tagBits & element) == 0) {
147
											scope.problemReporter().duplicateTargetInTargetAnnotation(annotationType, (NameReference)initExpr);
148
										} else {
149
											tagBits |= element;
146
											tagBits |= element;
150
										}
147
										}
151
									}
148
									}
Lines 210-217 Link Here
210
								if (irritant != 0) {
207
								if (irritant != 0) {
211
									suppressWarningIrritants |= irritant;
208
									suppressWarningIrritants |= irritant;
212
									if (~suppressWarningIrritants == 0) break pairLoop;
209
									if (~suppressWarningIrritants == 0) break pairLoop;
213
								} else {
214
									scope.problemReporter().unhandledWarningToken(inits[j]);
215
								}
210
								}
216
							}
211
							}
217
						}
212
						}
Lines 223-230 Link Here
223
						if (irritant != 0) {
218
						if (irritant != 0) {
224
							suppressWarningIrritants |= irritant;
219
							suppressWarningIrritants |= irritant;
225
							if (~suppressWarningIrritants == 0) break pairLoop;
220
							if (~suppressWarningIrritants == 0) break pairLoop;
226
						} else {
227
							scope.problemReporter().unhandledWarningToken(value);
228
						}
221
						}
229
					}
222
					}
230
				}
223
				}
Lines 290-315 Link Here
290
						if (otherPair == null) continue;
283
						if (otherPair == null) continue;
291
						if (CharOperation.equals(otherPair.name, selector)) {
284
						if (CharOperation.equals(otherPair.name, selector)) {
292
							foundDuplicate = true;
285
							foundDuplicate = true;
293
							scope.problemReporter().duplicateAnnotationValue(annotationType, otherPair);
294
							otherPair.binding = method;
286
							otherPair.binding = method;
295
							otherPair.resolveTypeExpecting(scope, method.returnType);
287
							otherPair.resolveTypeExpecting(scope, method.returnType);
296
							pairs[k] = null;
288
							pairs[k] = null;
297
						}
289
						}
298
					}
290
					}
299
					if (foundDuplicate) {
291
					if (foundDuplicate) {
300
						scope.problemReporter().duplicateAnnotationValue(annotationType, pair);
301
						continue nextMember;
292
						continue nextMember;
302
					}
293
					}
303
				}
294
				}
304
			}
295
			}
305
			if (!foundValue && (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0) {
306
				scope.problemReporter().missingValueForAnnotationMember(this, selector);
307
			}
308
		}
296
		}
309
		// check unused pairs
297
		// check unused pairs
310
		for (int i = 0; i < pairsLength; i++) {
298
		for (int i = 0; i < pairsLength; i++) {
311
			if (pairs[i] != null) {
299
			if (pairs[i] != null) {
312
				scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]);
313
				pairs[i].resolveTypeExpecting(scope, null); // resilient
300
				pairs[i].resolveTypeExpecting(scope, null); // resilient
314
			}
301
			}
315
		}
302
		}
Lines 408-414 Link Here
408
							break checkTargetCompatibility;
395
							break checkTargetCompatibility;
409
						break;
396
						break;
410
				}
397
				}
411
				scope.problemReporter().disallowedTargetForAnnotation(this);
412
			}
398
			}
413
		}
399
		}
414
		return this.resolvedType;
400
		return this.resolvedType;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java (-28 / +1 lines)
Lines 28-36 Link Here
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemBinding;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemFieldBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemFieldBinding;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
32
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
33
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
34
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
32
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
35
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
33
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
36
import org.eclipse.wst.jsdt.internal.compiler.lookup.VariableBinding;
34
import org.eclipse.wst.jsdt.internal.compiler.lookup.VariableBinding;
Lines 92-110 Link Here
92
				manageSyntheticAccessIfNecessary(currentScope, flowInfo, false /*write-access*/);
90
				manageSyntheticAccessIfNecessary(currentScope, flowInfo, false /*write-access*/);
93
91
94
				FieldBinding fieldBinding = (FieldBinding) binding;
92
				FieldBinding fieldBinding = (FieldBinding) binding;
95
				ReferenceBinding declaringClass = fieldBinding.declaringClass;
96
				// check if accessing enum static field in initializer
97
				if (declaringClass.isEnum()) {
98
					MethodScope methodScope = currentScope.methodScope();
99
					SourceTypeBinding sourceType = currentScope.enclosingSourceType();
100
					if (fieldBinding.isStatic()
101
							&& this.constant == Constant.NotAConstant
102
							&& !methodScope.isStatic
103
							&& (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
104
							&& methodScope.isInsideInitializerOrConstructor()) {
105
						currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(fieldBinding, this);
106
					}
107
				}
108
				// check if assigning a final field
93
				// check if assigning a final field
109
				if (fieldBinding.isFinal()) {
94
				if (fieldBinding.isFinal()) {
110
					// inside a context where allowed
95
					// inside a context where allowed
Lines 160-178 Link Here
160
					manageSyntheticAccessIfNecessary(currentScope, flowInfo, true /*read-access*/);
145
					manageSyntheticAccessIfNecessary(currentScope, flowInfo, true /*read-access*/);
161
				}
146
				}
162
				FieldBinding fieldBinding = (FieldBinding) binding;
147
				FieldBinding fieldBinding = (FieldBinding) binding;
163
				ReferenceBinding declaringClass = fieldBinding.declaringClass;
148
164
				// check if accessing enum static field in initializer
165
				if (declaringClass.isEnum()) {
166
					MethodScope methodScope = currentScope.methodScope();
167
					SourceTypeBinding sourceType = currentScope.enclosingSourceType();
168
					if (fieldBinding.isStatic()
169
							&& this.constant == Constant.NotAConstant
170
							&& !methodScope.isStatic
171
							&& (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
172
							&& methodScope.isInsideInitializerOrConstructor()) {
173
						currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(fieldBinding, this);
174
					}
175
				}
176
				// check if reading a final blank field
149
				// check if reading a final blank field
177
				if (fieldBinding.isBlankFinal() && currentScope.allowBlankFinalFieldAssignment(fieldBinding)) {
150
				if (fieldBinding.isBlankFinal() && currentScope.allowBlankFinalFieldAssignment(fieldBinding)) {
178
					if (!flowInfo.isDefinitelyAssigned(fieldBinding)) {
151
					if (!flowInfo.isDefinitelyAssigned(fieldBinding)) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java (-3 lines)
Lines 393-401 Link Here
393
				this.javadoc.resolve(this.scope);
393
				this.javadoc.resolve(this.scope);
394
    		}
394
    		}
395
		}
395
		}
396
		if (this.currentPackage != null && this.currentPackage.annotations != null && !isPackageInfo) {
397
			scope.problemReporter().invalidFileNameForPackageAnnotations(this.currentPackage.annotations[0]);
398
		}
399
		try {
396
		try {
400
			if (types != null) {
397
			if (types != null) {
401
				for (int i = startingTypeIndex, count = types.length; i < count; i++) {
398
				for (int i = startingTypeIndex, count = types.length; i < count; i++) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/MessageSend.java (-1 lines)
Lines 405-411 Link Here
405
			case ProblemReasons.NonStaticReferenceInConstructorInvocation :
405
			case ProblemReasons.NonStaticReferenceInConstructorInvocation :
406
			case ProblemReasons.NonStaticReferenceInStaticContext :
406
			case ProblemReasons.NonStaticReferenceInStaticContext :
407
			case ProblemReasons.ReceiverTypeNotVisible :
407
			case ProblemReasons.ReceiverTypeNotVisible :
408
			case ProblemReasons.ParameterBoundMismatch :
409
				// only steal returnType in cases listed above
408
				// only steal returnType in cases listed above
410
				if (closestMatch != null) this.resolvedType = closestMatch.returnType;
409
				if (closestMatch != null) this.resolvedType = closestMatch.returnType;
411
			default :
410
			default :
(-)src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java (-1229 lines)
Lines 29-36 Link Here
29
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
29
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
30
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
30
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
31
import org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression;
31
import org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression;
32
import org.eclipse.wst.jsdt.internal.compiler.ast.Annotation;
33
import org.eclipse.wst.jsdt.internal.compiler.ast.AnnotationMethodDeclaration;
34
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
32
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
35
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression;
33
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression;
36
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayQualifiedTypeReference;
34
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayQualifiedTypeReference;
Lines 59-65 Link Here
59
import org.eclipse.wst.jsdt.internal.compiler.ast.Literal;
57
import org.eclipse.wst.jsdt.internal.compiler.ast.Literal;
60
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
58
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
61
import org.eclipse.wst.jsdt.internal.compiler.ast.LongLiteral;
59
import org.eclipse.wst.jsdt.internal.compiler.ast.LongLiteral;
62
import org.eclipse.wst.jsdt.internal.compiler.ast.MemberValuePair;
63
import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend;
60
import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend;
64
import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration;
61
import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration;
65
import org.eclipse.wst.jsdt.internal.compiler.ast.NameReference;
62
import org.eclipse.wst.jsdt.internal.compiler.ast.NameReference;
Lines 72-78 Link Here
72
import org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement;
69
import org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement;
73
import org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference;
70
import org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference;
74
import org.eclipse.wst.jsdt.internal.compiler.ast.Statement;
71
import org.eclipse.wst.jsdt.internal.compiler.ast.Statement;
75
import org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement;
76
import org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference;
72
import org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference;
77
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
73
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
78
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeParameter;
74
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeParameter;
Lines 89-95 Link Here
89
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite;
85
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite;
90
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding;
86
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding;
91
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
87
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
92
import org.eclipse.wst.jsdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
93
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemMethodBinding;
88
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemMethodBinding;
94
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons;
89
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons;
95
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
90
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding;
Lines 206-213 Link Here
206
			return CompilerOptions.FieldHiding;
201
			return CompilerOptions.FieldHiding;
207
202
208
		case IProblem.TypeParameterHidingType:
203
		case IProblem.TypeParameterHidingType:
209
		case IProblem.TypeHidingTypeParameterFromType:
210
		case IProblem.TypeHidingTypeParameterFromMethod:
211
		case IProblem.TypeHidingType:
204
		case IProblem.TypeHidingType:
212
			return CompilerOptions.TypeHiding;
205
			return CompilerOptions.TypeHiding;
213
206
Lines 243-256 Link Here
243
		case IProblem.UnsafeReturnTypeOverride:
236
		case IProblem.UnsafeReturnTypeOverride:
244
			return CompilerOptions.UncheckedTypeOperation;
237
			return CompilerOptions.UncheckedTypeOperation;
245
238
246
		case IProblem.MissingOverrideAnnotation:
247
			return CompilerOptions.MissingOverrideAnnotation;
248
249
		case IProblem.FieldMissingDeprecatedAnnotation:
250
		case IProblem.MethodMissingDeprecatedAnnotation:
251
		case IProblem.TypeMissingDeprecatedAnnotation:
252
			return CompilerOptions.MissingDeprecatedAnnotation;
253
254
		case IProblem.FinalBoundForTypeVariable:
239
		case IProblem.FinalBoundForTypeVariable:
255
		    return CompilerOptions.FinalParameterBound;
240
		    return CompilerOptions.FinalParameterBound;
256
241
Lines 263-272 Link Here
263
		case IProblem.DiscouragedReference:
248
		case IProblem.DiscouragedReference:
264
			return CompilerOptions.DiscouragedReference;
249
			return CompilerOptions.DiscouragedReference;
265
250
266
		case IProblem.MethodVarargsArgumentNeedCast :
267
		case IProblem.ConstructorVarargsArgumentNeedCast :
268
			return CompilerOptions.VarargsArgumentNeedCast;
269
270
		case IProblem.NullLocalVariableReference:
251
		case IProblem.NullLocalVariableReference:
271
			return CompilerOptions.NullReference;
252
			return CompilerOptions.NullReference;
272
253
Lines 288-302 Link Here
288
		case IProblem.UnboxingConversion :
269
		case IProblem.UnboxingConversion :
289
			return CompilerOptions.AutoBoxing;
270
			return CompilerOptions.AutoBoxing;
290
271
291
		case IProblem.MissingEnumConstantCase :
292
			return CompilerOptions.IncompleteEnumSwitch;
293
294
		case IProblem.AnnotationTypeUsedAsSuperInterface :
295
			return CompilerOptions.AnnotationSuperInterface;
296
297
		case IProblem.UnhandledWarningToken :
298
			return CompilerOptions.UnhandledWarningToken;
299
300
		case IProblem.UnusedLabel :
272
		case IProblem.UnusedLabel :
301
			return CompilerOptions.UnusedLabel;
273
			return CompilerOptions.UnusedLabel;
302
274
Lines 342-357 Link Here
342
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
314
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
343
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
315
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
344
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
316
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
345
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
346
		case IProblem.JavadocNonGenericMethod:
347
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
348
		case IProblem.JavadocParameterizedMethodArgumentTypeMismatch:
349
		case IProblem.JavadocTypeArgumentsForRawGenericMethod:
350
		case IProblem.JavadocGenericConstructorTypeArgumentMismatch:
351
		case IProblem.JavadocNonGenericConstructor:
352
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
353
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
354
		case IProblem.JavadocTypeArgumentsForRawGenericConstructor:
355
		case IProblem.JavadocNotVisibleField:
317
		case IProblem.JavadocNotVisibleField:
356
		case IProblem.JavadocNotVisibleConstructor:
318
		case IProblem.JavadocNotVisibleConstructor:
357
		case IProblem.JavadocNotVisibleMethod:
319
		case IProblem.JavadocNotVisibleMethod:
Lines 385-392 Link Here
385
		case IProblem.WrongNumberOfArguments:
347
		case IProblem.WrongNumberOfArguments:
386
			return CompilerOptions.WrongNumberOfArguments;
348
			return CompilerOptions.WrongNumberOfArguments;
387
			
349
			
388
		case IProblem.NonConstantExpression:
389
			return CompilerOptions.SwitchCaseShouldBeConstant;
390
		case IProblem.MissingSemiColon:
350
		case IProblem.MissingSemiColon:
391
			return CompilerOptions.OptionalSemicolon;
351
			return CompilerOptions.OptionalSemicolon;
392
352
Lines 466-485 Link Here
466
			switch (irritantInt) {
426
			switch (irritantInt) {
467
				case (int)(CompilerOptions.FinalParameterBound >>> 32):
427
				case (int)(CompilerOptions.FinalParameterBound >>> 32):
468
				case (int)(CompilerOptions.EnumUsedAsAnIdentifier >>> 32):
428
				case (int)(CompilerOptions.EnumUsedAsAnIdentifier >>> 32):
469
				case (int)(CompilerOptions.AnnotationSuperInterface >>> 32):
470
				case (int)(CompilerOptions.AutoBoxing >>> 32):
429
				case (int)(CompilerOptions.AutoBoxing >>> 32):
471
				case (int)(CompilerOptions.MissingOverrideAnnotation >>> 32):
472
				case (int)(CompilerOptions.MissingDeprecatedAnnotation >>> 32):
473
				case (int)(CompilerOptions.ParameterAssignment >>> 32):
430
				case (int)(CompilerOptions.ParameterAssignment >>> 32):
474
					return CategorizedProblem.CAT_CODE_STYLE;
431
					return CategorizedProblem.CAT_CODE_STYLE;
475
432
476
				case (int)(CompilerOptions.MissingSerialVersion >>> 32):
433
				case (int)(CompilerOptions.MissingSerialVersion >>> 32):
477
				case (int)(CompilerOptions.VarargsArgumentNeedCast >>> 32):
478
				case (int)(CompilerOptions.NullReference >>> 32):
434
				case (int)(CompilerOptions.NullReference >>> 32):
479
				case (int)(CompilerOptions.PotentialNullReference >>> 32):
435
				case (int)(CompilerOptions.PotentialNullReference >>> 32):
480
				case (int)(CompilerOptions.DuplicateLocalVariables >>> 32):
436
				case (int)(CompilerOptions.DuplicateLocalVariables >>> 32):
481
				case (int)(CompilerOptions.RedundantNullCheck >>> 32):
437
				case (int)(CompilerOptions.RedundantNullCheck >>> 32):
482
				case (int)(CompilerOptions.IncompleteEnumSwitch >>> 32):
483
				case (int)(CompilerOptions.FallthroughCase >>> 32):
438
				case (int)(CompilerOptions.FallthroughCase >>> 32):
484
				case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32):
439
				case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32):
485
					return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM;
440
					return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM;
Lines 487-493 Link Here
487
				case (int)(CompilerOptions.TypeHiding >>> 32):
442
				case (int)(CompilerOptions.TypeHiding >>> 32):
488
					return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT;
443
					return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT;
489
444
490
				case (int)(CompilerOptions.UnhandledWarningToken >>> 32):
491
				case (int)(CompilerOptions.UnusedLabel >>> 32):
445
				case (int)(CompilerOptions.UnusedLabel >>> 32):
492
					return CategorizedProblem.CAT_UNNECESSARY_CODE;
446
					return CategorizedProblem.CAT_UNNECESSARY_CODE;
493
447
Lines 608-739 Link Here
608
		location.sourceStart,
562
		location.sourceStart,
609
		location.sourceEnd);
563
		location.sourceEnd);
610
}
564
}
611
public void annotationCannotOverrideMethod(MethodBinding overrideMethod, MethodBinding inheritedMethod) {
612
	ASTNode location = overrideMethod.sourceMethod();
613
	this.handle(
614
		IProblem.AnnotationCannotOverrideMethod,
615
		new String[] {
616
				new String(overrideMethod.declaringClass.readableName()),
617
				new String(inheritedMethod.declaringClass.readableName()),
618
				new String(inheritedMethod.selector),
619
				typesAsString(inheritedMethod.isVarargs(), inheritedMethod.parameters, false)},
620
		new String[] {
621
				new String(overrideMethod.declaringClass.shortReadableName()),
622
				new String(inheritedMethod.declaringClass.shortReadableName()),
623
				new String(inheritedMethod.selector),
624
				typesAsString(inheritedMethod.isVarargs(), inheritedMethod.parameters, true)},
625
		location.sourceStart,
626
		location.sourceEnd);
627
}
628
public void annotationCircularity(TypeBinding sourceType, TypeBinding otherType, TypeReference reference) {
629
	if (sourceType == otherType)
630
		this.handle(
631
			IProblem.AnnotationCircularitySelfReference,
632
			new String[] {new String(sourceType.readableName())},
633
			new String[] {new String(sourceType.shortReadableName())},
634
			reference.sourceStart,
635
			reference.sourceEnd);
636
	else
637
		this.handle(
638
			IProblem.AnnotationCircularity,
639
			new String[] {new String(sourceType.readableName()), new String(otherType.readableName())},
640
			new String[] {new String(sourceType.shortReadableName()), new String(otherType.shortReadableName())},
641
			reference.sourceStart,
642
			reference.sourceEnd);
643
}
644
public void annotationMembersCannotHaveParameters(AnnotationMethodDeclaration annotationMethodDeclaration) {
645
	this.handle(
646
		IProblem.AnnotationMembersCannotHaveParameters,
647
		NoArgument,
648
		NoArgument,
649
		annotationMethodDeclaration.sourceStart,
650
		annotationMethodDeclaration.sourceEnd);
651
}
652
public void annotationMembersCannotHaveTypeParameters(AnnotationMethodDeclaration annotationMethodDeclaration) {
653
	this.handle(
654
		IProblem.AnnotationMembersCannotHaveTypeParameters,
655
		NoArgument,
656
		NoArgument,
657
		annotationMethodDeclaration.sourceStart,
658
		annotationMethodDeclaration.sourceEnd);
659
}
660
public void annotationTypeDeclarationCannotHaveConstructor(ConstructorDeclaration constructorDeclaration) {
661
	this.handle(
662
		IProblem.AnnotationTypeDeclarationCannotHaveConstructor,
663
		NoArgument,
664
		NoArgument,
665
		constructorDeclaration.sourceStart,
666
		constructorDeclaration.sourceEnd);
667
}
668
public void annotationTypeDeclarationCannotHaveSuperclass(TypeDeclaration typeDeclaration) {
669
	this.handle(
670
		IProblem.AnnotationTypeDeclarationCannotHaveSuperclass,
671
		NoArgument,
672
		NoArgument,
673
		typeDeclaration.sourceStart,
674
		typeDeclaration.sourceEnd);
675
}
676
public void annotationTypeDeclarationCannotHaveSuperinterfaces(TypeDeclaration typeDeclaration) {
677
	this.handle(
678
		IProblem.AnnotationTypeDeclarationCannotHaveSuperinterfaces,
679
		NoArgument,
680
		NoArgument,
681
		typeDeclaration.sourceStart,
682
		typeDeclaration.sourceEnd);
683
}
684
public void annotationTypeUsedAsSuperinterface(SourceTypeBinding type, TypeReference superInterfaceRef, ReferenceBinding superType) {
685
	this.handle(
686
		IProblem.AnnotationTypeUsedAsSuperInterface,
687
		new String[] {new String(superType.readableName()), new String(type.sourceName())},
688
		new String[] {new String(superType.shortReadableName()), new String(type.sourceName())},
689
		superInterfaceRef.sourceStart,
690
		superInterfaceRef.sourceEnd);
691
}
692
public void annotationValueMustBeAnnotation(TypeBinding annotationType, char[] name, Expression value, TypeBinding expectedType) {
693
	String str = new String(name);
694
	this.handle(
695
		IProblem.AnnotationValueMustBeAnnotation,
696
		new String[] { new String(annotationType.readableName()), str, new String(expectedType.readableName()),  },
697
		new String[] { new String(annotationType.shortReadableName()), str, new String(expectedType.readableName()), },
698
		value.sourceStart,
699
		value.sourceEnd);
700
}
701
public void annotationValueMustBeArrayInitializer(TypeBinding annotationType, char[] name, Expression value) {
702
	String str = new String(name);
703
	this.handle(
704
    	IProblem.AnnotationValueMustBeArrayInitializer,
705
		new String[] { new String(annotationType.readableName()), str },
706
		new String[] { new String(annotationType.shortReadableName()), str},
707
    	value.sourceStart,
708
    	value.sourceEnd);
709
}
710
public void annotationValueMustBeClassLiteral(TypeBinding annotationType, char[] name, Expression value) {
711
	String str = new String(name);
712
	this.handle(
713
		IProblem.AnnotationValueMustBeClassLiteral,
714
		new String[] { new String(annotationType.readableName()), str },
715
		new String[] { new String(annotationType.shortReadableName()), str},
716
		value.sourceStart,
717
		value.sourceEnd);
718
}
719
public void annotationValueMustBeConstant(TypeBinding annotationType, char[] name, Expression value, boolean isEnum) {
720
	String str = new String(name);
721
	if (isEnum) {
722
    	this.handle(
723
    		IProblem.AnnotationValueMustBeAnEnumConstant,
724
    		new String[] { new String(annotationType.readableName()), str },
725
    		new String[] { new String(annotationType.shortReadableName()), str},
726
    		value.sourceStart,
727
    		value.sourceEnd);
728
	} else {
729
    	this.handle(
730
    		IProblem.AnnotationValueMustBeConstant,
731
    		new String[] { new String(annotationType.readableName()), str },
732
    		new String[] { new String(annotationType.shortReadableName()), str},
733
    		value.sourceStart,
734
    		value.sourceEnd);
735
    }
736
}
737
public void anonymousClassCannotExtendFinalClass(Expression expression, TypeBinding type) {
565
public void anonymousClassCannotExtendFinalClass(Expression expression, TypeBinding type) {
738
	this.handle(
566
	this.handle(
739
		IProblem.AnonymousClassCannotExtendFinalClass,
567
		IProblem.AnonymousClassCannotExtendFinalClass,
Lines 891-908 Link Here
891
		messageSend.sourceStart,
719
		messageSend.sourceStart,
892
		messageSend.sourceEnd);
720
		messageSend.sourceEnd);
893
}
721
}
894
public void cannotExtendEnum(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
895
	String name = new String(type.sourceName());
896
	String superTypeFullName = new String(superTypeBinding.readableName());
897
	String superTypeShortName = new String(superTypeBinding.shortReadableName());
898
	if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
899
	this.handle(
900
		IProblem.CannotExtendEnum,
901
		new String[] {superTypeFullName, name},
902
		new String[] {superTypeShortName, name},
903
		superclass.sourceStart,
904
		superclass.sourceEnd);
905
}
906
public void cannotImportPackage(ImportReference importRef) {
722
public void cannotImportPackage(ImportReference importRef) {
907
	String[] arguments = new String[] {CharOperation.toString(importRef.tokens)};
723
	String[] arguments = new String[] {CharOperation.toString(importRef.tokens)};
908
	this.handle(
724
	this.handle(
Lines 920-939 Link Here
920
		typeRef.sourceStart,
736
		typeRef.sourceStart,
921
		typeRef.sourceEnd);
737
		typeRef.sourceEnd);
922
}
738
}
923
public void cannotInvokeSuperConstructorInEnum(ExplicitConstructorCall constructorCall, MethodBinding enumConstructor) {
924
	this.handle(
925
		IProblem.CannotInvokeSuperConstructorInEnum,
926
		new String[] {
927
		        new String(enumConstructor.declaringClass.sourceName()),
928
		        typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, false),
929
		 },
930
		new String[] {
931
		        new String(enumConstructor.declaringClass.sourceName()),
932
		        typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, true),
933
		 },
934
		constructorCall.sourceStart,
935
		constructorCall.sourceEnd);
936
}
937
public void cannotReadSource(CompilationUnitDeclaration unit, AbortCompilationUnit abortException, boolean verbose) {
739
public void cannotReadSource(CompilationUnitDeclaration unit, AbortCompilationUnit abortException, boolean verbose) {
938
	String fileName = new String(unit.compilationResult.fileName);
740
	String fileName = new String(unit.compilationResult.fileName);
939
	if (abortException.exception instanceof CharConversionException) {
741
	if (abortException.exception instanceof CharConversionException) {
Lines 1002-1015 Link Here
1002
		exception.sourceStart,
804
		exception.sourceStart,
1003
		exception.sourceEnd);
805
		exception.sourceEnd);
1004
}
806
}
1005
public void cannotUseQualifiedEnumConstantInCaseLabel(Reference location, FieldBinding field) {
1006
	this.handle(
1007
			IProblem.IllegalQualifiedEnumConstantLabel,
1008
			new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) },
1009
			new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) },
1010
			nodeSourceStart(field, location),
1011
			nodeSourceEnd(field, location));
1012
}
1013
public void cannotUseSuperInCodeSnippet(int start, int end) {
807
public void cannotUseSuperInCodeSnippet(int start, int end) {
1014
	this.handle(
808
	this.handle(
1015
		IProblem.CannotUseSuperInCodeSnippet,
809
		IProblem.CannotUseSuperInCodeSnippet,
Lines 1027-1040 Link Here
1027
		reference.sourceStart,
821
		reference.sourceStart,
1028
		reference.sourceEnd);
822
		reference.sourceEnd);
1029
}
823
}
1030
public void caseExpressionMustBeConstant(Expression expression) {
1031
	this.handle(
1032
		IProblem.NonConstantExpression,
1033
		NoArgument,
1034
		NoArgument,
1035
		expression.sourceStart,
1036
		expression.sourceEnd);
1037
}
1038
public void classExtendFinalClass(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
824
public void classExtendFinalClass(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
1039
	String name = new String(type.sourceName());
825
	String name = new String(type.sourceName());
1040
	String superTypeFullName = new String(superTypeBinding.readableName());
826
	String superTypeFullName = new String(superTypeBinding.readableName());
Lines 1088-1095 Link Here
1088
	switch (problemID) {
874
	switch (problemID) {
1089
		case IProblem.Task :
875
		case IProblem.Task :
1090
			return ProblemSeverities.Warning;
876
			return ProblemSeverities.Warning;
1091
 		case IProblem.VarargsConflict :
1092
			return ProblemSeverities.Warning;
1093
 		case IProblem.TypeCollidesWithPackage :
877
 		case IProblem.TypeCollidesWithPackage :
1094
			return ProblemSeverities.Warning;
878
			return ProblemSeverities.Warning;
1095
879
Lines 1136-1151 Link Here
1136
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
920
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
1137
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
921
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
1138
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
922
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
1139
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
1140
		case IProblem.JavadocNonGenericMethod:
1141
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
1142
		case IProblem.JavadocParameterizedMethodArgumentTypeMismatch:
1143
		case IProblem.JavadocTypeArgumentsForRawGenericMethod:
1144
		case IProblem.JavadocGenericConstructorTypeArgumentMismatch:
1145
		case IProblem.JavadocNonGenericConstructor:
1146
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
1147
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
1148
		case IProblem.JavadocTypeArgumentsForRawGenericConstructor:
1149
		case IProblem.JavadocEmptyReturnTag:
923
		case IProblem.JavadocEmptyReturnTag:
1150
			if (!this.options.reportInvalidJavadocTags) {
924
			if (!this.options.reportInvalidJavadocTags) {
1151
				return ProblemSeverities.Ignore;
925
				return ProblemSeverities.Ignore;
Lines 1309-1339 Link Here
1309
		location.sourceStart,
1083
		location.sourceStart,
1310
		nodeSourceEnd(null, location));
1084
		nodeSourceEnd(null, location));
1311
}
1085
}
1312
public void disallowedTargetForAnnotation(Annotation annotation) {
1313
	this.handle(
1314
		IProblem.DisallowedTargetForAnnotation,
1315
		new String[] {new String(annotation.resolvedType.readableName())},
1316
		new String[] {new String(annotation.resolvedType.shortReadableName())},
1317
		annotation.sourceStart,
1318
		annotation.sourceEnd);
1319
}
1320
public void duplicateAnnotation(Annotation annotation) {
1321
	this.handle(
1322
		IProblem.DuplicateAnnotation,
1323
		new String[] {new String(annotation.resolvedType.readableName())},
1324
		new String[] {new String(annotation.resolvedType.shortReadableName())},
1325
		annotation.sourceStart,
1326
		annotation.sourceEnd);
1327
}
1328
public void duplicateAnnotationValue(TypeBinding annotationType, MemberValuePair memberValuePair) {
1329
	String name = 	new String(memberValuePair.name);
1330
	this.handle(
1331
		IProblem.DuplicateAnnotationMember,
1332
		new String[] { name, new String(annotationType.readableName())},
1333
		new String[] {	name, new String(annotationType.shortReadableName())},
1334
		memberValuePair.sourceStart,
1335
		memberValuePair.sourceEnd);
1336
}
1337
public void duplicateBounds(ASTNode location, TypeBinding type) {
1086
public void duplicateBounds(ASTNode location, TypeBinding type) {
1338
	this.handle(
1087
	this.handle(
1339
		IProblem.DuplicateBounds,
1088
		IProblem.DuplicateBounds,
Lines 1358-1379 Link Here
1358
		statement.sourceStart,
1107
		statement.sourceStart,
1359
		statement.sourceEnd);
1108
		statement.sourceEnd);
1360
}
1109
}
1361
1362
public void duplicateEnumSpecialMethod(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
1363
    MethodBinding method = methodDecl.binding;
1364
	this.handle(
1365
		IProblem.CannotDeclareEnumSpecialMethod,
1366
		new String[] {
1367
	        new String(methodDecl.getSafeName()),
1368
			new String(method.declaringClass.readableName()),
1369
			typesAsString(method.isVarargs(), method.parameters, false)},
1370
		new String[] {
1371
			new String(methodDecl.getSafeName()),
1372
			new String(method.declaringClass.shortReadableName()),
1373
			typesAsString(method.isVarargs(), method.parameters, true)},
1374
		methodDecl.sourceStart,
1375
		methodDecl.sourceEnd);
1376
}
1377
public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) {
1110
public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) {
1378
	this.handle(
1111
	this.handle(
1379
		IProblem.DuplicateField,
1112
		IProblem.DuplicateField,
Lines 1549-1564 Link Here
1549
		reference.sourceStart,
1282
		reference.sourceStart,
1550
		reference.sourceEnd);
1283
		reference.sourceEnd);
1551
}
1284
}
1552
public void duplicateTargetInTargetAnnotation(TypeBinding annotationType, NameReference reference) {
1553
	FieldBinding field = reference.fieldBinding();
1554
	String name = 	new String(field.name);
1555
	this.handle(
1556
		IProblem.DuplicateTargetInTargetAnnotation,
1557
		new String[] { name, new String(annotationType.readableName())},
1558
		new String[] {	name, new String(annotationType.shortReadableName())},
1559
		nodeSourceStart(field, reference),
1560
		nodeSourceEnd(field, reference));
1561
}
1562
public void duplicateTypeParameterInType(TypeParameter typeParameter) {
1285
public void duplicateTypeParameterInType(TypeParameter typeParameter) {
1563
	this.handle(
1286
	this.handle(
1564
		IProblem.DuplicateTypeVariable,
1287
		IProblem.DuplicateTypeVariable,
Lines 1597-1624 Link Here
1597
		sourceStart,
1320
		sourceStart,
1598
		sourceEnd);
1321
		sourceEnd);
1599
}
1322
}
1600
public void enumAbstractMethodMustBeImplemented(AbstractMethodDeclaration method) {
1601
	MethodBinding abstractMethod = method.binding;
1602
	char[] methodSelector = abstractMethod.selector;
1603
	if(methodSelector == null)
1604
		methodSelector = method.getSafeName();
1605
	this.handle(
1606
		// Must implement the inherited abstract method %1
1607
		// 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods.
1608
		IProblem.EnumAbstractMethodMustBeImplemented,
1609
		new String[] {
1610
		        new String(methodSelector),
1611
		        typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, false),
1612
		        new String(abstractMethod.declaringClass.readableName()),
1613
		},
1614
		new String[] {
1615
		        new String(methodSelector),
1616
		        typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, true),
1617
		        new String(abstractMethod.declaringClass.shortReadableName()),
1618
		},
1619
		method.sourceStart(),
1620
		method.sourceEnd());
1621
}
1622
public void enumConstantsCannotBeSurroundedByParenthesis(Expression expression) {
1323
public void enumConstantsCannotBeSurroundedByParenthesis(Expression expression) {
1623
	this.handle(
1324
	this.handle(
1624
		IProblem.EnumConstantsCannotBeSurroundedByParenthesis,
1325
		IProblem.EnumConstantsCannotBeSurroundedByParenthesis,
Lines 1627-1648 Link Here
1627
		expression.sourceStart,
1328
		expression.sourceStart,
1628
		expression.sourceEnd);
1329
		expression.sourceEnd);
1629
}
1330
}
1630
public void enumStaticFieldUsedDuringInitialization(FieldBinding field, ASTNode location) {
1631
	this.handle(
1632
		IProblem.EnumStaticFieldInInInitializerContext,
1633
		new String[] {new String(field.declaringClass.readableName()), new String(field.name)},
1634
		new String[] {new String(field.declaringClass.shortReadableName()), new String(field.name)},
1635
		nodeSourceStart(field, location),
1636
		nodeSourceEnd(field, location));
1637
}
1638
public void enumSwitchCannotTargetField(Reference reference, FieldBinding field) {
1639
	this.handle(
1640
			IProblem.EnumSwitchCannotTargetField,
1641
			new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) },
1642
			new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) },
1643
			nodeSourceStart(field, reference),
1644
			nodeSourceEnd(field, reference));
1645
}
1646
public void errorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params) {
1331
public void errorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params) {
1647
	StringBuffer buffer = new StringBuffer();
1332
	StringBuffer buffer = new StringBuffer();
1648
	StringBuffer shortBuffer = new StringBuffer();
1333
	StringBuffer shortBuffer = new StringBuffer();
Lines 1975-1996 Link Here
1975
		location.sourceStart,
1660
		location.sourceStart,
1976
		location.sourceEnd);
1661
		location.sourceEnd);
1977
}
1662
}
1978
public void illegalExtendedDimensions(AnnotationMethodDeclaration annotationTypeMemberDeclaration) {
1979
	this.handle(
1980
		IProblem.IllegalExtendedDimensions,
1981
		NoArgument,
1982
		NoArgument,
1983
		annotationTypeMemberDeclaration.sourceStart,
1984
		annotationTypeMemberDeclaration.sourceEnd);
1985
}
1986
public void illegalExtendedDimensions(Argument argument) {
1987
	this.handle(
1988
		IProblem.IllegalExtendedDimensionsForVarArgs,
1989
		NoArgument,
1990
		NoArgument,
1991
		argument.sourceStart,
1992
		argument.sourceEnd);
1993
}
1994
public void illegalGenericArray(TypeBinding leafComponentType, ASTNode location) {
1663
public void illegalGenericArray(TypeBinding leafComponentType, ASTNode location) {
1995
	this.handle(
1664
	this.handle(
1996
		IProblem.IllegalGenericArray,
1665
		IProblem.IllegalGenericArray,
Lines 1999-2021 Link Here
1999
		location.sourceStart,
1668
		location.sourceStart,
2000
		location.sourceEnd);
1669
		location.sourceEnd);
2001
}
1670
}
2002
public void illegalInstanceOfGenericType(TypeBinding checkedType, ASTNode location) {
2003
	if (checkedType.isTypeVariable()) {
2004
		this.handle(
2005
		IProblem.IllegalInstanceofTypeParameter,
2006
			new String[] { new String(checkedType.readableName()), new String(checkedType.erasure().readableName())},
2007
			new String[] { new String(checkedType.shortReadableName()), new String(checkedType.erasure().shortReadableName())},
2008
			location.sourceStart,
2009
			location.sourceEnd);
2010
		return;
2011
	}
2012
	this.handle(
2013
		IProblem.IllegalInstanceofParameterizedType,
2014
		new String[] { new String(checkedType.readableName()), new String(checkedType.erasure().sourceName())},
2015
		new String[] { new String(checkedType.shortReadableName()), new String(checkedType.erasure().sourceName())},
2016
		location.sourceStart,
2017
		location.sourceEnd);
2018
}
2019
public void illegalLocalTypeDeclaration(TypeDeclaration typeDeclaration) {
1671
public void illegalLocalTypeDeclaration(TypeDeclaration typeDeclaration) {
2020
	if (isRecoveredName(typeDeclaration.name)) return;
1672
	if (isRecoveredName(typeDeclaration.name)) return;
2021
1673
Lines 2056-2108 Link Here
2056
		fieldDecl.sourceStart,
1708
		fieldDecl.sourceStart,
2057
		fieldDecl.sourceEnd);
1709
		fieldDecl.sourceEnd);
2058
}
1710
}
2059
public void illegalModifierForAnnotationField(FieldDeclaration fieldDecl) {
2060
	String name = new String(fieldDecl.name);
2061
	this.handle(
2062
		IProblem.IllegalModifierForAnnotationField,
2063
		new String[] {
2064
			new String(fieldDecl.binding.declaringClass.readableName()),
2065
			name,
2066
		},
2067
		new String[] {
2068
			new String(fieldDecl.binding.declaringClass.shortReadableName()),
2069
			name,
2070
		},
2071
		fieldDecl.sourceStart,
2072
		fieldDecl.sourceEnd);
2073
}
2074
public void illegalModifierForAnnotationMember(AbstractMethodDeclaration methodDecl) {
2075
	this.handle(
2076
		IProblem.IllegalModifierForAnnotationMethod,
2077
		new String[] {
2078
			new String(methodDecl.binding.declaringClass.readableName()),
2079
			new String(methodDecl.getSafeName()),
2080
		},
2081
		new String[] {
2082
			new String(methodDecl.binding.declaringClass.shortReadableName()),
2083
			new String(methodDecl.getSafeName()),
2084
		},
2085
		methodDecl.sourceStart,
2086
		methodDecl.sourceEnd);
2087
}
2088
public void illegalModifierForAnnotationMemberType(SourceTypeBinding type) {
2089
	String[] arguments = new String[] {new String(type.sourceName())};
2090
	this.handle(
2091
		IProblem.IllegalModifierForAnnotationMemberType,
2092
		arguments,
2093
		arguments,
2094
		type.sourceStart(),
2095
		type.sourceEnd());
2096
}
2097
public void illegalModifierForAnnotationType(SourceTypeBinding type) {
2098
	String[] arguments = new String[] {new String(type.sourceName())};
2099
	this.handle(
2100
		IProblem.IllegalModifierForAnnotationType,
2101
		arguments,
2102
		arguments,
2103
		type.sourceStart(),
2104
		type.sourceEnd());
2105
}
2106
public void illegalModifierForClass(SourceTypeBinding type) {
1711
public void illegalModifierForClass(SourceTypeBinding type) {
2107
	String[] arguments = new String[] {new String(type.sourceName())};
1712
	String[] arguments = new String[] {new String(type.sourceName())};
2108
	this.handle(
1713
	this.handle(
Lines 2112-2144 Link Here
2112
		type.sourceStart(),
1717
		type.sourceStart(),
2113
		type.sourceEnd());
1718
		type.sourceEnd());
2114
}
1719
}
2115
public void illegalModifierForEnum(SourceTypeBinding type) {
2116
	String[] arguments = new String[] {new String(type.sourceName())};
2117
	this.handle(
2118
		IProblem.IllegalModifierForEnum,
2119
		arguments,
2120
		arguments,
2121
		type.sourceStart(),
2122
		type.sourceEnd());
2123
}
2124
public void illegalModifierForEnumConstant(ReferenceBinding type, FieldDeclaration fieldDecl) {
2125
	String[] arguments = new String[] {new String(fieldDecl.name)};
2126
	this.handle(
2127
		IProblem.IllegalModifierForEnumConstant,
2128
		arguments,
2129
		arguments,
2130
		fieldDecl.sourceStart,
2131
		fieldDecl.sourceEnd);
2132
}
2133
2134
public void illegalModifierForEnumConstructor(AbstractMethodDeclaration constructor) {
2135
	this.handle(
2136
		IProblem.IllegalModifierForEnumConstructor,
2137
		NoArgument,
2138
		NoArgument,
2139
		constructor.sourceStart,
2140
		constructor.sourceEnd);
2141
}
2142
public void illegalModifierForField(ReferenceBinding type, FieldDeclaration fieldDecl) {
1720
public void illegalModifierForField(ReferenceBinding type, FieldDeclaration fieldDecl) {
2143
	String[] arguments = new String[] {new String(fieldDecl.name)};
1721
	String[] arguments = new String[] {new String(fieldDecl.name)};
2144
	this.handle(
1722
	this.handle(
Lines 2198-2212 Link Here
2198
		type.sourceStart(),
1776
		type.sourceStart(),
2199
		type.sourceEnd());
1777
		type.sourceEnd());
2200
}
1778
}
2201
public void illegalModifierForLocalEnum(SourceTypeBinding type) {
2202
	String[] arguments = new String[] {new String(type.sourceName())};
2203
	this.handle(
2204
		IProblem.IllegalModifierForLocalEnum,
2205
		arguments,
2206
		arguments,
2207
		type.sourceStart(),
2208
		type.sourceEnd());
2209
}
2210
public void illegalModifierForMemberClass(SourceTypeBinding type) {
1779
public void illegalModifierForMemberClass(SourceTypeBinding type) {
2211
	String[] arguments = new String[] {new String(type.sourceName())};
1780
	String[] arguments = new String[] {new String(type.sourceName())};
2212
	this.handle(
1781
	this.handle(
Lines 2216-2230 Link Here
2216
		type.sourceStart(),
1785
		type.sourceStart(),
2217
		type.sourceEnd());
1786
		type.sourceEnd());
2218
}
1787
}
2219
public void illegalModifierForMemberEnum(SourceTypeBinding type) {
2220
	String[] arguments = new String[] {new String(type.sourceName())};
2221
	this.handle(
2222
		IProblem.IllegalModifierForMemberEnum,
2223
		arguments,
2224
		arguments,
2225
		type.sourceStart(),
2226
		type.sourceEnd());
2227
}
2228
public void illegalModifierForMemberInterface(SourceTypeBinding type) {
1788
public void illegalModifierForMemberInterface(SourceTypeBinding type) {
2229
	String[] arguments = new String[] {new String(type.sourceName())};
1789
	String[] arguments = new String[] {new String(type.sourceName())};
2230
	this.handle(
1790
	this.handle(
Lines 2720-2742 Link Here
2720
		fieldDecl.sourceStart,
2280
		fieldDecl.sourceStart,
2721
		fieldDecl.sourceEnd);
2281
		fieldDecl.sourceEnd);
2722
}
2282
}
2723
public void invalidAnnotationMemberType(MethodDeclaration methodDecl) {
2724
	this.handle(
2725
		IProblem.InvalidAnnotationMemberType,
2726
		new String[] {
2727
			new String(methodDecl.binding.returnType.readableName()),
2728
			new String(methodDecl.getSafeName()),
2729
			new String(methodDecl.binding.declaringClass.readableName()),
2730
		},
2731
		new String[] {
2732
			new String(methodDecl.binding.returnType.shortReadableName()),
2733
			new String(methodDecl.getSafeName()),
2734
			new String(methodDecl.binding.declaringClass.shortReadableName()),
2735
		},
2736
		methodDecl.returnType.sourceStart,
2737
		methodDecl.returnType.sourceEnd);
2738
2739
}
2740
public void invalidBreak(ASTNode location) {
2283
public void invalidBreak(ASTNode location) {
2741
	this.handle(
2284
	this.handle(
2742
		IProblem.InvalidBreak,
2285
		IProblem.InvalidBreak,
Lines 2797-2908 Link Here
2797
				id = IProblem.AmbiguousConstructor;
2340
				id = IProblem.AmbiguousConstructor;
2798
			}
2341
			}
2799
			break;
2342
			break;
2800
		case ProblemReasons.ParameterBoundMismatch :
2801
			problemConstructor = (ProblemMethodBinding) targetConstructor;
2802
			ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch;
2803
			shownConstructor = substitutedConstructor.original();
2804
			int augmentedLength = problemConstructor.parameters.length;
2805
			TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2];
2806
			TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1];
2807
			TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
2808
			System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2);
2809
			this.handle(
2810
				IProblem.GenericConstructorTypeArgumentMismatch,
2811
				new String[] {
2812
				        new String(shownConstructor.declaringClass.sourceName()),
2813
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
2814
				        new String(shownConstructor.declaringClass.readableName()),
2815
				        typesAsString(false, invocationArguments, false),
2816
				        new String(inferredTypeArgument.readableName()),
2817
				        new String(typeParameter.sourceName),
2818
				        parameterBoundAsString(typeParameter, false) },
2819
				new String[] {
2820
				        new String(shownConstructor.declaringClass.sourceName()),
2821
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
2822
				        new String(shownConstructor.declaringClass.shortReadableName()),
2823
				        typesAsString(false, invocationArguments, true),
2824
				        new String(inferredTypeArgument.shortReadableName()),
2825
				        new String(typeParameter.sourceName),
2826
				        parameterBoundAsString(typeParameter, true) },
2827
				sourceStart,
2828
				sourceEnd);
2829
			return;
2830
2343
2831
		case ProblemReasons.TypeParameterArityMismatch :
2832
			problemConstructor = (ProblemMethodBinding) targetConstructor;
2833
			shownConstructor = problemConstructor.closestMatch;
2834
			if (shownConstructor.typeVariables == Binding.NO_TYPE_VARIABLES) {
2835
				this.handle(
2836
					IProblem.NonGenericConstructor,
2837
					new String[] {
2838
					        new String(shownConstructor.declaringClass.sourceName()),
2839
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
2840
					        new String(shownConstructor.declaringClass.readableName()),
2841
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
2842
					new String[] {
2843
					        new String(shownConstructor.declaringClass.sourceName()),
2844
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
2845
					        new String(shownConstructor.declaringClass.shortReadableName()),
2846
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
2847
					sourceStart,
2848
					sourceEnd);
2849
			} else {
2850
				this.handle(
2851
					IProblem.IncorrectArityForParameterizedConstructor  ,
2852
					new String[] {
2853
					        new String(shownConstructor.declaringClass.sourceName()),
2854
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
2855
					        new String(shownConstructor.declaringClass.readableName()),
2856
							typesAsString(false, shownConstructor.typeVariables, false),
2857
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
2858
					new String[] {
2859
					        new String(shownConstructor.declaringClass.sourceName()),
2860
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
2861
					        new String(shownConstructor.declaringClass.shortReadableName()),
2862
							typesAsString(false, shownConstructor.typeVariables, true),
2863
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
2864
					sourceStart,
2865
					sourceEnd);
2866
			}
2867
			return;
2868
		case ProblemReasons.ParameterizedMethodTypeMismatch :
2869
			problemConstructor = (ProblemMethodBinding) targetConstructor;
2870
			shownConstructor = problemConstructor.closestMatch;
2871
			this.handle(
2872
				IProblem.ParameterizedConstructorArgumentTypeMismatch,
2873
				new String[] {
2874
				        new String(shownConstructor.declaringClass.sourceName()),
2875
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
2876
				        new String(shownConstructor.declaringClass.readableName()),
2877
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, false),
2878
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
2879
				new String[] {
2880
				        new String(shownConstructor.declaringClass.sourceName()),
2881
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
2882
				        new String(shownConstructor.declaringClass.shortReadableName()),
2883
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, true),
2884
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
2885
				sourceStart,
2886
				sourceEnd);
2887
			return;
2888
		case ProblemReasons.TypeArgumentsForRawGenericMethod :
2889
			problemConstructor = (ProblemMethodBinding) targetConstructor;
2890
			shownConstructor = problemConstructor.closestMatch;
2891
			this.handle(
2892
				IProblem.TypeArgumentsForRawGenericConstructor,
2893
				new String[] {
2894
				        new String(shownConstructor.declaringClass.sourceName()),
2895
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
2896
				        new String(shownConstructor.declaringClass.readableName()),
2897
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
2898
				new String[] {
2899
				        new String(shownConstructor.declaringClass.sourceName()),
2900
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
2901
				        new String(shownConstructor.declaringClass.shortReadableName()),
2902
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
2903
				sourceStart,
2904
				sourceEnd);
2905
			return;
2906
		case ProblemReasons.NoError : // 0
2344
		case ProblemReasons.NoError : // 0
2907
		default :
2345
		default :
2908
			needImplementation(); // want to fail to see why we were here...
2346
			needImplementation(); // want to fail to see why we were here...
Lines 3163-3176 Link Here
3163
		nameRef.sourceStart,
2601
		nameRef.sourceStart,
3164
		(int) nameRef.sourcePositions[index]);
2602
		(int) nameRef.sourcePositions[index]);
3165
}
2603
}
3166
public void invalidFileNameForPackageAnnotations(Annotation annotation) {
3167
	this.handle(
3168
			IProblem.InvalidFileNameForPackageAnnotations,
3169
			NoArgument,
3170
			NoArgument,
3171
			annotation.sourceStart,
3172
			annotation.sourceEnd);
3173
}
3174
public void invalidMethod(MessageSend messageSend, MethodBinding method) {
2604
public void invalidMethod(MessageSend messageSend, MethodBinding method) {
3175
	if (isRecoveredName(messageSend.selector)) return;
2605
	if (isRecoveredName(messageSend.selector)) return;
3176
2606
Lines 3237-3347 Link Here
3237
				messageSend.receiver.sourceStart,
2667
				messageSend.receiver.sourceStart,
3238
				messageSend.receiver.sourceEnd);
2668
				messageSend.receiver.sourceEnd);
3239
			return;
2669
			return;
3240
		case ProblemReasons.ParameterBoundMismatch :
3241
			problemMethod = (ProblemMethodBinding) method;
3242
			ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
3243
			shownMethod = substitutedMethod.original();
3244
			int augmentedLength = problemMethod.parameters.length;
3245
			TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2];
3246
			TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1];
3247
			TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
3248
			System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2);
3249
			this.handle(
3250
				IProblem.GenericMethodTypeArgumentMismatch,
3251
				new String[] {
3252
				        new String(shownMethod.selector),
3253
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
3254
				        new String(shownMethod.declaringClass.readableName()),
3255
				        typesAsString(false, invocationArguments, false),
3256
				        new String(inferredTypeArgument.readableName()),
3257
				        new String(typeParameter.sourceName),
3258
				        parameterBoundAsString(typeParameter, false) },
3259
				new String[] {
3260
				        new String(shownMethod.selector),
3261
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
3262
				        new String(shownMethod.declaringClass.shortReadableName()),
3263
				        typesAsString(false, invocationArguments, true),
3264
				        new String(inferredTypeArgument.shortReadableName()),
3265
				        new String(typeParameter.sourceName),
3266
				        parameterBoundAsString(typeParameter, true) },
3267
				(int) (messageSend.nameSourcePosition >>> 32),
3268
				(int) messageSend.nameSourcePosition);
3269
			return;
3270
		case ProblemReasons.TypeParameterArityMismatch :
3271
			problemMethod = (ProblemMethodBinding) method;
3272
			shownMethod = problemMethod.closestMatch;
3273
			if (shownMethod.typeVariables == Binding.NO_TYPE_VARIABLES) {
3274
				this.handle(
3275
					IProblem.NonGenericMethod ,
3276
					new String[] {
3277
					        new String(shownMethod.selector),
3278
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
3279
					        new String(shownMethod.declaringClass.readableName()),
3280
					        typesAsString(method.isVarargs(), method.parameters, false) },
3281
					new String[] {
3282
					        new String(shownMethod.selector),
3283
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
3284
					        new String(shownMethod.declaringClass.shortReadableName()),
3285
					        typesAsString(method.isVarargs(), method.parameters, true) },
3286
					(int) (messageSend.nameSourcePosition >>> 32),
3287
					(int) messageSend.nameSourcePosition);
3288
			} else {
3289
				this.handle(
3290
					IProblem.IncorrectArityForParameterizedMethod  ,
3291
					new String[] {
3292
					        new String(shownMethod.selector),
3293
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
3294
					        new String(shownMethod.declaringClass.readableName()),
3295
							typesAsString(false, shownMethod.typeVariables, false),
3296
					        typesAsString(method.isVarargs(), method.parameters, false) },
3297
					new String[] {
3298
					        new String(shownMethod.selector),
3299
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
3300
					        new String(shownMethod.declaringClass.shortReadableName()),
3301
							typesAsString(false, shownMethod.typeVariables, true),
3302
					        typesAsString(method.isVarargs(), method.parameters, true) },
3303
					(int) (messageSend.nameSourcePosition >>> 32),
3304
					(int) messageSend.nameSourcePosition);
3305
			}
3306
			return;
3307
		case ProblemReasons.ParameterizedMethodTypeMismatch :
3308
			problemMethod = (ProblemMethodBinding) method;
3309
			shownMethod = problemMethod.closestMatch;
3310
			this.handle(
3311
				IProblem.ParameterizedMethodArgumentTypeMismatch,
3312
				new String[] {
3313
				        new String(shownMethod.selector),
3314
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
3315
				        new String(shownMethod.declaringClass.readableName()),
3316
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false),
3317
				        typesAsString(method.isVarargs(), method.parameters, false) },
3318
				new String[] {
3319
				        new String(shownMethod.selector),
3320
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
3321
				        new String(shownMethod.declaringClass.shortReadableName()),
3322
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, true),
3323
				        typesAsString(method.isVarargs(), method.parameters, true) },
3324
				(int) (messageSend.nameSourcePosition >>> 32),
3325
				(int) messageSend.nameSourcePosition);
3326
			return;
3327
		case ProblemReasons.TypeArgumentsForRawGenericMethod :
3328
			problemMethod = (ProblemMethodBinding) method;
3329
			shownMethod = problemMethod.closestMatch;
3330
			this.handle(
3331
				IProblem.TypeArgumentsForRawGenericMethod ,
3332
				new String[] {
3333
				        new String(shownMethod.selector),
3334
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
3335
				        new String(shownMethod.declaringClass.readableName()),
3336
				        typesAsString(method.isVarargs(), method.parameters, false) },
3337
				new String[] {
3338
				        new String(shownMethod.selector),
3339
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
3340
				        new String(shownMethod.declaringClass.shortReadableName()),
3341
				        typesAsString(method.isVarargs(), method.parameters, true) },
3342
				(int) (messageSend.nameSourcePosition >>> 32),
3343
				(int) messageSend.nameSourcePosition);
3344
			return;
3345
		case ProblemReasons.NoError : // 0
2670
		case ProblemReasons.NoError : // 0
3346
		default :
2671
		default :
3347
			needImplementation(); // want to fail to see why we were here...
2672
			needImplementation(); // want to fail to see why we were here...
Lines 3602-3631 Link Here
3602
		expression.sourceStart,
2927
		expression.sourceStart,
3603
		expression.sourceEnd);
2928
		expression.sourceEnd);
3604
}
2929
}
3605
public void invalidUsageOfAnnotation(Annotation annotation) {
3606
	this.handle(
3607
		IProblem.InvalidUsageOfAnnotations,
3608
		NoArgument,
3609
		NoArgument,
3610
		annotation.sourceStart,
3611
		annotation.sourceEnd);
3612
}
3613
public void invalidUsageOfAnnotationDeclarations(TypeDeclaration annotationTypeDeclaration) {
3614
	this.handle(
3615
		IProblem.InvalidUsageOfAnnotationDeclarations,
3616
		NoArgument,
3617
		NoArgument,
3618
		annotationTypeDeclaration.sourceStart,
3619
		annotationTypeDeclaration.sourceEnd);
3620
}
3621
public void invalidUsageOfEnumDeclarations(TypeDeclaration enumDeclaration) {
3622
	this.handle(
3623
		IProblem.InvalidUsageOfEnumDeclarations,
3624
		NoArgument,
3625
		NoArgument,
3626
		enumDeclaration.sourceStart,
3627
		enumDeclaration.sourceEnd);
3628
}
3629
public void invalidUsageOfForeachStatements(LocalDeclaration elementVariable, Expression collection) {
2930
public void invalidUsageOfForeachStatements(LocalDeclaration elementVariable, Expression collection) {
3630
	this.handle(
2931
	this.handle(
3631
		IProblem.InvalidUsageOfForeachStatements,
2932
		IProblem.InvalidUsageOfForeachStatements,
Lines 3634-3655 Link Here
3634
		elementVariable.declarationSourceStart,
2935
		elementVariable.declarationSourceStart,
3635
		collection.sourceEnd);
2936
		collection.sourceEnd);
3636
}
2937
}
3637
public void invalidUsageOfStaticImports(ImportReference staticImport) {
3638
	this.handle(
3639
		IProblem.InvalidUsageOfStaticImports,
3640
		NoArgument,
3641
		NoArgument,
3642
		staticImport.declarationSourceStart,
3643
		staticImport.declarationSourceEnd);
3644
}
3645
public void invalidUsageOfTypeArguments(TypeReference firstTypeReference, TypeReference lastTypeReference) {
3646
	this.handle(
3647
		IProblem.InvalidUsageOfTypeArguments,
3648
		NoArgument,
3649
		NoArgument,
3650
		firstTypeReference.sourceStart,
3651
		lastTypeReference.sourceEnd);
3652
}
3653
public void invalidUsageOfTypeParameters(TypeParameter firstTypeParameter, TypeParameter lastTypeParameter) {
2938
public void invalidUsageOfTypeParameters(TypeParameter firstTypeParameter, TypeParameter lastTypeParameter) {
3654
	this.handle(
2939
	this.handle(
3655
		IProblem.InvalidUsageOfTypeParameters,
2940
		IProblem.InvalidUsageOfTypeParameters,
Lines 3658-3679 Link Here
3658
		firstTypeParameter.declarationSourceStart,
2943
		firstTypeParameter.declarationSourceStart,
3659
		lastTypeParameter.declarationSourceEnd);
2944
		lastTypeParameter.declarationSourceEnd);
3660
}
2945
}
3661
public void invalidUsageOfVarargs(Argument argument) {
3662
	this.handle(
3663
		IProblem.InvalidUsageOfVarargs,
3664
		NoArgument,
3665
		NoArgument,
3666
		argument.type.sourceStart,
3667
		argument.sourceEnd);
3668
}
3669
public void illegalUsageOfWildcard(TypeReference wildcard) {
3670
	this.handle(
3671
		IProblem.InvalidUsageOfWildcard,
3672
		NoArgument,
3673
		NoArgument,
3674
		wildcard.sourceStart,
3675
		wildcard.sourceEnd);
3676
}
3677
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
2946
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
3678
	this.referenceContext = compUnitDecl;
2947
	this.referenceContext = compUnitDecl;
3679
	String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
2948
	String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
Lines 3944-3961 Link Here
3944
public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) {
3213
public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) {
3945
3214
3946
	if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return;
3215
	if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return;
3947
	int sourceStart = statement.sourceStart;
3948
	int sourceEnd = statement.sourceEnd;
3949
	if (statement instanceof AllocationExpression) {
3950
		AllocationExpression allocation = (AllocationExpression)statement;
3951
		if (allocation.enumConstant != null) {
3952
			sourceStart = allocation.enumConstant.sourceStart;
3953
			sourceEnd = allocation.enumConstant.sourceEnd;
3954
		}
3955
	}
3956
	int id = IProblem.JavadocUndefinedConstructor; //default...
3216
	int id = IProblem.JavadocUndefinedConstructor; //default...
3957
	ProblemMethodBinding problemConstructor = null;
3958
	MethodBinding shownConstructor = null;
3959
	switch (targetConstructor.problemId()) {
3217
	switch (targetConstructor.problemId()) {
3960
		case ProblemReasons.NotFound :
3218
		case ProblemReasons.NotFound :
3961
			id = IProblem.JavadocUndefinedConstructor;
3219
			id = IProblem.JavadocUndefinedConstructor;
Lines 3966-4093 Link Here
3966
		case ProblemReasons.Ambiguous :
3224
		case ProblemReasons.Ambiguous :
3967
			id = IProblem.JavadocAmbiguousConstructor;
3225
			id = IProblem.JavadocAmbiguousConstructor;
3968
			break;
3226
			break;
3969
		case ProblemReasons.ParameterBoundMismatch :
3970
			int severity = computeSeverity(IProblem.JavadocGenericConstructorTypeArgumentMismatch);
3971
			if (severity == ProblemSeverities.Ignore) return;
3972
			problemConstructor = (ProblemMethodBinding) targetConstructor;
3973
			ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch;
3974
			shownConstructor = substitutedConstructor.original();
3975
3976
			int augmentedLength = problemConstructor.parameters.length;
3977
			TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2];
3978
			TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1];
3979
			TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
3980
			System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2);
3981
3982
			this.handle(
3983
				IProblem.JavadocGenericConstructorTypeArgumentMismatch,
3984
				new String[] {
3985
				        new String(shownConstructor.declaringClass.sourceName()),
3986
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
3987
				        new String(shownConstructor.declaringClass.readableName()),
3988
				        typesAsString(false, invocationArguments, false),
3989
				        new String(inferredTypeArgument.readableName()),
3990
				        new String(typeParameter.sourceName),
3991
				        parameterBoundAsString(typeParameter, false) },
3992
				new String[] {
3993
				        new String(shownConstructor.declaringClass.sourceName()),
3994
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
3995
				        new String(shownConstructor.declaringClass.shortReadableName()),
3996
				        typesAsString(false, invocationArguments, true),
3997
				        new String(inferredTypeArgument.shortReadableName()),
3998
				        new String(typeParameter.sourceName),
3999
				        parameterBoundAsString(typeParameter, true) },
4000
				severity,
4001
				sourceStart,
4002
				sourceEnd);
4003
			return;
4004
4005
		case ProblemReasons.TypeParameterArityMismatch :
4006
			problemConstructor = (ProblemMethodBinding) targetConstructor;
4007
			shownConstructor = problemConstructor.closestMatch;
4008
			boolean noTypeVariables = shownConstructor.typeVariables == Binding.NO_TYPE_VARIABLES;
4009
			severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericConstructor : IProblem.JavadocIncorrectArityForParameterizedConstructor);
4010
			if (severity == ProblemSeverities.Ignore) return;
4011
			if (noTypeVariables) {
4012
				this.handle(
4013
					IProblem.JavadocNonGenericConstructor,
4014
					new String[] {
4015
					        new String(shownConstructor.declaringClass.sourceName()),
4016
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
4017
					        new String(shownConstructor.declaringClass.readableName()),
4018
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
4019
					new String[] {
4020
					        new String(shownConstructor.declaringClass.sourceName()),
4021
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
4022
					        new String(shownConstructor.declaringClass.shortReadableName()),
4023
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
4024
					severity,
4025
					sourceStart,
4026
					sourceEnd);
4027
			} else {
4028
				this.handle(
4029
					IProblem.JavadocIncorrectArityForParameterizedConstructor,
4030
					new String[] {
4031
					        new String(shownConstructor.declaringClass.sourceName()),
4032
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
4033
					        new String(shownConstructor.declaringClass.readableName()),
4034
							typesAsString(false, shownConstructor.typeVariables, false),
4035
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
4036
					new String[] {
4037
					        new String(shownConstructor.declaringClass.sourceName()),
4038
					        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
4039
					        new String(shownConstructor.declaringClass.shortReadableName()),
4040
							typesAsString(false, shownConstructor.typeVariables, true),
4041
					        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
4042
					severity,
4043
					sourceStart,
4044
					sourceEnd);
4045
			}
4046
			return;
4047
		case ProblemReasons.ParameterizedMethodTypeMismatch :
4048
			severity = computeSeverity(IProblem.JavadocParameterizedConstructorArgumentTypeMismatch);
4049
			if (severity == ProblemSeverities.Ignore) return;
4050
			problemConstructor = (ProblemMethodBinding) targetConstructor;
4051
			shownConstructor = problemConstructor.closestMatch;
4052
			this.handle(
4053
				IProblem.JavadocParameterizedConstructorArgumentTypeMismatch,
4054
				new String[] {
4055
				        new String(shownConstructor.declaringClass.sourceName()),
4056
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
4057
				        new String(shownConstructor.declaringClass.readableName()),
4058
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, false),
4059
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
4060
				new String[] {
4061
				        new String(shownConstructor.declaringClass.sourceName()),
4062
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
4063
				        new String(shownConstructor.declaringClass.shortReadableName()),
4064
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, true),
4065
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
4066
				severity,
4067
				sourceStart,
4068
				sourceEnd);
4069
			return;
4070
		case ProblemReasons.TypeArgumentsForRawGenericMethod :
4071
			severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericConstructor);
4072
			if (severity == ProblemSeverities.Ignore) return;
4073
			problemConstructor = (ProblemMethodBinding) targetConstructor;
4074
			shownConstructor = problemConstructor.closestMatch;
4075
			this.handle(
4076
				IProblem.JavadocTypeArgumentsForRawGenericConstructor,
4077
				new String[] {
4078
				        new String(shownConstructor.declaringClass.sourceName()),
4079
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
4080
				        new String(shownConstructor.declaringClass.readableName()),
4081
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
4082
				new String[] {
4083
				        new String(shownConstructor.declaringClass.sourceName()),
4084
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
4085
				        new String(shownConstructor.declaringClass.shortReadableName()),
4086
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
4087
				severity,
4088
				sourceStart,
4089
				sourceEnd);
4090
			return;
4091
		case ProblemReasons.NoError : // 0
3227
		case ProblemReasons.NoError : // 0
4092
		default :
3228
		default :
4093
			needImplementation(); // want to fail to see why we were here...
3229
			needImplementation(); // want to fail to see why we were here...
Lines 4200-4324 Link Here
4200
		case ProblemReasons.Ambiguous :
3336
		case ProblemReasons.Ambiguous :
4201
			id = IProblem.JavadocAmbiguousMethod;
3337
			id = IProblem.JavadocAmbiguousMethod;
4202
			break;
3338
			break;
4203
		case ProblemReasons.ParameterBoundMismatch :
4204
			int severity = computeSeverity(IProblem.JavadocGenericMethodTypeArgumentMismatch);
4205
			if (severity == ProblemSeverities.Ignore) return;
4206
			problemMethod = (ProblemMethodBinding) method;
4207
			ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
4208
			shownMethod = substitutedMethod.original();
4209
			int augmentedLength = problemMethod.parameters.length;
4210
			TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2];
4211
			TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1];
4212
			TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
4213
			System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2);
4214
			this.handle(
4215
				IProblem.JavadocGenericMethodTypeArgumentMismatch,
4216
				new String[] {
4217
				        new String(shownMethod.selector),
4218
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
4219
				        new String(shownMethod.declaringClass.readableName()),
4220
				        typesAsString(false, invocationArguments, false),
4221
				        new String(inferredTypeArgument.readableName()),
4222
				        new String(typeParameter.sourceName),
4223
				        parameterBoundAsString(typeParameter, false) },
4224
				new String[] {
4225
				        new String(shownMethod.selector),
4226
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
4227
				        new String(shownMethod.declaringClass.shortReadableName()),
4228
				        typesAsString(false, invocationArguments, true),
4229
				        new String(inferredTypeArgument.shortReadableName()),
4230
				        new String(typeParameter.sourceName),
4231
				        parameterBoundAsString(typeParameter, true) },
4232
				severity,
4233
				(int) (messageSend.nameSourcePosition >>> 32),
4234
				(int) messageSend.nameSourcePosition);
4235
			return;
4236
		case ProblemReasons.TypeParameterArityMismatch :
4237
			problemMethod = (ProblemMethodBinding) method;
4238
			shownMethod = problemMethod.closestMatch;
4239
			boolean noTypeVariables = shownMethod.typeVariables == Binding.NO_TYPE_VARIABLES;
4240
			severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericMethod : IProblem.JavadocIncorrectArityForParameterizedMethod);
4241
			if (severity == ProblemSeverities.Ignore) return;
4242
			if (noTypeVariables) {
4243
				this.handle(
4244
					IProblem.JavadocNonGenericMethod,
4245
					new String[] {
4246
					        new String(shownMethod.selector),
4247
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
4248
					        new String(shownMethod.declaringClass.readableName()),
4249
					        typesAsString(method.isVarargs(), method.parameters, false) },
4250
					new String[] {
4251
					        new String(shownMethod.selector),
4252
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
4253
					        new String(shownMethod.declaringClass.shortReadableName()),
4254
					        typesAsString(method.isVarargs(), method.parameters, true) },
4255
					severity,
4256
					(int) (messageSend.nameSourcePosition >>> 32),
4257
					(int) messageSend.nameSourcePosition);
4258
			} else {
4259
				this.handle(
4260
					IProblem.JavadocIncorrectArityForParameterizedMethod,
4261
					new String[] {
4262
					        new String(shownMethod.selector),
4263
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
4264
					        new String(shownMethod.declaringClass.readableName()),
4265
							typesAsString(false, shownMethod.typeVariables, false),
4266
					        typesAsString(method.isVarargs(), method.parameters, false) },
4267
					new String[] {
4268
					        new String(shownMethod.selector),
4269
					        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
4270
					        new String(shownMethod.declaringClass.shortReadableName()),
4271
							typesAsString(false, shownMethod.typeVariables, true),
4272
					        typesAsString(method.isVarargs(), method.parameters, true) },
4273
					severity,
4274
					(int) (messageSend.nameSourcePosition >>> 32),
4275
					(int) messageSend.nameSourcePosition);
4276
			}
4277
			return;
4278
		case ProblemReasons.ParameterizedMethodTypeMismatch :
4279
			severity = computeSeverity(IProblem.JavadocParameterizedMethodArgumentTypeMismatch);
4280
			if (severity == ProblemSeverities.Ignore) return;
4281
			problemMethod = (ProblemMethodBinding) method;
4282
			shownMethod = problemMethod.closestMatch;
4283
			this.handle(
4284
				IProblem.JavadocParameterizedMethodArgumentTypeMismatch,
4285
				new String[] {
4286
				        new String(shownMethod.selector),
4287
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
4288
				        new String(shownMethod.declaringClass.readableName()),
4289
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false),
4290
				        typesAsString(method.isVarargs(), method.parameters, false) },
4291
				new String[] {
4292
				        new String(shownMethod.selector),
4293
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
4294
				        new String(shownMethod.declaringClass.shortReadableName()),
4295
						typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, true),
4296
				        typesAsString(method.isVarargs(), method.parameters, true) },
4297
				severity,
4298
				(int) (messageSend.nameSourcePosition >>> 32),
4299
				(int) messageSend.nameSourcePosition);
4300
			return;
4301
		case ProblemReasons.TypeArgumentsForRawGenericMethod :
4302
			severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericMethod);
4303
			if (severity == ProblemSeverities.Ignore) return;
4304
			problemMethod = (ProblemMethodBinding) method;
4305
			shownMethod = problemMethod.closestMatch;
4306
			this.handle(
4307
				IProblem.JavadocTypeArgumentsForRawGenericMethod,
4308
				new String[] {
4309
				        new String(shownMethod.selector),
4310
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false),
4311
				        new String(shownMethod.declaringClass.readableName()),
4312
				        typesAsString(method.isVarargs(), method.parameters, false) },
4313
				new String[] {
4314
				        new String(shownMethod.selector),
4315
				        typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true),
4316
				        new String(shownMethod.declaringClass.shortReadableName()),
4317
				        typesAsString(method.isVarargs(), method.parameters, true) },
4318
				severity,
4319
				(int) (messageSend.nameSourcePosition >>> 32),
4320
				(int) messageSend.nameSourcePosition);
4321
			return;
4322
		case ProblemReasons.NoError : // 0
3339
		case ProblemReasons.NoError : // 0
4323
		default :
3340
		default :
4324
			needImplementation(); // want to fail to see why we were here...
3341
			needImplementation(); // want to fail to see why we were here...
Lines 4700-4718 Link Here
4700
		nodeSourceStart(local, location),
3717
		nodeSourceStart(local, location),
4701
		nodeSourceEnd(local, location));
3718
		nodeSourceEnd(local, location));
4702
}
3719
}
4703
public void methodMustOverride(AbstractMethodDeclaration method) {
4704
	MethodBinding binding = method.binding;
4705
	char[] methodSelector = binding.selector;
4706
	if(methodSelector == null)
4707
		methodSelector = method.getSafeName();
4708
	
4709
	this.handle(
4710
		this.options.sourceLevel == ClassFileConstants.JDK1_5 ? IProblem.MethodMustOverride : IProblem.MethodMustOverrideOrImplement,
4711
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), },
4712
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),},
4713
		method.sourceStart,
4714
		method.sourceEnd);
4715
}
4716
public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) {
3720
public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) {
4717
	this.handle(
3721
	this.handle(
4718
		IProblem.MethodNameClash,
3722
		IProblem.MethodNameClash,
Lines 4758-4827 Link Here
4758
		methodDecl.sourceStart,
3762
		methodDecl.sourceStart,
4759
		methodDecl.sourceEnd);
3763
		methodDecl.sourceEnd);
4760
}
3764
}
4761
public void missingDeprecatedAnnotationForField(FieldDeclaration field) {
4762
	int severity = computeSeverity(IProblem.FieldMissingDeprecatedAnnotation);
4763
	if (severity == ProblemSeverities.Ignore) return;
4764
	FieldBinding binding = field.binding;
4765
	this.handle(
4766
		IProblem.FieldMissingDeprecatedAnnotation,
4767
		new String[] {new String(binding.declaringClass.readableName()), new String(binding.name), },
4768
		new String[] {new String(binding.declaringClass.shortReadableName()), new String(binding.name), },
4769
		severity,
4770
		nodeSourceStart(binding, field),
4771
		nodeSourceEnd(binding, field));
4772
}
4773
public void missingDeprecatedAnnotationForMethod(AbstractMethodDeclaration method) {
4774
	int severity = computeSeverity(IProblem.MethodMissingDeprecatedAnnotation);
4775
	if (severity == ProblemSeverities.Ignore) return;
4776
	MethodBinding binding = method.binding;
4777
	char[] methodSelector = binding.selector;
4778
	if(methodSelector == null)
4779
		methodSelector = method.getSafeName();
4780
	
4781
	this.handle(
4782
		IProblem.MethodMissingDeprecatedAnnotation,
4783
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), },
4784
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),},
4785
		severity,
4786
		method.sourceStart,
4787
		method.sourceEnd);
4788
}
4789
public void missingDeprecatedAnnotationForType(TypeDeclaration type) {
4790
	int severity = computeSeverity(IProblem.TypeMissingDeprecatedAnnotation);
4791
	if (severity == ProblemSeverities.Ignore) return;
4792
	TypeBinding binding = type.binding;
4793
	this.handle(
4794
		IProblem.TypeMissingDeprecatedAnnotation,
4795
		new String[] {new String(binding.readableName()), },
4796
		new String[] {new String(binding.shortReadableName()),},
4797
		severity,
4798
		type.sourceStart,
4799
		type.sourceEnd);
4800
}
4801
public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) {
4802
	this.handle(
4803
		IProblem.MissingEnumConstantCase,
4804
		new String[] {new String(enumConstant.declaringClass.readableName()), new String(enumConstant.name) },
4805
		new String[] {new String(enumConstant.declaringClass.shortReadableName()), new String(enumConstant.name) },
4806
		switchStatement.expression.sourceStart,
4807
		switchStatement.expression.sourceEnd);
4808
}
4809
public void missingOverrideAnnotation(AbstractMethodDeclaration method) {
4810
	int severity = computeSeverity(IProblem.MissingOverrideAnnotation);
4811
	if (severity == ProblemSeverities.Ignore) return;
4812
	MethodBinding binding = method.binding;
4813
	char[] methodSelector = binding.selector;
4814
	if(methodSelector == null)
4815
		methodSelector = method.getSafeName();
4816
	
4817
	this.handle(
4818
		IProblem.MissingOverrideAnnotation,
4819
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), },
4820
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),},
4821
		severity,
4822
		method.sourceStart,
4823
		method.sourceEnd);
4824
}
4825
public void missingReturnType(AbstractMethodDeclaration methodDecl) {
3765
public void missingReturnType(AbstractMethodDeclaration methodDecl) {
4826
	this.handle(
3766
	this.handle(
4827
		IProblem.MissingReturnType,
3767
		IProblem.MissingReturnType,
Lines 4848-4862 Link Here
4848
		typeDecl.sourceStart,
3788
		typeDecl.sourceStart,
4849
		typeDecl.sourceEnd);
3789
		typeDecl.sourceEnd);
4850
}
3790
}
4851
public void missingValueForAnnotationMember(Annotation annotation, char[] memberName) {
4852
	String memberString = new String(memberName);
4853
	this.handle(
4854
		IProblem.MissingValueForAnnotationMember,
4855
		new String[] {new String(annotation.resolvedType.readableName()), memberString },
4856
		new String[] {new String(annotation.resolvedType.shortReadableName()), memberString},
4857
		annotation.sourceStart,
4858
		annotation.sourceEnd);
4859
}
4860
public void mustDefineDimensionsOrInitializer(ArrayAllocationExpression expression) {
3791
public void mustDefineDimensionsOrInitializer(ArrayAllocationExpression expression) {
4861
	this.handle(
3792
	this.handle(
4862
		IProblem.MustDefineEitherDimensionExpressionsOrInitializer,
3793
		IProblem.MustDefineEitherDimensionExpressionsOrInitializer,
Lines 5208-5221 Link Here
5208
		expression.sourceStart,
4139
		expression.sourceStart,
5209
		expression.sourceEnd);
4140
		expression.sourceEnd);
5210
}
4141
}
5211
public void objectCannotBeGeneric(TypeDeclaration typeDecl) {
5212
	this.handle(
5213
		IProblem.ObjectCannotBeGeneric,
5214
		NoArgument,
5215
		NoArgument,
5216
		typeDecl.typeParameters[0].sourceStart,
5217
		typeDecl.typeParameters[typeDecl.typeParameters.length-1].sourceEnd);
5218
}
5219
public void objectCannotHaveSuperTypes(SourceTypeBinding type) {
4142
public void objectCannotHaveSuperTypes(SourceTypeBinding type) {
5220
	this.handle(
4143
	this.handle(
5221
		IProblem.ObjectCannotHaveSuperTypes,
4144
		IProblem.ObjectCannotHaveSuperTypes,
Lines 6015-6032 Link Here
6015
		decl.sourceStart,
4938
		decl.sourceStart,
6016
		decl.sourceEnd);
4939
		decl.sourceEnd);
6017
}
4940
}
6018
public void superTypeCannotUseWildcard(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
6019
	String name = new String(type.sourceName());
6020
	String superTypeFullName = new String(superTypeBinding.readableName());
6021
	String superTypeShortName = new String(superTypeBinding.shortReadableName());
6022
	if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
6023
	this.handle(
6024
		IProblem.SuperTypeUsingWildcard,
6025
		new String[] {superTypeFullName, name},
6026
		new String[] {superTypeShortName, name},
6027
		superclass.sourceStart,
6028
		superclass.sourceEnd);
6029
}
6030
private void syntaxError(
4941
private void syntaxError(
6031
	int id,
4942
	int id,
6032
	int startPosition,
4943
	int startPosition,
Lines 6130-6171 Link Here
6130
		typeDecl.sourceEnd,
5041
		typeDecl.sourceEnd,
6131
		compUnitDecl.compilationResult);
5042
		compUnitDecl.compilationResult);
6132
}
5043
}
6133
public void typeHiding(TypeDeclaration typeDecl, TypeVariableBinding hiddenTypeParameter) {
6134
	int severity = computeSeverity(IProblem.TypeHidingTypeParameterFromType);
6135
	if (severity == ProblemSeverities.Ignore) return;
6136
	if (hiddenTypeParameter.declaringElement instanceof TypeBinding) {
6137
		TypeBinding declaringType = (TypeBinding) hiddenTypeParameter.declaringElement;
6138
		this.handle(
6139
			IProblem.TypeHidingTypeParameterFromType,
6140
			new String[] { new String(typeDecl.name) , new String(hiddenTypeParameter.readableName()), new String(declaringType.readableName())  },
6141
			new String[] { new String(typeDecl.name) , new String(hiddenTypeParameter.shortReadableName()), new String(declaringType.shortReadableName()) },
6142
			severity,
6143
			typeDecl.sourceStart,
6144
			typeDecl.sourceEnd);
6145
	} else {
6146
		// type parameter of generic method
6147
		MethodBinding declaringMethod = (MethodBinding) hiddenTypeParameter.declaringElement;
6148
		this.handle(
6149
				IProblem.TypeHidingTypeParameterFromMethod,
6150
				new String[] {
6151
						new String(typeDecl.name),
6152
						new String(hiddenTypeParameter.readableName()),
6153
						new String(declaringMethod.selector),
6154
						typesAsString(declaringMethod.isVarargs(), declaringMethod.parameters, false),
6155
						new String(declaringMethod.declaringClass.readableName()),
6156
				},
6157
				new String[] {
6158
						new String(typeDecl.name),
6159
						new String(hiddenTypeParameter.shortReadableName()),
6160
						new String(declaringMethod.selector),
6161
						typesAsString(declaringMethod.isVarargs(), declaringMethod.parameters, true),
6162
						new String(declaringMethod.declaringClass.shortReadableName()),
6163
				},
6164
				severity,
6165
				typeDecl.sourceStart,
6166
				typeDecl.sourceEnd);
6167
	}
6168
}
6169
public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) {
5044
public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) {
6170
	int severity = computeSeverity(IProblem.TypeHidingType);
5045
	int severity = computeSeverity(IProblem.TypeHidingType);
6171
	if (severity == ProblemSeverities.Ignore) return;
5046
	if (severity == ProblemSeverities.Ignore) return;
Lines 6197-6220 Link Here
6197
		location.sourceStart,
5072
		location.sourceStart,
6198
		location.sourceEnd);
5073
		location.sourceEnd);
6199
}
5074
}
6200
public void typeMismatchError(TypeBinding typeArgument, TypeVariableBinding typeParameter, ReferenceBinding genericType, ASTNode location) {
6201
    if (location == null) { // binary case
6202
		this.handle(
6203
			IProblem.TypeArgumentMismatch,
6204
			new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, false) },
6205
			new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, true) },
6206
			ProblemSeverities.AbortCompilation | ProblemSeverities.Error | ProblemSeverities.Fatal,
6207
			0,
6208
			0);
6209
        return;
6210
    }
6211
	this.handle(
6212
		IProblem.TypeArgumentMismatch,
6213
		new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, false) },
6214
		new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, true) },
6215
		location.sourceStart,
6216
		location.sourceEnd);
6217
}
6218
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) {
5075
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) {
6219
	StringBuffer buffer = new StringBuffer(10);
5076
	StringBuffer buffer = new StringBuffer(10);
6220
	for (int i = 0, length = types.length; i < length; i++) {
5077
	for (int i = 0, length = types.length; i < length; i++) {
Lines 6228-6243 Link Here
6228
	}
5085
	}
6229
	return buffer.toString();
5086
	return buffer.toString();
6230
}
5087
}
6231
public void undefinedAnnotationValue(TypeBinding annotationType, MemberValuePair memberValuePair) {
6232
	if (isRecoveredName(memberValuePair.name)) return;
6233
	String name = 	new String(memberValuePair.name);
6234
	this.handle(
6235
		IProblem.UndefinedAnnotationMember,
6236
		new String[] { name, new String(annotationType.readableName())},
6237
		new String[] {	name, new String(annotationType.shortReadableName())},
6238
		memberValuePair.sourceStart,
6239
		memberValuePair.sourceEnd);
6240
}
6241
public void undefinedLabel(BranchStatement statement) {
5088
public void undefinedLabel(BranchStatement statement) {
6242
	if (isRecoveredName(statement.label)) return;
5089
	if (isRecoveredName(statement.label)) return;
6243
	String[] arguments = new String[] {new String(statement.label)};
5090
	String[] arguments = new String[] {new String(statement.label)};
Lines 6304-6318 Link Here
6304
		location.sourceStart,
5151
		location.sourceStart,
6305
		location.sourceEnd);
5152
		location.sourceEnd);
6306
}
5153
}
6307
public void unhandledWarningToken(Expression token) {
6308
	String[] arguments = new String[] { token.constant.stringValue() };
6309
	this.handle(
6310
		IProblem.UnhandledWarningToken,
6311
		arguments,
6312
		arguments,
6313
		token.sourceStart,
6314
		token.sourceEnd);
6315
}
6316
public void uninitializedBlankFinalField(FieldBinding field, ASTNode location) {
5154
public void uninitializedBlankFinalField(FieldBinding field, ASTNode location) {
6317
	String[] arguments = new String[] {new String(field.readableName())};
5155
	String[] arguments = new String[] {new String(field.readableName())};
6318
	this.handle(
5156
	this.handle(
Lines 6753-6825 Link Here
6753
		sourceStart,
5591
		sourceStart,
6754
		sourceEnd);
5592
		sourceEnd);
6755
}
5593
}
6756
public void varargsArgumentNeedCast(MethodBinding method, TypeBinding argumentType, InvocationSite location) {
6757
	int severity = this.options.getSeverity(CompilerOptions.VarargsArgumentNeedCast);
6758
	if (severity == ProblemSeverities.Ignore) return;
6759
	ArrayBinding varargsType = (ArrayBinding)method.parameters[method.parameters.length-1];
6760
	if (method.isConstructor()) {
6761
		this.handle(
6762
			IProblem.ConstructorVarargsArgumentNeedCast,
6763
			new String[] {
6764
					new String(argumentType.readableName()),
6765
					new String(varargsType.readableName()),
6766
					new String(method.declaringClass.readableName()),
6767
					typesAsString(method.isVarargs(), method.parameters, false),
6768
					new String(varargsType.elementsType().readableName()),
6769
			},
6770
			new String[] {
6771
					new String(argumentType.shortReadableName()),
6772
					new String(varargsType.shortReadableName()),
6773
					new String(method.declaringClass.shortReadableName()),
6774
					typesAsString(method.isVarargs(), method.parameters, true),
6775
					new String(varargsType.elementsType().shortReadableName()),
6776
			},
6777
			severity,
6778
			location.sourceStart(),
6779
			location.sourceEnd());
6780
	} else {
6781
		this.handle(
6782
			IProblem.MethodVarargsArgumentNeedCast,
6783
			new String[] {
6784
					new String(argumentType.readableName()),
6785
					new String(varargsType.readableName()),
6786
					new String(method.selector),
6787
					typesAsString(method.isVarargs(), method.parameters, false),
6788
					new String(method.declaringClass.readableName()),
6789
					new String(varargsType.elementsType().readableName()),
6790
			},
6791
			new String[] {
6792
					new String(argumentType.shortReadableName()),
6793
					new String(varargsType.shortReadableName()),
6794
					new String(method.selector), typesAsString(method.isVarargs(), method.parameters, true),
6795
					new String(method.declaringClass.shortReadableName()),
6796
					new String(varargsType.elementsType().shortReadableName()),
6797
			},
6798
			severity,
6799
			location.sourceStart(),
6800
			location.sourceEnd());
6801
	}
6802
}
6803
public void varargsConflict(MethodBinding method1, MethodBinding method2, SourceTypeBinding type) {
6804
	this.handle(
6805
		IProblem.VarargsConflict,
6806
		new String[] {
6807
		        new String(method1.selector),
6808
		        typesAsString(method1.isVarargs(), method1.parameters, false),
6809
		        new String(method1.declaringClass.readableName()),
6810
		        typesAsString(method2.isVarargs(), method2.parameters, false),
6811
		        new String(method2.declaringClass.readableName())
6812
		},
6813
		new String[] {
6814
		        new String(method1.selector),
6815
		        typesAsString(method1.isVarargs(), method1.parameters, true),
6816
		        new String(method1.declaringClass.shortReadableName()),
6817
		        typesAsString(method2.isVarargs(), method2.parameters, true),
6818
		        new String(method2.declaringClass.shortReadableName())
6819
		},
6820
		method1.declaringClass == type ? method1.sourceStart() : type.sourceStart(),
6821
		method1.declaringClass == type ? method1.sourceEnd() : type.sourceEnd());
6822
}
6823
public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) {
5594
public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) {
6824
	String[] arguments = new String[] {new String(varDecl.name)};
5595
	String[] arguments = new String[] {new String(varDecl.name)};
6825
	this.handle(
5596
	this.handle(
(-)src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties (-149 lines)
Lines 127-133 Link Here
127
150 = The type of the expression must be an array type but it resolved to {0}
127
150 = The type of the expression must be an array type but it resolved to {0}
128
151 = Must explicitly convert the char[] to a String
128
151 = Must explicitly convert the char[] to a String
129
152 = String constant is exceeding the limit of 65535 bytes of UTF8 encoding
129
152 = String constant is exceeding the limit of 65535 bytes of UTF8 encoding
130
153 = case expressions should be constant expressions
131
154 = The literal {1} of type {0} is out of range 
130
154 = The literal {1} of type {0} is out of range 
132
156 = Cannot cast from {0} to {1}
131
156 = Cannot cast from {0} to {1}
133
157 = Cannot instantiate the type {0}
132
157 = Cannot instantiate the type {0}
Lines 257-273 Link Here
257
329 = The type java.lang.Object cannot have a superclass or superinterfaces
256
329 = The type java.lang.Object cannot have a superclass or superinterfaces
258
330 = The type java.lang.Object must be a class
257
330 = The type java.lang.Object must be a class
259
258
260
###[obsolete] 330 = {0} cannot be resolved or is not a valid superclass
261
###[obsolete] 331 = Superclass {0} is not visible
262
###[obsolete] 332 = Superclass {0} is ambiguous
263
###[obsolete] 333 = Superclass {0} cannot be referenced using its binary name
264
###[obsolete] 334 = Superclass {0} is defined in an inherited type and an enclosing scope
265
###[obsolete] 335 = {0} cannot be resolved or is not a valid superinterface
266
###[obsolete] 336 = Superinterface {0} is not visible
267
###[obsolete] 337 = Superinterface {0} is ambiguous
268
###[obsolete] 338 = Superinterface {0} cannot be referenced using its binary name
269
###[obsolete] 339 = Superinterface {0} is defined in an inherited type and an enclosing scope
270
271
340 = Duplicate field {0}.{1}
259
340 = Duplicate field {0}.{1}
272
341 = Duplicate modifier for the field {0}
260
341 = Duplicate modifier for the field {0}
273
342 = Illegal modifier for the field {0}; only public, protected, private, static, final, transient & volatile are permitted
261
342 = Illegal modifier for the field {0}; only public, protected, private, static, final, transient & volatile are permitted
Lines 276-287 Link Here
276
345 = The field {0} can be either final or volatile, not both
264
345 = The field {0} can be either final or volatile, not both
277
346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types
265
346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types
278
266
279
###[obsolete] 350 = {2} cannot be resolved (or is not a valid type) for the field {1}.{0}
280
###[obsolete] 351 = The type {2} is not visible for the field {1}.{0}
281
###[obsolete] 352 = The type {2} is ambiguous for the field {1}.{0}
282
###[obsolete] 353 = The field type {2} cannot be referenced using its binary name
283
###[obsolete] 354 = The field type {2} is defined in an inherited type and an enclosing scope
284
285
355 = Duplicate function {0}({2}) in type {1}
267
355 = Duplicate function {0}({2}) in type {1}
286
356 = Illegal modifier for parameter {0}; only final is permitted
268
356 = Illegal modifier for parameter {0}; only final is permitted
287
357 = Duplicate modifier for the function {1} in type {0}
269
357 = Duplicate modifier for the function {1} in type {0}
Lines 292-336 Link Here
292
362 = The abstract function {1} in type {0} can only set a visibility modifier, one of public or protected
274
362 = The abstract function {1} in type {0} can only set a visibility modifier, one of public or protected
293
363 = The abstract function {1} in type {0} can only be defined by an abstract class
275
363 = The abstract function {1} in type {0} can only be defined by an abstract class
294
364 = void is an invalid type for the parameter {1} of the function {0}
276
364 = void is an invalid type for the parameter {1} of the function {0}
295
###[obsolete] 365 = An array of void is an invalid type for the parameter {1} of the function {0}
296
###[obsolete] 366 = An array of void is an invalid return type for the function {0}
297
367 = The native function {1} cannot also be declared strictfp
277
367 = The native function {1} cannot also be declared strictfp
298
368 = Duplicate modifier for parameter {0}
278
368 = Duplicate modifier for parameter {0}
299
279
300
###[obsolete] 370 = {2} cannot be resolved (or is not a valid type) for the parameter {1} of the function {0}
301
###[obsolete] 371 = The type {2} is not visible for the parameter {1} of the function {0}
302
###[obsolete] 372 = The type {2} is ambiguous for the parameter {1} of the function {0}
303
###[obsolete] 373 = The parameter type {2} cannot be referenced using its binary name
304
###[obsolete] 374 = The parameter type {2} is defined in an inherited type and an enclosing scope
305
###[obsolete] 375 = {1} cannot be resolved (or is not an exception type) for the function {0}
306
###[obsolete] 376 = The exception type {1} is not visible for the function {0}
307
###[obsolete] 377 = The exception type {1} is ambiguous for the function {0}
308
###[obsolete] 378 = The exception type {1} cannot be referenced using its binary name
309
###[obsolete] 379 = The exception type {1} is defined in an inherited type and an enclosing scope
310
###[obsolete] 380 = {1} cannot be resolved (or is not a valid return type) for the function {0}
311
###[obsolete] 381 = The return type {1} is not visible for the function {0}
312
###[obsolete] 382 = The return type {1} is ambiguous for the function {0}
313
###[obsolete] 383 = The return type {1} cannot be referenced using its binary name
314
###[obsolete] 384 = The return type {1} is defined in an inherited type and an enclosing scope
315
316
385 = The import {0} conflicts with a type defined in the same file
280
385 = The import {0} conflicts with a type defined in the same file
317
386 = The import {0} collides with another import statement
281
386 = The import {0} collides with another import statement
318
387 = Only a type can be imported. {0} resolves to a package
282
387 = Only a type can be imported. {0} resolves to a package
319
388 = The import {0} is never used
283
388 = The import {0} is never used
320
390 = The import {0} cannot be resolved
284
390 = The import {0} cannot be resolved
321
285
322
###[obsolete] 391 = The imported type {0} is not visible
323
###[obsolete] 392 = The imported type {0} is ambiguous
324
###[obsolete] 393 = The imported type {0} cannot be referenced using its binary name
325
###[obsolete] 394 = The imported type {0} is defined in an inherited type and an enclosing scope
326
327
391 = The static import {0} must be a field or member type
286
391 = The static import {0} must be a field or member type
328
287
329
395 = Duplicate modifier for the variable {0}
288
395 = Duplicate modifier for the variable {0}
330
396 = Illegal modifier for the variable {0}; only final is permitted
289
396 = Illegal modifier for the variable {0}; only final is permitted
331
###[obsolete] 397 = Redundant null check: The variable {0} cannot be null at this location
332
###[obsolete] 398 = Null pointer access: The variable {0} can only be null at this location
333
###[obsolete] 399 = Potential null pointer access: The variable {0} may be null at this location
334
	
290
	
335
400 = The type {3} must implement the inherited abstract function {2}.{0}({1})
291
400 = The type {3} must implement the inherited abstract function {2}.{0}({1})
336
401 = Cannot override the final function from {0}
292
401 = Cannot override the final function from {0}
Lines 438-477 Link Here
438
520 = Duplicate type parameter {0}
394
520 = Duplicate type parameter {0}
439
521 = Cannot refer to the type parameter {0} as a supertype
395
521 = Cannot refer to the type parameter {0} as a supertype
440
522 = Cannot make a static reference to the non-static type {0}
396
522 = Cannot make a static reference to the non-static type {0}
441
523 = The type java.lang.Object cannot be declared as a generic
442
524 = The type {0} is not generic; it cannot be parameterized with arguments <{1}>
397
524 = The type {0} is not generic; it cannot be parameterized with arguments <{1}>
443
525 = Incorrect number of arguments for type {0}; it cannot be parameterized with arguments <{1}>
398
525 = Incorrect number of arguments for type {0}; it cannot be parameterized with arguments <{1}>
444
526 = Bound mismatch: The type {0} is not a valid substitute for the bounded parameter <{2} extends {3}> of the type {1}
445
527 = function {0}({2}) has the same erasure {0}({3}) as another function in type {1}
399
527 = function {0}({2}) has the same erasure {0}({3}) as another function in type {1}
446
528 = Illegal forward reference to type parameter {0}
400
528 = Illegal forward reference to type parameter {0}
447
529 = The type {0} is not an interface; it cannot be specified as a bounded parameter
401
529 = The type {0} is not an interface; it cannot be specified as a bounded parameter
448
530 = Type safety: The constructor {0}({1}) belongs to the raw type {0}. References to generic type {2} should be parameterized
449
531 = Type safety: The function {0}({1}) belongs to the raw type {2}. References to generic type {3} should be parameterized
450
532 = Type safety: The expression of type {0} needs unchecked conversion to conform to {1}
402
532 = Type safety: The expression of type {0} needs unchecked conversion to conform to {1}
451
533 = Cannot use the type parameter {0} in a catch block
403
533 = Cannot use the type parameter {0} in a catch block
452
534 = Cannot use the parameterized type {0} either in catch block or throws clause
404
534 = Cannot use the parameterized type {0} either in catch block or throws clause
453
535 = Cannot create a generic array of {0}
405
535 = Cannot create a generic array of {0}
454
536 = Type safety: The field {1} from the raw type {2} is assigned a value of type {0}. References to generic type {3} should be parameterized
455
537 = The type parameter {0} should not be bounded by the final type {1}. Final types cannot be further extended
406
537 = The type parameter {0} should not be bounded by the final type {1}. Final types cannot be further extended
456
538 = Inconsistent classfile encountered: The undefined type parameter {0} is referenced from within {1}
407
538 = Inconsistent classfile encountered: The undefined type parameter {0} is referenced from within {1}
457
539 = The interface {2} cannot be implemented more than once with different arguments: {0} and {1}
408
539 = The interface {2} cannot be implemented more than once with different arguments: {0} and {1}
458
540 = Bound mismatch: The constructor {0}({1}) of type {2} is not applicable for the arguments ({3}). The wildcard parameter {5} has no lower bound, and may actually be more restrictive than argument {4}
459
541 = Bound mismatch: The function {0}({1}) of type {2} is not applicable for the arguments ({3}). The wildcard parameter {5} has no lower bound, and may actually be more restrictive than argument {4}
460
542 = Bound mismatch: Cannot assign expression of type {0} to wildcard type {1}. The wildcard type has no lower bound, and may actually be more restrictive than expression type
461
543 = Bound mismatch: The generic function {0}({1}) of type {2} is not applicable for the arguments ({3}). The inferred type {4} is not a valid substitute for the bounded parameter <{5} extends {6}>
462
544 = Bound mismatch: The generic constructor {0}({1}) of type {2} is not applicable for the arguments ({3}). The inferred type {4} is not a valid substitute for the bounded parameter <{5} extends {6}>
463
545 = Type safety: Unchecked cast from {0} to {1}
409
545 = Type safety: Unchecked cast from {0} to {1}
464
546 = Cannot perform instanceof check against parameterized type {0}. Use instead its raw form {1} since generic type information will be erased at runtime
465
547 = Cannot perform instanceof check against type parameter {0}. Use instead its erasure {1} since generic type information will be erased at runtime
466
548 = The function {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
467
549 = Incorrect number of type arguments for generic function <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
468
550 = The parameterized function <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
469
551 = The constructor {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
470
552 = Incorrect number of type arguments for generic constructor <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
471
553 = The parameterized constructor <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
472
554 = The function {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}>
473
555 = The constructor {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}>
474
556 = The type {1} cannot extend or implement {0}. A supertype may not specify any wildcard
475
557 = The generic class {0} may not subclass java.lang.Throwable
410
557 = The generic class {0} may not subclass java.lang.Throwable
476
558 = Illegal class literal for the type parameter {0}
411
558 = Illegal class literal for the type parameter {0}
477
559 = Type safety: The return type {0} for {1}({2}) from the type {3} needs unchecked conversion to conform to {4} from the type {5}
412
559 = Type safety: The return type {0} for {1}({2}) from the type {3} needs unchecked conversion to conform to {4} from the type {5}
Lines 479-499 Link Here
479
561 = The member type {0}<{1}> must be qualified with a parameterized type, since it is not static
414
561 = The member type {0}<{1}> must be qualified with a parameterized type, since it is not static
480
562 = The member type {0} must be parameterized, since it is qualified with a parameterized type
415
562 = The member type {0} must be parameterized, since it is qualified with a parameterized type
481
563 = The member type {0} cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type {1}
416
563 = The member type {0} cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type {1}
482
###[obsolete] 564 = Bound conflict: {0} is inherited with conflicting arguments
483
565 = Duplicate functions named {0} with the parameters ({2}) and ({3}) are defined by the type {1}
417
565 = Duplicate functions named {0} with the parameters ({2}) and ({3}) are defined by the type {1}
484
566 = Cannot allocate the member type {0} using a parameterized compound name; use its simple name and an enclosing instance of type {1}
418
566 = Cannot allocate the member type {0} using a parameterized compound name; use its simple name and an enclosing instance of type {1}
485
567 = Duplicate bound {0}
419
567 = Duplicate bound {0}
486
568 = The array type {0} cannot be used as a type parameter bound
420
568 = The array type {0} cannot be used as a type parameter bound
487
569 = Type safety: Unchecked invocation {0}({3}) of the generic constructor {0}({1}) of type {2}
488
570 = Type safety: Unchecked invocation {0}({3}) of the generic function {0}({1}) of type {2}
489
571 = The type parameter {0} is hiding the type {1}
421
571 = The type parameter {0} is hiding the type {1}
490
572 = {0} is a raw type. References to generic type {1} should be parameterized
491
573 = Cannot specify any additional bound {0} when first bound is a type parameter
422
573 = Cannot specify any additional bound {0} when first bound is a type parameter
492
574 = Type safety : A generic array of {0} is created for a varargs parameter
493
575 = Illegal qualified access from the type parameter {0}
423
575 = Illegal qualified access from the type parameter {0}
494
576 = The nested type {0} is hiding the type parameter {1} of type {2}
495
577 = The nested type {0} is hiding the type parameter {1} of the generic function {2}({3}) of type {4}
496
578 = Wildcard is not allowed at this location
497
424
498
### FOREACH
425
### FOREACH
499
580 = Type mismatch: cannot convert from element type {0} to {1}
426
580 = Type mismatch: cannot convert from element type {0} to {1}
Lines 501-550 Link Here
501
428
502
### SOURCE LEVEL
429
### SOURCE LEVEL
503
590 = Syntax error, type parameters are only available if source level is 5.0
430
590 = Syntax error, type parameters are only available if source level is 5.0
504
591 = Syntax error, static imports are only available if source level is 5.0
505
592 = Syntax error, 'for each' statements are only available if source level is 5.0
431
592 = Syntax error, 'for each' statements are only available if source level is 5.0
506
593 = Syntax error, parameterized types are only available if source level is 5.0
507
594 = Syntax error, enum declarations are only available if source level is 5.0
508
595 = Syntax error, varargs are only available if source level is 5.0
509
596 = Syntax error, annotations are only available if source level is 5.0
510
597 = Syntax error, annotation declarations are only available if source level is 5.0
511
512
### ANNOTATIONS
513
600 = Illegal modifier for the annotation attribute {0}.{1}; only public & abstract are permitted
514
601 = Extended dimensions are illegal in an annotation attribute declaration
515
602 = Package annotations must be in file package-info.js
516
603 = Illegal modifier for the annotation type {0}; only public & abstract are permitted
517
604 = Illegal modifier for the member annotation type {0}; only public, protected, private, static & abstract are permitted
518
605 = Invalid type {0} for the annotation attribute {2}.{1}; only primitive type, String, Class, annotation, enumeration are permitted or 1-dimensional arrays thereof
519
606 = Cycle detected: the annotation type {0} cannot contain attributes of the annotation type itself
520
607 = Cycle detected: a cycle exists between annotation attributes of {0} and {1}
521
608 = Duplicate annotation @{0}
522
609 = The annotation @{0} must define the attribute {1}
523
610 = Duplicate attribute {0} in annotation @{1}
524
611 = The attribute {0} is undefined for the annotation type {1}
525
612 = The value for annotation attribute {0}.{1} must be a class literal
526
613 = The value for annotation attribute {0}.{1} must be a constant expression
527
###[obsolete] 614 = The annotation field {0}.{1} must be initialized with a constant expression
528
615 = Illegal modifier for the annotation field {0}.{1}; only public, static & final are permitted
529
616 = The annotation type {0} cannot override the function {1}.{2}({3})
530
617 = Annotation attributes cannot have parameters
531
618 = Annotation attributes cannot be generic
532
619 = Annotation type declaration cannot have an explicit superclass
533
620 = Annotation type declaration cannot have explicit superinterfaces
534
621 = Duplicate element {0} specified in annotation @{1}
535
622 = The annotation @{0} is disallowed for this location
536
623 = The function {0}({1}) of type {2} must override a superclass function
537
624 = Annotation type declaration cannot have a constructor
538
625 = The value for annotation attribute {0}.{1} must be some @{2} annotation 
539
626 = The annotation type {0} should not be used as a superinterface for {1}
540
627 = The function {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superclass function
541
628 = The deprecated field {0}.{1} should be annotated with @Deprecated
542
629 = The deprecated function {0}({1}) of type {2} should be annotated with @Deprecated
543
630 = The deprecated type {0} should be annotated with @Deprecated
544
631 = Unhandled warning token {0}
545
632 = The value for annotation attribute {0}.{1} must be an array initializer
546
633 = The value for annotation attribute {0}.{1} must be an enum constant expression
547
634 = The function {0}({1}) of type {2} must override or implement a supertype function
548
432
549
### CORRUPTED BINARIES
433
### CORRUPTED BINARIES
550
700 = The class file {0} contains a signature ''{1}'' ill-formed at position {2}
434
700 = The class file {0} contains a signature ''{1}'' ill-formed at position {2}
Lines 556-591 Link Here
556
### AUTOBOXING
440
### AUTOBOXING
557
720 = The expression of type {0} is boxed into {1}
441
720 = The expression of type {0} is boxed into {1}
558
721 = The expression of type {0} is unboxed into {1}
442
721 = The expression of type {0} is unboxed into {1}
559
560
### ENUMS
561
750 = Illegal modifier for the enum {0}; only public is permitted
562
751 = Illegal modifier for the enum constant {0}; no modifier is allowed
563
752 = Illegal modifier for the local enum {0}; only abstract is permitted
564
753 = Illegal modifier for the member enum {0}; only public, protected, private, static & abstract are permitted
565
754 = The enum {1} already defines the function {0}({2}) implicitly
566
755 = The enum constant {0}.{1} reference cannot be qualified in a case label
567
756 = The type {1} may not subclass {0} explicitly
568
757 = Cannot invoke super constructor from enum constructor {0}({1})
569
758 = The enum {2} can only define the abstract function {0}({1}) if it also defines enum constants with corresponding implementations
570
759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch
571
760 = Illegal modifier for the enum constructor; only private is permitted.
572
761 = The enum constant {0}.{1} has no corresponding case label
573
762 = Cannot refer to the static enum field {0}.{1} within an initializer
574
575
### VARARGS
576
800 = Extended dimensions are illegal for a variable argument
577
801 = The argument of type {0} should explicitly be cast to {1} for the invocation of the varargs function {2}({3}) from type {4}. It could alternatively be cast to {5} for a varargs invocation
578
802 = The argument of type {0} should explicitly be cast to {1} for the invocation of the varargs constructor {2}({3}). It could alternatively be cast to {4} for a varargs invocation
579
803 = Varargs functions should only override or be overridden by other varargs functions unlike {2}.{0}({1}) and {4}.{0}({3})
580
581
### GENERIC JAVADOC
582
850 = Bound mismatch: The generic function {0}({1}) of type {2} is not applicable for the arguments ({3}). The inferred type {4} is not a valid substitute for the bounded parameter <{5} extends {6}>
583
851 = The function {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
584
852 = Incorrect number of type arguments for generic function <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
585
853 = The parameterized function <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
586
854 = The function {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}>
587
855 = Bound mismatch: The generic constructor {0}({1}) of type {2} is not applicable for the arguments ({3}). The inferred type {4} is not a valid substitute for the bounded parameter <{5} extends {6}>
588
856 = The constructor {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
589
857 = Incorrect number of type arguments for generic constructor <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
590
858 = The parameterized constructor <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
591
859 = The constructor {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}>
(-)src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties (-1 lines)
Lines 277-283 Link Here
277
\      unusedPrivate      + unused private member declaration\n\
277
\      unusedPrivate      + unused private member declaration\n\
278
\      unusedThrown         unused declared thrown exception\n\
278
\      unusedThrown         unused declared thrown exception\n\
279
\      uselessTypeCheck     unnecessary cast/instanceof operation\n\
279
\      uselessTypeCheck     unnecessary cast/instanceof operation\n\
280
\      varargsCast        + varargs argument need explicit cast\n\
281
\      warningToken       + unhandled warning token in @SuppressWarnings\n\
280
\      warningToken       + unhandled warning token in @SuppressWarnings\n\
282
\ \n\
281
\ \n\
283
\ Advanced options:\n\
282
\ Advanced options:\n\
(-)src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java (-25 lines)
Lines 1776-1785 Link Here
1776
		this.options.put(
1776
		this.options.put(
1777
			CompilerOptions.OPTION_SuppressWarnings,
1777
			CompilerOptions.OPTION_SuppressWarnings,
1778
			isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
1778
			isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
1779
	} else if (token.equals("warningToken")) {//$NON-NLS-1$
1780
		this.options.put(
1781
			CompilerOptions.OPTION_ReportUnhandledWarningToken,
1782
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1783
	} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$
1779
	} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$
1784
		this.options.put(
1780
		this.options.put(
1785
			CompilerOptions.OPTION_ReportUnnecessaryElse,
1781
			CompilerOptions.OPTION_ReportUnnecessaryElse,
Lines 1880-1889 Link Here
1880
		this.options.put(
1876
		this.options.put(
1881
			CompilerOptions.OPTION_ReportTypeParameterHiding,
1877
			CompilerOptions.OPTION_ReportTypeParameterHiding,
1882
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1878
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1883
	} else if (token.equals("varargsCast")) { //$NON-NLS-1$
1884
		this.options.put(
1885
			CompilerOptions.OPTION_ReportVarargsArgumentNeedCast,
1886
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1887
	} else if (token.equals("null")) { //$NON-NLS-1$
1879
	} else if (token.equals("null")) { //$NON-NLS-1$
1888
		if (isEnabling) {
1880
		if (isEnabling) {
1889
			this.options.put(CompilerOptions.OPTION_ReportNullReference,
1881
			this.options.put(CompilerOptions.OPTION_ReportNullReference,
Lines 1916-1938 Link Here
1916
		this.options.put(
1908
		this.options.put(
1917
			CompilerOptions.OPTION_ReportAutoboxing,
1909
			CompilerOptions.OPTION_ReportAutoboxing,
1918
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1910
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1919
	} else if (token.equals("over-ann")) { //$NON-NLS-1$
1920
		this.options.put(
1921
			CompilerOptions.OPTION_ReportMissingOverrideAnnotation,
1922
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1923
	} else if (token.equals("dep-ann")) { //$NON-NLS-1$
1924
		this.options.put(
1925
			CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation,
1926
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1927
	} else if (token.equals("intfAnnotation")) { //$NON-NLS-1$
1928
		this.options.put(
1929
			CompilerOptions.OPTION_ReportAnnotationSuperInterface,
1930
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1931
	} else if (token.equals("enumSwitch") //$NON-NLS-1$
1932
			|| token.equals("incomplete-switch")) { //$NON-NLS-1$
1933
		this.options.put(
1934
			CompilerOptions.OPTION_ReportIncompleteEnumSwitch,
1935
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1936
	} else if (token.equals("hiding")) { //$NON-NLS-1$
1911
	} else if (token.equals("hiding")) { //$NON-NLS-1$
1937
		this.options.put(
1912
		this.options.put(
1938
			CompilerOptions.OPTION_ReportHiddenCatchBlock,
1913
			CompilerOptions.OPTION_ReportHiddenCatchBlock,
(-)src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionParser.java (-10 lines)
Lines 3366-3381 Link Here
3366
		}
3366
		}
3367
	}
3367
	}
3368
}
3368
}
3369
protected void consumeOnlyTypeArguments() {
3370
	super.consumeOnlyTypeArguments();
3371
	popElement(K_BINARY_OPERATOR);
3372
	if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_METHOD_INVOCATION) {
3373
		popElement(K_PARAMETERIZED_METHOD_INVOCATION);
3374
		pushOnElementStack(K_PARAMETERIZED_METHOD_INVOCATION, INSIDE_NAME);
3375
	} else {
3376
		popElement(K_PARAMETERIZED_ALLOCATION);
3377
	}
3378
}
3379
protected void consumeOnlyTypeArgumentsForCastExpression() {
3369
protected void consumeOnlyTypeArgumentsForCastExpression() {
3380
	super.consumeOnlyTypeArgumentsForCastExpression();
3370
	super.consumeOnlyTypeArgumentsForCastExpression();
3381
	pushOnElementStack(K_PARAMETERIZED_CAST);
3371
	pushOnElementStack(K_PARAMETERIZED_CAST);
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodVerifier.java (-1 lines)
Lines 139-145 Link Here
139
}
139
}
140
void checkAgainstInheritedMethods(MethodBinding currentMethod, MethodBinding[] methods, int length, MethodBinding[] allInheritedMethods) {
140
void checkAgainstInheritedMethods(MethodBinding currentMethod, MethodBinding[] methods, int length, MethodBinding[] allInheritedMethods) {
141
	if (this.type.isAnnotationType()) { // annotation cannot override any method
141
	if (this.type.isAnnotationType()) { // annotation cannot override any method
142
		problemReporter().annotationCannotOverrideMethod(currentMethod, methods[length - 1]);
143
		return; // do not repoort against subsequent inherited methods
142
		return; // do not repoort against subsequent inherited methods
144
	}
143
	}
145
	CompilerOptions options = type.scope.compilerOptions();
144
	CompilerOptions options = type.scope.compilerOptions();
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodScope.java (-5 / +1 lines)
Lines 106-116 Link Here
106
		// check for abnormal modifiers
106
		// check for abnormal modifiers
107
		final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccStatic | ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStrictfp);
107
		final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccStatic | ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStrictfp);
108
		if (declaringClass.isEnum() && !((ConstructorDeclaration) referenceContext).isDefaultConstructor) {
108
		if (declaringClass.isEnum() && !((ConstructorDeclaration) referenceContext).isDefaultConstructor) {
109
			final int UNEXPECTED_ENUM_CONSTR_MODIFIERS = ~(ClassFileConstants.AccPrivate | ClassFileConstants.AccStrictfp);
109
			if ((((AbstractMethodDeclaration) referenceContext).modifiers & ClassFileConstants.AccStrictfp) != 0) {
110
			if ((realModifiers & UNEXPECTED_ENUM_CONSTR_MODIFIERS) != 0) {
111
				problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) referenceContext);
112
				modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~UNEXPECTED_ENUM_CONSTR_MODIFIERS;
113
			} else if ((((AbstractMethodDeclaration) referenceContext).modifiers & ClassFileConstants.AccStrictfp) != 0) {
114
				// must check the parse node explicitly
110
				// must check the parse node explicitly
115
				problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) referenceContext);
111
				problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) referenceContext);
116
			}
112
			}
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java (-17 / +7 lines)
Lines 1438-1452 Link Here
1438
					if (methodDecl == null) {
1438
					if (methodDecl == null) {
1439
						methodDecl = method.sourceMethod(); // cannot be retrieved after binding is lost & may still be null if method is special
1439
						methodDecl = method.sourceMethod(); // cannot be retrieved after binding is lost & may still be null if method is special
1440
						if (methodDecl != null && methodDecl.binding != null) { // ensure its a valid user defined method
1440
						if (methodDecl != null && methodDecl.binding != null) { // ensure its a valid user defined method
1441
							if (isEnumSpecialMethod) {
1441
							this.scope
1442
								this.scope.problemReporter()
1442
									.problemReporter()
1443
										.duplicateEnumSpecialMethod(this,
1443
									.duplicateMethodInType(this, methodDecl);
1444
												methodDecl);
1444
							
1445
							} else {
1446
								this.scope
1447
										.problemReporter()
1448
										.duplicateMethodInType(this, methodDecl);
1449
							}
1450
							methodDecl.binding = null;
1445
							methodDecl.binding = null;
1451
							// do not alter original method array until resolution is over, due to reentrance (143259)
1446
							// do not alter original method array until resolution is over, due to reentrance (143259)
1452
							if (resolvedMethods == this.methods) {
1447
							if (resolvedMethods == this.methods) {
Lines 1464-1477 Link Here
1464
					AbstractMethodDeclaration method2Decl = method2
1459
					AbstractMethodDeclaration method2Decl = method2
1465
							.sourceMethod();
1460
							.sourceMethod();
1466
					if (method2Decl != null && method2Decl.binding != null) { // ensure its a valid user defined method
1461
					if (method2Decl != null && method2Decl.binding != null) { // ensure its a valid user defined method
1467
						if (isEnumSpecialMethod) {
1462
						this.scope.problemReporter().duplicateMethodInType(
1468
							this.scope.problemReporter()
1463
								this, method2Decl);
1469
									.duplicateEnumSpecialMethod(this,
1464
						
1470
											method2Decl);
1471
						} else {
1472
							this.scope.problemReporter().duplicateMethodInType(
1473
									this, method2Decl);
1474
						}
1475
						method2Decl.binding = null;
1465
						method2Decl.binding = null;
1476
						// do not alter original method array until resolution is over, due to reentrance (143259)
1466
						// do not alter original method array until resolution is over, due to reentrance (143259)
1477
						if (resolvedMethods == this.methods) {
1467
						if (resolvedMethods == this.methods) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/Scope.java (-11 lines)
Lines 443-463 Link Here
443
			if (method == null) return null; // incompatible
443
			if (method == null) return null; // incompatible
444
			if (!method.isValidBinding()) return method; // bound check issue is taking precedence
444
			if (!method.isValidBinding()) return method; // bound check issue is taking precedence
445
			parameters = method.parameters; // reacquire them after type inference has performed
445
			parameters = method.parameters; // reacquire them after type inference has performed
446
		} else if (genericTypeArguments != null) {
447
			if (method instanceof ParameterizedGenericMethodBinding) {
448
				if (!((ParameterizedGenericMethodBinding) method).wasInferred) {
449
					// attempt to invoke generic method of raw type with type hints <String>foo()
450
					return new ProblemMethodBinding(method, method.selector, genericTypeArguments, ProblemReasons.TypeArgumentsForRawGenericMethod);
451
				}
452
			} else {
453
				return new ProblemMethodBinding(method, method.selector, genericTypeArguments, ProblemReasons.TypeParameterArityMismatch);
454
			}
455
		}
446
		}
456
447
457
		if (parameterCompatibilityLevel(method, arguments) > NOT_COMPATIBLE)
448
		if (parameterCompatibilityLevel(method, arguments) > NOT_COMPATIBLE)
458
			return method;
449
			return method;
459
		if (genericTypeArguments != null)
460
			return new ProblemMethodBinding(method, method.selector, arguments, ProblemReasons.ParameterizedMethodTypeMismatch);
461
		return null; // incompatible
450
		return null; // incompatible
462
	}
451
	}
463
452
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java (-11 / +1 lines)
Lines 16-22 Link Here
16
import org.eclipse.wst.jsdt.core.JavaScriptCore;
16
import org.eclipse.wst.jsdt.core.JavaScriptCore;
17
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
17
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
18
import org.eclipse.wst.jsdt.core.infer.InferredType;
18
import org.eclipse.wst.jsdt.core.infer.InferredType;
19
import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration;
20
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
19
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
21
import org.eclipse.wst.jsdt.internal.compiler.env.IDependent;
20
import org.eclipse.wst.jsdt.internal.compiler.env.IDependent;
22
import org.eclipse.wst.jsdt.internal.compiler.util.SimpleLookupTable;
21
import org.eclipse.wst.jsdt.internal.compiler.util.SimpleLookupTable;
Lines 569-584 Link Here
569
	boolean inCycle = false; // check each method before failing
568
	boolean inCycle = false; // check each method before failing
570
	for (int i = 0, l = currentMethods.length; i < l; i++) {
569
	for (int i = 0, l = currentMethods.length; i < l; i++) {
571
		TypeBinding returnType = currentMethods[i].returnType.leafComponentType();
570
		TypeBinding returnType = currentMethods[i].returnType.leafComponentType();
572
		if (this == returnType) {
571
		if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) {
573
			if (this instanceof SourceTypeBinding) {
574
				MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
575
				((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);
576
			}
577
		} else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) {
578
			if (this instanceof SourceTypeBinding) {
579
				MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
580
				((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null);
581
			}
582
			inCycle = true;
572
			inCycle = true;
583
		}
573
		}
584
	}
574
	}
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java (-35 / +3 lines)
Lines 353-359 Link Here
353
		sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety
353
		sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety
354
354
355
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
355
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
356
			problemReporter().objectCannotBeGeneric(referenceContext);
357
			return;
356
			return;
358
		}
357
		}
359
		sourceType.typeVariables = createTypeVariables(typeParameters, sourceType);
358
		sourceType.typeVariables = createTypeVariables(typeParameters, sourceType);
Lines 442-450 Link Here
442
				final int UNEXPECTED_MODIFIERS =
441
				final int UNEXPECTED_MODIFIERS =
443
					~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStatic | ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
442
					~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStatic | ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
444
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
443
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
445
					if ((realModifiers & ClassFileConstants.AccAnnotation) != 0)
444
					if ((realModifiers & ClassFileConstants.AccAnnotation) == 0)
446
						problemReporter().illegalModifierForAnnotationMemberType(sourceType);
447
					else
448
						problemReporter().illegalModifierForMemberInterface(sourceType);
445
						problemReporter().illegalModifierForMemberInterface(sourceType);
449
				}
446
				}
450
				/*
447
				/*
Lines 456-483 Link Here
456
			} else {
453
			} else {
457
				final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
454
				final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
458
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
455
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
459
					if ((realModifiers & ClassFileConstants.AccAnnotation) != 0)
456
					if ((realModifiers & ClassFileConstants.AccAnnotation) == 0)
460
						problemReporter().illegalModifierForAnnotationType(sourceType);
461
					else
462
						problemReporter().illegalModifierForInterface(sourceType);
457
						problemReporter().illegalModifierForInterface(sourceType);
463
				}
458
				}
464
			}
459
			}
465
			modifiers |= ClassFileConstants.AccAbstract;
460
			modifiers |= ClassFileConstants.AccAbstract;
466
		} else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
461
		} else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
467
			// detect abnormal cases for enums
462
			// detect abnormal cases for enums
468
			if (isMemberType) { // includes member types defined inside local types
469
				final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStatic | ClassFileConstants.AccStrictfp | ClassFileConstants.AccEnum);
470
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
471
					problemReporter().illegalModifierForMemberEnum(sourceType);
472
			} else if (sourceType.isLocalType()) { // each enum constant is an anonymous local type
473
				final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccStrictfp | ClassFileConstants.AccFinal | ClassFileConstants.AccEnum); // add final since implicitly set for anonymous type
474
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
475
					problemReporter().illegalModifierForLocalEnum(sourceType);
476
			} else {
477
				final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccStrictfp | ClassFileConstants.AccEnum);
478
				if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
479
					problemReporter().illegalModifierForEnum(sourceType);
480
			}
481
			if (!sourceType.isAnonymousType()) {
463
			if (!sourceType.isAnonymousType()) {
482
				checkAbstractEnum: {
464
				checkAbstractEnum: {
483
					// does define abstract methods ?
465
					// does define abstract methods ?
Lines 615-632 Link Here
615
597
616
			// and then check that they are the only ones
598
			// and then check that they are the only ones
617
			if ((modifiers & ExtraCompilerModifiers.AccJustFlag) != IMPLICIT_MODIFIERS) {
599
			if ((modifiers & ExtraCompilerModifiers.AccJustFlag) != IMPLICIT_MODIFIERS) {
618
				if ((declaringClass.modifiers  & ClassFileConstants.AccAnnotation) != 0)
600
				if ((declaringClass.modifiers  & ClassFileConstants.AccAnnotation) == 0)
619
					problemReporter().illegalModifierForAnnotationField(fieldDecl);
620
				else
621
					problemReporter().illegalModifierForInterfaceField(fieldDecl);
601
					problemReporter().illegalModifierForInterfaceField(fieldDecl);
622
			}
602
			}
623
			fieldBinding.modifiers = modifiers;
603
			fieldBinding.modifiers = modifiers;
624
			return;
604
			return;
625
		} else if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
605
		} else if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
626
			// check that they are not modifiers in source
627
			if ((modifiers & ExtraCompilerModifiers.AccJustFlag) != 0)
628
				problemReporter().illegalModifierForEnumConstant(declaringClass, fieldDecl);
629
630
			// set the modifiers
606
			// set the modifiers
631
			final int IMPLICIT_MODIFIERS = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccEnum;
607
			final int IMPLICIT_MODIFIERS = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccEnum;
632
			fieldBinding.modifiers|= IMPLICIT_MODIFIERS;
608
			fieldBinding.modifiers|= IMPLICIT_MODIFIERS;
Lines 852-861 Link Here
852
					problemReporter().superclassMustBeAClass(sourceType, superclassRef, superclass);
828
					problemReporter().superclassMustBeAClass(sourceType, superclassRef, superclass);
853
				} else if (superclass.isFinal()) {
829
				} else if (superclass.isFinal()) {
854
					problemReporter().classExtendFinalClass(sourceType, superclassRef, superclass);
830
					problemReporter().classExtendFinalClass(sourceType, superclassRef, superclass);
855
				} else if ((superclass.tagBits & TagBits.HasDirectWildcard) != 0) {
856
					problemReporter().superTypeCannotUseWildcard(sourceType, superclassRef, superclass);
857
				} else if (superclass.erasure().id == T_JavaLangEnum) {
858
					problemReporter().cannotExtendEnum(sourceType, superclassRef, superclass);
859
				} else {
831
				} else {
860
					// only want to reach here when no errors are reported
832
					// only want to reach here when no errors are reported
861
					sourceType.superclass = superclass;
833
					sourceType.superclass = superclass;
Lines 910-919 Link Here
910
		// check argument type compatibility
882
		// check argument type compatibility
911
		ParameterizedTypeBinding  superType = environment().createParameterizedType(rootEnumType, new TypeBinding[]{ environment().convertToRawType(sourceType) } , null);
883
		ParameterizedTypeBinding  superType = environment().createParameterizedType(rootEnumType, new TypeBinding[]{ environment().convertToRawType(sourceType) } , null);
912
		sourceType.superclass = superType;
884
		sourceType.superclass = superType;
913
		// bound check (in case of bogus definition of Enum type)
914
		if (refTypeVariables[0].boundCheck(superType, sourceType) != TypeConstants.OK) {
915
			problemReporter().typeMismatchError(rootEnumType, refTypeVariables[0], sourceType, null);
916
		}
917
		return !foundCycle;
885
		return !foundCycle;
918
	}
886
	}
919
887
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodVerifier15.java (-5 lines)
Lines 102-109 Link Here
102
102
103
	for (int i = 0, l = abstractMethods.length; i < l; i++) {
103
	for (int i = 0, l = abstractMethods.length; i < l; i++) {
104
		MethodBinding abstractMethod = abstractMethods[i];
104
		MethodBinding abstractMethod = abstractMethods[i];
105
		if (concreteMethod.isVarargs() != abstractMethod.isVarargs())
106
			problemReporter().varargsConflict(concreteMethod, abstractMethod, this.type);
107
105
108
		// so the parameters are equal and the return type is compatible b/w the currentMethod & the substituted inheritedMethod
106
		// so the parameters are equal and the return type is compatible b/w the currentMethod & the substituted inheritedMethod
109
		MethodBinding originalInherited = abstractMethod.original();
107
		MethodBinding originalInherited = abstractMethod.original();
Lines 127-135 Link Here
127
	}
125
	}
128
}
126
}
129
void checkForBridgeMethod(MethodBinding currentMethod, MethodBinding inheritedMethod, MethodBinding[] allInheritedMethods) {
127
void checkForBridgeMethod(MethodBinding currentMethod, MethodBinding inheritedMethod, MethodBinding[] allInheritedMethods) {
130
	if (currentMethod.isVarargs() != inheritedMethod.isVarargs())
131
		problemReporter(currentMethod).varargsConflict(currentMethod, inheritedMethod, this.type);
132
133
	// so the parameters are equal and the return type is compatible b/w the currentMethod & the substituted inheritedMethod
128
	// so the parameters are equal and the return type is compatible b/w the currentMethod & the substituted inheritedMethod
134
	MethodBinding originalInherited = inheritedMethod.original();
129
	MethodBinding originalInherited = inheritedMethod.original();
135
	if (originalInherited.returnType != currentMethod.returnType) {
130
	if (originalInherited.returnType != currentMethod.returnType) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java (-12 lines)
Lines 40-49 Link Here
40
		computeSubstitutes: {
40
		computeSubstitutes: {
41
			if (substitutes != null) {
41
			if (substitutes != null) {
42
				// explicit type arguments got supplied
42
				// explicit type arguments got supplied
43
				if (substitutes.length != typeVariables.length) {
44
			        // incompatible due to wrong arity
45
			        return new ProblemMethodBinding(originalMethod, originalMethod.selector, substitutes, ProblemReasons.TypeParameterArityMismatch);
46
				}
47
				methodSubstitute = scope.environment().createParameterizedGenericMethod(originalMethod, substitutes);
43
				methodSubstitute = scope.environment().createParameterizedGenericMethod(originalMethod, substitutes);
48
				break computeSubstitutes;
44
				break computeSubstitutes;
49
			}
45
			}
Lines 87-100 Link Here
87
			    TypeVariableBinding typeVariable = typeVariables[i];
83
			    TypeVariableBinding typeVariable = typeVariables[i];
88
			    TypeBinding substitute = methodSubstitute.typeArguments[i];
84
			    TypeBinding substitute = methodSubstitute.typeArguments[i];
89
				switch (typeVariable.boundCheck(methodSubstitute, substitute)) {
85
				switch (typeVariable.boundCheck(methodSubstitute, substitute)) {
90
					case TypeConstants.MISMATCH :
91
				        // incompatible due to bound check
92
						int argLength = arguments.length;
93
						TypeBinding[] augmentedArguments = new TypeBinding[argLength + 2]; // append offending substitute and typeVariable
94
						System.arraycopy(arguments, 0, augmentedArguments, 0, argLength);
95
						augmentedArguments[argLength] = substitute;
96
						augmentedArguments[argLength+1] = typeVariable;
97
				        return new ProblemMethodBinding(methodSubstitute, originalMethod.selector, augmentedArguments, ProblemReasons.ParameterBoundMismatch);
98
					case TypeConstants.UNCHECKED :
86
					case TypeConstants.UNCHECKED :
99
						// tolerate unchecked bounds
87
						// tolerate unchecked bounds
100
						methodSubstitute.isUnchecked = true;
88
						methodSubstitute.isUnchecked = true;
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemReasons.java (-4 lines)
Lines 21-30 Link Here
21
	final int NonStaticReferenceInStaticContext = 7;
21
	final int NonStaticReferenceInStaticContext = 7;
22
	final int ReceiverTypeNotVisible = 8;
22
	final int ReceiverTypeNotVisible = 8;
23
	final int IllegalSuperTypeVariable = 9;
23
	final int IllegalSuperTypeVariable = 9;
24
	final int ParameterBoundMismatch = 10; // for generic method
25
	final int TypeParameterArityMismatch = 11; // for generic method
26
	final int ParameterizedMethodTypeMismatch = 12; // for generic method
27
	final int TypeArgumentsForRawGenericMethod = 13; // for generic method
28
	final int InvalidTypeForStaticImport = 14;
24
	final int InvalidTypeForStaticImport = 14;
29
	final int NotAFunction = 15;
25
	final int NotAFunction = 15;
30
}
26
}
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ParameterizedTypeBinding.java (-1 lines)
Lines 69-75 Link Here
69
				for (int i = 0, length = typeVariables.length; i < length; i++) {
69
				for (int i = 0, length = typeVariables.length; i < length; i++) {
70
				    if (typeVariables[i].boundCheck(this, this.arguments[i])  != TypeConstants.OK) {
70
				    if (typeVariables[i].boundCheck(this, this.arguments[i])  != TypeConstants.OK) {
71
				    	hasErrors = true;
71
				    	hasErrors = true;
72
						scope.problemReporter().typeMismatchError(this.arguments[i], typeVariables[i], this.type, argumentReferences[i]);
73
				    }
72
				    }
74
				}
73
				}
75
			}
74
			}
(-)src/org/eclipse/wst/jsdt/core/compiler/IProblem.java (-178 lines)
Lines 89-95 Link Here
89
 *                                 AnnotationValueMustBeArrayInitializer
89
 *                                 AnnotationValueMustBeArrayInitializer
90
 *                                 InvalidEncoding
90
 *                                 InvalidEncoding
91
 *                                 CannotReadSource
91
 *                                 CannotReadSource
92
 *                                 EnumStaticFieldInInInitializerContext
93
 *                                 ExternalProblemNotFixable
92
 *                                 ExternalProblemNotFixable
94
 *                                 ExternalProblemFixable
93
 *                                 ExternalProblemFixable
95
 *     IBM Corporation - added the following constants
94
 *     IBM Corporation - added the following constants
Lines 399-405 Link Here
399
	int NoImplicitStringConversionForCharArrayExpression = Internal + 151;
398
	int NoImplicitStringConversionForCharArrayExpression = Internal + 151;
400
	// constant expressions
399
	// constant expressions
401
	int StringConstantIsExceedingUtf8Limit = Internal + 152;
400
	int StringConstantIsExceedingUtf8Limit = Internal + 152;
402
	int NonConstantExpression = Internal + 153;
403
	int NumericValueOutOfRange = Internal + 154;
401
	int NumericValueOutOfRange = Internal + 154;
404
	// cast expressions
402
	// cast expressions
405
	int IllegalCast = TypeRelated + 156;
403
	int IllegalCast = TypeRelated + 156;
Lines 555-582 Link Here
555
	int ObjectCannotHaveSuperTypes = Internal + 329;
553
	int ObjectCannotHaveSuperTypes = Internal + 329;
556
	int ObjectMustBeClass = Internal + 330;
554
	int ObjectMustBeClass = Internal + 330;
557
555
558
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
559
	int SuperclassNotFound =  TypeRelated + 329 + ProblemReasons.NotFound; // TypeRelated + 330
560
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
561
	int SuperclassNotVisible =  TypeRelated + 329 + ProblemReasons.NotVisible; // TypeRelated + 331
562
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
563
	int SuperclassAmbiguous =  TypeRelated + 329 + ProblemReasons.Ambiguous; // TypeRelated + 332
564
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
565
	int SuperclassInternalNameProvided =  TypeRelated + 329 + ProblemReasons.InternalNameProvided; // TypeRelated + 333
566
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
567
	int SuperclassInheritedNameHidesEnclosingName =  TypeRelated + 329 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 334
568
569
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
570
	int InterfaceNotFound =  TypeRelated + 334 + ProblemReasons.NotFound; // TypeRelated + 335
571
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
572
	int InterfaceNotVisible =  TypeRelated + 334 + ProblemReasons.NotVisible; // TypeRelated + 336
573
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
574
	int InterfaceAmbiguous =  TypeRelated + 334 + ProblemReasons.Ambiguous; // TypeRelated + 337
575
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
576
	int InterfaceInternalNameProvided =  TypeRelated + 334 + ProblemReasons.InternalNameProvided; // TypeRelated + 338
577
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
578
	int InterfaceInheritedNameHidesEnclosingName =  TypeRelated + 334 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 339
579
580
	// field related problems
556
	// field related problems
581
	int DuplicateField = FieldRelated + 340;
557
	int DuplicateField = FieldRelated + 340;
582
	int DuplicateModifierForField = FieldRelated + 341;
558
	int DuplicateModifierForField = FieldRelated + 341;
Lines 597-668 Link Here
597
	int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362;
573
	int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362;
598
	int AbstractMethodInAbstractClass = MethodRelated + 363;
574
	int AbstractMethodInAbstractClass = MethodRelated + 363;
599
	int ArgumentTypeCannotBeVoid = MethodRelated + 364;
575
	int ArgumentTypeCannotBeVoid = MethodRelated + 364;
600
	/** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
601
	int ArgumentTypeCannotBeVoidArray = MethodRelated + 365;
602
	/** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
603
	int ReturnTypeCannotBeVoidArray = MethodRelated + 366;
604
	int NativeMethodsCannotBeStrictfp = MethodRelated + 367;
576
	int NativeMethodsCannotBeStrictfp = MethodRelated + 367;
605
	int DuplicateModifierForArgument = MethodRelated + 368;
577
	int DuplicateModifierForArgument = MethodRelated + 368;
606
578
607
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
608
	int ArgumentTypeNotFound =  MethodRelated + 369 + ProblemReasons.NotFound; // MethodRelated + 370
609
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
610
	int ArgumentTypeNotVisible =  MethodRelated + 369 + ProblemReasons.NotVisible; // MethodRelated + 371
611
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
612
	int ArgumentTypeAmbiguous =  MethodRelated + 369 + ProblemReasons.Ambiguous; // MethodRelated + 372
613
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
614
	int ArgumentTypeInternalNameProvided =  MethodRelated + 369 + ProblemReasons.InternalNameProvided; // MethodRelated + 373
615
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
616
	int ArgumentTypeInheritedNameHidesEnclosingName =  MethodRelated + 369 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 374
617
618
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
619
	int ExceptionTypeNotFound =  MethodRelated + 374 + ProblemReasons.NotFound; // MethodRelated + 375
620
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
621
	int ExceptionTypeNotVisible =  MethodRelated + 374 + ProblemReasons.NotVisible; // MethodRelated + 376
622
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
623
	int ExceptionTypeAmbiguous =  MethodRelated + 374 + ProblemReasons.Ambiguous; // MethodRelated + 377
624
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
625
	int ExceptionTypeInternalNameProvided =  MethodRelated + 374 + ProblemReasons.InternalNameProvided; // MethodRelated + 378
626
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
627
	int ExceptionTypeInheritedNameHidesEnclosingName =  MethodRelated + 374 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 379
628
629
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
630
	int ReturnTypeNotFound =  MethodRelated + 379 + ProblemReasons.NotFound; // MethodRelated + 380
631
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
632
	int ReturnTypeNotVisible =  MethodRelated + 379 + ProblemReasons.NotVisible; // MethodRelated + 381
633
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
634
	int ReturnTypeAmbiguous =  MethodRelated + 379 + ProblemReasons.Ambiguous; // MethodRelated + 382
635
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
636
	int ReturnTypeInternalNameProvided =  MethodRelated + 379 + ProblemReasons.InternalNameProvided; // MethodRelated + 383
637
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
638
	int ReturnTypeInheritedNameHidesEnclosingName =  MethodRelated + 379 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 384
639
640
	// import related problems
579
	// import related problems
641
	int ConflictingImport = ImportRelated + 385;
580
	int ConflictingImport = ImportRelated + 385;
642
	int DuplicateImport = ImportRelated + 386;
581
	int DuplicateImport = ImportRelated + 386;
643
	int CannotImportPackage = ImportRelated + 387;
582
	int CannotImportPackage = ImportRelated + 387;
644
583
645
	int ImportNotFound =  ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390
584
	int ImportNotFound =  ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390
646
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
647
	int ImportNotVisible =  ImportRelated + 389 + ProblemReasons.NotVisible; // ImportRelated + 391
648
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
649
	int ImportAmbiguous =  ImportRelated + 389 + ProblemReasons.Ambiguous; // ImportRelated + 392
650
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
651
	int ImportInternalNameProvided =  ImportRelated + 389 + ProblemReasons.InternalNameProvided; // ImportRelated + 393
652
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
653
	int ImportInheritedNameHidesEnclosingName =  ImportRelated + 389 + ProblemReasons.InheritedNameHidesEnclosingName; // ImportRelated + 394
654
585
655
	int InvalidTypeForStaticImport =  ImportRelated + 391;
586
	int InvalidTypeForStaticImport =  ImportRelated + 391;
656
587
657
	// local variable related problems
588
	// local variable related problems
658
	int DuplicateModifierForVariable = MethodRelated + 395;
589
	int DuplicateModifierForVariable = MethodRelated + 395;
659
	int IllegalModifierForVariable = MethodRelated + 396;
590
	int IllegalModifierForVariable = MethodRelated + 396;
660
	/** @deprecated - problem is no longer generated, use {@link #RedundantNullCheckOnNonNullLocalVariable} instead */
661
	int LocalVariableCannotBeNull = Internal + 397; // since 3.3: semantics are LocalVariableRedundantCheckOnNonNull
662
	/** @deprecated - problem is no longer generated, use {@link #NullLocalVariableReference}, {@link #RedundantNullCheckOnNullLocalVariable} or {@link #RedundantLocalVariableNullAssignment} instead */
663
	int LocalVariableCanOnlyBeNull = Internal + 398; // since 3.3: split with LocalVariableRedundantCheckOnNull depending on context
664
	/** @deprecated - problem is no longer generated, use {@link #PotentialNullLocalVariableReference} instead */
665
	int LocalVariableMayBeNull = Internal + 399;
666
591
667
	// method verifier problems
592
	// method verifier problems
668
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
593
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
Lines 809-818 Link Here
809
	int DuplicateTypeVariable = Internal + 520;
734
	int DuplicateTypeVariable = Internal + 520;
810
	int IllegalTypeVariableSuperReference = Internal + 521;
735
	int IllegalTypeVariableSuperReference = Internal + 521;
811
	int NonStaticTypeFromStaticInvocation = Internal + 522;
736
	int NonStaticTypeFromStaticInvocation = Internal + 522;
812
	int ObjectCannotBeGeneric = Internal + 523;
813
	int NonGenericType = TypeRelated + 524;
737
	int NonGenericType = TypeRelated + 524;
814
	int IncorrectArityForParameterizedType = TypeRelated + 525;
738
	int IncorrectArityForParameterizedType = TypeRelated + 525;
815
	int TypeArgumentMismatch = TypeRelated + 526;
816
	int DuplicateMethodErasure = TypeRelated + 527;
739
	int DuplicateMethodErasure = TypeRelated + 527;
817
	int ReferenceToForwardTypeVariable = TypeRelated + 528;
740
	int ReferenceToForwardTypeVariable = TypeRelated + 528;
818
	int BoundMustBeAnInterface = TypeRelated + 529;
741
	int BoundMustBeAnInterface = TypeRelated + 529;
Lines 823-849 Link Here
823
	int FinalBoundForTypeVariable = TypeRelated + 537;
746
	int FinalBoundForTypeVariable = TypeRelated + 537;
824
	int UndefinedTypeVariable = Internal + 538;
747
	int UndefinedTypeVariable = Internal + 538;
825
	int SuperInterfacesCollide = TypeRelated + 539;
748
	int SuperInterfacesCollide = TypeRelated + 539;
826
	int GenericMethodTypeArgumentMismatch = TypeRelated + 543;
827
	int GenericConstructorTypeArgumentMismatch = TypeRelated + 544;
828
	int UnsafeGenericCast = TypeRelated + 545;
749
	int UnsafeGenericCast = TypeRelated + 545;
829
	int IllegalInstanceofParameterizedType = Internal + 546;
830
	int IllegalInstanceofTypeParameter = Internal + 547;
831
	int NonGenericMethod = TypeRelated + 548;
832
	int IncorrectArityForParameterizedMethod = TypeRelated + 549;
833
	int ParameterizedMethodArgumentTypeMismatch = TypeRelated + 550;
834
	int NonGenericConstructor = TypeRelated + 551;
835
	int IncorrectArityForParameterizedConstructor = TypeRelated + 552;
836
	int ParameterizedConstructorArgumentTypeMismatch = TypeRelated + 553;
837
	int TypeArgumentsForRawGenericMethod = TypeRelated + 554;
838
	int TypeArgumentsForRawGenericConstructor = TypeRelated + 555;
839
	int SuperTypeUsingWildcard = TypeRelated + 556;
840
	int GenericTypeCannotExtendThrowable = TypeRelated + 557;
750
	int GenericTypeCannotExtendThrowable = TypeRelated + 557;
841
	int IllegalClassLiteralForTypeVariable = TypeRelated + 558;
751
	int IllegalClassLiteralForTypeVariable = TypeRelated + 558;
842
	int UnsafeReturnTypeOverride = MethodRelated + 559;
752
	int UnsafeReturnTypeOverride = MethodRelated + 559;
843
	int MethodNameClash = MethodRelated + 560;
753
	int MethodNameClash = MethodRelated + 560;
844
	int MissingArgumentsForParameterizedMemberType = TypeRelated + 562;
754
	int MissingArgumentsForParameterizedMemberType = TypeRelated + 562;
845
	int StaticMemberOfParameterizedType = TypeRelated + 563;
755
	int StaticMemberOfParameterizedType = TypeRelated + 563;
846
	int BoundHasConflictingArguments = TypeRelated + 564;
847
	int DuplicateParameterizedMethods = MethodRelated + 565;
756
	int DuplicateParameterizedMethods = MethodRelated + 565;
848
	int IllegalQualifiedParameterizedTypeAllocation = TypeRelated + 566;
757
	int IllegalQualifiedParameterizedTypeAllocation = TypeRelated + 566;
849
	int DuplicateBounds = TypeRelated + 567;
758
	int DuplicateBounds = TypeRelated + 567;
Lines 851-859 Link Here
851
	int TypeParameterHidingType = TypeRelated + 571;
760
	int TypeParameterHidingType = TypeRelated + 571;
852
	int NoAdditionalBoundAfterTypeVariable = TypeRelated + 573;
761
	int NoAdditionalBoundAfterTypeVariable = TypeRelated + 573;
853
	int IllegalAccessFromTypeVariable = TypeRelated + 575;
762
	int IllegalAccessFromTypeVariable = TypeRelated + 575;
854
	int TypeHidingTypeParameterFromType = TypeRelated + 576;
855
	int TypeHidingTypeParameterFromMethod = TypeRelated + 577;
856
    int InvalidUsageOfWildcard = Syntax + Internal + 578;
857
763
858
	/**
764
	/**
859
	 * Foreach
765
	 * Foreach
Lines 865-916 Link Here
865
	 * 1.5 Syntax errors (when source level < 1.5)
771
	 * 1.5 Syntax errors (when source level < 1.5)
866
	 */
772
	 */
867
    int InvalidUsageOfTypeParameters = Syntax + Internal + 590;
773
    int InvalidUsageOfTypeParameters = Syntax + Internal + 590;
868
    int InvalidUsageOfStaticImports = Syntax + Internal + 591;
869
    int InvalidUsageOfForeachStatements = Syntax + Internal + 592;
774
    int InvalidUsageOfForeachStatements = Syntax + Internal + 592;
870
    int InvalidUsageOfTypeArguments = Syntax + Internal + 593;
871
    int InvalidUsageOfEnumDeclarations = Syntax + Internal + 594;
872
    int InvalidUsageOfVarargs = Syntax + Internal + 595;
873
    int InvalidUsageOfAnnotations = Syntax + Internal + 596;
874
    int InvalidUsageOfAnnotationDeclarations = Syntax + Internal + 597;
875
876
    /**
877
     * Annotation
878
     */
879
	int IllegalModifierForAnnotationMethod = MethodRelated + 600;
880
    int IllegalExtendedDimensions = MethodRelated + 601;
881
	int InvalidFileNameForPackageAnnotations = Syntax + Internal + 602;
882
	int IllegalModifierForAnnotationType = TypeRelated + 603;
883
	int IllegalModifierForAnnotationMemberType = TypeRelated + 604;
884
	int InvalidAnnotationMemberType = TypeRelated + 605;
885
	int AnnotationCircularitySelfReference = TypeRelated + 606;
886
	int AnnotationCircularity = TypeRelated + 607;
887
	int DuplicateAnnotation = TypeRelated + 608;
888
	int MissingValueForAnnotationMember = TypeRelated + 609;
889
	int DuplicateAnnotationMember = Internal + 610;
890
	int UndefinedAnnotationMember = MethodRelated + 611;
891
	int AnnotationValueMustBeClassLiteral = Internal + 612;
892
	int AnnotationValueMustBeConstant = Internal + 613;
893
	int AnnotationFieldNeedConstantInitialization = Internal + 614;
894
	int IllegalModifierForAnnotationField = Internal + 615;
895
	int AnnotationCannotOverrideMethod = MethodRelated + 616;
896
	int AnnotationMembersCannotHaveParameters = Syntax + Internal + 617;
897
	int AnnotationMembersCannotHaveTypeParameters = Syntax + Internal + 618;
898
	int AnnotationTypeDeclarationCannotHaveSuperclass = Syntax + Internal + 619;
899
	int AnnotationTypeDeclarationCannotHaveSuperinterfaces = Syntax + Internal + 620;
900
	int DuplicateTargetInTargetAnnotation = Internal + 621;
901
	int DisallowedTargetForAnnotation = TypeRelated + 622;
902
	int MethodMustOverride = MethodRelated + 623;
903
	int AnnotationTypeDeclarationCannotHaveConstructor = Syntax + Internal + 624;
904
	int AnnotationValueMustBeAnnotation = Internal + 625;
905
	int AnnotationTypeUsedAsSuperInterface = TypeRelated + 626;
906
	int MissingOverrideAnnotation = MethodRelated + 627;
907
	int FieldMissingDeprecatedAnnotation = Internal + 628;
908
	int MethodMissingDeprecatedAnnotation = Internal + 629;
909
	int TypeMissingDeprecatedAnnotation = Internal + 630;
910
	int UnhandledWarningToken = Internal + 631;
911
	int AnnotationValueMustBeArrayInitializer = Internal + 632;
912
	int AnnotationValueMustBeAnEnumConstant = Internal + 633;
913
	int MethodMustOverrideOrImplement = MethodRelated + 634;
914
775
915
	/**
776
	/**
916
	 * Corrupted binaries
777
	 * Corrupted binaries
Lines 929-973 Link Here
929
	int UnboxingConversion = Internal + 721;
790
	int UnboxingConversion = Internal + 721;
930
791
931
	/**
792
	/**
932
	 * Enum
933
	 */
934
	int IllegalModifierForEnum = TypeRelated + 750;
935
	int IllegalModifierForEnumConstant = FieldRelated + 751;
936
	int IllegalModifierForLocalEnum = TypeRelated + 752;
937
	int IllegalModifierForMemberEnum = TypeRelated + 753;
938
	int CannotDeclareEnumSpecialMethod = MethodRelated + 754;
939
	int IllegalQualifiedEnumConstantLabel = FieldRelated + 755;
940
	int CannotExtendEnum = TypeRelated + 756;
941
	int CannotInvokeSuperConstructorInEnum = MethodRelated + 757;
942
	int EnumAbstractMethodMustBeImplemented = MethodRelated + 758;
943
	int EnumSwitchCannotTargetField = FieldRelated + 759;
944
	int IllegalModifierForEnumConstructor = MethodRelated + 760;
945
	int MissingEnumConstantCase = FieldRelated + 761;
946
	int EnumStaticFieldInInInitializerContext = FieldRelated + 762;
947
948
	/**
949
	 * Var args
950
	 */
951
	int IllegalExtendedDimensionsForVarArgs = Syntax + Internal + 800;
952
	int MethodVarargsArgumentNeedCast = MethodRelated + 801;
953
	int ConstructorVarargsArgumentNeedCast = ConstructorRelated + 802;
954
	int VarargsConflict = MethodRelated + 803;
955
956
	/**
957
	 * Javadoc Generic
958
	 */
959
	int JavadocGenericMethodTypeArgumentMismatch = Javadoc + Internal + 850;
960
	int JavadocNonGenericMethod = Javadoc + Internal + 851;
961
	int JavadocIncorrectArityForParameterizedMethod = Javadoc + Internal + 852;
962
	int JavadocParameterizedMethodArgumentTypeMismatch = Javadoc + Internal + 853;
963
	int JavadocTypeArgumentsForRawGenericMethod = Javadoc + Internal + 854;
964
	int JavadocGenericConstructorTypeArgumentMismatch = Javadoc + Internal + 855;
965
	int JavadocNonGenericConstructor = Javadoc + Internal + 856;
966
	int JavadocIncorrectArityForParameterizedConstructor = Javadoc + Internal + 857;
967
	int JavadocParameterizedConstructorArgumentTypeMismatch = Javadoc + Internal + 858;
968
	int JavadocTypeArgumentsForRawGenericConstructor = Javadoc + Internal + 859;
969
970
	/**
971
	 * External problems -- These are problems defined by other plugins
793
	 * External problems -- These are problems defined by other plugins
972
	 */
794
	 */
973
795
(-)src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java (-60 lines)
Lines 1621-1631 Link Here
1621
	annotationTypeDeclaration.javadoc = this.javadoc;
1621
	annotationTypeDeclaration.javadoc = this.javadoc;
1622
	this.javadoc = null;
1622
	this.javadoc = null;
1623
	pushOnAstStack(annotationTypeDeclaration);
1623
	pushOnAstStack(annotationTypeDeclaration);
1624
	if(!this.statementRecoveryActivated &&
1625
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
1626
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
1627
		this.problemReporter().invalidUsageOfAnnotationDeclarations(annotationTypeDeclaration);
1628
	}
1629
1624
1630
	// recovery
1625
	// recovery
1631
	if (this.currentElement != null){
1626
	if (this.currentElement != null){
Lines 3589-3601 Link Here
3589
3584
3590
	this.listLength = 0; // will be updated when reading super-interfaces
3585
	this.listLength = 0; // will be updated when reading super-interfaces
3591
3586
3592
	if(!this.statementRecoveryActivated &&
3593
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
3594
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
3595
		//TODO this code will be never run while 'enum' is an identifier in 1.3 scanner
3596
		this.problemReporter().invalidUsageOfEnumDeclarations(enumDeclaration);
3597
	}
3598
3599
	// recovery
3587
	// recovery
3600
	if (this.currentElement != null){
3588
	if (this.currentElement != null){
3601
		this.lastCheckPoint = enumDeclaration.bodyStart;
3589
		this.lastCheckPoint = enumDeclaration.bodyStart;
Lines 3902-3918 Link Here
3902
	/* if incomplete method header, this.listLength counter will not have been reset,
3890
	/* if incomplete method header, this.listLength counter will not have been reset,
3903
		indicating that some arguments are available on the stack */
3891
		indicating that some arguments are available on the stack */
3904
	this.listLength++;
3892
	this.listLength++;
3905
3906
//	if(isVarArgs) {
3907
//		if (!this.statementRecoveryActivated &&
3908
//				options.sourceLevel < ClassFileConstants.JDK1_5 &&
3909
//				this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
3910
//				this.problemReporter().invalidUsageOfVarargs(arg);
3911
//		} else if (!this.statementRecoveryActivated &&
3912
//				extendedDimensions > 0) {
3913
//			this.problemReporter().illegalExtendedDimensions(arg);
3914
//		}
3915
//	}
3916
}
3893
}
3917
3894
3918
protected void handleArgumentComment(Argument arg)
3895
protected void handleArgumentComment(Argument arg)
Lines 4343-4353 Link Here
4343
	markerAnnotation = new MarkerAnnotation(typeReference, this.intStack[this.intPtr--]);
4320
	markerAnnotation = new MarkerAnnotation(typeReference, this.intStack[this.intPtr--]);
4344
	markerAnnotation.declarationSourceEnd = markerAnnotation.sourceEnd;
4321
	markerAnnotation.declarationSourceEnd = markerAnnotation.sourceEnd;
4345
	pushOnExpressionStack(markerAnnotation);
4322
	pushOnExpressionStack(markerAnnotation);
4346
	if(!this.statementRecoveryActivated &&
4347
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
4348
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
4349
		this.problemReporter().invalidUsageOfAnnotation(markerAnnotation);
4350
	}
4351
	this.recordStringLiterals = true;
4323
	this.recordStringLiterals = true;
4352
}
4324
}
4353
protected void consumeMemberValueArrayInitializer() {
4325
protected void consumeMemberValueArrayInitializer() {
Lines 4909-4936 Link Here
4909
		annotationRecoveryCheckPoint(normalAnnotation.sourceStart, normalAnnotation.declarationSourceEnd);
4881
		annotationRecoveryCheckPoint(normalAnnotation.sourceStart, normalAnnotation.declarationSourceEnd);
4910
	}
4882
	}
4911
4883
4912
	if(!this.statementRecoveryActivated &&
4913
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
4914
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
4915
		this.problemReporter().invalidUsageOfAnnotation(normalAnnotation);
4916
	}
4917
	this.recordStringLiterals = true;
4884
	this.recordStringLiterals = true;
4918
}
4885
}
4919
protected void consumeOneDimLoop() {
4886
protected void consumeOneDimLoop() {
4920
	// OneDimLoop ::= '[' ']'
4887
	// OneDimLoop ::= '[' ']'
4921
	this.dimensions++;
4888
	this.dimensions++;
4922
}
4889
}
4923
 
4924
protected void consumeOnlyTypeArguments() {
4925
	if(!this.statementRecoveryActivated &&
4926
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
4927
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
4928
		int length = this.genericsLengthStack[this.genericsLengthPtr];
4929
		this.problemReporter().invalidUsageOfTypeArguments(
4930
			(TypeReference)this.genericsStack[this.genericsPtr - length + 1],
4931
			(TypeReference)this.genericsStack[this.genericsPtr]);
4932
	}
4933
}
4934
protected void consumeOnlyTypeArgumentsForCastExpression() {
4890
protected void consumeOnlyTypeArgumentsForCastExpression() {
4935
	// OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
4891
	// OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
4936
}
4892
}
Lines 6489-6499 Link Here
6489
		annotationRecoveryCheckPoint(singleMemberAnnotation.sourceStart, singleMemberAnnotation.declarationSourceEnd);
6445
		annotationRecoveryCheckPoint(singleMemberAnnotation.sourceStart, singleMemberAnnotation.declarationSourceEnd);
6490
	}
6446
	}
6491
6447
6492
	if(!this.statementRecoveryActivated &&
6493
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
6494
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
6495
		this.problemReporter().invalidUsageOfAnnotation(singleMemberAnnotation);
6496
	}
6497
	this.recordStringLiterals = true;
6448
	this.recordStringLiterals = true;
6498
}
6449
}
6499
protected void consumeSingleStaticImportDeclarationName() {
6450
protected void consumeSingleStaticImportDeclarationName() {
Lines 6526-6532 Link Here
6526
			this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
6477
			this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
6527
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
6478
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
6528
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
6479
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
6529
		this.problemReporter().invalidUsageOfStaticImports(impt);
6530
	}
6480
	}
6531
6481
6532
	// recovery
6482
	// recovery
Lines 6885-6891 Link Here
6885
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
6835
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
6886
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
6836
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
6887
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
6837
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
6888
		this.problemReporter().invalidUsageOfStaticImports(impt);
6889
	}
6838
	}
6890
6839
6891
	// recovery
6840
	// recovery
Lines 7348-7362 Link Here
7348
protected void consumeTypeArguments() {
7297
protected void consumeTypeArguments() {
7349
	concatGenericsLists();
7298
	concatGenericsLists();
7350
	intPtr--;
7299
	intPtr--;
7351
7352
	if(!this.statementRecoveryActivated &&
7353
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
7354
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
7355
		int length = this.genericsLengthStack[this.genericsLengthPtr];
7356
		this.problemReporter().invalidUsageOfTypeArguments(
7357
			(TypeReference)this.genericsStack[this.genericsPtr - length + 1],
7358
			(TypeReference)this.genericsStack[this.genericsPtr]);
7359
	}
7360
}
7300
}
7361
protected void consumeTypeDeclarations() {
7301
protected void consumeTypeDeclarations() {
7362
	// TypeDeclarations ::= TypeDeclarations TypeDeclaration
7302
	// TypeDeclarations ::= TypeDeclarations TypeDeclaration
(-)src/org/eclipse/wst/jsdt/internal/compiler/SourceElementParser.java (-2 lines)
Lines 706-712 Link Here
706
			this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
706
			this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
707
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
707
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
708
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
708
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
709
		this.problemReporter().invalidUsageOfStaticImports(impt);
710
	}
709
	}
711
710
712
	// recovery
711
	// recovery
Lines 801-807 Link Here
801
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
800
			options.sourceLevel < ClassFileConstants.JDK1_5 &&
802
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
801
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
803
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
802
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
804
		this.problemReporter().invalidUsageOfStaticImports(impt);
805
	}
803
	}
806
804
807
	// recovery
805
	// recovery
(-)src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java (-77 lines)
Lines 84-91 Link Here
84
	public static final String OPTION_ReportUncheckedTypeOperation = "org.eclipse.wst.jsdt.core.compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$
84
	public static final String OPTION_ReportUncheckedTypeOperation = "org.eclipse.wst.jsdt.core.compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$
85
	public static final String OPTION_ReportRawTypeReference =  "org.eclipse.wst.jsdt.core.compiler.problem.rawTypeReference"; //$NON-NLS-1$
85
	public static final String OPTION_ReportRawTypeReference =  "org.eclipse.wst.jsdt.core.compiler.problem.rawTypeReference"; //$NON-NLS-1$
86
	public static final String OPTION_ReportFinalParameterBound = "org.eclipse.wst.jsdt.core.compiler.problem.finalParameterBound"; //$NON-NLS-1$
86
	public static final String OPTION_ReportFinalParameterBound = "org.eclipse.wst.jsdt.core.compiler.problem.finalParameterBound"; //$NON-NLS-1$
87
	public static final String OPTION_ReportSwitchCaseShouldBeConstant = "org.eclipse.wst.jsdt.core.compiler.problem.SwitchCaseShouldBeConstant"; //$NON-NLS-1$
88
	public static final String OPTION_ReportVarargsArgumentNeedCast = "org.eclipse.wst.jsdt.core.compiler.problem.varargsArgumentNeedCast"; //$NON-NLS-1$
89
	public static final String OPTION_Source = "org.eclipse.wst.jsdt.core.compiler.source"; //$NON-NLS-1$
87
	public static final String OPTION_Source = "org.eclipse.wst.jsdt.core.compiler.source"; //$NON-NLS-1$
90
	public static final String OPTION_TargetPlatform = "org.eclipse.wst.jsdt.core.compiler.codegen.targetPlatform"; //$NON-NLS-1$
88
	public static final String OPTION_TargetPlatform = "org.eclipse.wst.jsdt.core.compiler.codegen.targetPlatform"; //$NON-NLS-1$
91
	public static final String OPTION_Compliance = "org.eclipse.wst.jsdt.core.compiler.compliance"; //$NON-NLS-1$
89
	public static final String OPTION_Compliance = "org.eclipse.wst.jsdt.core.compiler.compliance"; //$NON-NLS-1$
Lines 100-113 Link Here
100
	public static final String OPTION_ReportDuplicateLocalVariables = "org.eclipse.wst.jsdt.core.compiler.problem.duplicateLocalVariables"; //$NON-NLS-1$
98
	public static final String OPTION_ReportDuplicateLocalVariables = "org.eclipse.wst.jsdt.core.compiler.problem.duplicateLocalVariables"; //$NON-NLS-1$
101
	public static final String OPTION_ReportRedundantNullCheck = "org.eclipse.wst.jsdt.core.compiler.problem.redundantNullCheck"; //$NON-NLS-1$
99
	public static final String OPTION_ReportRedundantNullCheck = "org.eclipse.wst.jsdt.core.compiler.problem.redundantNullCheck"; //$NON-NLS-1$
102
	public static final String OPTION_ReportAutoboxing = "org.eclipse.wst.jsdt.core.compiler.problem.autoboxing"; //$NON-NLS-1$
100
	public static final String OPTION_ReportAutoboxing = "org.eclipse.wst.jsdt.core.compiler.problem.autoboxing"; //$NON-NLS-1$
103
	public static final String OPTION_ReportAnnotationSuperInterface = "org.eclipse.wst.jsdt.core.compiler.problem.annotationSuperInterface"; //$NON-NLS-1$
104
	public static final String OPTION_ReportMissingOverrideAnnotation = "org.eclipse.wst.jsdt.core.compiler.problem.missingOverrideAnnotation"; //$NON-NLS-1$
105
	public static final String OPTION_ReportMissingDeprecatedAnnotation = "org.eclipse.wst.jsdt.core.compiler.problem.missingDeprecatedAnnotation"; //$NON-NLS-1$
106
	public static final String OPTION_ReportIncompleteEnumSwitch = "org.eclipse.wst.jsdt.core.compiler.problem.incompleteEnumSwitch"; //$NON-NLS-1$
107
	public static final String OPTION_ReportForbiddenReference =  "org.eclipse.wst.jsdt.core.compiler.problem.forbiddenReference"; //$NON-NLS-1$
101
	public static final String OPTION_ReportForbiddenReference =  "org.eclipse.wst.jsdt.core.compiler.problem.forbiddenReference"; //$NON-NLS-1$
108
	public static final String OPTION_ReportDiscouragedReference =  "org.eclipse.wst.jsdt.core.compiler.problem.discouragedReference"; //$NON-NLS-1$
102
	public static final String OPTION_ReportDiscouragedReference =  "org.eclipse.wst.jsdt.core.compiler.problem.discouragedReference"; //$NON-NLS-1$
109
	public static final String OPTION_SuppressWarnings =  "org.eclipse.wst.jsdt.core.compiler.problem.suppressWarnings"; //$NON-NLS-1$
103
	public static final String OPTION_SuppressWarnings =  "org.eclipse.wst.jsdt.core.compiler.problem.suppressWarnings"; //$NON-NLS-1$
110
	public static final String OPTION_ReportUnhandledWarningToken =  "org.eclipse.wst.jsdt.core.compiler.problem.unhandledWarningToken"; //$NON-NLS-1$
111
	public static final String OPTION_ReportUnusedLabel =  "org.eclipse.wst.jsdt.core.compiler.problem.unusedLabel"; //$NON-NLS-1$
104
	public static final String OPTION_ReportUnusedLabel =  "org.eclipse.wst.jsdt.core.compiler.problem.unusedLabel"; //$NON-NLS-1$
112
	public static final String OPTION_FatalOptionalError =  "org.eclipse.wst.jsdt.core.compiler.problem.fatalOptionalError"; //$NON-NLS-1$
105
	public static final String OPTION_FatalOptionalError =  "org.eclipse.wst.jsdt.core.compiler.problem.fatalOptionalError"; //$NON-NLS-1$
113
	public static final String OPTION_ReportParameterAssignment =  "org.eclipse.wst.jsdt.core.compiler.problem.parameterAssignment"; //$NON-NLS-1$
106
	public static final String OPTION_ReportParameterAssignment =  "org.eclipse.wst.jsdt.core.compiler.problem.parameterAssignment"; //$NON-NLS-1$
Lines 197-215 Link Here
197
	public static final long FinalParameterBound = ASTNode.Bit32L;
190
	public static final long FinalParameterBound = ASTNode.Bit32L;
198
//TODO: remove	MissingSerialVersion
191
//TODO: remove	MissingSerialVersion
199
	public static final long MissingSerialVersion = ASTNode.Bit33L;
192
	public static final long MissingSerialVersion = ASTNode.Bit33L;
200
	public static final long SwitchCaseShouldBeConstant = ASTNode.Bit33L;
201
	public static final long EnumUsedAsAnIdentifier = ASTNode.Bit34L;
193
	public static final long EnumUsedAsAnIdentifier = ASTNode.Bit34L;
202
	public static final long ForbiddenReference = ASTNode.Bit35L;
194
	public static final long ForbiddenReference = ASTNode.Bit35L;
203
	public static final long VarargsArgumentNeedCast = ASTNode.Bit36L;
204
	public static final long NullReference = ASTNode.Bit37L;
195
	public static final long NullReference = ASTNode.Bit37L;
205
	public static final long AutoBoxing = ASTNode.Bit38L;
196
	public static final long AutoBoxing = ASTNode.Bit38L;
206
	public static final long AnnotationSuperInterface = ASTNode.Bit39L;
207
	public static final long TypeHiding = ASTNode.Bit40L;
197
	public static final long TypeHiding = ASTNode.Bit40L;
208
	public static final long MissingOverrideAnnotation = ASTNode.Bit41L;
209
	public static final long IncompleteEnumSwitch = ASTNode.Bit42L;
210
	public static final long MissingDeprecatedAnnotation = ASTNode.Bit43L;
211
	public static final long DiscouragedReference = ASTNode.Bit44L;
198
	public static final long DiscouragedReference = ASTNode.Bit44L;
212
	public static final long UnhandledWarningToken = ASTNode.Bit45L;
213
	public static final long RawTypeReference = ASTNode.Bit46L;
199
	public static final long RawTypeReference = ASTNode.Bit46L;
214
	public static final long UnusedLabel = ASTNode.Bit47L;
200
	public static final long UnusedLabel = ASTNode.Bit47L;
215
	public static final long ParameterAssignment = ASTNode.Bit48L;
201
	public static final long ParameterAssignment = ASTNode.Bit48L;
Lines 253-266 Link Here
253
		| EnumUsedAsAnIdentifier
239
		| EnumUsedAsAnIdentifier
254
		| UncheckedTypeOperation
240
		| UncheckedTypeOperation
255
		| RawTypeReference
241
		| RawTypeReference
256
		| SwitchCaseShouldBeConstant
257
		| VarargsArgumentNeedCast
258
		| ForbiddenReference
242
		| ForbiddenReference
259
		| DiscouragedReference
243
		| DiscouragedReference
260
		| AnnotationSuperInterface
261
		| TypeHiding
244
		| TypeHiding
262
		| FinalParameterBound
245
		| FinalParameterBound
263
		| UnhandledWarningToken
264
		| UnusedLocalVariable
246
		| UnusedLocalVariable
265
		| UnusedPrivateMember
247
		| UnusedPrivateMember
266
		| UnusedLabel
248
		| UnusedLabel
Lines 424-431 Link Here
424
		optionsMap.put(OPTION_ReportUnnecessaryTypeCheck, getSeverityString(UnnecessaryTypeCheck));
406
		optionsMap.put(OPTION_ReportUnnecessaryTypeCheck, getSeverityString(UnnecessaryTypeCheck));
425
		optionsMap.put(OPTION_ReportUnnecessaryElse, getSeverityString(UnnecessaryElse));
407
		optionsMap.put(OPTION_ReportUnnecessaryElse, getSeverityString(UnnecessaryElse));
426
		optionsMap.put(OPTION_ReportAutoboxing, getSeverityString(AutoBoxing));
408
		optionsMap.put(OPTION_ReportAutoboxing, getSeverityString(AutoBoxing));
427
		optionsMap.put(OPTION_ReportAnnotationSuperInterface, getSeverityString(AnnotationSuperInterface));
428
		optionsMap.put(OPTION_ReportIncompleteEnumSwitch, getSeverityString(IncompleteEnumSwitch));
429
		optionsMap.put(OPTION_ReportInvalidJavadoc, getSeverityString(InvalidJavadoc));
409
		optionsMap.put(OPTION_ReportInvalidJavadoc, getSeverityString(InvalidJavadoc));
430
		optionsMap.put(OPTION_ReportInvalidJavadocTagsVisibility, getVisibilityString(this.reportInvalidJavadocTagsVisibility));
410
		optionsMap.put(OPTION_ReportInvalidJavadocTagsVisibility, getVisibilityString(this.reportInvalidJavadocTagsVisibility));
431
		optionsMap.put(OPTION_ReportInvalidJavadocTags, this.reportInvalidJavadocTags ? ENABLED : DISABLED);
411
		optionsMap.put(OPTION_ReportInvalidJavadocTags, this.reportInvalidJavadocTags ? ENABLED : DISABLED);
Lines 444-456 Link Here
444
		optionsMap.put(OPTION_ReportUncheckedTypeOperation, getSeverityString(UncheckedTypeOperation));
424
		optionsMap.put(OPTION_ReportUncheckedTypeOperation, getSeverityString(UncheckedTypeOperation));
445
		optionsMap.put(OPTION_ReportRawTypeReference, getSeverityString(RawTypeReference));
425
		optionsMap.put(OPTION_ReportRawTypeReference, getSeverityString(RawTypeReference));
446
		optionsMap.put(OPTION_ReportFinalParameterBound, getSeverityString(FinalParameterBound));
426
		optionsMap.put(OPTION_ReportFinalParameterBound, getSeverityString(FinalParameterBound));
447
		optionsMap.put(OPTION_ReportSwitchCaseShouldBeConstant, getSeverityString(SwitchCaseShouldBeConstant));
448
		optionsMap.put(OPTION_ReportForbiddenReference, getSeverityString(ForbiddenReference));
427
		optionsMap.put(OPTION_ReportForbiddenReference, getSeverityString(ForbiddenReference));
449
		optionsMap.put(OPTION_ReportDiscouragedReference, getSeverityString(DiscouragedReference));
428
		optionsMap.put(OPTION_ReportDiscouragedReference, getSeverityString(DiscouragedReference));
450
		optionsMap.put(OPTION_ReportVarargsArgumentNeedCast, getSeverityString(VarargsArgumentNeedCast));
451
		optionsMap.put(OPTION_ReportMissingOverrideAnnotation, getSeverityString(MissingOverrideAnnotation));
452
		optionsMap.put(OPTION_ReportMissingDeprecatedAnnotation, getSeverityString(MissingDeprecatedAnnotation));
453
		optionsMap.put(OPTION_ReportIncompleteEnumSwitch, getSeverityString(IncompleteEnumSwitch));
454
		optionsMap.put(OPTION_ReportUnusedLabel, getSeverityString(UnusedLabel));
429
		optionsMap.put(OPTION_ReportUnusedLabel, getSeverityString(UnusedLabel));
455
		optionsMap.put(OPTION_Compliance, versionFromJdkLevel(this.complianceLevel));
430
		optionsMap.put(OPTION_Compliance, versionFromJdkLevel(this.complianceLevel));
456
		optionsMap.put(OPTION_Source, versionFromJdkLevel(this.sourceLevel));
431
		optionsMap.put(OPTION_Source, versionFromJdkLevel(this.sourceLevel));
Lines 473-479 Link Here
473
		optionsMap.put(OPTION_ReportDuplicateLocalVariables, getSeverityString(DuplicateLocalVariables));
448
		optionsMap.put(OPTION_ReportDuplicateLocalVariables, getSeverityString(DuplicateLocalVariables));
474
		optionsMap.put(OPTION_ReportRedundantNullCheck, getSeverityString(RedundantNullCheck));
449
		optionsMap.put(OPTION_ReportRedundantNullCheck, getSeverityString(RedundantNullCheck));
475
		optionsMap.put(OPTION_SuppressWarnings, this.suppressWarnings ? ENABLED : DISABLED);
450
		optionsMap.put(OPTION_SuppressWarnings, this.suppressWarnings ? ENABLED : DISABLED);
476
		optionsMap.put(OPTION_ReportUnhandledWarningToken, getSeverityString(UnhandledWarningToken));
477
		optionsMap.put(OPTION_ReportParameterAssignment, getSeverityString(ParameterAssignment));
451
		optionsMap.put(OPTION_ReportParameterAssignment, getSeverityString(ParameterAssignment));
478
		optionsMap.put(OPTION_ReportFallthroughCase, getSeverityString(FallthroughCase));
452
		optionsMap.put(OPTION_ReportFallthroughCase, getSeverityString(FallthroughCase));
479
		optionsMap.put(OPTION_ReportOverridingMethodWithoutSuperInvocation, getSeverityString(OverridingMethodWithoutSuperInvocation));
453
		optionsMap.put(OPTION_ReportOverridingMethodWithoutSuperInvocation, getSeverityString(OverridingMethodWithoutSuperInvocation));
Lines 575-588 Link Here
575
		} else {
549
		} else {
576
			irritantInt = (int)(irritant >>> 32);
550
			irritantInt = (int)(irritant >>> 32);
577
			switch (irritantInt) {
551
			switch (irritantInt) {
578
				case (int)(SwitchCaseShouldBeConstant >>> 32) :
579
					return OPTION_ReportSwitchCaseShouldBeConstant ;
580
				case (int)(EnumUsedAsAnIdentifier >>> 32) :
552
				case (int)(EnumUsedAsAnIdentifier >>> 32) :
581
					return OPTION_ReportEnumIdentifier;
553
					return OPTION_ReportEnumIdentifier;
582
				case (int)(ForbiddenReference >>> 32) :
554
				case (int)(ForbiddenReference >>> 32) :
583
					return OPTION_ReportForbiddenReference;
555
					return OPTION_ReportForbiddenReference;
584
				case (int)(VarargsArgumentNeedCast >>> 32) :
585
					return OPTION_ReportVarargsArgumentNeedCast;
586
				case (int)(NullReference >>> 32) :
556
				case (int)(NullReference >>> 32) :
587
					return OPTION_ReportNullReference;
557
					return OPTION_ReportNullReference;
588
				case (int)(PotentialNullReference >>> 32) :
558
				case (int)(PotentialNullReference >>> 32) :
Lines 593-612 Link Here
593
					return OPTION_ReportRedundantNullCheck;
563
					return OPTION_ReportRedundantNullCheck;
594
				case (int)(AutoBoxing >>> 32) :
564
				case (int)(AutoBoxing >>> 32) :
595
					return OPTION_ReportAutoboxing;
565
					return OPTION_ReportAutoboxing;
596
				case (int)(AnnotationSuperInterface >>> 32) :
597
					return OPTION_ReportAnnotationSuperInterface;
598
				case (int)(TypeHiding >>> 32) :
566
				case (int)(TypeHiding >>> 32) :
599
					return OPTION_ReportTypeParameterHiding;
567
					return OPTION_ReportTypeParameterHiding;
600
				case (int)(MissingOverrideAnnotation >>> 32) :
601
					return OPTION_ReportMissingOverrideAnnotation;
602
				case (int)(IncompleteEnumSwitch >>> 32) :
603
					return OPTION_ReportIncompleteEnumSwitch;
604
				case (int)(MissingDeprecatedAnnotation >>> 32) :
605
					return OPTION_ReportMissingDeprecatedAnnotation;
606
				case (int)(DiscouragedReference >>> 32) :
568
				case (int)(DiscouragedReference >>> 32) :
607
					return OPTION_ReportDiscouragedReference;
569
					return OPTION_ReportDiscouragedReference;
608
				case (int)(UnhandledWarningToken >>> 32) :
609
					return OPTION_ReportUnhandledWarningToken;
610
				case (int)(RawTypeReference >>> 32) :
570
				case (int)(RawTypeReference >>> 32) :
611
					return OPTION_ReportRawTypeReference;
571
					return OPTION_ReportRawTypeReference;
612
				case (int)(UnusedLabel >>> 32) :
572
				case (int)(UnusedLabel >>> 32) :
Lines 896-915 Link Here
896
		if ((optionValue = optionsMap.get(OPTION_ReportUncheckedTypeOperation)) != null) updateSeverity(UncheckedTypeOperation, optionValue);
856
		if ((optionValue = optionsMap.get(OPTION_ReportUncheckedTypeOperation)) != null) updateSeverity(UncheckedTypeOperation, optionValue);
897
		if ((optionValue = optionsMap.get(OPTION_ReportRawTypeReference)) != null) updateSeverity(RawTypeReference, optionValue);
857
		if ((optionValue = optionsMap.get(OPTION_ReportRawTypeReference)) != null) updateSeverity(RawTypeReference, optionValue);
898
		if ((optionValue = optionsMap.get(OPTION_ReportFinalParameterBound)) != null) updateSeverity(FinalParameterBound, optionValue);
858
		if ((optionValue = optionsMap.get(OPTION_ReportFinalParameterBound)) != null) updateSeverity(FinalParameterBound, optionValue);
899
		if ((optionValue = optionsMap.get(OPTION_ReportSwitchCaseShouldBeConstant)) != null) updateSeverity(SwitchCaseShouldBeConstant, optionValue);
900
		if ((optionValue = optionsMap.get(OPTION_ReportForbiddenReference)) != null) updateSeverity(ForbiddenReference, optionValue);
859
		if ((optionValue = optionsMap.get(OPTION_ReportForbiddenReference)) != null) updateSeverity(ForbiddenReference, optionValue);
901
		if ((optionValue = optionsMap.get(OPTION_ReportDiscouragedReference)) != null) updateSeverity(DiscouragedReference, optionValue);
860
		if ((optionValue = optionsMap.get(OPTION_ReportDiscouragedReference)) != null) updateSeverity(DiscouragedReference, optionValue);
902
		if ((optionValue = optionsMap.get(OPTION_ReportVarargsArgumentNeedCast)) != null) updateSeverity(VarargsArgumentNeedCast, optionValue);
903
		if ((optionValue = optionsMap.get(OPTION_ReportNullReference)) != null) updateSeverity(NullReference, optionValue);
861
		if ((optionValue = optionsMap.get(OPTION_ReportNullReference)) != null) updateSeverity(NullReference, optionValue);
904
		if ((optionValue = optionsMap.get(OPTION_ReportPotentialNullReference)) != null) updateSeverity(PotentialNullReference, optionValue);
862
		if ((optionValue = optionsMap.get(OPTION_ReportPotentialNullReference)) != null) updateSeverity(PotentialNullReference, optionValue);
905
		if ((optionValue = optionsMap.get(OPTION_ReportDuplicateLocalVariables)) != null) updateSeverity(DuplicateLocalVariables, optionValue);
863
		if ((optionValue = optionsMap.get(OPTION_ReportDuplicateLocalVariables)) != null) updateSeverity(DuplicateLocalVariables, optionValue);
906
		if ((optionValue = optionsMap.get(OPTION_ReportRedundantNullCheck)) != null) updateSeverity(RedundantNullCheck, optionValue);
864
		if ((optionValue = optionsMap.get(OPTION_ReportRedundantNullCheck)) != null) updateSeverity(RedundantNullCheck, optionValue);
907
		if ((optionValue = optionsMap.get(OPTION_ReportAutoboxing)) != null) updateSeverity(AutoBoxing, optionValue);
865
		if ((optionValue = optionsMap.get(OPTION_ReportAutoboxing)) != null) updateSeverity(AutoBoxing, optionValue);
908
		if ((optionValue = optionsMap.get(OPTION_ReportAnnotationSuperInterface)) != null) updateSeverity(AnnotationSuperInterface, optionValue);
909
		if ((optionValue = optionsMap.get(OPTION_ReportMissingOverrideAnnotation)) != null) updateSeverity(MissingOverrideAnnotation, optionValue);
910
		if ((optionValue = optionsMap.get(OPTION_ReportMissingDeprecatedAnnotation)) != null) updateSeverity(MissingDeprecatedAnnotation, optionValue);
911
		if ((optionValue = optionsMap.get(OPTION_ReportIncompleteEnumSwitch)) != null) updateSeverity(IncompleteEnumSwitch, optionValue);
912
		if ((optionValue = optionsMap.get(OPTION_ReportUnhandledWarningToken)) != null) updateSeverity(UnhandledWarningToken, optionValue);
913
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedLabel)) != null) updateSeverity(UnusedLabel, optionValue);
866
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedLabel)) != null) updateSeverity(UnusedLabel, optionValue);
914
		if ((optionValue = optionsMap.get(OPTION_ReportParameterAssignment)) != null) updateSeverity(ParameterAssignment, optionValue);
867
		if ((optionValue = optionsMap.get(OPTION_ReportParameterAssignment)) != null) updateSeverity(ParameterAssignment, optionValue);
915
		if ((optionValue = optionsMap.get(OPTION_ReportFallthroughCase)) != null) updateSeverity(FallthroughCase, optionValue);
868
		if ((optionValue = optionsMap.get(OPTION_ReportFallthroughCase)) != null) updateSeverity(FallthroughCase, optionValue);
Lines 1099-1106 Link Here
1099
		buf.append("\n\t- unsafe type operation: ").append(getSeverityString(UncheckedTypeOperation)); //$NON-NLS-1$
1052
		buf.append("\n\t- unsafe type operation: ").append(getSeverityString(UncheckedTypeOperation)); //$NON-NLS-1$
1100
		buf.append("\n\t- unsafe raw type: ").append(getSeverityString(RawTypeReference)); //$NON-NLS-1$
1053
		buf.append("\n\t- unsafe raw type: ").append(getSeverityString(RawTypeReference)); //$NON-NLS-1$
1101
		buf.append("\n\t- final bound for type parameter: ").append(getSeverityString(FinalParameterBound)); //$NON-NLS-1$
1054
		buf.append("\n\t- final bound for type parameter: ").append(getSeverityString(FinalParameterBound)); //$NON-NLS-1$
1102
		buf.append("\n\t- missing serialVersionUID: ").append(getSeverityString(SwitchCaseShouldBeConstant)); //$NON-NLS-1$
1103
		buf.append("\n\t- varargs argument need cast: ").append(getSeverityString(VarargsArgumentNeedCast)); //$NON-NLS-1$
1104
		buf.append("\n\t- forbidden reference to type with access restriction: ").append(getSeverityString(ForbiddenReference)); //$NON-NLS-1$
1055
		buf.append("\n\t- forbidden reference to type with access restriction: ").append(getSeverityString(ForbiddenReference)); //$NON-NLS-1$
1105
		buf.append("\n\t- discouraged reference to type with access restriction: ").append(getSeverityString(DiscouragedReference)); //$NON-NLS-1$
1056
		buf.append("\n\t- discouraged reference to type with access restriction: ").append(getSeverityString(DiscouragedReference)); //$NON-NLS-1$
1106
		buf.append("\n\t- null reference: ").append(getSeverityString(NullReference)); //$NON-NLS-1$
1057
		buf.append("\n\t- null reference: ").append(getSeverityString(NullReference)); //$NON-NLS-1$
Lines 1108-1119 Link Here
1108
		buf.append("\n\t- duplicate local variables: ").append(getSeverityString(DuplicateLocalVariables)); //$NON-NLS-1%
1059
		buf.append("\n\t- duplicate local variables: ").append(getSeverityString(DuplicateLocalVariables)); //$NON-NLS-1%
1109
		buf.append("\n\t- redundant null check: ").append(getSeverityString(RedundantNullCheck)); //$NON-NLS-1$
1060
		buf.append("\n\t- redundant null check: ").append(getSeverityString(RedundantNullCheck)); //$NON-NLS-1$
1110
		buf.append("\n\t- autoboxing: ").append(getSeverityString(AutoBoxing)); //$NON-NLS-1$
1061
		buf.append("\n\t- autoboxing: ").append(getSeverityString(AutoBoxing)); //$NON-NLS-1$
1111
		buf.append("\n\t- annotation super interface: ").append(getSeverityString(AnnotationSuperInterface)); //$NON-NLS-1$
1112
		buf.append("\n\t- missing @Override annotation: ").append(getSeverityString(MissingOverrideAnnotation)); //$NON-NLS-1$
1113
		buf.append("\n\t- missing @Deprecated annotation: ").append(getSeverityString(MissingDeprecatedAnnotation)); //$NON-NLS-1$
1114
		buf.append("\n\t- incomplete enum switch: ").append(getSeverityString(IncompleteEnumSwitch)); //$NON-NLS-1$
1115
		buf.append("\n\t- suppress warnings: ").append(this.suppressWarnings ? ENABLED : DISABLED); //$NON-NLS-1$
1062
		buf.append("\n\t- suppress warnings: ").append(this.suppressWarnings ? ENABLED : DISABLED); //$NON-NLS-1$
1116
		buf.append("\n\t- unhandled warning token: ").append(getSeverityString(UnhandledWarningToken)); //$NON-NLS-1$
1117
		buf.append("\n\t- unused label: ").append(getSeverityString(UnusedLabel)); //$NON-NLS-1$
1063
		buf.append("\n\t- unused label: ").append(getSeverityString(UnusedLabel)); //$NON-NLS-1$
1118
		buf.append("\n\t- treat optional error as fatal: ").append(this.treatOptionalErrorAsFatal ? ENABLED : DISABLED); //$NON-NLS-1$
1064
		buf.append("\n\t- treat optional error as fatal: ").append(this.treatOptionalErrorAsFatal ? ENABLED : DISABLED); //$NON-NLS-1$
1119
		buf.append("\n\t- parameter assignment: ").append(getSeverityString(ParameterAssignment)); //$NON-NLS-1$
1065
		buf.append("\n\t- parameter assignment: ").append(getSeverityString(ParameterAssignment)); //$NON-NLS-1$
Lines 1206-1212 Link Here
1206
	 */
1152
	 */
1207
	public static String[] warningOptionNames() {
1153
	public static String[] warningOptionNames() {
1208
		String[] result = {
1154
		String[] result = {
1209
			OPTION_ReportAnnotationSuperInterface,
1210
			OPTION_ReportAssertIdentifier,
1155
			OPTION_ReportAssertIdentifier,
1211
			OPTION_ReportAutoboxing,
1156
			OPTION_ReportAutoboxing,
1212
			OPTION_ReportDeprecation,
1157
			OPTION_ReportDeprecation,
Lines 1220-1235 Link Here
1220
			OPTION_ReportForbiddenReference,
1165
			OPTION_ReportForbiddenReference,
1221
			OPTION_ReportHiddenCatchBlock,
1166
			OPTION_ReportHiddenCatchBlock,
1222
			OPTION_ReportIncompatibleNonInheritedInterfaceMethod,
1167
			OPTION_ReportIncompatibleNonInheritedInterfaceMethod,
1223
			OPTION_ReportIncompleteEnumSwitch,
1224
			OPTION_ReportIndirectStaticAccess,
1168
			OPTION_ReportIndirectStaticAccess,
1225
			OPTION_ReportInvalidJavadoc,
1169
			OPTION_ReportInvalidJavadoc,
1226
			OPTION_ReportLocalVariableHiding,
1170
			OPTION_ReportLocalVariableHiding,
1227
			OPTION_ReportMethodWithConstructorName,
1171
			OPTION_ReportMethodWithConstructorName,
1228
			OPTION_ReportMissingDeprecatedAnnotation,
1229
			OPTION_ReportMissingJavadocComments,
1172
			OPTION_ReportMissingJavadocComments,
1230
			OPTION_ReportMissingJavadocTags,
1173
			OPTION_ReportMissingJavadocTags,
1231
			OPTION_ReportMissingOverrideAnnotation,
1232
			OPTION_ReportSwitchCaseShouldBeConstant,
1233
			OPTION_ReportNoEffectAssignment,
1174
			OPTION_ReportNoEffectAssignment,
1234
			OPTION_ReportNoImplicitStringConversion,
1175
			OPTION_ReportNoImplicitStringConversion,
1235
			OPTION_ReportNonExternalizedStringLiteral,
1176
			OPTION_ReportNonExternalizedStringLiteral,
Lines 1252-1259 Link Here
1252
			OPTION_ReportUnusedLocal,
1193
			OPTION_ReportUnusedLocal,
1253
			OPTION_ReportUnusedParameter,
1194
			OPTION_ReportUnusedParameter,
1254
			OPTION_ReportUnusedPrivateMember,
1195
			OPTION_ReportUnusedPrivateMember,
1255
			OPTION_ReportVarargsArgumentNeedCast,
1256
			OPTION_ReportUnhandledWarningToken,
1257
			OPTION_ReportOverridingMethodWithoutSuperInvocation
1196
			OPTION_ReportOverridingMethodWithoutSuperInvocation
1258
		};
1197
		};
1259
		return result;
1198
		return result;
Lines 1295-1310 Link Here
1295
		} else {
1234
		} else {
1296
			irritantInt = (int)(irritant >>> 32);
1235
			irritantInt = (int)(irritant >>> 32);
1297
			switch (irritantInt) {
1236
			switch (irritantInt) {
1298
				case (int)(SwitchCaseShouldBeConstant >>> 32) :
1299
					return "serial"; //$NON-NLS-1$
1300
				case (int)(AutoBoxing >>> 32) :
1237
				case (int)(AutoBoxing >>> 32) :
1301
					return "boxing"; //$NON-NLS-1$
1238
					return "boxing"; //$NON-NLS-1$
1302
				case (int)(TypeHiding >>> 32) :
1239
				case (int)(TypeHiding >>> 32) :
1303
					return "hiding"; //$NON-NLS-1$
1240
					return "hiding"; //$NON-NLS-1$
1304
				case (int)(IncompleteEnumSwitch >>> 32) :
1305
					return "incomplete-switch"; //$NON-NLS-1$
1306
				case (int)(MissingDeprecatedAnnotation >>> 32) :
1307
					return "dep-ann"; //$NON-NLS-1$
1308
				case (int)(RawTypeReference >>> 32):
1241
				case (int)(RawTypeReference >>> 32):
1309
					return "unchecked"; //$NON-NLS-1$
1242
					return "unchecked"; //$NON-NLS-1$
1310
				case (int) (UnusedLabel >>> 32):
1243
				case (int) (UnusedLabel >>> 32):
Lines 1329-1344 Link Here
1329
		"all", //$NON-NLS-1$
1262
		"all", //$NON-NLS-1$
1330
		"boxing", //$NON-NLS-1$
1263
		"boxing", //$NON-NLS-1$
1331
		"cast", //$NON-NLS-1$
1264
		"cast", //$NON-NLS-1$
1332
		"dep-ann", //$NON-NLS-1$
1333
		"deprecation", //$NON-NLS-1$
1265
		"deprecation", //$NON-NLS-1$
1334
		"fallthrough", //$NON-NLS-1$
1266
		"fallthrough", //$NON-NLS-1$
1335
		"finally", //$NON-NLS-1$
1267
		"finally", //$NON-NLS-1$
1336
		"hiding", //$NON-NLS-1$
1268
		"hiding", //$NON-NLS-1$
1337
		"incomplete-switch", //$NON-NLS-1$
1338
		"nls", //$NON-NLS-1$
1269
		"nls", //$NON-NLS-1$
1339
		"null", //$NON-NLS-1$
1270
		"null", //$NON-NLS-1$
1340
		"restriction", //$NON-NLS-1$
1271
		"restriction", //$NON-NLS-1$
1341
		"serial", //$NON-NLS-1$
1342
		"static-access", //$NON-NLS-1$
1272
		"static-access", //$NON-NLS-1$
1343
		"super", //$NON-NLS-1$
1273
		"super", //$NON-NLS-1$
1344
		"synthetic-access", //$NON-NLS-1$
1274
		"synthetic-access", //$NON-NLS-1$
Lines 1365-1372 Link Here
1365
			case 'd' :
1295
			case 'd' :
1366
				if ("deprecation".equals(warningToken)) //$NON-NLS-1$
1296
				if ("deprecation".equals(warningToken)) //$NON-NLS-1$
1367
					return UsingDeprecatedAPI;
1297
					return UsingDeprecatedAPI;
1368
				if ("dep-ann".equals(warningToken)) //$NON-NLS-1$
1369
					return MissingDeprecatedAnnotation;
1370
				break;
1298
				break;
1371
			case 'f' :
1299
			case 'f' :
1372
				if ("fallthrough".equals(warningToken)) //$NON-NLS-1$
1300
				if ("fallthrough".equals(warningToken)) //$NON-NLS-1$
Lines 1377-1385 Link Here
1377
			case 'h' :
1305
			case 'h' :
1378
				if ("hiding".equals(warningToken)) //$NON-NLS-1$
1306
				if ("hiding".equals(warningToken)) //$NON-NLS-1$
1379
					return FieldHiding | LocalVariableHiding | MaskedCatchBlock | TypeHiding;
1307
					return FieldHiding | LocalVariableHiding | MaskedCatchBlock | TypeHiding;
1380
			case 'i' :
1381
				if ("incomplete-switch".equals(warningToken)) //$NON-NLS-1$
1382
					return IncompleteEnumSwitch;
1383
				break;
1308
				break;
1384
			case 'n' :
1309
			case 'n' :
1385
				if ("nls".equals(warningToken)) //$NON-NLS-1$
1310
				if ("nls".equals(warningToken)) //$NON-NLS-1$
Lines 1392-1399 Link Here
1392
					return DiscouragedReference | ForbiddenReference;
1317
					return DiscouragedReference | ForbiddenReference;
1393
				break;
1318
				break;
1394
			case 's' :
1319
			case 's' :
1395
				if ("serial".equals(warningToken)) //$NON-NLS-1$
1396
					return SwitchCaseShouldBeConstant;
1397
				if ("static-access".equals(warningToken)) //$NON-NLS-1$
1320
				if ("static-access".equals(warningToken)) //$NON-NLS-1$
1398
					return IndirectStaticAccess | NonStaticAccessToStatic;
1321
					return IndirectStaticAccess | NonStaticAccessToStatic;
1399
				if ("synthetic-access".equals(warningToken)) //$NON-NLS-1$
1322
				if ("synthetic-access".equals(warningToken)) //$NON-NLS-1$

Return to bug 268542