org.aspectj.ajdt.internal.compiler.problem
Class AjProblemReporter
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemHandler
org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter
org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter
public class AjProblemReporter
- extends ProblemReporter
Extends problem reporter to support compiler-side implementation of declare soft. Also overrides error reporting for the need to
implement abstract methods to account for inter-type declarations and pointcut declarations. This second job might be better done
directly in the SourceTypeBinding/ClassScope classes.
Method Summary |
void |
abstractMethodCannotBeOverridden(SourceTypeBinding type,
MethodBinding concreteMethod)
|
void |
abstractMethodInAbstractClass(SourceTypeBinding type,
AbstractMethodDeclaration methodDecl)
|
void |
abstractMethodInConcreteClass(SourceTypeBinding type)
|
void |
abstractMethodMustBeImplemented(SourceTypeBinding type,
MethodBinding abstractMethod)
|
void |
caseExpressionMustBeConstant(Expression expression)
|
IProblem |
createProblem(char[] fileName,
int problemId,
java.lang.String[] problemArguments,
java.lang.String[] messageArguments,
int severity,
int problemStartPosition,
int problemEndPosition,
int lineNumber)
All problems end up routed through here at some point... |
void |
disallowedTargetForAnnotation(Annotation annotation)
|
void |
duplicateInheritedMethods(SourceTypeBinding type,
MethodBinding inheritedMethod1,
MethodBinding inheritedMethod2)
The method verifier is a bit 'keen' and doesn't cope well with ITDMs which are of course to be considered a 'default'
implementation if the target type doesn't supply one. |
void |
duplicateMethodInType(SourceTypeBinding type,
AbstractMethodDeclaration methodDecl,
boolean equalParameters,
int severity)
|
void |
finalMethodCannotBeOverridden(MethodBinding currentMethod,
MethodBinding inheritedMethod)
A side-effect of the way that we handle itds on default methods on top-most implementors of interfaces is that a class
acquiring a final default ITD will erroneously report that it can't override its own member. |
void |
handle(int problemId,
java.lang.String[] problemArguments,
java.lang.String[] messageArguments,
int severity,
int problemStartPosition,
int problemEndPosition,
ReferenceContext referenceContext,
CompilationResult unitResult)
|
void |
inheritedMethodReducesVisibility(SourceTypeBinding type,
MethodBinding concreteMethod,
MethodBinding[] abstractMethods)
|
void |
itdMethodMustOverride(AbstractMethodDeclaration method,
MethodBinding binding)
Called when there is an ITD marked @override that doesn't override a supertypes method. |
void |
javadocMissingParamTag(char[] name,
int sourceStart,
int sourceEnd,
int modifiers)
|
void |
methodMustOverride(AbstractMethodDeclaration method,
long complianceLevel)
Overrides the implementation in ProblemReporter and is ITD aware. |
void |
missingValueForAnnotationMember(Annotation annotation,
char[] memberName)
|
void |
overridesPackageDefaultMethod(MethodBinding localMethod,
MethodBinding inheritedMethod)
|
void |
parseErrorInsertAfterToken(int start,
int end,
int currentKind,
char[] errorTokenSource,
java.lang.String errorTokenName,
java.lang.String expectedToken)
|
void |
staticAndInstanceConflict(MethodBinding currentMethod,
MethodBinding inheritedMethod)
|
void |
unhandledException(TypeBinding exceptionType,
ASTNode location)
|
void |
unusedArgument(LocalDeclaration localDecl)
|
void |
unusedPrivateField(FieldDeclaration fieldDecl)
|
void |
unusedPrivateMethod(AbstractMethodDeclaration methodDecl)
|
void |
unusedPrivateType(TypeDeclaration typeDecl)
|
void |
visibilityConflict(MethodBinding currentMethod,
MethodBinding inheritedMethod)
|
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter |
abortDueToInternalError, abortDueToInternalError, abstractMethodMustBeImplemented, abstractMethodNeedingNoBody, alreadyDefinedLabel, annotationCannotOverrideMethod, annotationCircularity, annotationMembersCannotHaveParameters, annotationMembersCannotHaveTypeParameters, annotationTypeDeclarationCannotHaveConstructor, annotationTypeDeclarationCannotHaveSuperclass, annotationTypeDeclarationCannotHaveSuperinterfaces, annotationTypeUsedAsSuperinterface, annotationValueMustBeAnnotation, annotationValueMustBeArrayInitializer, annotationValueMustBeClassLiteral, annotationValueMustBeConstant, anonymousClassCannotExtendFinalClass, argumentTypeCannotBeVoid, argumentTypeCannotBeVoidArray, arrayConstantsOnlyInArrayInitializers, assignmentHasNoEffect, assignmentHasNoEffect, attemptToReturnNonVoidExpression, attemptToReturnVoidValue, autoboxing, autoManagedResourcesNotBelow17, boundCannotBeArray, boundMustBeAnInterface, bytecodeExceeds64KLimit, bytecodeExceeds64KLimit, cannotAllocateVoidArray, cannotAssignToFinalField, cannotAssignToFinalLocal, cannotAssignToFinalOuterLocal, cannotDefineDimensionsAndInitializer, cannotDireclyInvokeAbstractMethod, cannotExtendEnum, cannotImportPackage, cannotInferElidedTypes, cannotInstantiate, cannotInvokeSuperConstructorInEnum, cannotReadSource, cannotReferToNonFinalOuterLocal, cannotReturnInInitializer, cannotThrowNull, cannotThrowType, cannotUseQualifiedEnumConstantInCaseLabel, cannotUseSuperInCodeSnippet, cannotUseSuperInJavaLangObject, classExtendFinalClass, codeSnippetMissingClass, codeSnippetMissingMethod, comparingIdenticalExpressions, computeSeverity, conditionalArgumentsIncompatibleTypes, conflictingImport, constantOutOfRange, corruptedSignature, deprecatedField, deprecatedMethod, deprecatedType, deprecatedType, diamondNotBelow17, diamondNotBelow17, diamondNotWithAnoymousClasses, diamondNotWithExplicitTypeArguments, duplicateAnnotation, duplicateAnnotationValue, duplicateBounds, duplicateCase, duplicateDefaultCase, duplicateEnumSpecialMethod, duplicateFieldInType, duplicateImport, duplicateInitializationOfBlankFinalField, duplicateInitializationOfFinalLocal, duplicateModifierForField, duplicateModifierForMethod, duplicateModifierForType, duplicateModifierForVariable, duplicateNestedType, duplicateSuperinterface, duplicateTargetInTargetAnnotation, duplicateTypeParameterInType, duplicateTypes, emptyControlFlowStatement, enumAbstractMethodMustBeImplemented, enumConstantMustImplementAbstractMethod, enumConstantsCannotBeSurroundedByParenthesis, enumStaticFieldUsedDuringInitialization, enumSwitchCannotTargetField, errorNoMethodFor, errorThisSuperInStatic, expressionShouldBeAVariable, fakeReachable, fieldHiding, fieldsOrThisBeforeConstructorInvocation, finallyMustCompleteNormally, finalVariableBound, forbiddenReference, forbiddenReference, forbiddenReference, forwardReference, forwardTypeVariableReference, genericTypeCannotExtendThrowable, getIrritant, getProblemCategory, hiddenCatchBlock, hierarchyCircularity, hierarchyCircularity, hierarchyHasProblems, illegalAbstractModifierCombinationForMethod, illegalAccessFromTypeVariable, illegalClassLiteralForTypeVariable, illegalExtendedDimensions, illegalExtendedDimensions, illegalGenericArray, illegalInstanceOfGenericType, illegalLocalTypeDeclaration, illegalModifierCombinationFinalAbstractForClass, illegalModifierCombinationFinalVolatileForField, illegalModifierForAnnotationField, illegalModifierForAnnotationMember, illegalModifierForAnnotationMemberType, illegalModifierForAnnotationType, illegalModifierForClass, illegalModifierForEnum, illegalModifierForEnumConstant, illegalModifierForEnumConstructor, illegalModifierForField, illegalModifierForInterface, illegalModifierForInterfaceField, illegalModifierForInterfaceMethod, illegalModifierForLocalClass, illegalModifierForMemberClass, illegalModifierForMemberEnum, illegalModifierForMemberInterface, illegalModifierForMethod, illegalModifierForVariable, illegalPrimitiveOrArrayTypeForEnclosingInstance, illegalQualifiedParameterizedTypeAllocation, illegalStaticModifierForMemberType, illegalUsageOfQualifiedTypeReference, illegalUsageOfWildcard, illegalVararg, illegalVisibilityModifierCombinationForField, illegalVisibilityModifierCombinationForMemberType, illegalVisibilityModifierCombinationForMethod, illegalVisibilityModifierForInterfaceMemberType, illegalVoidExpression, importProblem, incompatibleExceptionInThrowsClause, incompatibleReturnType, incorrectArityForParameterizedType, incorrectArityForParameterizedType, incorrectLocationForNonEmptyDimension, incorrectSwitchType, indirectAccessToStaticField, indirectAccessToStaticMethod, inheritedMethodReducesVisibility, inheritedMethodsHaveIncompatibleReturnTypes, inheritedMethodsHaveIncompatibleReturnTypes, inheritedMethodsHaveNameClash, initializerMustCompleteNormally, innerTypesCannotDeclareStaticInitializers, interfaceCannotHaveConstructors, interfaceCannotHaveInitializers, invalidAnnotationMemberType, invalidBreak, invalidConstructor, invalidContinue, invalidEnclosingType, invalidExplicitConstructorCall, invalidExpressionAsStatement, invalidField, invalidField, invalidField, invalidFileNameForPackageAnnotations, invalidMethod, invalidNullToSynchronize, invalidOperator, invalidOperator, invalidOperator, invalidParameterizedExceptionType, invalidParenthesizedExpression, invalidType, invalidTypeForCollection, invalidTypeForCollectionTarget14, invalidTypeToSynchronize, invalidTypeVariableAsException, invalidUnaryExpression, invalidUsageOfAnnotation, invalidUsageOfAnnotationDeclarations, invalidUsageOfEnumDeclarations, invalidUsageOfForeachStatements, invalidUsageOfStaticImports, invalidUsageOfTypeArguments, invalidUsageOfTypeParameters, invalidUsageOfTypeParametersForAnnotationDeclaration, invalidUsageOfTypeParametersForEnumDeclaration, invalidUsageOfVarargs, isClassPathCorrect, javadocAmbiguousMethodReference, javadocDeprecatedField, javadocDeprecatedMethod, javadocDeprecatedType, javadocDeprecatedType, javadocDuplicatedParamTag, javadocDuplicatedReturnTag, javadocDuplicatedTag, javadocDuplicatedThrowsClassName, javadocEmptyReturnTag, javadocErrorNoMethodFor, javadocHiddenReference, javadocInvalidConstructor, javadocInvalidField, javadocInvalidMemberTypeQualification, javadocInvalidMethod, javadocInvalidParamTagName, javadocInvalidParamTypeParameter, javadocInvalidReference, javadocInvalidSeeHref, javadocInvalidSeeReferenceArgs, javadocInvalidSeeUrlReference, javadocInvalidTag, javadocInvalidThrowsClass, javadocInvalidThrowsClassName, javadocInvalidType, javadocInvalidValueReference, javadocMalformedSeeReference, javadocMissing, javadocMissing, javadocMissingHashCharacter, javadocMissingIdentifier, javadocMissingParamName, javadocMissingReference, javadocMissingReturnTag, javadocMissingTagDescription, javadocMissingTagDescriptionAfterReference, javadocMissingThrowsClassName, javadocMissingThrowsTag, javadocUndeclaredParamTagName, javadocUnexpectedTag, javadocUnexpectedText, javadocUnterminatedInlineTag, localVariableHiding, localVariableNonNullComparedToNull, localVariableNullComparedToNonNull, localVariableNullInstanceof, localVariableNullReference, localVariablePotentialNullReference, localVariableRedundantCheckOnNonNull, localVariableRedundantCheckOnNull, localVariableRedundantNullAssignment, methodCanBeDeclaredStatic, methodCanBePotentiallyDeclaredStatic, methodNameClash, methodNeedBody, methodNeedingNoBody, methodWithConstructorName, missingDeprecatedAnnotationForField, missingDeprecatedAnnotationForMethod, missingDeprecatedAnnotationForType, missingEnumConstantCase, missingOverrideAnnotation, missingOverrideAnnotationForInterfaceMethodImplementation, missingReturnType, missingSemiColon, missingSerialVersion, missingSynchronizedOnInheritedMethod, missingTypeInConstructor, missingTypeInMethod, multiCatchNotBelow17, mustDefineDimensionsOrInitializer, mustUseAStaticMethod, nativeMethodsCannotBeStrictfp, needImplementation, needToEmulateFieldAccess, needToEmulateMethodAccess, noAdditionalBoundAfterTypeVariable, noMoreAvailableSpaceForArgument, noMoreAvailableSpaceForConstant, noMoreAvailableSpaceForLocal, noMoreAvailableSpaceInConstantPool, nonExternalizedStringLiteral, nonGenericTypeCannotBeParameterized, nonStaticAccessToStaticField, nonStaticAccessToStaticField, nonStaticAccessToStaticMethod, nonStaticContextForEnumMemberType, noSuchEnclosingInstance, notCompatibleTypesError, notCompatibleTypesError, notCompatibleTypesErrorInForeach, objectCannotBeGeneric, objectCannotHaveSuperTypes, objectMustBeClass, operatorOnlyValidOnNumericType, overridesDeprecatedMethod, overridesMethodWithoutSuperInvocation, packageCollidesWithType, packageIsNotExpectedPackage, parameterAssignment, parameterizedMemberTypeMissingArguments, parseError, parseErrorDeleteToken, parseErrorDeleteTokens, parseErrorInsertBeforeToken, parseErrorInsertToComplete, parseErrorInsertToCompletePhrase, parseErrorInsertToCompleteScope, parseErrorInvalidToken, parseErrorMergeTokens, parseErrorMisplacedConstruct, parseErrorNoSuggestion, parseErrorNoSuggestionForTokens, parseErrorReplaceToken, parseErrorReplaceTokens, parseErrorUnexpectedEnd, polymorphicMethodNotBelow17, possibleAccidentalBooleanAssignment, possibleFallThroughCase, possibleHeapPollutionFromVararg, publicClassMustMatchFileName, rawMemberTypeCannotBeParameterized, rawTypeReference, recursiveConstructorInvocation, redefineArgument, redefineLocal, redundantSpecificationOfTypeArguments, redundantSuperInterface, referenceMustBeArrayTypeAt, reset, resourceHasToImplementAutoCloseable, returnTypeCannotBeVoidArray, safeVarargsOnFixedArityMethod, safeVarargsOnNonFinalInstanceMethod, scannerError, shouldImplementHashcode, shouldReturn, signalError, signalNoImplicitStringConversionForCharArrayExpression, staticFieldAccessToNonStaticVariable, staticInheritedMethodConflicts, staticMemberOfParameterizedType, stringConstantIsExceedingUtf8Limit, superclassMustBeAClass, superfluousSemicolon, superinterfaceMustBeAnInterface, superinterfacesCollide, superTypeCannotUseWildcard, swallowedException, task, tooManyDimensions, tooManyFields, tooManyMethods, tooManyParametersForSyntheticMethod, typeCastError, typeCollidesWithEnclosingType, typeCollidesWithPackage, typeHiding, typeHiding, typeHiding, typeMismatchError, typeMismatchError, undefinedAnnotationValue, undefinedLabel, undefinedTypeVariableSignature, undocumentedEmptyBlock, unexpectedStaticModifierForField, unexpectedStaticModifierForMethod, unhandledExceptionFromAutoClose, unhandledWarningToken, uninitializedBlankFinalField, uninitializedLocalVariable, unmatchedBracket, unnecessaryCast, unnecessaryElse, unnecessaryEnclosingInstanceSpecification, unnecessaryInstanceof, unnecessaryNLSTags, unnecessaryTypeArgumentsForMethodInvocation, unqualifiedFieldAccess, unreachableCatchBlock, unreachableCode, unresolvableReference, unsafeCast, unsafeGenericArrayForVarargs, unsafeRawFieldAssignment, unsafeRawGenericMethodInvocation, unsafeRawInvocation, unsafeReturnTypeOverride, unsafeTypeConversion, unusedDeclaredThrownException, unusedImport, unusedLabel, unusedLocalVariable, unusedObjectAllocation, unusedPrivateConstructor, unusedWarningToken, useAssertAsAnIdentifier, useEnumAsAnIdentifier, varargsArgumentNeedCast, varargsConflict, variableTypeCannotBeVoid, variableTypeCannotBeVoidArray, wildcardAssignment, wildcardInvocation, wrongSequenceOfExceptionTypes, wrongSequenceOfExceptionTypesError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
factory
public EclipseFactory factory
AjProblemReporter
public AjProblemReporter(IErrorHandlingPolicy policy,
CompilerOptions options,
IProblemFactory problemFactory)
unhandledException
public void unhandledException(TypeBinding exceptionType,
ASTNode location)
- Overrides:
unhandledException
in class ProblemReporter
abstractMethodCannotBeOverridden
public void abstractMethodCannotBeOverridden(SourceTypeBinding type,
MethodBinding concreteMethod)
- Overrides:
abstractMethodCannotBeOverridden
in class ProblemReporter
inheritedMethodReducesVisibility
public void inheritedMethodReducesVisibility(SourceTypeBinding type,
MethodBinding concreteMethod,
MethodBinding[] abstractMethods)
- Overrides:
inheritedMethodReducesVisibility
in class ProblemReporter
staticAndInstanceConflict
public void staticAndInstanceConflict(MethodBinding currentMethod,
MethodBinding inheritedMethod)
- Overrides:
staticAndInstanceConflict
in class ProblemReporter
abstractMethodMustBeImplemented
public void abstractMethodMustBeImplemented(SourceTypeBinding type,
MethodBinding abstractMethod)
- Overrides:
abstractMethodMustBeImplemented
in class ProblemReporter
disallowedTargetForAnnotation
public void disallowedTargetForAnnotation(Annotation annotation)
- Overrides:
disallowedTargetForAnnotation
in class ProblemReporter
overridesPackageDefaultMethod
public void overridesPackageDefaultMethod(MethodBinding localMethod,
MethodBinding inheritedMethod)
- Overrides:
overridesPackageDefaultMethod
in class ProblemReporter
handle
public void handle(int problemId,
java.lang.String[] problemArguments,
java.lang.String[] messageArguments,
int severity,
int problemStartPosition,
int problemEndPosition,
ReferenceContext referenceContext,
CompilationResult unitResult)
javadocMissingParamTag
public void javadocMissingParamTag(char[] name,
int sourceStart,
int sourceEnd,
int modifiers)
- Overrides:
javadocMissingParamTag
in class ProblemReporter
abstractMethodInAbstractClass
public void abstractMethodInAbstractClass(SourceTypeBinding type,
AbstractMethodDeclaration methodDecl)
- Overrides:
abstractMethodInAbstractClass
in class ProblemReporter
itdMethodMustOverride
public void itdMethodMustOverride(AbstractMethodDeclaration method,
MethodBinding binding)
- Called when there is an ITD marked @override that doesn't override a supertypes method. The method and the binding are passed
- some information is useful from each. The 'method' knows about source offsets for the message, the 'binding' has the
signature of what the ITD is trying to be in the target class.
methodMustOverride
public void methodMustOverride(AbstractMethodDeclaration method,
long complianceLevel)
- Overrides the implementation in ProblemReporter and is ITD aware. To report a *real* problem with an ITD marked @override,
the other methodMustOverride() method is used.
- Overrides:
methodMustOverride
in class ProblemReporter
visibilityConflict
public void visibilityConflict(MethodBinding currentMethod,
MethodBinding inheritedMethod)
- Overrides:
visibilityConflict
in class ProblemReporter
unusedPrivateType
public void unusedPrivateType(TypeDeclaration typeDecl)
- Overrides:
unusedPrivateType
in class ProblemReporter
abstractMethodInConcreteClass
public void abstractMethodInConcreteClass(SourceTypeBinding type)
- Overrides:
abstractMethodInConcreteClass
in class ProblemReporter
unusedPrivateField
public void unusedPrivateField(FieldDeclaration fieldDecl)
- Overrides:
unusedPrivateField
in class ProblemReporter
unusedPrivateMethod
public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl)
- Overrides:
unusedPrivateMethod
in class ProblemReporter
caseExpressionMustBeConstant
public void caseExpressionMustBeConstant(Expression expression)
- Overrides:
caseExpressionMustBeConstant
in class ProblemReporter
unusedArgument
public void unusedArgument(LocalDeclaration localDecl)
- Overrides:
unusedArgument
in class ProblemReporter
finalMethodCannotBeOverridden
public void finalMethodCannotBeOverridden(MethodBinding currentMethod,
MethodBinding inheritedMethod)
- A side-effect of the way that we handle itds on default methods on top-most implementors of interfaces is that a class
acquiring a final default ITD will erroneously report that it can't override its own member. This method detects that
situation.
- Overrides:
finalMethodCannotBeOverridden
in class ProblemReporter
duplicateInheritedMethods
public void duplicateInheritedMethods(SourceTypeBinding type,
MethodBinding inheritedMethod1,
MethodBinding inheritedMethod2)
- The method verifier is a bit 'keen' and doesn't cope well with ITDMs which are of course to be considered a 'default'
implementation if the target type doesn't supply one. This test may not be complete - it is possible that it should read if
*either* is an ITD...but I dont have a testcase that shows that is required. yet. (pr115788)
- Overrides:
duplicateInheritedMethods
in class ProblemReporter
createProblem
public IProblem createProblem(char[] fileName,
int problemId,
java.lang.String[] problemArguments,
java.lang.String[] messageArguments,
int severity,
int problemStartPosition,
int problemEndPosition,
int lineNumber)
- All problems end up routed through here at some point...
duplicateMethodInType
public void duplicateMethodInType(SourceTypeBinding type,
AbstractMethodDeclaration methodDecl,
boolean equalParameters,
int severity)
- Overrides:
duplicateMethodInType
in class ProblemReporter
parseErrorInsertAfterToken
public void parseErrorInsertAfterToken(int start,
int end,
int currentKind,
char[] errorTokenSource,
java.lang.String errorTokenName,
java.lang.String expectedToken)
- Overrides:
parseErrorInsertAfterToken
in class ProblemReporter
missingValueForAnnotationMember
public void missingValueForAnnotationMember(Annotation annotation,
char[] memberName)
- Overrides:
missingValueForAnnotationMember
in class ProblemReporter