### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.jsdt.core Index: src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java,v retrieving revision 1.13 diff -u -r1.13 SwitchStatement.java --- src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java 30 Apr 2008 21:32:18 -0000 1.13 +++ src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java 2 Apr 2009 15:06:08 -0000 @@ -220,27 +220,6 @@ upperScope.problemReporter().undocumentedEmptyBlock(this.blockStart, this.sourceEnd); } } - // for enum switch, check if all constants are accounted for (if no default) -// if (isEnumSwitch && defaultCase == null -// && upperScope.compilerOptions().getSeverity(CompilerOptions.IncompleteEnumSwitch) != ProblemSeverities.Ignore) { -// int constantCount = this.constants == null ? 0 : this.constants.length; // could be null if no case statement -// if (constantCount == caseCount // ignore diagnosis if unresolved constants -// && caseCount != ((ReferenceBinding)expressionType).enumConstantCount()) { -// FieldBinding[] enumFields = ((ReferenceBinding)expressionType.erasure()).fields(); -// for (int i = 0, max = enumFields.length; i >> 32): - case (int)(CompilerOptions.VarargsArgumentNeedCast >>> 32): case (int)(CompilerOptions.NullReference >>> 32): case (int)(CompilerOptions.PotentialNullReference >>> 32): case (int)(CompilerOptions.DuplicateLocalVariables >>> 32): case (int)(CompilerOptions.RedundantNullCheck >>> 32): - case (int)(CompilerOptions.IncompleteEnumSwitch >>> 32): case (int)(CompilerOptions.FallthroughCase >>> 32): case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32): return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM; @@ -891,18 +871,6 @@ messageSend.sourceStart, messageSend.sourceEnd); } -public void cannotExtendEnum(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) { - String name = new String(type.sourceName()); - String superTypeFullName = new String(superTypeBinding.readableName()); - String superTypeShortName = new String(superTypeBinding.shortReadableName()); - if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName; - this.handle( - IProblem.CannotExtendEnum, - new String[] {superTypeFullName, name}, - new String[] {superTypeShortName, name}, - superclass.sourceStart, - superclass.sourceEnd); -} public void cannotImportPackage(ImportReference importRef) { String[] arguments = new String[] {CharOperation.toString(importRef.tokens)}; this.handle( @@ -920,20 +888,6 @@ typeRef.sourceStart, typeRef.sourceEnd); } -public void cannotInvokeSuperConstructorInEnum(ExplicitConstructorCall constructorCall, MethodBinding enumConstructor) { - this.handle( - IProblem.CannotInvokeSuperConstructorInEnum, - new String[] { - new String(enumConstructor.declaringClass.sourceName()), - typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, false), - }, - new String[] { - new String(enumConstructor.declaringClass.sourceName()), - typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, true), - }, - constructorCall.sourceStart, - constructorCall.sourceEnd); -} public void cannotReadSource(CompilationUnitDeclaration unit, AbortCompilationUnit abortException, boolean verbose) { String fileName = new String(unit.compilationResult.fileName); if (abortException.exception instanceof CharConversionException) { @@ -1002,14 +956,6 @@ exception.sourceStart, exception.sourceEnd); } -public void cannotUseQualifiedEnumConstantInCaseLabel(Reference location, FieldBinding field) { - this.handle( - IProblem.IllegalQualifiedEnumConstantLabel, - new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) }, - new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) }, - nodeSourceStart(field, location), - nodeSourceEnd(field, location)); -} public void cannotUseSuperInCodeSnippet(int start, int end) { this.handle( IProblem.CannotUseSuperInCodeSnippet, @@ -1088,8 +1034,6 @@ switch (problemID) { case IProblem.Task : return ProblemSeverities.Warning; - case IProblem.VarargsConflict : - return ProblemSeverities.Warning; case IProblem.TypeCollidesWithPackage : return ProblemSeverities.Warning; @@ -1136,16 +1080,6 @@ case IProblem.JavadocInheritedFieldHidesEnclosingName: case IProblem.JavadocInheritedNameHidesEnclosingTypeName: case IProblem.JavadocNonStaticTypeFromStaticInvocation: - case IProblem.JavadocGenericMethodTypeArgumentMismatch: - case IProblem.JavadocNonGenericMethod: - case IProblem.JavadocIncorrectArityForParameterizedMethod: - case IProblem.JavadocParameterizedMethodArgumentTypeMismatch: - case IProblem.JavadocTypeArgumentsForRawGenericMethod: - case IProblem.JavadocGenericConstructorTypeArgumentMismatch: - case IProblem.JavadocNonGenericConstructor: - case IProblem.JavadocIncorrectArityForParameterizedConstructor: - case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: - case IProblem.JavadocTypeArgumentsForRawGenericConstructor: case IProblem.JavadocEmptyReturnTag: if (!this.options.reportInvalidJavadocTags) { return ProblemSeverities.Ignore; @@ -1358,22 +1292,6 @@ statement.sourceStart, statement.sourceEnd); } - -public void duplicateEnumSpecialMethod(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) { - MethodBinding method = methodDecl.binding; - this.handle( - IProblem.CannotDeclareEnumSpecialMethod, - new String[] { - new String(methodDecl.getSafeName()), - new String(method.declaringClass.readableName()), - typesAsString(method.isVarargs(), method.parameters, false)}, - new String[] { - new String(methodDecl.getSafeName()), - new String(method.declaringClass.shortReadableName()), - typesAsString(method.isVarargs(), method.parameters, true)}, - methodDecl.sourceStart, - methodDecl.sourceEnd); -} public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) { this.handle( IProblem.DuplicateField, @@ -1597,28 +1515,6 @@ sourceStart, sourceEnd); } -public void enumAbstractMethodMustBeImplemented(AbstractMethodDeclaration method) { - MethodBinding abstractMethod = method.binding; - char[] methodSelector = abstractMethod.selector; - if(methodSelector == null) - methodSelector = method.getSafeName(); - this.handle( - // Must implement the inherited abstract method %1 - // 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods. - IProblem.EnumAbstractMethodMustBeImplemented, - new String[] { - new String(methodSelector), - typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, false), - new String(abstractMethod.declaringClass.readableName()), - }, - new String[] { - new String(methodSelector), - typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, true), - new String(abstractMethod.declaringClass.shortReadableName()), - }, - method.sourceStart(), - method.sourceEnd()); -} public void enumConstantsCannotBeSurroundedByParenthesis(Expression expression) { this.handle( IProblem.EnumConstantsCannotBeSurroundedByParenthesis, @@ -1627,22 +1523,6 @@ expression.sourceStart, expression.sourceEnd); } -public void enumStaticFieldUsedDuringInitialization(FieldBinding field, ASTNode location) { - this.handle( - IProblem.EnumStaticFieldInInInitializerContext, - new String[] {new String(field.declaringClass.readableName()), new String(field.name)}, - new String[] {new String(field.declaringClass.shortReadableName()), new String(field.name)}, - nodeSourceStart(field, location), - nodeSourceEnd(field, location)); -} -public void enumSwitchCannotTargetField(Reference reference, FieldBinding field) { - this.handle( - IProblem.EnumSwitchCannotTargetField, - new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) }, - new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) }, - nodeSourceStart(field, reference), - nodeSourceEnd(field, reference)); -} public void errorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params) { StringBuffer buffer = new StringBuffer(); StringBuffer shortBuffer = new StringBuffer(); @@ -1983,14 +1863,6 @@ annotationTypeMemberDeclaration.sourceStart, annotationTypeMemberDeclaration.sourceEnd); } -public void illegalExtendedDimensions(Argument argument) { - this.handle( - IProblem.IllegalExtendedDimensionsForVarArgs, - NoArgument, - NoArgument, - argument.sourceStart, - argument.sourceEnd); -} public void illegalGenericArray(TypeBinding leafComponentType, ASTNode location) { this.handle( IProblem.IllegalGenericArray, @@ -2112,33 +1984,6 @@ type.sourceStart(), type.sourceEnd()); } -public void illegalModifierForEnum(SourceTypeBinding type) { - String[] arguments = new String[] {new String(type.sourceName())}; - this.handle( - IProblem.IllegalModifierForEnum, - arguments, - arguments, - type.sourceStart(), - type.sourceEnd()); -} -public void illegalModifierForEnumConstant(ReferenceBinding type, FieldDeclaration fieldDecl) { - String[] arguments = new String[] {new String(fieldDecl.name)}; - this.handle( - IProblem.IllegalModifierForEnumConstant, - arguments, - arguments, - fieldDecl.sourceStart, - fieldDecl.sourceEnd); -} - -public void illegalModifierForEnumConstructor(AbstractMethodDeclaration constructor) { - this.handle( - IProblem.IllegalModifierForEnumConstructor, - NoArgument, - NoArgument, - constructor.sourceStart, - constructor.sourceEnd); -} public void illegalModifierForField(ReferenceBinding type, FieldDeclaration fieldDecl) { String[] arguments = new String[] {new String(fieldDecl.name)}; this.handle( @@ -2198,15 +2043,6 @@ type.sourceStart(), type.sourceEnd()); } -public void illegalModifierForLocalEnum(SourceTypeBinding type) { - String[] arguments = new String[] {new String(type.sourceName())}; - this.handle( - IProblem.IllegalModifierForLocalEnum, - arguments, - arguments, - type.sourceStart(), - type.sourceEnd()); -} public void illegalModifierForMemberClass(SourceTypeBinding type) { String[] arguments = new String[] {new String(type.sourceName())}; this.handle( @@ -2216,15 +2052,6 @@ type.sourceStart(), type.sourceEnd()); } -public void illegalModifierForMemberEnum(SourceTypeBinding type) { - String[] arguments = new String[] {new String(type.sourceName())}; - this.handle( - IProblem.IllegalModifierForMemberEnum, - arguments, - arguments, - type.sourceStart(), - type.sourceEnd()); -} public void illegalModifierForMemberInterface(SourceTypeBinding type) { String[] arguments = new String[] {new String(type.sourceName())}; this.handle( @@ -3944,18 +3771,7 @@ public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) { if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return; - int sourceStart = statement.sourceStart; - int sourceEnd = statement.sourceEnd; - if (statement instanceof AllocationExpression) { - AllocationExpression allocation = (AllocationExpression)statement; - if (allocation.enumConstant != null) { - sourceStart = allocation.enumConstant.sourceStart; - sourceEnd = allocation.enumConstant.sourceEnd; - } - } int id = IProblem.JavadocUndefinedConstructor; //default... - ProblemMethodBinding problemConstructor = null; - MethodBinding shownConstructor = null; switch (targetConstructor.problemId()) { case ProblemReasons.NotFound : id = IProblem.JavadocUndefinedConstructor; @@ -3966,128 +3782,6 @@ case ProblemReasons.Ambiguous : id = IProblem.JavadocAmbiguousConstructor; break; - case ProblemReasons.ParameterBoundMismatch : - int severity = computeSeverity(IProblem.JavadocGenericConstructorTypeArgumentMismatch); - if (severity == ProblemSeverities.Ignore) return; - problemConstructor = (ProblemMethodBinding) targetConstructor; - ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch; - shownConstructor = substitutedConstructor.original(); - - int augmentedLength = problemConstructor.parameters.length; - TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2]; - TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1]; - TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end - System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2); - - this.handle( - IProblem.JavadocGenericConstructorTypeArgumentMismatch, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), - new String(shownConstructor.declaringClass.readableName()), - typesAsString(false, invocationArguments, false), - new String(inferredTypeArgument.readableName()), - new String(typeParameter.sourceName), - parameterBoundAsString(typeParameter, false) }, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), - new String(shownConstructor.declaringClass.shortReadableName()), - typesAsString(false, invocationArguments, true), - new String(inferredTypeArgument.shortReadableName()), - new String(typeParameter.sourceName), - parameterBoundAsString(typeParameter, true) }, - severity, - sourceStart, - sourceEnd); - return; - - case ProblemReasons.TypeParameterArityMismatch : - problemConstructor = (ProblemMethodBinding) targetConstructor; - shownConstructor = problemConstructor.closestMatch; - boolean noTypeVariables = shownConstructor.typeVariables == Binding.NO_TYPE_VARIABLES; - severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericConstructor : IProblem.JavadocIncorrectArityForParameterizedConstructor); - if (severity == ProblemSeverities.Ignore) return; - if (noTypeVariables) { - this.handle( - IProblem.JavadocNonGenericConstructor, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), - new String(shownConstructor.declaringClass.readableName()), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), - new String(shownConstructor.declaringClass.shortReadableName()), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, - severity, - sourceStart, - sourceEnd); - } else { - this.handle( - IProblem.JavadocIncorrectArityForParameterizedConstructor, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), - new String(shownConstructor.declaringClass.readableName()), - typesAsString(false, shownConstructor.typeVariables, false), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), - new String(shownConstructor.declaringClass.shortReadableName()), - typesAsString(false, shownConstructor.typeVariables, true), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, - severity, - sourceStart, - sourceEnd); - } - return; - case ProblemReasons.ParameterizedMethodTypeMismatch : - severity = computeSeverity(IProblem.JavadocParameterizedConstructorArgumentTypeMismatch); - if (severity == ProblemSeverities.Ignore) return; - problemConstructor = (ProblemMethodBinding) targetConstructor; - shownConstructor = problemConstructor.closestMatch; - this.handle( - IProblem.JavadocParameterizedConstructorArgumentTypeMismatch, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), - new String(shownConstructor.declaringClass.readableName()), - typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, false), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), - new String(shownConstructor.declaringClass.shortReadableName()), - typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, true), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, - severity, - sourceStart, - sourceEnd); - return; - case ProblemReasons.TypeArgumentsForRawGenericMethod : - severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericConstructor); - if (severity == ProblemSeverities.Ignore) return; - problemConstructor = (ProblemMethodBinding) targetConstructor; - shownConstructor = problemConstructor.closestMatch; - this.handle( - IProblem.JavadocTypeArgumentsForRawGenericConstructor, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), - new String(shownConstructor.declaringClass.readableName()), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, - new String[] { - new String(shownConstructor.declaringClass.sourceName()), - typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), - new String(shownConstructor.declaringClass.shortReadableName()), - typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, - severity, - sourceStart, - sourceEnd); - return; case ProblemReasons.NoError : // 0 default : needImplementation(); // want to fail to see why we were here... @@ -4200,125 +3894,6 @@ case ProblemReasons.Ambiguous : id = IProblem.JavadocAmbiguousMethod; break; - case ProblemReasons.ParameterBoundMismatch : - int severity = computeSeverity(IProblem.JavadocGenericMethodTypeArgumentMismatch); - if (severity == ProblemSeverities.Ignore) return; - problemMethod = (ProblemMethodBinding) method; - ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch; - shownMethod = substitutedMethod.original(); - int augmentedLength = problemMethod.parameters.length; - TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2]; - TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1]; - TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end - System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2); - this.handle( - IProblem.JavadocGenericMethodTypeArgumentMismatch, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), - new String(shownMethod.declaringClass.readableName()), - typesAsString(false, invocationArguments, false), - new String(inferredTypeArgument.readableName()), - new String(typeParameter.sourceName), - parameterBoundAsString(typeParameter, false) }, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), - new String(shownMethod.declaringClass.shortReadableName()), - typesAsString(false, invocationArguments, true), - new String(inferredTypeArgument.shortReadableName()), - new String(typeParameter.sourceName), - parameterBoundAsString(typeParameter, true) }, - severity, - (int) (messageSend.nameSourcePosition >>> 32), - (int) messageSend.nameSourcePosition); - return; - case ProblemReasons.TypeParameterArityMismatch : - problemMethod = (ProblemMethodBinding) method; - shownMethod = problemMethod.closestMatch; - boolean noTypeVariables = shownMethod.typeVariables == Binding.NO_TYPE_VARIABLES; - severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericMethod : IProblem.JavadocIncorrectArityForParameterizedMethod); - if (severity == ProblemSeverities.Ignore) return; - if (noTypeVariables) { - this.handle( - IProblem.JavadocNonGenericMethod, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), - new String(shownMethod.declaringClass.readableName()), - typesAsString(method.isVarargs(), method.parameters, false) }, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), - new String(shownMethod.declaringClass.shortReadableName()), - typesAsString(method.isVarargs(), method.parameters, true) }, - severity, - (int) (messageSend.nameSourcePosition >>> 32), - (int) messageSend.nameSourcePosition); - } else { - this.handle( - IProblem.JavadocIncorrectArityForParameterizedMethod, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), - new String(shownMethod.declaringClass.readableName()), - typesAsString(false, shownMethod.typeVariables, false), - typesAsString(method.isVarargs(), method.parameters, false) }, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), - new String(shownMethod.declaringClass.shortReadableName()), - typesAsString(false, shownMethod.typeVariables, true), - typesAsString(method.isVarargs(), method.parameters, true) }, - severity, - (int) (messageSend.nameSourcePosition >>> 32), - (int) messageSend.nameSourcePosition); - } - return; - case ProblemReasons.ParameterizedMethodTypeMismatch : - severity = computeSeverity(IProblem.JavadocParameterizedMethodArgumentTypeMismatch); - if (severity == ProblemSeverities.Ignore) return; - problemMethod = (ProblemMethodBinding) method; - shownMethod = problemMethod.closestMatch; - this.handle( - IProblem.JavadocParameterizedMethodArgumentTypeMismatch, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), - new String(shownMethod.declaringClass.readableName()), - typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false), - typesAsString(method.isVarargs(), method.parameters, false) }, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), - new String(shownMethod.declaringClass.shortReadableName()), - typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, true), - typesAsString(method.isVarargs(), method.parameters, true) }, - severity, - (int) (messageSend.nameSourcePosition >>> 32), - (int) messageSend.nameSourcePosition); - return; - case ProblemReasons.TypeArgumentsForRawGenericMethod : - severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericMethod); - if (severity == ProblemSeverities.Ignore) return; - problemMethod = (ProblemMethodBinding) method; - shownMethod = problemMethod.closestMatch; - this.handle( - IProblem.JavadocTypeArgumentsForRawGenericMethod, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), - new String(shownMethod.declaringClass.readableName()), - typesAsString(method.isVarargs(), method.parameters, false) }, - new String[] { - new String(shownMethod.selector), - typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), - new String(shownMethod.declaringClass.shortReadableName()), - typesAsString(method.isVarargs(), method.parameters, true) }, - severity, - (int) (messageSend.nameSourcePosition >>> 32), - (int) messageSend.nameSourcePosition); - return; case ProblemReasons.NoError : // 0 default : needImplementation(); // want to fail to see why we were here... @@ -4798,14 +4373,6 @@ type.sourceStart, type.sourceEnd); } -public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) { - this.handle( - IProblem.MissingEnumConstantCase, - new String[] {new String(enumConstant.declaringClass.readableName()), new String(enumConstant.name) }, - new String[] {new String(enumConstant.declaringClass.shortReadableName()), new String(enumConstant.name) }, - switchStatement.expression.sourceStart, - switchStatement.expression.sourceEnd); -} public void missingOverrideAnnotation(AbstractMethodDeclaration method) { int severity = computeSeverity(IProblem.MissingOverrideAnnotation); if (severity == ProblemSeverities.Ignore) return; @@ -6753,73 +6320,6 @@ sourceStart, sourceEnd); } -public void varargsArgumentNeedCast(MethodBinding method, TypeBinding argumentType, InvocationSite location) { - int severity = this.options.getSeverity(CompilerOptions.VarargsArgumentNeedCast); - if (severity == ProblemSeverities.Ignore) return; - ArrayBinding varargsType = (ArrayBinding)method.parameters[method.parameters.length-1]; - if (method.isConstructor()) { - this.handle( - IProblem.ConstructorVarargsArgumentNeedCast, - new String[] { - new String(argumentType.readableName()), - new String(varargsType.readableName()), - new String(method.declaringClass.readableName()), - typesAsString(method.isVarargs(), method.parameters, false), - new String(varargsType.elementsType().readableName()), - }, - new String[] { - new String(argumentType.shortReadableName()), - new String(varargsType.shortReadableName()), - new String(method.declaringClass.shortReadableName()), - typesAsString(method.isVarargs(), method.parameters, true), - new String(varargsType.elementsType().shortReadableName()), - }, - severity, - location.sourceStart(), - location.sourceEnd()); - } else { - this.handle( - IProblem.MethodVarargsArgumentNeedCast, - new String[] { - new String(argumentType.readableName()), - new String(varargsType.readableName()), - new String(method.selector), - typesAsString(method.isVarargs(), method.parameters, false), - new String(method.declaringClass.readableName()), - new String(varargsType.elementsType().readableName()), - }, - new String[] { - new String(argumentType.shortReadableName()), - new String(varargsType.shortReadableName()), - new String(method.selector), typesAsString(method.isVarargs(), method.parameters, true), - new String(method.declaringClass.shortReadableName()), - new String(varargsType.elementsType().shortReadableName()), - }, - severity, - location.sourceStart(), - location.sourceEnd()); - } -} -public void varargsConflict(MethodBinding method1, MethodBinding method2, SourceTypeBinding type) { - this.handle( - IProblem.VarargsConflict, - new String[] { - new String(method1.selector), - typesAsString(method1.isVarargs(), method1.parameters, false), - new String(method1.declaringClass.readableName()), - typesAsString(method2.isVarargs(), method2.parameters, false), - new String(method2.declaringClass.readableName()) - }, - new String[] { - new String(method1.selector), - typesAsString(method1.isVarargs(), method1.parameters, true), - new String(method1.declaringClass.shortReadableName()), - typesAsString(method2.isVarargs(), method2.parameters, true), - new String(method2.declaringClass.shortReadableName()) - }, - method1.declaringClass == type ? method1.sourceStart() : type.sourceStart(), - method1.declaringClass == type ? method1.sourceEnd() : type.sourceEnd()); -} public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) { String[] arguments = new String[] {new String(varDecl.name)}; this.handle( Index: src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties,v retrieving revision 1.15 diff -u -r1.15 messages.properties --- src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties 30 Apr 2008 21:32:41 -0000 1.15 +++ src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties 2 Apr 2009 15:06:11 -0000 @@ -556,36 +556,3 @@ ### AUTOBOXING 720 = The expression of type {0} is boxed into {1} 721 = The expression of type {0} is unboxed into {1} - -### ENUMS -750 = Illegal modifier for the enum {0}; only public is permitted -751 = Illegal modifier for the enum constant {0}; no modifier is allowed -752 = Illegal modifier for the local enum {0}; only abstract is permitted -753 = Illegal modifier for the member enum {0}; only public, protected, private, static & abstract are permitted -754 = The enum {1} already defines the function {0}({2}) implicitly -755 = The enum constant {0}.{1} reference cannot be qualified in a case label -756 = The type {1} may not subclass {0} explicitly -757 = Cannot invoke super constructor from enum constructor {0}({1}) -758 = The enum {2} can only define the abstract function {0}({1}) if it also defines enum constants with corresponding implementations -759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch -760 = Illegal modifier for the enum constructor; only private is permitted. -761 = The enum constant {0}.{1} has no corresponding case label -762 = Cannot refer to the static enum field {0}.{1} within an initializer - -### VARARGS -800 = Extended dimensions are illegal for a variable argument -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 -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 -803 = Varargs functions should only override or be overridden by other varargs functions unlike {2}.{0}({1}) and {4}.{0}({3}) - -### GENERIC JAVADOC -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}> -851 = The function {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}> -852 = Incorrect number of type arguments for generic function <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}> -853 = The parameterized function <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4}) -854 = The function {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}> -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}> -856 = The constructor {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}> -857 = Incorrect number of type arguments for generic constructor <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}> -858 = The parameterized constructor <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4}) -859 = The constructor {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}> Index: src/org/eclipse/wst/jsdt/core/compiler/IProblem.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java,v retrieving revision 1.13 diff -u -r1.13 IProblem.java --- src/org/eclipse/wst/jsdt/core/compiler/IProblem.java 12 Mar 2009 05:00:40 -0000 1.13 +++ src/org/eclipse/wst/jsdt/core/compiler/IProblem.java 2 Apr 2009 15:06:08 -0000 @@ -89,7 +89,6 @@ * AnnotationValueMustBeArrayInitializer * InvalidEncoding * CannotReadSource - * EnumStaticFieldInInInitializerContext * ExternalProblemNotFixable * ExternalProblemFixable * IBM Corporation - added the following constants @@ -929,45 +928,6 @@ int UnboxingConversion = Internal + 721; /** - * Enum - */ - int IllegalModifierForEnum = TypeRelated + 750; - int IllegalModifierForEnumConstant = FieldRelated + 751; - int IllegalModifierForLocalEnum = TypeRelated + 752; - int IllegalModifierForMemberEnum = TypeRelated + 753; - int CannotDeclareEnumSpecialMethod = MethodRelated + 754; - int IllegalQualifiedEnumConstantLabel = FieldRelated + 755; - int CannotExtendEnum = TypeRelated + 756; - int CannotInvokeSuperConstructorInEnum = MethodRelated + 757; - int EnumAbstractMethodMustBeImplemented = MethodRelated + 758; - int EnumSwitchCannotTargetField = FieldRelated + 759; - int IllegalModifierForEnumConstructor = MethodRelated + 760; - int MissingEnumConstantCase = FieldRelated + 761; - int EnumStaticFieldInInInitializerContext = FieldRelated + 762; - - /** - * Var args - */ - int IllegalExtendedDimensionsForVarArgs = Syntax + Internal + 800; - int MethodVarargsArgumentNeedCast = MethodRelated + 801; - int ConstructorVarargsArgumentNeedCast = ConstructorRelated + 802; - int VarargsConflict = MethodRelated + 803; - - /** - * Javadoc Generic - */ - int JavadocGenericMethodTypeArgumentMismatch = Javadoc + Internal + 850; - int JavadocNonGenericMethod = Javadoc + Internal + 851; - int JavadocIncorrectArityForParameterizedMethod = Javadoc + Internal + 852; - int JavadocParameterizedMethodArgumentTypeMismatch = Javadoc + Internal + 853; - int JavadocTypeArgumentsForRawGenericMethod = Javadoc + Internal + 854; - int JavadocGenericConstructorTypeArgumentMismatch = Javadoc + Internal + 855; - int JavadocNonGenericConstructor = Javadoc + Internal + 856; - int JavadocIncorrectArityForParameterizedConstructor = Javadoc + Internal + 857; - int JavadocParameterizedConstructorArgumentTypeMismatch = Javadoc + Internal + 858; - int JavadocTypeArgumentsForRawGenericConstructor = Javadoc + Internal + 859; - - /** * External problems -- These are problems defined by other plugins */ Index: src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties,v retrieving revision 1.3 diff -u -r1.3 messages.properties --- src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties 30 Apr 2008 21:32:33 -0000 1.3 +++ src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties 2 Apr 2009 15:06:09 -0000 @@ -277,7 +277,6 @@ \ unusedPrivate + unused private member declaration\n\ \ unusedThrown unused declared thrown exception\n\ \ uselessTypeCheck unnecessary cast/instanceof operation\n\ -\ varargsCast + varargs argument need explicit cast\n\ \ warningToken + unhandled warning token in @SuppressWarnings\n\ \ \n\ \ Advanced options:\n\ Index: src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java,v retrieving revision 1.15 diff -u -r1.15 Main.java --- src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java 12 Mar 2009 05:00:39 -0000 1.15 +++ src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java 2 Apr 2009 15:06:08 -0000 @@ -1880,10 +1880,6 @@ this.options.put( CompilerOptions.OPTION_ReportTypeParameterHiding, isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); - } else if (token.equals("varargsCast")) { //$NON-NLS-1$ - this.options.put( - CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, - isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); } else if (token.equals("null")) { //$NON-NLS-1$ if (isEnabling) { this.options.put(CompilerOptions.OPTION_ReportNullReference, @@ -1928,11 +1924,6 @@ this.options.put( CompilerOptions.OPTION_ReportAnnotationSuperInterface, isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); - } else if (token.equals("enumSwitch") //$NON-NLS-1$ - || token.equals("incomplete-switch")) { //$NON-NLS-1$ - this.options.put( - CompilerOptions.OPTION_ReportIncompleteEnumSwitch, - isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); } else if (token.equals("hiding")) { //$NON-NLS-1$ this.options.put( CompilerOptions.OPTION_ReportHiddenCatchBlock, Index: src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java,v retrieving revision 1.55 diff -u -r1.55 Parser.java --- src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java 3 Dec 2008 22:14:05 -0000 1.55 +++ src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java 2 Apr 2009 15:06:10 -0000 @@ -3902,17 +3902,6 @@ /* if incomplete method header, this.listLength counter will not have been reset, indicating that some arguments are available on the stack */ this.listLength++; - -// if(isVarArgs) { -// if (!this.statementRecoveryActivated && -// options.sourceLevel < ClassFileConstants.JDK1_5 && -// this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { -// this.problemReporter().invalidUsageOfVarargs(arg); -// } else if (!this.statementRecoveryActivated && -// extendedDimensions > 0) { -// this.problemReporter().illegalExtendedDimensions(arg); -// } -// } } protected void handleArgumentComment(Argument arg) Index: src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.16 diff -u -r1.16 CompilerOptions.java --- src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 12 Mar 2009 05:00:40 -0000 1.16 +++ src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 2 Apr 2009 15:06:09 -0000 @@ -85,7 +85,6 @@ public static final String OPTION_ReportRawTypeReference = "org.eclipse.wst.jsdt.core.compiler.problem.rawTypeReference"; //$NON-NLS-1$ public static final String OPTION_ReportFinalParameterBound = "org.eclipse.wst.jsdt.core.compiler.problem.finalParameterBound"; //$NON-NLS-1$ public static final String OPTION_ReportSwitchCaseShouldBeConstant = "org.eclipse.wst.jsdt.core.compiler.problem.SwitchCaseShouldBeConstant"; //$NON-NLS-1$ - public static final String OPTION_ReportVarargsArgumentNeedCast = "org.eclipse.wst.jsdt.core.compiler.problem.varargsArgumentNeedCast"; //$NON-NLS-1$ public static final String OPTION_Source = "org.eclipse.wst.jsdt.core.compiler.source"; //$NON-NLS-1$ public static final String OPTION_TargetPlatform = "org.eclipse.wst.jsdt.core.compiler.codegen.targetPlatform"; //$NON-NLS-1$ public static final String OPTION_Compliance = "org.eclipse.wst.jsdt.core.compiler.compliance"; //$NON-NLS-1$ @@ -103,7 +102,6 @@ public static final String OPTION_ReportAnnotationSuperInterface = "org.eclipse.wst.jsdt.core.compiler.problem.annotationSuperInterface"; //$NON-NLS-1$ public static final String OPTION_ReportMissingOverrideAnnotation = "org.eclipse.wst.jsdt.core.compiler.problem.missingOverrideAnnotation"; //$NON-NLS-1$ public static final String OPTION_ReportMissingDeprecatedAnnotation = "org.eclipse.wst.jsdt.core.compiler.problem.missingDeprecatedAnnotation"; //$NON-NLS-1$ - public static final String OPTION_ReportIncompleteEnumSwitch = "org.eclipse.wst.jsdt.core.compiler.problem.incompleteEnumSwitch"; //$NON-NLS-1$ public static final String OPTION_ReportForbiddenReference = "org.eclipse.wst.jsdt.core.compiler.problem.forbiddenReference"; //$NON-NLS-1$ public static final String OPTION_ReportDiscouragedReference = "org.eclipse.wst.jsdt.core.compiler.problem.discouragedReference"; //$NON-NLS-1$ public static final String OPTION_SuppressWarnings = "org.eclipse.wst.jsdt.core.compiler.problem.suppressWarnings"; //$NON-NLS-1$ @@ -200,13 +198,11 @@ public static final long SwitchCaseShouldBeConstant = ASTNode.Bit33L; public static final long EnumUsedAsAnIdentifier = ASTNode.Bit34L; public static final long ForbiddenReference = ASTNode.Bit35L; - public static final long VarargsArgumentNeedCast = ASTNode.Bit36L; public static final long NullReference = ASTNode.Bit37L; public static final long AutoBoxing = ASTNode.Bit38L; public static final long AnnotationSuperInterface = ASTNode.Bit39L; public static final long TypeHiding = ASTNode.Bit40L; public static final long MissingOverrideAnnotation = ASTNode.Bit41L; - public static final long IncompleteEnumSwitch = ASTNode.Bit42L; public static final long MissingDeprecatedAnnotation = ASTNode.Bit43L; public static final long DiscouragedReference = ASTNode.Bit44L; public static final long UnhandledWarningToken = ASTNode.Bit45L; @@ -254,7 +250,6 @@ | UncheckedTypeOperation | RawTypeReference | SwitchCaseShouldBeConstant - | VarargsArgumentNeedCast | ForbiddenReference | DiscouragedReference | AnnotationSuperInterface @@ -425,7 +420,6 @@ optionsMap.put(OPTION_ReportUnnecessaryElse, getSeverityString(UnnecessaryElse)); optionsMap.put(OPTION_ReportAutoboxing, getSeverityString(AutoBoxing)); optionsMap.put(OPTION_ReportAnnotationSuperInterface, getSeverityString(AnnotationSuperInterface)); - optionsMap.put(OPTION_ReportIncompleteEnumSwitch, getSeverityString(IncompleteEnumSwitch)); optionsMap.put(OPTION_ReportInvalidJavadoc, getSeverityString(InvalidJavadoc)); optionsMap.put(OPTION_ReportInvalidJavadocTagsVisibility, getVisibilityString(this.reportInvalidJavadocTagsVisibility)); optionsMap.put(OPTION_ReportInvalidJavadocTags, this.reportInvalidJavadocTags ? ENABLED : DISABLED); @@ -447,10 +441,8 @@ optionsMap.put(OPTION_ReportSwitchCaseShouldBeConstant, getSeverityString(SwitchCaseShouldBeConstant)); optionsMap.put(OPTION_ReportForbiddenReference, getSeverityString(ForbiddenReference)); optionsMap.put(OPTION_ReportDiscouragedReference, getSeverityString(DiscouragedReference)); - optionsMap.put(OPTION_ReportVarargsArgumentNeedCast, getSeverityString(VarargsArgumentNeedCast)); optionsMap.put(OPTION_ReportMissingOverrideAnnotation, getSeverityString(MissingOverrideAnnotation)); optionsMap.put(OPTION_ReportMissingDeprecatedAnnotation, getSeverityString(MissingDeprecatedAnnotation)); - optionsMap.put(OPTION_ReportIncompleteEnumSwitch, getSeverityString(IncompleteEnumSwitch)); optionsMap.put(OPTION_ReportUnusedLabel, getSeverityString(UnusedLabel)); optionsMap.put(OPTION_Compliance, versionFromJdkLevel(this.complianceLevel)); optionsMap.put(OPTION_Source, versionFromJdkLevel(this.sourceLevel)); @@ -581,8 +573,6 @@ return OPTION_ReportEnumIdentifier; case (int)(ForbiddenReference >>> 32) : return OPTION_ReportForbiddenReference; - case (int)(VarargsArgumentNeedCast >>> 32) : - return OPTION_ReportVarargsArgumentNeedCast; case (int)(NullReference >>> 32) : return OPTION_ReportNullReference; case (int)(PotentialNullReference >>> 32) : @@ -599,8 +589,6 @@ return OPTION_ReportTypeParameterHiding; case (int)(MissingOverrideAnnotation >>> 32) : return OPTION_ReportMissingOverrideAnnotation; - case (int)(IncompleteEnumSwitch >>> 32) : - return OPTION_ReportIncompleteEnumSwitch; case (int)(MissingDeprecatedAnnotation >>> 32) : return OPTION_ReportMissingDeprecatedAnnotation; case (int)(DiscouragedReference >>> 32) : @@ -899,7 +887,6 @@ if ((optionValue = optionsMap.get(OPTION_ReportSwitchCaseShouldBeConstant)) != null) updateSeverity(SwitchCaseShouldBeConstant, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportForbiddenReference)) != null) updateSeverity(ForbiddenReference, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportDiscouragedReference)) != null) updateSeverity(DiscouragedReference, optionValue); - if ((optionValue = optionsMap.get(OPTION_ReportVarargsArgumentNeedCast)) != null) updateSeverity(VarargsArgumentNeedCast, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportNullReference)) != null) updateSeverity(NullReference, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportPotentialNullReference)) != null) updateSeverity(PotentialNullReference, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportDuplicateLocalVariables)) != null) updateSeverity(DuplicateLocalVariables, optionValue); @@ -908,7 +895,6 @@ if ((optionValue = optionsMap.get(OPTION_ReportAnnotationSuperInterface)) != null) updateSeverity(AnnotationSuperInterface, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportMissingOverrideAnnotation)) != null) updateSeverity(MissingOverrideAnnotation, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportMissingDeprecatedAnnotation)) != null) updateSeverity(MissingDeprecatedAnnotation, optionValue); - if ((optionValue = optionsMap.get(OPTION_ReportIncompleteEnumSwitch)) != null) updateSeverity(IncompleteEnumSwitch, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportUnhandledWarningToken)) != null) updateSeverity(UnhandledWarningToken, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportUnusedLabel)) != null) updateSeverity(UnusedLabel, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportParameterAssignment)) != null) updateSeverity(ParameterAssignment, optionValue); @@ -1100,7 +1086,6 @@ buf.append("\n\t- unsafe raw type: ").append(getSeverityString(RawTypeReference)); //$NON-NLS-1$ buf.append("\n\t- final bound for type parameter: ").append(getSeverityString(FinalParameterBound)); //$NON-NLS-1$ buf.append("\n\t- missing serialVersionUID: ").append(getSeverityString(SwitchCaseShouldBeConstant)); //$NON-NLS-1$ - buf.append("\n\t- varargs argument need cast: ").append(getSeverityString(VarargsArgumentNeedCast)); //$NON-NLS-1$ buf.append("\n\t- forbidden reference to type with access restriction: ").append(getSeverityString(ForbiddenReference)); //$NON-NLS-1$ buf.append("\n\t- discouraged reference to type with access restriction: ").append(getSeverityString(DiscouragedReference)); //$NON-NLS-1$ buf.append("\n\t- null reference: ").append(getSeverityString(NullReference)); //$NON-NLS-1$ @@ -1111,7 +1096,6 @@ buf.append("\n\t- annotation super interface: ").append(getSeverityString(AnnotationSuperInterface)); //$NON-NLS-1$ buf.append("\n\t- missing @Override annotation: ").append(getSeverityString(MissingOverrideAnnotation)); //$NON-NLS-1$ buf.append("\n\t- missing @Deprecated annotation: ").append(getSeverityString(MissingDeprecatedAnnotation)); //$NON-NLS-1$ - buf.append("\n\t- incomplete enum switch: ").append(getSeverityString(IncompleteEnumSwitch)); //$NON-NLS-1$ buf.append("\n\t- suppress warnings: ").append(this.suppressWarnings ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- unhandled warning token: ").append(getSeverityString(UnhandledWarningToken)); //$NON-NLS-1$ buf.append("\n\t- unused label: ").append(getSeverityString(UnusedLabel)); //$NON-NLS-1$ @@ -1220,7 +1204,6 @@ OPTION_ReportForbiddenReference, OPTION_ReportHiddenCatchBlock, OPTION_ReportIncompatibleNonInheritedInterfaceMethod, - OPTION_ReportIncompleteEnumSwitch, OPTION_ReportIndirectStaticAccess, OPTION_ReportInvalidJavadoc, OPTION_ReportLocalVariableHiding, @@ -1252,7 +1235,6 @@ OPTION_ReportUnusedLocal, OPTION_ReportUnusedParameter, OPTION_ReportUnusedPrivateMember, - OPTION_ReportVarargsArgumentNeedCast, OPTION_ReportUnhandledWarningToken, OPTION_ReportOverridingMethodWithoutSuperInvocation }; @@ -1301,8 +1283,6 @@ return "boxing"; //$NON-NLS-1$ case (int)(TypeHiding >>> 32) : return "hiding"; //$NON-NLS-1$ - case (int)(IncompleteEnumSwitch >>> 32) : - return "incomplete-switch"; //$NON-NLS-1$ case (int)(MissingDeprecatedAnnotation >>> 32) : return "dep-ann"; //$NON-NLS-1$ case (int)(RawTypeReference >>> 32): @@ -1334,7 +1314,6 @@ "fallthrough", //$NON-NLS-1$ "finally", //$NON-NLS-1$ "hiding", //$NON-NLS-1$ - "incomplete-switch", //$NON-NLS-1$ "nls", //$NON-NLS-1$ "null", //$NON-NLS-1$ "restriction", //$NON-NLS-1$ @@ -1377,9 +1356,6 @@ case 'h' : if ("hiding".equals(warningToken)) //$NON-NLS-1$ return FieldHiding | LocalVariableHiding | MaskedCatchBlock | TypeHiding; - case 'i' : - if ("incomplete-switch".equals(warningToken)) //$NON-NLS-1$ - return IncompleteEnumSwitch; break; case 'n' : if ("nls".equals(warningToken)) //$NON-NLS-1$ #P org.eclipse.wst.jsdt.core.tests.compiler Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java,v retrieving revision 1.3 diff -u -r1.3 AbstractComparableTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java 30 Apr 2008 21:31:29 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java 2 Apr 2009 15:06:11 -0000 @@ -37,7 +37,6 @@ options.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, CompilerOptions.WARNING); - options.put(CompilerOptions.OPTION_ReportIncompleteEnumSwitch, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.WARNING); return options; } Index: src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java,v retrieving revision 1.3 diff -u -r1.3 AnnotationTest.java --- src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java 12 Mar 2009 05:49:09 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java 2 Apr 2009 15:06:12 -0000 @@ -4912,33 +4912,6 @@ ); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99009 - public void test153() { - Map options = this.getCompilerOptions(); - options.put(CompilerOptions.OPTION_ReportIncompleteEnumSwitch, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { - "X.java", - "enum E { A, B, C }\n" + - "public class X {\n" + - " @SuppressWarnings({\"incomplete-switch\"})\n" + - " public static void main(String[] args) {\n" + - " for (E e : E.values()) {\n" + - " switch(e) {\n" + - " case A :\n" + - " System.out.println(e);\n" + - " break;\n" + - " }\n" + - " }\n" + - " }\n" + - "}", - }, - "", - null, - true, - options - ); - } - //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99009 public void test154() { Map options = this.getCompilerOptions(); options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.WARNING); #P org.eclipse.wst.jsdt.core.tests.model Index: src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java,v retrieving revision 1.5 diff -u -r1.5 CodeCorrectionTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java 12 Mar 2009 05:47:35 -0000 1.5 +++ src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java 2 Apr 2009 15:06:12 -0000 @@ -780,7 +780,6 @@ assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.MaskedCatch)); assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.TypeParameterHidingType)); assertEquals("wrong token", "nls", CorrectionEngine.getWarningToken(IProblem.NonExternalizedStringLiteral)); - assertEquals("wrong token", "incomplete-switch", CorrectionEngine.getWarningToken(IProblem.MissingEnumConstantCase)); assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.LocalVariableIsNeverUsed)); assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.ArgumentIsNeverUsed)); assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateConstructor));