this.handle(
// %1 must be abstract since it cannot override the inherited
// package-private abstract method %2
- IProblem.AbstractMethodCannotBeOverridden, new String[] { new String(type.sourceName()),
+ IProblem.AbstractMethodCannotBeOverridden, new String[] {
+ new String(type.sourceName()),
new String(CharOperation.concat(concreteMethod.declaringClass.readableName(), concreteMethod.readableName(), '.')) },
new String[] {
new String(type.sourceName()),
}
public void cannotDireclyInvokeAbstractMethod(MessageSend messageSend, MethodBinding method) {
- this.handle(IProblem.DirectInvocationOfAbstractMethod, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- messageSend.sourceStart, messageSend.sourceEnd);
+ this.handle(IProblem.DirectInvocationOfAbstractMethod, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, messageSend.sourceStart, messageSend.sourceEnd);
}
// public void cannotImportPackage(ImportReference importRef) {
case IProblem.PHPBadStyleUppercaseIdentifierWarning:
return this.options.getSeverity(CompilerOptions.PHPBadStyleUppercaseIdentifierWarning);
+ case IProblem.UninitializedLocalVariable:
+ return this.options.getSeverity(CompilerOptions.UninitializedLocalVariableWarning);
+ case IProblem.CodeCannotBeReached:
+ return this.options.getSeverity(CompilerOptions.CodeCannotBeReachedWarning);
+
case IProblem.MaskedCatch:
return this.options.getSeverity(CompilerOptions.MaskedCatchBlock);
}
public void deprecatedField(FieldBinding field, ASTNode location) {
- this.handle(IProblem.UsingDeprecatedField, new String[] { new String(field.declaringClass.readableName()),
+ this.handle(IProblem.UsingDeprecatedField, new String[] {
+ new String(field.declaringClass.readableName()),
new String(field.name) }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name) },
location.sourceStart, location.sourceEnd);
}
public void deprecatedMethod(MethodBinding method, ASTNode location) {
if (method.isConstructor())
- this.handle(IProblem.UsingDeprecatedConstructor, new String[] { new String(method.declaringClass.readableName()),
- parametersAsString(method) }, new String[] { new String(method.declaringClass.shortReadableName()),
+ this.handle(IProblem.UsingDeprecatedConstructor, new String[] {
+ new String(method.declaringClass.readableName()),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
else
- this.handle(IProblem.UsingDeprecatedMethod, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- location.sourceStart, location.sourceEnd);
+ this.handle(IProblem.UsingDeprecatedMethod, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
}
public void deprecatedType(TypeBinding type, ASTNode location) {
public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) {
this.handle(IProblem.DuplicateField, new String[] { new String(type.sourceName()), fieldDecl.name() }, new String[] {
- new String(type.shortReadableName()), fieldDecl.name() }, fieldDecl.sourceStart, fieldDecl.sourceEnd);
+ new String(type.shortReadableName()),
+ fieldDecl.name() }, fieldDecl.sourceStart, fieldDecl.sourceEnd);
}
// public void duplicateImport(ImportReference importRef) {
public void duplicateModifierForMethod(ReferenceBinding type, AbstractMethodDeclaration methodDecl) {
this.handle(IProblem.DuplicateModifierForMethod,
new String[] { new String(type.sourceName()), new String(methodDecl.selector) }, new String[] {
- new String(type.shortReadableName()), new String(methodDecl.selector) }, methodDecl.sourceStart, methodDecl.sourceEnd);
+ new String(type.shortReadableName()),
+ new String(methodDecl.selector) }, methodDecl.sourceStart, methodDecl.sourceEnd);
}
public void duplicateModifierForType(SourceTypeBinding type) {
}
public void duplicateSuperinterface(SourceTypeBinding type, TypeDeclaration typeDecl, ReferenceBinding superType) {
- this.handle(IProblem.DuplicateSuperInterface, new String[] { new String(superType.readableName()),
+ this.handle(IProblem.DuplicateSuperInterface, new String[] {
+ new String(superType.readableName()),
new String(type.sourceName()) }, new String[] { new String(superType.shortReadableName()), new String(type.sourceName()) },
typeDecl.sourceStart, typeDecl.sourceEnd);
}
shortBuffer.append(new String(params[i].shortReadableName()));
}
this.handle(recType.isArrayType() ? IProblem.NoMessageSendOnArrayType : IProblem.NoMessageSendOnBaseType, new String[] {
- new String(recType.readableName()), new String(messageSend.selector), buffer.toString() }, new String[] {
- new String(recType.shortReadableName()), new String(messageSend.selector), shortBuffer.toString() },
- messageSend.sourceStart, messageSend.sourceEnd);
+ new String(recType.readableName()),
+ new String(messageSend.selector),
+ buffer.toString() }, new String[] {
+ new String(recType.shortReadableName()),
+ new String(messageSend.selector),
+ shortBuffer.toString() }, messageSend.sourceStart, messageSend.sourceEnd);
}
public void errorThisSuperInStatic(ASTNode reference) {
return;
}
this.handle(id, new String[] { new String(methodDecl.selector), new String(expectedType.readableName()) }, new String[] {
- new String(methodDecl.selector), new String(expectedType.shortReadableName()) }, exceptionType.sourceStart,
- exceptionType.sourceEnd);
+ new String(methodDecl.selector),
+ new String(expectedType.shortReadableName()) }, exceptionType.sourceStart, exceptionType.sourceEnd);
}
public void expressionShouldBeAVariable(Expression expression) {
new String[] { new String(sourceType.sourceName()), shortTypeName }, start, end);
else
this.handle(IProblem.HierarchyCircularity, new String[] { new String(sourceType.sourceName()), typeName }, new String[] {
- new String(sourceType.sourceName()), shortTypeName }, start, end);
+ new String(sourceType.sourceName()),
+ shortTypeName }, start, end);
}
public void hierarchyHasProblems(SourceTypeBinding type) {
shortSignature.append(concreteMethod.declaringClass.shortReadableName()).append('.').append(concreteMethod.shortReadableName());
this.handle(
// The inherited method %1 cannot hide the public abstract method in %2
- IProblem.InheritedMethodReducesVisibility, new String[] { new String(concreteSignature.toString()),
- new String(abstractMethods[0].declaringClass.readableName()) }, new String[] { new String(shortSignature.toString()),
+ IProblem.InheritedMethodReducesVisibility, new String[] {
+ new String(concreteSignature.toString()),
+ new String(abstractMethods[0].declaringClass.readableName()) }, new String[] {
+ new String(shortSignature.toString()),
new String(abstractMethods[0].declaringClass.shortReadableName()) }, type.sourceStart(), type.sourceEnd());
}
// here...
break;
}
- this.handle(flag, new String[] { new String(targetConstructor.declaringClass.readableName()),
- parametersAsString(targetConstructor) }, new String[] { new String(targetConstructor.declaringClass.shortReadableName()),
+ this.handle(flag, new String[] {
+ new String(targetConstructor.declaringClass.readableName()),
+ parametersAsString(targetConstructor) }, new String[] {
+ new String(targetConstructor.declaringClass.shortReadableName()),
parametersAsShortString(targetConstructor) }, statement.sourceStart, statement.sourceEnd);
}
//NotVisibleField
//AmbiguousField
if (searchedType.isBaseType()) {
- this.handle(IProblem.NoFieldOnBaseType, new String[] { new String(searchedType.readableName()),
- CharOperation.toString(CharOperation.subarray(nameRef.tokens, 0, index)), new String(nameRef.tokens[index]) },
- new String[] { new String(searchedType.sourceName()),
- CharOperation.toString(CharOperation.subarray(nameRef.tokens, 0, index)), new String(nameRef.tokens[index]) },
- nameRef.sourceStart, nameRef.sourceEnd);
+ this.handle(IProblem.NoFieldOnBaseType, new String[] {
+ new String(searchedType.readableName()),
+ CharOperation.toString(CharOperation.subarray(nameRef.tokens, 0, index)),
+ new String(nameRef.tokens[index]) }, new String[] {
+ new String(searchedType.sourceName()),
+ CharOperation.toString(CharOperation.subarray(nameRef.tokens, 0, index)),
+ new String(nameRef.tokens[index]) }, nameRef.sourceStart, nameRef.sourceEnd);
return;
}
int flag = IProblem.UndefinedField;
parameterTypeShortNames = parameterTypeNames;
}
this.handle(IProblem.ParameterMismatch, new String[] {
- new String(problemMethod.closestMatch.declaringClass.readableName()), new String(problemMethod.closestMatch.selector),
- closestParameterTypeNames, parameterTypeNames }, new String[] {
+ new String(problemMethod.closestMatch.declaringClass.readableName()),
+ new String(problemMethod.closestMatch.selector),
+ closestParameterTypeNames,
+ parameterTypeNames }, new String[] {
new String(problemMethod.closestMatch.declaringClass.shortReadableName()),
- new String(problemMethod.closestMatch.selector), closestParameterTypeShortNames, parameterTypeShortNames },
- (int) (messageSend.nameSourcePosition >>> 32), (int) messageSend.nameSourcePosition);
+ new String(problemMethod.closestMatch.selector),
+ closestParameterTypeShortNames,
+ parameterTypeShortNames }, (int) (messageSend.nameSourcePosition >>> 32), (int) messageSend.nameSourcePosition);
return;
}
}
- this.handle(flag, new String[] { new String(method.declaringClass.readableName()), new String(method.selector),
- parametersAsString(method) }, new String[] { new String(method.declaringClass.shortReadableName()),
- new String(method.selector), parametersAsShortString(method) }, (int) (messageSend.nameSourcePosition >>> 32),
- (int) messageSend.nameSourcePosition);
+ this.handle(flag, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, (int) (messageSend.nameSourcePosition >>> 32), (int) messageSend.nameSourcePosition);
}
public void invalidNullToSynchronize(Expression expression) {
return;
}
this.handle(id, new String[] { new String(expectedType.readableName()), new String(type.sourceName()) }, new String[] {
- new String(expectedType.shortReadableName()), new String(type.sourceName()) }, superclassRef.sourceStart,
- superclassRef.sourceEnd);
+ new String(expectedType.shortReadableName()),
+ new String(type.sourceName()) }, superclassRef.sourceStart, superclassRef.sourceEnd);
}
public void invalidSuperinterface(SourceTypeBinding type, TypeReference superinterfaceRef, ReferenceBinding expectedType) {
return;
}
this.handle(id, new String[] { new String(expectedType.readableName()), new String(type.sourceName()) }, new String[] {
- new String(expectedType.shortReadableName()), new String(type.sourceName()) }, superinterfaceRef.sourceStart,
- superinterfaceRef.sourceEnd);
+ new String(expectedType.shortReadableName()),
+ new String(type.sourceName()) }, superinterfaceRef.sourceStart, superinterfaceRef.sourceEnd);
}
public void invalidType(ASTNode location, TypeBinding type) {
: compUnitDecl.sourceStart, compUnitDecl == null ? 1 : compUnitDecl.sourceEnd);
}
- public void javadocDuplicatedReturnTag(int sourceStart, int sourceEnd){
- this.handle(IProblem.JavadocDuplicateReturnTag, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocDeprecatedField(FieldBinding field, ASTNode location, int modifiers) {
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- this.handle(
- IProblem.JavadocUsingDeprecatedField,
- new String[] {new String(field.declaringClass.readableName()), new String(field.name)},
- new String[] {new String(field.declaringClass.shortReadableName()), new String(field.name)},
- location.sourceStart,
- location.sourceEnd);
- }
-}
-public void javadocDeprecatedMethod(MethodBinding method, ASTNode location, int modifiers) {
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- if (method.isConstructor()) {
- this.handle(
- IProblem.JavadocUsingDeprecatedConstructor,
- new String[] {new String(method.declaringClass.readableName()), parametersAsString(method)},
- new String[] {new String(method.declaringClass.shortReadableName()), parametersAsShortString(method)},
- location.sourceStart,
- location.sourceEnd);
- } else {
- this.handle(
- IProblem.JavadocUsingDeprecatedMethod,
- new String[] {new String(method.declaringClass.readableName()), new String(method.selector), parametersAsString(method)},
- new String[] {new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method)},
- location.sourceStart,
- location.sourceEnd);
- }
- }
-}
-public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) {
- if (location == null) return; // 1G828DN - no type ref for synthetic arguments
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- this.handle(
- IProblem.JavadocUsingDeprecatedType,
- new String[] {new String(type.readableName())},
- new String[] {new String(type.shortReadableName())},
- location.sourceStart,
- location.sourceEnd);
- }
-}
-//public void javadocDuplicatedParamTag(JavadocSingleNameReference param, int modifiers) {
-// if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
-// String[] arguments = new String[] {String.valueOf(param.token)};
-// this.handle(IProblem.JavadocDuplicateParamName, arguments, arguments, param.sourceStart, param.sourceEnd);
-// }
-//}
-public void javadocDuplicatedThrowsClassName(TypeReference typeReference, int modifiers) {
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] {String.valueOf(typeReference.resolvedType.sourceName())};
- this.handle(IProblem.JavadocDuplicateThrowsClassName, arguments, arguments, typeReference.sourceStart, typeReference.sourceEnd);
- }
-}
-public void javadocErrorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params, int modifiers) {
- StringBuffer buffer = new StringBuffer();
- StringBuffer shortBuffer = new StringBuffer();
- for (int i = 0, length = params.length; i < length; i++) {
- if (i != 0){
- buffer.append(", "); //$NON-NLS-1$
- shortBuffer.append(", "); //$NON-NLS-1$
- }
- buffer.append(new String(params[i].readableName()));
- shortBuffer.append(new String(params[i].shortReadableName()));
- }
-
- int id = recType.isArrayType() ? IProblem.JavadocNoMessageSendOnArrayType : IProblem.JavadocNoMessageSendOnBaseType;
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- this.handle(
- id,
- new String[] {new String(recType.readableName()), new String(messageSend.selector), buffer.toString()},
- new String[] {new String(recType.shortReadableName()), new String(messageSend.selector), shortBuffer.toString()},
- messageSend.sourceStart,
- messageSend.sourceEnd);
- }
-}
-public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) {
-
- if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- return;
- }
-// boolean insideDefaultConstructor =
-// (this.referenceContext instanceof ConstructorDeclaration)
-// && ((ConstructorDeclaration)this.referenceContext).isDefaultConstructor();
-// boolean insideImplicitConstructorCall =
-// (statement instanceof ExplicitConstructorCall)
-// && (((ExplicitConstructorCall) statement).accessMode == ExplicitConstructorCall.ImplicitSuper);
-
- int id = IProblem.JavadocUndefinedConstructor; //default...
- switch (targetConstructor.problemId()) {
- case NotFound :
-// if (insideDefaultConstructor){
-// id = IProblem.JavadocUndefinedConstructorInDefaultConstructor;
-// } else if (insideImplicitConstructorCall){
-// id = IProblem.JavadocUndefinedConstructorInImplicitConstructorCall;
-// } else {
- id = IProblem.JavadocUndefinedConstructor;
-// }
- break;
- case NotVisible :
-// if (insideDefaultConstructor){
-// id = IProblem.JavadocNotVisibleConstructorInDefaultConstructor;
-// } else if (insideImplicitConstructorCall){
-// id = IProblem.JavadocNotVisibleConstructorInImplicitConstructorCall;
-// } else {
- id = IProblem.JavadocNotVisibleConstructor;
-// }
- break;
- case Ambiguous :
-// if (insideDefaultConstructor){
-// id = IProblem.AmbiguousConstructorInDefaultConstructor;
-// } else if (insideImplicitConstructorCall){
-// id = IProblem.AmbiguousConstructorInImplicitConstructorCall;
-// } else {
- id = IProblem.JavadocAmbiguousConstructor;
-// }
- break;
- case NoError : // 0
- default :
- needImplementation(); // want to fail to see why we were here...
- break;
- }
-
- this.handle(
- id,
- new String[] {new String(targetConstructor.declaringClass.readableName()), parametersAsString(targetConstructor)},
- new String[] {new String(targetConstructor.declaringClass.shortReadableName()), parametersAsShortString(targetConstructor)},
- statement.sourceStart,
- statement.sourceEnd);
-}
-public void javadocAmbiguousMethodReference(int sourceStart, int sourceEnd, Binding fieldBinding, int modifiers) {
- int id = IProblem.JavadocAmbiguousMethodReference;
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] {new String(fieldBinding.readableName())};
- handle(id, arguments, arguments, sourceStart, sourceEnd);
- }
-}
-/*
- * Similar implementation than invalidField(FieldReference...)
- * Note that following problem id cannot occur for Javadoc:
- * - NonStaticReferenceInStaticContext :
- * - NonStaticReferenceInConstructorInvocation :
- * - ReceiverTypeNotVisible :
- */
-public void javadocInvalidField(int sourceStart, int sourceEnd, Binding fieldBinding, TypeBinding searchedType, int modifiers) {
- int id = IProblem.JavadocUndefinedField;
- switch (fieldBinding.problemId()) {
- case NotFound :
- id = IProblem.JavadocUndefinedField;
- break;
- case NotVisible :
- id = IProblem.JavadocNotVisibleField;
- break;
- case Ambiguous :
- id = IProblem.JavadocAmbiguousField;
- break;
- case InheritedNameHidesEnclosingName :
- id = IProblem.JavadocInheritedFieldHidesEnclosingName;
- break;
- case NoError : // 0
- default :
- needImplementation(); // want to fail to see why we were here...
- break;
- }
-
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] {new String(fieldBinding.readableName())};
- handle(id, arguments, arguments, sourceStart, sourceEnd);
- }
-}
-/*
- * Similar implementation than invalidMethod(MessageSend...)
- * Note that following problem id cannot occur for Javadoc:
- * - NonStaticReferenceInStaticContext :
- * - NonStaticReferenceInConstructorInvocation :
- * - ReceiverTypeNotVisible :
- */
-public void javadocInvalidMethod(MessageSend messageSend, MethodBinding method, int modifiers) {
- if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- return;
- }
- int id = IProblem.JavadocUndefinedMethod; //default...
- switch (method.problemId()) {
- case NotFound :
- id = IProblem.JavadocUndefinedMethod;
- break;
- case NotVisible :
- id = IProblem.JavadocNotVisibleMethod;
- break;
- case Ambiguous :
- id = IProblem.JavadocAmbiguousMethod;
- break;
- case InheritedNameHidesEnclosingName :
- id = IProblem.JavadocInheritedMethodHidesEnclosingName;
- break;
- case NoError : // 0
- default :
- needImplementation(); // want to fail to see why we were here...
- break;
- }
-
- if (id == IProblem.JavadocUndefinedMethod) {
- ProblemMethodBinding problemMethod = (ProblemMethodBinding) method;
- if (problemMethod.closestMatch != null) {
- String closestParameterTypeNames = parametersAsString(problemMethod.closestMatch);
- String parameterTypeNames = parametersAsString(method);
- String closestParameterTypeShortNames = parametersAsShortString(problemMethod.closestMatch);
- String parameterTypeShortNames = parametersAsShortString(method);
- if (closestParameterTypeShortNames.equals(parameterTypeShortNames)){
- closestParameterTypeShortNames = closestParameterTypeNames;
- parameterTypeShortNames = parameterTypeNames;
- }
- this.handle(
- IProblem.JavadocParameterMismatch,
- new String[] {
- new String(problemMethod.closestMatch.declaringClass.readableName()),
- new String(problemMethod.closestMatch.selector),
- closestParameterTypeNames,
- parameterTypeNames
- },
- new String[] {
- new String(problemMethod.closestMatch.declaringClass.shortReadableName()),
- new String(problemMethod.closestMatch.selector),
- closestParameterTypeShortNames,
- parameterTypeShortNames
- },
- (int) (messageSend.nameSourcePosition >>> 32),
- (int) messageSend.nameSourcePosition);
- return;
- }
- }
-
- this.handle(
- id,
- new String[] {
- new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method)},
- new String[] {
- new String(method.declaringClass.shortReadableName()),
- new String(method.selector), parametersAsShortString(method)},
- (int) (messageSend.nameSourcePosition >>> 32),
- (int) messageSend.nameSourcePosition);
-}
-//public void javadocInvalidParamName(JavadocSingleNameReference param, int modifiers) {
-// if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
-// String[] arguments = new String[] {String.valueOf(param.token)};
-// this.handle(IProblem.JavadocInvalidParamName, arguments, arguments, param.sourceStart, param.sourceEnd);
-// }
-//}
-public void javadocInvalidSeeReference(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocInvalidSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocInvalidSeeReferenceArgs(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocInvalidSeeArgs, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocInvalidSeeUrlReference(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocInvalidSeeHref, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocInvalidTag(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocInvalidTag, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocInvalidThrowsClass(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocInvalidThrowsClass, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocInvalidThrowsClassName(TypeReference typeReference, int modifiers) {
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] {String.valueOf(typeReference.resolvedType.sourceName())};
- this.handle(IProblem.JavadocInvalidThrowsClassName, arguments, arguments, typeReference.sourceStart, typeReference.sourceEnd);
- }
-}
-public void javadocInvalidType(ASTNode location, TypeBinding type, int modifiers) {
- if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- int id = IProblem.JavadocUndefinedType; // default
- switch (type.problemId()) {
- case NotFound :
- id = IProblem.JavadocUndefinedType;
- break;
- case NotVisible :
- id = IProblem.JavadocNotVisibleType;
- break;
- case Ambiguous :
- id = IProblem.JavadocAmbiguousType;
- break;
- case InternalNameProvided :
- id = IProblem.JavadocInternalTypeNameProvided;
- break;
- case InheritedNameHidesEnclosingName :
- id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
- break;
- case NoError : // 0
- default :
- needImplementation(); // want to fail to see why we were here...
- break;
- }
- this.handle(
- id,
- new String[] {new String(type.readableName())},
- new String[] {new String(type.shortReadableName())},
- location.sourceStart,
- location.sourceEnd);
- }
-}
-public void javadocMalformedSeeReference(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocMalformedSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocMissing(int sourceStart, int sourceEnd, int modifiers){
- boolean overriding = (modifiers & (CompilerModifiers.AccImplementing+CompilerModifiers.AccOverriding)) != 0;
- boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocComments) != ProblemSeverities.Ignore)
- && (!overriding || this.options.reportMissingJavadocCommentsOverriding);
- if (report) {
- String arg = javadocVisibilityArgument(this.options.reportMissingJavadocCommentsVisibility, modifiers);
- if (arg != null) {
- String[] arguments = new String[] { arg };
- this.handle(IProblem.JavadocMissing, arguments, arguments, sourceStart, sourceEnd);
- }
- }
-}
-public void javadocMissingParamName(int sourceStart, int sourceEnd){
- this.handle(IProblem.JavadocMissingParamName, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocMissingParamTag(Argument param, int modifiers) {
- boolean overriding = (modifiers & (CompilerModifiers.AccImplementing+CompilerModifiers.AccOverriding)) != 0;
- boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
- && (!overriding || this.options.reportMissingJavadocTagsOverriding);
- if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] { String.valueOf(param.name) };
- this.handle(IProblem.JavadocMissingParamTag, arguments, arguments, param.sourceStart, param.sourceEnd);
- }
-}
-public void javadocMissingReturnTag(int sourceStart, int sourceEnd, int modifiers){
- boolean overriding = (modifiers & (CompilerModifiers.AccImplementing+CompilerModifiers.AccOverriding)) != 0;
- boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
- && (!overriding || this.options.reportMissingJavadocTagsOverriding);
- if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
- this.handle(IProblem.JavadocMissingReturnTag, NoArgument, NoArgument, sourceStart, sourceEnd);
- }
-}
-public void javadocMissingSeeReference(int sourceStart, int sourceEnd){
- this.handle(IProblem.JavadocMissingSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocMissingThrowsClassName(int sourceStart, int sourceEnd){
- this.handle(IProblem.JavadocMissingThrowsClassName, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocMissingThrowsTag(TypeReference typeRef, int modifiers){
- boolean overriding = (modifiers & (CompilerModifiers.AccImplementing+CompilerModifiers.AccOverriding)) != 0;
- boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
- && (!overriding || this.options.reportMissingJavadocTagsOverriding);
- if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
- String[] arguments = new String[] { String.valueOf(typeRef.resolvedType.sourceName()) };
- this.handle(IProblem.JavadocMissingThrowsTag, arguments, arguments, typeRef.sourceStart, typeRef.sourceEnd);
- }
-}
-public void javadocUnexpectedTag(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocUnexpectedTag, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-public void javadocUnterminatedInlineTag(int sourceStart, int sourceEnd) {
- this.handle(IProblem.JavadocUnterminatedInlineTag, NoArgument, NoArgument, sourceStart, sourceEnd);
-}
-private boolean javadocVisibility(int visibility, int modifiers) {
- switch (modifiers & CompilerModifiers.AccVisibilityMASK) {
- case IConstants.AccPublic :
- return true;
- case IConstants.AccProtected:
- return (visibility != IConstants.AccPublic);
-// case IConstants.AccDefault:
-// return (visibility == IConstants.AccDefault || visibility == IConstants.AccPrivate);
- case IConstants.AccPrivate:
- return (visibility == IConstants.AccPrivate);
- }
- return true;
-}
-private String javadocVisibilityArgument(int visibility, int modifiers) {
- String argument = null;
- switch (modifiers & CompilerModifiers.AccVisibilityMASK) {
- case IConstants.AccPublic :
- argument = CompilerOptions.PUBLIC;
- break;
- case IConstants.AccProtected:
- if (visibility != IConstants.AccPublic) {
- argument = CompilerOptions.PROTECTED;
- }
- break;
-// case IConstants.AccDefault:
-// if (visibility == IConstants.AccDefault || visibility == IConstants.AccPrivate) {
-// argument = CompilerOptions.DEFAULT;
-// }
-// break;
- case IConstants.AccPrivate:
- if (visibility == IConstants.AccPrivate) {
- argument = CompilerOptions.PRIVATE;
- }
- break;
- }
- return argument;
-}
+ public void javadocDuplicatedReturnTag(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocDuplicateReturnTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocDeprecatedField(FieldBinding field, ASTNode location, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocUsingDeprecatedField, new String[] {
+ new String(field.declaringClass.readableName()),
+ new String(field.name) }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name) },
+ location.sourceStart, location.sourceEnd);
+ }
+ }
+
+ public void javadocDeprecatedMethod(MethodBinding method, ASTNode location, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ if (method.isConstructor()) {
+ this.handle(IProblem.JavadocUsingDeprecatedConstructor, new String[] {
+ new String(method.declaringClass.readableName()),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
+ } else {
+ this.handle(IProblem.JavadocUsingDeprecatedMethod, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
+ }
+ }
+ }
+
+ public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) {
+ if (location == null)
+ return; // 1G828DN - no type ref for synthetic arguments
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocUsingDeprecatedType, new String[] { new String(type.readableName()) }, new String[] { new String(
+ type.shortReadableName()) }, location.sourceStart, location.sourceEnd);
+ }
+ }
+
+ //public void javadocDuplicatedParamTag(JavadocSingleNameReference param, int modifiers) {
+ // if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ // String[] arguments = new String[] {String.valueOf(param.token)};
+ // this.handle(IProblem.JavadocDuplicateParamName, arguments, arguments, param.sourceStart, param.sourceEnd);
+ // }
+ //}
+ public void javadocDuplicatedThrowsClassName(TypeReference typeReference, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { String.valueOf(typeReference.resolvedType.sourceName()) };
+ this.handle(IProblem.JavadocDuplicateThrowsClassName, arguments, arguments, typeReference.sourceStart,
+ typeReference.sourceEnd);
+ }
+ }
+
+ public void javadocErrorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params, int modifiers) {
+ StringBuffer buffer = new StringBuffer();
+ StringBuffer shortBuffer = new StringBuffer();
+ for (int i = 0, length = params.length; i < length; i++) {
+ if (i != 0) {
+ buffer.append(", "); //$NON-NLS-1$
+ shortBuffer.append(", "); //$NON-NLS-1$
+ }
+ buffer.append(new String(params[i].readableName()));
+ shortBuffer.append(new String(params[i].shortReadableName()));
+ }
+
+ int id = recType.isArrayType() ? IProblem.JavadocNoMessageSendOnArrayType : IProblem.JavadocNoMessageSendOnBaseType;
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(id, new String[] { new String(recType.readableName()), new String(messageSend.selector), buffer.toString() },
+ new String[] { new String(recType.shortReadableName()), new String(messageSend.selector), shortBuffer.toString() },
+ messageSend.sourceStart, messageSend.sourceEnd);
+ }
+ }
+
+ public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) {
+
+ if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ return;
+ }
+ // boolean insideDefaultConstructor =
+ // (this.referenceContext instanceof ConstructorDeclaration)
+ // && ((ConstructorDeclaration)this.referenceContext).isDefaultConstructor();
+ // boolean insideImplicitConstructorCall =
+ // (statement instanceof ExplicitConstructorCall)
+ // && (((ExplicitConstructorCall) statement).accessMode == ExplicitConstructorCall.ImplicitSuper);
+
+ int id = IProblem.JavadocUndefinedConstructor; //default...
+ switch (targetConstructor.problemId()) {
+ case NotFound:
+ // if (insideDefaultConstructor){
+ // id = IProblem.JavadocUndefinedConstructorInDefaultConstructor;
+ // } else if (insideImplicitConstructorCall){
+ // id = IProblem.JavadocUndefinedConstructorInImplicitConstructorCall;
+ // } else {
+ id = IProblem.JavadocUndefinedConstructor;
+ // }
+ break;
+ case NotVisible:
+ // if (insideDefaultConstructor){
+ // id = IProblem.JavadocNotVisibleConstructorInDefaultConstructor;
+ // } else if (insideImplicitConstructorCall){
+ // id = IProblem.JavadocNotVisibleConstructorInImplicitConstructorCall;
+ // } else {
+ id = IProblem.JavadocNotVisibleConstructor;
+ // }
+ break;
+ case Ambiguous:
+ // if (insideDefaultConstructor){
+ // id = IProblem.AmbiguousConstructorInDefaultConstructor;
+ // } else if (insideImplicitConstructorCall){
+ // id = IProblem.AmbiguousConstructorInImplicitConstructorCall;
+ // } else {
+ id = IProblem.JavadocAmbiguousConstructor;
+ // }
+ break;
+ case NoError: // 0
+ default:
+ needImplementation(); // want to fail to see why we were here...
+ break;
+ }
+
+ this.handle(id, new String[] {
+ new String(targetConstructor.declaringClass.readableName()),
+ parametersAsString(targetConstructor) }, new String[] {
+ new String(targetConstructor.declaringClass.shortReadableName()),
+ parametersAsShortString(targetConstructor) }, statement.sourceStart, statement.sourceEnd);
+ }
+
+ public void javadocAmbiguousMethodReference(int sourceStart, int sourceEnd, Binding fieldBinding, int modifiers) {
+ int id = IProblem.JavadocAmbiguousMethodReference;
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { new String(fieldBinding.readableName()) };
+ handle(id, arguments, arguments, sourceStart, sourceEnd);
+ }
+ }
+
+ /*
+ * Similar implementation than invalidField(FieldReference...) Note that following problem id cannot occur for Javadoc: -
+ * NonStaticReferenceInStaticContext : - NonStaticReferenceInConstructorInvocation : - ReceiverTypeNotVisible :
+ */
+ public void javadocInvalidField(int sourceStart, int sourceEnd, Binding fieldBinding, TypeBinding searchedType, int modifiers) {
+ int id = IProblem.JavadocUndefinedField;
+ switch (fieldBinding.problemId()) {
+ case NotFound:
+ id = IProblem.JavadocUndefinedField;
+ break;
+ case NotVisible:
+ id = IProblem.JavadocNotVisibleField;
+ break;
+ case Ambiguous:
+ id = IProblem.JavadocAmbiguousField;
+ break;
+ case InheritedNameHidesEnclosingName:
+ id = IProblem.JavadocInheritedFieldHidesEnclosingName;
+ break;
+ case NoError: // 0
+ default:
+ needImplementation(); // want to fail to see why we were here...
+ break;
+ }
+
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { new String(fieldBinding.readableName()) };
+ handle(id, arguments, arguments, sourceStart, sourceEnd);
+ }
+ }
+
+ /*
+ * Similar implementation than invalidMethod(MessageSend...) Note that following problem id cannot occur for Javadoc: -
+ * NonStaticReferenceInStaticContext : - NonStaticReferenceInConstructorInvocation : - ReceiverTypeNotVisible :
+ */
+ public void javadocInvalidMethod(MessageSend messageSend, MethodBinding method, int modifiers) {
+ if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ return;
+ }
+ int id = IProblem.JavadocUndefinedMethod; //default...
+ switch (method.problemId()) {
+ case NotFound:
+ id = IProblem.JavadocUndefinedMethod;
+ break;
+ case NotVisible:
+ id = IProblem.JavadocNotVisibleMethod;
+ break;
+ case Ambiguous:
+ id = IProblem.JavadocAmbiguousMethod;
+ break;
+ case InheritedNameHidesEnclosingName:
+ id = IProblem.JavadocInheritedMethodHidesEnclosingName;
+ break;
+ case NoError: // 0
+ default:
+ needImplementation(); // want to fail to see why we were here...
+ break;
+ }
+
+ if (id == IProblem.JavadocUndefinedMethod) {
+ ProblemMethodBinding problemMethod = (ProblemMethodBinding) method;
+ if (problemMethod.closestMatch != null) {
+ String closestParameterTypeNames = parametersAsString(problemMethod.closestMatch);
+ String parameterTypeNames = parametersAsString(method);
+ String closestParameterTypeShortNames = parametersAsShortString(problemMethod.closestMatch);
+ String parameterTypeShortNames = parametersAsShortString(method);
+ if (closestParameterTypeShortNames.equals(parameterTypeShortNames)) {
+ closestParameterTypeShortNames = closestParameterTypeNames;
+ parameterTypeShortNames = parameterTypeNames;
+ }
+ this.handle(IProblem.JavadocParameterMismatch, new String[] {
+ new String(problemMethod.closestMatch.declaringClass.readableName()),
+ new String(problemMethod.closestMatch.selector),
+ closestParameterTypeNames,
+ parameterTypeNames }, new String[] {
+ new String(problemMethod.closestMatch.declaringClass.shortReadableName()),
+ new String(problemMethod.closestMatch.selector),
+ closestParameterTypeShortNames,
+ parameterTypeShortNames }, (int) (messageSend.nameSourcePosition >>> 32), (int) messageSend.nameSourcePosition);
+ return;
+ }
+ }
+
+ this.handle(id, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, (int) (messageSend.nameSourcePosition >>> 32), (int) messageSend.nameSourcePosition);
+ }
+
+ //public void javadocInvalidParamName(JavadocSingleNameReference param, int modifiers) {
+ // if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ // String[] arguments = new String[] {String.valueOf(param.token)};
+ // this.handle(IProblem.JavadocInvalidParamName, arguments, arguments, param.sourceStart, param.sourceEnd);
+ // }
+ //}
+ public void javadocInvalidSeeReference(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocInvalidSeeReferenceArgs(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidSeeArgs, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocInvalidSeeUrlReference(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidSeeHref, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocInvalidTag(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocInvalidThrowsClass(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidThrowsClass, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocInvalidThrowsClassName(TypeReference typeReference, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { String.valueOf(typeReference.resolvedType.sourceName()) };
+ this.handle(IProblem.JavadocInvalidThrowsClassName, arguments, arguments, typeReference.sourceStart, typeReference.sourceEnd);
+ }
+ }
+
+ public void javadocInvalidType(ASTNode location, TypeBinding type, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ int id = IProblem.JavadocUndefinedType; // default
+ switch (type.problemId()) {
+ case NotFound:
+ id = IProblem.JavadocUndefinedType;
+ break;
+ case NotVisible:
+ id = IProblem.JavadocNotVisibleType;
+ break;
+ case Ambiguous:
+ id = IProblem.JavadocAmbiguousType;
+ break;
+ case InternalNameProvided:
+ id = IProblem.JavadocInternalTypeNameProvided;
+ break;
+ case InheritedNameHidesEnclosingName:
+ id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
+ break;
+ case NoError: // 0
+ default:
+ needImplementation(); // want to fail to see why we were here...
+ break;
+ }
+ this.handle(id, new String[] { new String(type.readableName()) }, new String[] { new String(type.shortReadableName()) },
+ location.sourceStart, location.sourceEnd);
+ }
+ }
+
+ public void javadocMalformedSeeReference(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocMalformedSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocMissing(int sourceStart, int sourceEnd, int modifiers) {
+ boolean overriding = (modifiers & (CompilerModifiers.AccImplementing + CompilerModifiers.AccOverriding)) != 0;
+ boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocComments) != ProblemSeverities.Ignore)
+ && (!overriding || this.options.reportMissingJavadocCommentsOverriding);
+ if (report) {
+ String arg = javadocVisibilityArgument(this.options.reportMissingJavadocCommentsVisibility, modifiers);
+ if (arg != null) {
+ String[] arguments = new String[] { arg };
+ this.handle(IProblem.JavadocMissing, arguments, arguments, sourceStart, sourceEnd);
+ }
+ }
+ }
+
+ public void javadocMissingParamName(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocMissingParamName, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocMissingParamTag(Argument param, int modifiers) {
+ boolean overriding = (modifiers & (CompilerModifiers.AccImplementing + CompilerModifiers.AccOverriding)) != 0;
+ boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
+ && (!overriding || this.options.reportMissingJavadocTagsOverriding);
+ if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { String.valueOf(param.name) };
+ this.handle(IProblem.JavadocMissingParamTag, arguments, arguments, param.sourceStart, param.sourceEnd);
+ }
+ }
+
+ public void javadocMissingReturnTag(int sourceStart, int sourceEnd, int modifiers) {
+ boolean overriding = (modifiers & (CompilerModifiers.AccImplementing + CompilerModifiers.AccOverriding)) != 0;
+ boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
+ && (!overriding || this.options.reportMissingJavadocTagsOverriding);
+ if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocMissingReturnTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+ }
+
+ public void javadocMissingSeeReference(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocMissingSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocMissingThrowsClassName(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocMissingThrowsClassName, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocMissingThrowsTag(TypeReference typeRef, int modifiers) {
+ boolean overriding = (modifiers & (CompilerModifiers.AccImplementing + CompilerModifiers.AccOverriding)) != 0;
+ boolean report = (this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore)
+ && (!overriding || this.options.reportMissingJavadocTagsOverriding);
+ if (report && javadocVisibility(this.options.reportMissingJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] { String.valueOf(typeRef.resolvedType.sourceName()) };
+ this.handle(IProblem.JavadocMissingThrowsTag, arguments, arguments, typeRef.sourceStart, typeRef.sourceEnd);
+ }
+ }
+
+ public void javadocUnexpectedTag(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocUnexpectedTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ public void javadocUnterminatedInlineTag(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocUnterminatedInlineTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+
+ private boolean javadocVisibility(int visibility, int modifiers) {
+ switch (modifiers & CompilerModifiers.AccVisibilityMASK) {
+ case IConstants.AccPublic:
+ return true;
+ case IConstants.AccProtected:
+ return (visibility != IConstants.AccPublic);
+ // case IConstants.AccDefault:
+ // return (visibility == IConstants.AccDefault || visibility == IConstants.AccPrivate);
+ case IConstants.AccPrivate:
+ return (visibility == IConstants.AccPrivate);
+ }
+ return true;
+ }
+
+ private String javadocVisibilityArgument(int visibility, int modifiers) {
+ String argument = null;
+ switch (modifiers & CompilerModifiers.AccVisibilityMASK) {
+ case IConstants.AccPublic:
+ argument = CompilerOptions.PUBLIC;
+ break;
+ case IConstants.AccProtected:
+ if (visibility != IConstants.AccPublic) {
+ argument = CompilerOptions.PROTECTED;
+ }
+ break;
+ // case IConstants.AccDefault:
+ // if (visibility == IConstants.AccDefault || visibility == IConstants.AccPrivate) {
+ // argument = CompilerOptions.DEFAULT;
+ // }
+ // break;
+ case IConstants.AccPrivate:
+ if (visibility == IConstants.AccPrivate) {
+ argument = CompilerOptions.PRIVATE;
+ }
+ break;
+ }
+ return argument;
+ }
public void methodNeedingAbstractModifier(MethodDeclaration methodDecl) {
this.handle(IProblem.MethodRequiresBody, NoArgument, NoArgument, methodDecl.sourceStart, methodDecl.sourceEnd);
}
public void mustUseAStaticMethod(MessageSend messageSend, MethodBinding method) {
- this.handle(IProblem.StaticMethodRequested, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- messageSend.sourceStart, messageSend.sourceEnd);
+ this.handle(IProblem.StaticMethodRequested, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, messageSend.sourceStart, messageSend.sourceEnd);
}
public void nativeMethodsCannotBeStrictfp(ReferenceBinding type, AbstractMethodDeclaration methodDecl) {
}
public void needToEmulateFieldReadAccess(FieldBinding field, ASTNode location) {
- this.handle(IProblem.NeedToEmulateFieldReadAccess, new String[] { new String(field.declaringClass.readableName()),
+ this.handle(IProblem.NeedToEmulateFieldReadAccess, new String[] {
+ new String(field.declaringClass.readableName()),
new String(field.name) }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name) },
location.sourceStart, location.sourceEnd);
}
public void needToEmulateFieldWriteAccess(FieldBinding field, ASTNode location) {
- this.handle(IProblem.NeedToEmulateFieldWriteAccess, new String[] { new String(field.declaringClass.readableName()),
+ this.handle(IProblem.NeedToEmulateFieldWriteAccess, new String[] {
+ new String(field.declaringClass.readableName()),
new String(field.name) }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name) },
location.sourceStart, location.sourceEnd);
}
public void needToEmulateMethodAccess(MethodBinding method, ASTNode location) {
if (method.isConstructor())
- this.handle(IProblem.NeedToEmulateConstructorAccess, new String[] { new String(method.declaringClass.readableName()),
- parametersAsString(method) }, new String[] { new String(method.declaringClass.shortReadableName()),
+ this.handle(IProblem.NeedToEmulateConstructorAccess, new String[] {
+ new String(method.declaringClass.readableName()),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
else
- this.handle(IProblem.NeedToEmulateMethodAccess, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- location.sourceStart, location.sourceEnd);
+ this.handle(IProblem.NeedToEmulateMethodAccess, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
}
public void nestedClassCannotDeclareInterface(TypeDeclaration typeDecl) {
leftShortName = leftName;
rightShortName = rightName;
}
- this.handle(IProblem.IncompatibleTypesInEqualityOperator, new String[] { leftName, rightName }, new String[] { leftShortName,
+ this.handle(IProblem.IncompatibleTypesInEqualityOperator, new String[] { leftName, rightName }, new String[] {
+ leftShortName,
rightShortName }, expression.sourceStart, expression.sourceEnd);
}
rightShortName = rightName;
}
this.handle(IProblem.IncompatibleTypesInConditionalOperator, new String[] { leftName, rightName }, new String[] {
- leftShortName, rightShortName }, expression.sourceStart, expression.sourceEnd);
+ leftShortName,
+ rightShortName }, expression.sourceStart, expression.sourceEnd);
}
public void objectCannotHaveSuperTypes(SourceTypeBinding type) {
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) {
this.handle(IProblem.RecursiveConstructorInvocation, new String[] {
- new String(constructorCall.binding.declaringClass.readableName()), parametersAsString(constructorCall.binding) },
- new String[] { new String(constructorCall.binding.declaringClass.shortReadableName()),
- parametersAsShortString(constructorCall.binding) }, constructorCall.sourceStart, constructorCall.sourceEnd);
+ new String(constructorCall.binding.declaringClass.readableName()),
+ parametersAsString(constructorCall.binding) }, new String[] {
+ new String(constructorCall.binding.declaringClass.shortReadableName()),
+ parametersAsShortString(constructorCall.binding) }, constructorCall.sourceStart, constructorCall.sourceEnd);
}
public void redefineArgument(Argument arg) {
return;
}
this.handle(id, new String[] { new String(methodDecl.selector), new String(expectedType.readableName()) }, new String[] {
- new String(methodDecl.selector), new String(expectedType.shortReadableName()) }, methodDecl.returnType.sourceStart,
- methodDecl.returnType.sourceEnd);
+ new String(methodDecl.selector),
+ new String(expectedType.shortReadableName()) }, methodDecl.returnType.sourceStart, methodDecl.returnType.sourceEnd);
}
public void scannerError(Parser parser, String errorTokenName) {
// 8.4.6.4 - If a class inherits more than one method with the
// same signature it is an error for one to be static
// (non-abstract) and the other abstract.
- IProblem.StaticInheritedMethodConflicts, new String[] { new String(concreteMethod.readableName()),
+ IProblem.StaticInheritedMethodConflicts, new String[] {
+ new String(concreteMethod.readableName()),
new String(abstractMethods[0].declaringClass.readableName()) }, new String[] {
- new String(concreteMethod.readableName()), new String(abstractMethods[0].declaringClass.shortReadableName()) }, type
- .sourceStart(), type.sourceEnd());
+ new String(concreteMethod.readableName()),
+ new String(abstractMethods[0].declaringClass.shortReadableName()) }, type.sourceStart(), type.sourceEnd());
}
public void stringConstantIsExceedingUtf8Limit(ASTNode location) {
public void superclassMustBeAClass(SourceTypeBinding type, TypeReference superclassRef, ReferenceBinding superType) {
this.handle(IProblem.SuperclassMustBeAClass,
new String[] { new String(superType.readableName()), new String(type.sourceName()) }, new String[] {
- new String(superType.shortReadableName()), new String(type.sourceName()) }, superclassRef.sourceStart,
- superclassRef.sourceEnd);
+ new String(superType.shortReadableName()),
+ new String(type.sourceName()) }, superclassRef.sourceStart, superclassRef.sourceEnd);
}
public void superinterfaceMustBeAnInterface(SourceTypeBinding type, TypeDeclaration typeDecl, ReferenceBinding superType) {
- this.handle(IProblem.SuperInterfaceMustBeAnInterface, new String[] { new String(superType.readableName()),
+ this.handle(IProblem.SuperInterfaceMustBeAnInterface, new String[] {
+ new String(superType.readableName()),
new String(type.sourceName()) }, new String[] { new String(superType.shortReadableName()), new String(type.sourceName()) },
typeDecl.sourceStart, typeDecl.sourceEnd);
}
resultTypeShortName = resultTypeName;
expectedTypeShortName = expectedTypeName;
}
- this.handle(IProblem.TypeMismatch, new String[] { resultTypeName, expectedTypeName }, new String[] { resultTypeShortName,
+ this.handle(IProblem.TypeMismatch, new String[] { resultTypeName, expectedTypeName }, new String[] {
+ resultTypeShortName,
expectedTypeShortName }, location.sourceStart, location.sourceEnd);
}
constantTypeShortName = constantTypeName;
expectedTypeShortName = expectedTypeName;
}
- this.handle(IProblem.TypeMismatch, new String[] { constantTypeName, expectedTypeName }, new String[] { constantTypeShortName,
+ this.handle(IProblem.TypeMismatch, new String[] { constantTypeName, expectedTypeName }, new String[] {
+ constantTypeShortName,
expectedTypeShortName }, expression.sourceStart, expression.sourceEnd);
}
-// public void undefinedLabel(BranchStatement statement) {
-// String[] arguments = new String[] { new String(statement.label) };
-// this.handle(IProblem.UndefinedLabel, arguments, arguments, statement.sourceStart, statement.sourceEnd);
-// }
+ // public void undefinedLabel(BranchStatement statement) {
+ // String[] arguments = new String[] { new String(statement.label) };
+ // this.handle(IProblem.UndefinedLabel, arguments, arguments, statement.sourceStart, statement.sourceEnd);
+ // }
public void unexpectedStaticModifierForField(SourceTypeBinding type, FieldDeclaration fieldDecl) {
String[] arguments = new String[] { fieldDecl.name() };
this.handle(IProblem.UninitializedBlankFinalField, arguments, arguments, location.sourceStart, location.sourceEnd);
}
- public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location) {
- String[] arguments = new String[] { new String(binding.readableName()) };
- this.handle(IProblem.UninitializedLocalVariable, arguments, arguments, location.sourceStart, location.sourceEnd);
- }
-
public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
this.handle(IProblem.UnmatchedBracket, NoArgument, NoArgument, position, position, context, compilationResult);
}
}
public void unnecessaryReceiverForStaticMethod(ASTNode location, MethodBinding method) {
- this.handle(IProblem.NonStaticAccessToStaticMethod, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- location.sourceStart, location.sourceEnd);
+ this.handle(IProblem.NonStaticAccessToStaticMethod, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, location.sourceStart, location.sourceEnd);
}
public void unnecessaryReceiverForStaticField(ASTNode location, FieldBinding field) {
- this.handle(IProblem.NonStaticAccessToStaticField, new String[] { new String(field.declaringClass.readableName()),
+ this.handle(IProblem.NonStaticAccessToStaticField, new String[] {
+ new String(field.declaringClass.readableName()),
new String(field.name) }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name) },
location.sourceStart, location.sourceEnd);
}
- public void unreachableCode(Statement statement) {
- this.handle(IProblem.CodeCannotBeReached, NoArgument, NoArgument, statement.sourceStart, statement.sourceEnd);
- }
-
public void unreachableExceptionHandler(ReferenceBinding exceptionType, ASTNode location) {
this.handle(IProblem.UnreachableCatch, NoArgument, NoArgument, location.sourceStart, location.sourceEnd);
}
if (constructorDecl.arguments == null || constructorDecl.arguments.length == 0)
return;
MethodBinding constructor = constructorDecl.binding;
- this.handle(IProblem.UnusedPrivateConstructor, new String[] { new String(constructor.declaringClass.readableName()),
- parametersAsString(constructor) }, new String[] { new String(constructor.declaringClass.shortReadableName()),
+ this.handle(IProblem.UnusedPrivateConstructor, new String[] {
+ new String(constructor.declaringClass.readableName()),
+ parametersAsString(constructor) }, new String[] {
+ new String(constructor.declaringClass.shortReadableName()),
parametersAsShortString(constructor) }, constructorDecl.sourceStart, constructorDecl.sourceEnd);
}
&& TypeBinding.LongBinding == field.type) {
return; // do not report unused serialVersionUID field
}
- this.handle(IProblem.UnusedPrivateField, new String[] { new String(field.declaringClass.readableName()),
+ this.handle(IProblem.UnusedPrivateField, new String[] {
+ new String(field.declaringClass.readableName()),
new String(field.name), }, new String[] { new String(field.declaringClass.shortReadableName()), new String(field.name), },
fieldDecl.sourceStart, fieldDecl.sourceEnd);
}
&& CharOperation.equals(method.selector, TypeConstants.WRITEREPLACE)) {
return;
}
- this.handle(IProblem.UnusedPrivateMethod, new String[] { new String(method.declaringClass.readableName()),
- new String(method.selector), parametersAsString(method) }, new String[] {
- new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method) },
- methodDecl.sourceStart, methodDecl.sourceEnd);
+ this.handle(IProblem.UnusedPrivateMethod, new String[] {
+ new String(method.declaringClass.readableName()),
+ new String(method.selector),
+ parametersAsString(method) }, new String[] {
+ new String(method.declaringClass.shortReadableName()),
+ new String(method.selector),
+ parametersAsShortString(method) }, methodDecl.sourceStart, methodDecl.sourceEnd);
}
public void unusedPrivateType(TypeDeclaration typeDecl) {
compilationResult);
}
- public void phpIncludeNotExistWarning(String[] messageArguments, int problemStartPosition, int problemEndPosition, ReferenceContext context,
- CompilationResult compilationResult) {
+ public void phpIncludeNotExistWarning(String[] messageArguments, int problemStartPosition, int problemEndPosition,
+ ReferenceContext context, CompilationResult compilationResult) {
if (computeSeverity(IProblem.PHPIncludeNotExistWarning) == Ignore)
return;
- this.handle(IProblem.PHPIncludeNotExistWarning, NoArgument, messageArguments, problemStartPosition, problemEndPosition, context,
- compilationResult);
+ this.handle(IProblem.PHPIncludeNotExistWarning, NoArgument, messageArguments, problemStartPosition, problemEndPosition,
+ context, compilationResult);
}
public void phpKeywordWarning(String[] messageArguments, int problemStartPosition, int problemEndPosition,
this.handle(IProblem.PHPBadStyleUppercaseIdentifierWarning, NoArgument, new String[] {}, problemStartPosition,
problemEndPosition, context, compilationResult);
}
+
+ public void uninitializedLocalVariable(String token, int problemStartPosition, int problemEndPosition, ReferenceContext context,
+ CompilationResult compilationResult) {
+ if (computeSeverity(IProblem.UninitializedLocalVariable) == Ignore)
+ return;
+ // String[] arguments = new String[] { new String(binding.readableName()) };
+ String[] arguments = new String[] { token };
+ this.handle(IProblem.UninitializedLocalVariable, arguments, arguments, problemStartPosition, problemEndPosition, context,
+ compilationResult);
+ }
+
+ public void unreachableCode(String token, int problemStartPosition, int problemEndPosition, ReferenceContext context,
+ CompilationResult compilationResult) {
+ if (computeSeverity(IProblem.CodeCannotBeReached) == Ignore)
+ return;
+ this.handle(IProblem.CodeCannotBeReached, NoArgument, new String[] {}, problemStartPosition,
+ problemEndPosition, context, compilationResult);
+ }
+
}
\ No newline at end of file