Class CategorizedProblem
- All Implemented Interfaces:
IProblem
org.eclipse.jdt.core.compiler.CompilationParticipant
,
the simpler problem interface IProblem
did not carry enough information to better
separate and categorize Java problems. In order to minimize impact on existing API, Java problems
are still passed around as IProblem
, though actual implementations should explicitly
extend CategorizedProblem
. Participants can produce their own problem definitions,
and given these are categorized problems, they can be better handled by clients (such as user
interface).
A categorized problem provides access to:
- its location (originating source file name, source position, line number)
- its message description
- predicates to check its severity (error, warning, or info)
- its ID : a number identifying the very nature of this problem. All possible IDs for standard Java
problems are listed as constants on
IProblem
. - its marker type : a string identifying the problem creator. It corresponds to the marker type chosen if this problem was to be persisted. Standard Java problems are associated to marker type "org.eclipse.jdt.core.problem").
- its category ID : a number identifying the category this problem belongs to. All possible IDs for standard Java problem categories are listed in this class.
Note: the compiler produces IProblems internally, which are turned into markers by the JavaBuilder so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected when compiling. However, the Java problem markers carry equivalent information to IProblem, in particular their ID (attribute "id") is set to one of the IDs defined on this interface.
Note: Standard Java problems produced by Java default tooling will be subclasses of this class. Technically, most
API methods dealing with problems are referring to IProblem
for backward compatibility reason.
It is intended that CategorizedProblem
will be subclassed for custom problem implementation when
participating in compilation operations, so as to allow participant to contribute their own marker types, and thus
defining their own domain specific problem/category IDs.
Note: standard Java problems produced by Java default tooling will set the marker
IMarker#SOURCE_ID
attribute to
JavaBuilder#SOURCE_ID
; compiler
participants may specify the IMarker#SOURCE_ID
attribute of their markers by adding it to the extra marker attributes of the problems they generate;
markers resulting from compiler participants' problems that do not have the
IMarker#SOURCE_ID
extra attribute set do not have the
JavaBuilder#SOURCE_ID
attribute set either.
- Since:
- 3.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Category for problems related to buildpathstatic final int
Category for optional problems related to coding style practicesstatic final int
static final int
Category for optional problems related to deprecationstatic final int
Category for fatal problems in import statementsstatic final int
Category for fatal problems which could not be addressed by external changes, but require an edit to be addressedstatic final int
Category for optional problems in Javadocstatic final int
Category for fatal problems related to type members, could be addressed by some field or method changestatic final int
Category for fatal problems relating to modulesstatic final int
Category for optional problems related to naming conflictsstatic final int
Category for optional problems related to internationalization of String literalsstatic final int
Category for optional problems related to potential programming flawsstatic final int
Category for problems related to preview featuresstatic final int
Category for optional problems related to access restrictionsstatic final int
Category for fatal problems related to syntaxstatic final int
Category for fatal problems related to types, could be addressed by some type changestatic final int
Category for optional problems related to type safety in genericsstatic final int
Category for optional problems related to unnecessary codestatic final int
List of standard category IDs used by Java problems, more categories will be added in the future.Fields inherited from interface org.eclipse.jdt.core.compiler.IProblem
AbstractMethodCannotBeOverridden, AbstractMethodInAbstractClass, AbstractMethodInEnum, AbstractMethodMustBeImplemented, AbstractMethodMustBeImplementedOverConcreteMethod, AbstractMethodsInConcreteClass, AbstractServiceImplementation, AmbiguousConstructor, AmbiguousConstructorInDefaultConstructor, AmbiguousConstructorInImplicitConstructorCall, AmbiguousField, AmbiguousMethod, AmbiguousType, AnnotatedTypeArgumentToUnannotated, AnnotatedTypeArgumentToUnannotatedSuperHint, AnnotationCannotOverrideMethod, AnnotationCircularity, AnnotationCircularitySelfReference, AnnotationFieldNeedConstantInitialization, AnnotationMembersCannotHaveParameters, AnnotationMembersCannotHaveTypeParameters, AnnotationTypeDeclarationCannotHaveConstructor, AnnotationTypeDeclarationCannotHaveSuperclass, AnnotationTypeDeclarationCannotHaveSuperinterfaces, AnnotationTypeUsedAsSuperInterface, AnnotationValueMustBeAnEnumConstant, AnnotationValueMustBeAnnotation, AnnotationValueMustBeArrayInitializer, AnnotationValueMustBeClassLiteral, AnnotationValueMustBeConstant, AnonymousClassCannotExtendFinalClass, ApplicableMethodOverriddenByInapplicable, ArgumentHidingField, ArgumentHidingLocalVariable, ArgumentIsNeverUsed, ArgumentTypeAmbiguous, ArgumentTypeCannotBeVoid, ArgumentTypeCannotBeVoidArray, ArgumentTypeInheritedNameHidesEnclosingName, ArgumentTypeInternalNameProvided, ArgumentTypeNotFound, ArgumentTypeNotVisible, ArrayConstantsOnlyInArrayInitializers, ArrayReferencePotentialNullReference, ArrayReferenceRequired, ArrowInCaseStatementsNotSupported, AssignmentHasNoEffect, AssignmentToMultiCatchParameter, AssignmentToResource, AutoManagedResourceNotBelow17, AutoManagedVariableResourceNotBelow9, BinaryLiteralNotBelow17, BodyForAbstractMethod, BodyForNativeMethod, BoundCannotBeArray, BoundHasConflictingArguments, BoundMustBeAnInterface, BoxingConversion, BytecodeExceeds64KLimit, BytecodeExceeds64KLimitForClinit, BytecodeExceeds64KLimitForConstructor, BytecodeExceeds64KLimitForSwitchTable, CannotAllocateVoidArray, CannotDeclareEnumSpecialMethod, CannotDefineAnnotationInLocalType, CannotDefineDimensionExpressionsWithInit, CannotDefineEnumInLocalType, CannotDefineInterfaceInLocalType, CannotDefineStaticInitializerInLocalType, CannotExtendEnum, CannotHideAnInstanceMethodWithAStaticMethod, CannotImplementIncompatibleNullness, CannotImportPackage, CannotInferElidedTypes, CannotInferInvocationType, CannotInferRecordPatternTypes, CannotInvokeSuperConstructorInEnum, CannotOverrideAStaticMethodWithAnInstanceMethod, CannotReadSource, CannotReturnInInitializer, CannotThrowNull, CannotThrowType, CannotUseDiamondWithAnonymousClasses, CannotUseDiamondWithExplicitTypeArguments, CannotUseSuperInCodeSnippet, ClassExtendFinalClass, ClassExtendFinalRecord, CodeCannotBeReached, CodeSnippetMissingClass, CodeSnippetMissingMethod, ComparingIdentical, Compliance, ConflictingImport, ConflictingInheritedNullAnnotations, ConflictingNullAnnotations, ConflictingPackageFromModules, ConflictingPackageFromOtherModules, ConflictingPackageInModules, ConstantWithPatternIncompatible, ConstNonNullFieldComparisonYieldsFalse, ConstructedArrayIncompatible, ConstructionTypeMismatch, ConstructorReferenceNotBelow18, ConstructorRelated, ConstructorVarargsArgumentNeedCast, ContainerAnnotationTypeHasNonDefaultMembers, ContainerAnnotationTypeHasShorterRetention, ContainerAnnotationTypeHasWrongValueType, ContainerAnnotationTypeMustHaveValue, ContradictoryNullAnnotations, ContradictoryNullAnnotationsInferred, ContradictoryNullAnnotationsInferredFunctionType, ContradictoryNullAnnotationsOnBound, CorruptedSignature, CyclicModuleDependency, DanglingReference, DeadCode, DefaultMethodNotBelow18, DefaultMethodOverridesObjectMethod, DereferencingNullableExpression, DiamondNotBelow17, DimensionsIllegalOnRecordPattern, DirectInvocationOfAbstractMethod, DisallowedExplicitThisParameter, DisallowedStatementInPrologue, DisallowedTargetForAnnotation, DisallowedTargetForContainerAnnotationType, DiscouragedReference, DiscouragedValueBasedTypeSynchronization, DuplicateAnnotation, DuplicateAnnotationMember, DuplicateAnnotationNotMarkedRepeatable, DuplicateBlankFinalFieldInitialization, DuplicateBoundInIntersectionCast, DuplicateBounds, DuplicateCase, DuplicateDefaultCase, DuplicateExports, DuplicateField, DuplicateFinalLocalInitialization, DuplicateImport, DuplicateInheritedDefaultMethods, DuplicateInheritedMethods, DuplicateLabel, DuplicateMethod, DuplicateMethodErasure, DuplicateModifierForArgument, DuplicateModifierForField, DuplicateModifierForMethod, DuplicateModifierForType, DuplicateModifierForVariable, DuplicateModuleRef, DuplicateNestedType, DuplicateOpens, DuplicateParameterizedMethods, DuplicateRequires, DuplicateResource, DuplicateServices, DuplicateSuperInterface, DuplicateTargetInTargetAnnotation, DuplicateTotalPattern, DuplicateTypes, DuplicateTypeVariable, DuplicateUses, EmptyControlFlowStatement, EnclosingInstanceInConstructorCall, EndOfSource, EnhancedSwitchMissingDefault, EnumAbstractMethodMustBeImplemented, EnumConstantCannotDefineAbstractMethod, EnumConstantMustImplementAbstractMethod, EnumConstantsCannotBeSurroundedByParenthesis, EnumStaticFieldInInInitializerContext, EnumSwitchCannotTargetField, ErrorUseOfUnderscoreAsAnIdentifier, ExceptionParameterIsNeverUsed, ExceptionTypeAmbiguous, ExceptionTypeInheritedNameHidesEnclosingName, ExceptionTypeInternalNameProvided, ExceptionTypeNotFound, ExceptionTypeNotVisible, ExplicitAnnotationTargetRequired, ExplicitlyClosedAutoCloseable, ExplicitThisParameterNotBelow18, ExplicitThisParameterNotInLambda, ExportingForeignPackage, ExpressionInPreConstructorContext, ExpressionShouldBeAVariable, ExternalProblemFixable, ExternalProblemNotFixable, FallthroughCase, FalseConstantInGuard, FeatureNotSupported, FieldComparisonYieldsFalse, FieldHidingField, FieldHidingLocalVariable, FieldMissingDeprecatedAnnotation, FieldMustBeFinal, FieldRelated, FieldTypeAmbiguous, FieldTypeInheritedNameHidesEnclosingName, FieldTypeInternalNameProvided, FieldTypeNotFound, FieldTypeNotVisible, FinalBoundForTypeVariable, FinalFieldAssignment, FinallyMustCompleteNormally, FinalMethodCannotBeOverridden, FinalOuterLocalAssignment, ForbiddenReference, GenericConstructorTypeArgumentMismatch, GenericInferenceError, GenericMethodTypeArgumentMismatch, GenericTypeCannotExtendThrowable, HidingEnclosingType, HierarchyCircularity, HierarchyCircularitySelfReference, HierarchyHasProblems, IgnoreCategoriesMask, IllegalAbstractModifierCombinationForMethod, IllegalAccessFromTypeVariable, IllegalAnnotationForBaseType, IllegalArrayOfUnionType, IllegalArrayTypeInIntersectionCast, IllegalBasetypeInIntersectionCast, IllegalCast, IllegalClassLiteralForTypeVariable, IllegalDeclarationOfThisParameter, IllegalDefaultModifierSpecification, IllegalDefinitionToNonNullParameter, IllegalDimension, IllegalEnclosingInstanceSpecification, IllegalExtendedDimensions, IllegalExtendedDimensionsForVarArgs, IllegalFallthroughFromAPattern, IllegalFallthroughToPattern, IllegalGenericArray, IllegalHexaLiteral, IllegalInstanceofParameterizedType, IllegalInstanceofTypeParameter, IllegalModifierCombinationFinalAbstractForClass, IllegalModifierCombinationFinalVolatileForField, IllegalModifierCombinationForInterfaceMethod, IllegalModifierCombinationForPrivateInterfaceMethod9, IllegalModifierForAnnotationField, IllegalModifierForAnnotationMemberType, IllegalModifierForAnnotationMethod, IllegalModifierForAnnotationType, IllegalModifierForArgument, IllegalModifierForClass, IllegalModifierForConstructor, IllegalModifierForEnum, IllegalModifierForEnumConstant, IllegalModifierForEnumConstructor, IllegalModifierForField, IllegalModifierForInterface, IllegalModifierForInterfaceField, IllegalModifierForInterfaceMethod, IllegalModifierForInterfaceMethod18, IllegalModifierForInterfaceMethod9, IllegalModifierForLocalClass, IllegalModifierForLocalEnum, IllegalModifierForLocalEnumDeclaration, IllegalModifierForMemberClass, IllegalModifierForMemberEnum, IllegalModifierForMemberInterface, IllegalModifierForMethod, IllegalModifierForModule, IllegalModifierForPatternVariable, IllegalModifierForVariable, IllegalModifiers, IllegalModifiersForElidedType, IllegalParameterNullityRedefinition, IllegalPrimitiveOrArrayTypeForEnclosingInstance, IllegalQualifiedEnumConstantLabel, IllegalQualifiedParameterizedTypeAllocation, IllegalQualifierForExplicitThis, IllegalQualifierForExplicitThis2, IllegalRecordPattern, IllegalRedefinitionOfTypeVariable, IllegalRedefinitionToNonNullParameter, IllegalReturnNullityRedefinition, IllegalReturnNullityRedefinitionFreeTypeVariable, IllegalStaticModifierForMemberType, IllegalStrictfpForAbstractInterfaceMethod, IllegalTotalPatternWithDefault, IllegalTypeAnnotationsInStaticMemberAccess, IllegalTypeArgumentsInRawConstructorReference, IllegalTypeForExplicitThis, IllegalTypeVariableSuperReference, IllegalUnderscorePosition, IllegalUsageOfQualifiedTypeReference, IllegalUsageOfTypeAnnotations, IllegalUseOfUnderscoreAsAnIdentifier, IllegalVararg, IllegalVarargInLambda, IllegalVisibilityModifierCombinationForField, IllegalVisibilityModifierCombinationForMemberType, IllegalVisibilityModifierCombinationForMethod, IllegalVisibilityModifierForInterfaceMemberType, illFormedParameterizationOfFunctionalInterface, ImplicitClassMissingMainMethod, ImplicitObjectBoundNoNullDefault, ImportAmbiguous, ImportInheritedNameHidesEnclosingName, ImportInternalNameProvided, ImportNotFound, ImportNotVisible, ImportRelated, IncompatibleExceptionInInheritedMethodThrowsClause, IncompatibleExceptionInThrowsClause, IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod, IncompatibleLambdaParameterType, IncompatibleMethodReference, IncompatibleReturnType, IncompatibleReturnTypeForNonInheritedInterfaceMethod, IncompatibleTypesInConditionalOperator, IncompatibleTypesInEqualityOperator, IncompatibleTypesInForeach, IncorrectArityForParameterizedConstructor, IncorrectArityForParameterizedMethod, IncorrectArityForParameterizedType, IncorrectEnclosingInstanceReference, IncorrectSwitchType, IncorrectSwitchType17, IndirectAccessToStaticField, IndirectAccessToStaticMethod, IndirectAccessToStaticType, InheritedDefaultMethodConflictsWithOtherInherited, InheritedFieldHidesEnclosingName, InheritedIncompatibleReturnType, InheritedMethodHidesEnclosingName, InheritedMethodReducesVisibility, InheritedParameterLackingNonNullAnnotation, InheritedTypeHidesEnclosingName, InitializerMustCompleteNormally, InstanceFieldDuringConstructorInvocation, InstanceMethodDuringConstructorInvocation, InterfaceAmbiguous, InterfaceCannotHaveConstructors, InterfaceCannotHaveInitializers, InterfaceInheritedNameHidesEnclosingName, InterfaceInternalNameProvided, InterfaceNotFound, InterfaceNotFunctionalInterface, InterfaceNotVisible, InterfaceStaticMethodInvocationNotBelow18, InterfaceSuperInvocationNotBelow18, Internal, InternalTypeNameProvided, IntersectionCastNotBelow18, InvalidAnnotationMemberType, InvalidArrayConstructorReference, InvalidBinary, InvalidBreak, InvalidCatchBlockSequence, InvalidCharacterConstant, InvalidClassInstantiation, InvalidContinue, InvalidDigit, InvalidEncoding, InvalidEscape, InvalidExplicitConstructorCall, InvalidExpressionAsStatement, InvalidFileNameForPackageAnnotations, InvalidFloat, InvalidHexa, InvalidHighSurrogate, InvalidInput, InvalidLowSurrogate, InvalidNullToSynchronized, InvalidOctal, InvalidOpensStatement, InvalidOperator, InvalidParameterizedExceptionType, InvalidParenthesizedExpression, InvalidServiceImplType, InvalidServiceIntfType, InvalidTypeArguments, InvalidTypeExpression, InvalidTypeForCollection, InvalidTypeForCollectionTarget14, InvalidTypeForStaticImport, InvalidTypeToSynchronized, InvalidTypeVariableExceptionType, InvalidUnaryExpression, InvalidUnicodeEscape, InvalidUnionTypeReferenceSequence, InvalidUsageOfAnnotationDeclarations, InvalidUsageOfAnnotations, InvalidUsageOfEnumDeclarations, InvalidUsageOfForeachStatements, InvalidUsageOfStaticImports, InvalidUsageOfTypeAnnotations, InvalidUsageOfTypeArguments, InvalidUsageOfTypeParameters, InvalidUsageOfTypeParametersForAnnotationDeclaration, InvalidUsageOfTypeParametersForEnumDeclaration, InvalidUsageOfVarargs, InvalidUsageOfWildcard, InvalidVoidExpression, IsClassPathCorrect, IsClassPathCorrectWithReferencingType, Javadoc, JavadocAmbiguousConstructor, JavadocAmbiguousField, JavadocAmbiguousMethod, JavadocAmbiguousMethodReference, JavadocAmbiguousType, JavadocDuplicateParamName, JavadocDuplicateProvidesTag, JavadocDuplicateReturnTag, JavadocDuplicateTag, JavadocDuplicateThrowsClassName, JavadocDuplicateUsesTag, JavadocEmptyReturnTag, JavadocGenericConstructorTypeArgumentMismatch, JavadocGenericMethodTypeArgumentMismatch, JavadocHiddenReference, JavadocIncorrectArityForParameterizedConstructor, JavadocIncorrectArityForParameterizedMethod, JavadocInheritedFieldHidesEnclosingName, JavadocInheritedMethodHidesEnclosingName, JavadocInheritedNameHidesEnclosingTypeName, JavadocInternalTypeNameProvided, JavadocInvalidMemberTypeQualification, JavadocInvalidModule, JavadocInvalidModuleQualification, JavadocInvalidParamName, JavadocInvalidParamTagName, JavadocInvalidParamTagTypeParameter, JavadocInvalidProvidesClass, JavadocInvalidProvidesClassName, JavadocInvalidSeeArgs, JavadocInvalidSeeHref, JavadocInvalidSeeReference, JavadocInvalidSeeUrlReference, JavadocInvalidSnippet, JavadocInvalidSnippetContentNewLine, JavadocInvalidSnippetDuplicateRegions, JavadocInvalidSnippetMissingColon, JavadocInvalidSnippetRegexSubstringTogether, JavadocInvalidSnippetRegionNotClosed, JavadocInvalidTag, JavadocInvalidThrowsClass, JavadocInvalidThrowsClassName, JavadocInvalidUsesClass, JavadocInvalidUsesClassName, JavadocInvalidValueReference, JavadocMalformedSeeReference, JavadocMessagePrefix, JavadocMissing, JavadocMissingHashCharacter, JavadocMissingIdentifier, JavadocMissingParamName, JavadocMissingParamTag, JavadocMissingProvidesClassName, JavadocMissingProvidesTag, JavadocMissingReturnTag, JavadocMissingSeeReference, JavadocMissingTagDescription, JavadocMissingThrowsClassName, JavadocMissingThrowsTag, JavadocMissingUsesClassName, JavadocMissingUsesTag, JavadocNoMessageSendOnArrayType, JavadocNoMessageSendOnBaseType, JavadocNonGenericConstructor, JavadocNonGenericMethod, JavadocNonStaticTypeFromStaticInvocation, JavadocNotAccessibleType, JavadocNotVisibleConstructor, JavadocNotVisibleField, JavadocNotVisibleMethod, JavadocNotVisibleType, JavadocParameterizedConstructorArgumentTypeMismatch, JavadocParameterizedMethodArgumentTypeMismatch, JavadocParameterMismatch, JavadocTypeArgumentsForRawGenericConstructor, JavadocTypeArgumentsForRawGenericMethod, JavadocUndefinedConstructor, JavadocUndefinedField, JavadocUndefinedMethod, JavadocUndefinedType, JavadocUnexpectedTag, JavadocUnexpectedText, JavadocUnterminatedInlineTag, JavadocUsingDeprecatedConstructor, JavadocUsingDeprecatedField, JavadocUsingDeprecatedMethod, JavadocUsingDeprecatedType, JavaVersionNotSupported, LambdaDescriptorMentionsUnmentionable, LambdaExpressionNotBelow18, lambdaParameterTypeMismatched, LambdaRedeclaresArgument, LambdaRedeclaresLocal, LambdaShapeComputationError, lambdaSignatureMismatched, LocalReferencedInGuardMustBeEffectivelyFinal, LocalStaticsIllegalVisibilityModifierForInterfaceLocalType, LocalVariableCannotBeNull, LocalVariableCanOnlyBeNull, LocalVariableHidingField, LocalVariableHidingLocalVariable, LocalVariableIsNeverUsed, LocalVariableMayBeNull, MandatoryCloseNotShown, MandatoryCloseNotShownAtExit, MaskedCatch, MethodButWithConstructorName, MethodCanBePotentiallyStatic, MethodCanBeStatic, MethodMissingDeprecatedAnnotation, MethodMustOverride, MethodMustOverrideOrImplement, MethodNameClash, MethodNameClashHidden, MethodReducesVisibility, MethodReferenceNotBelow18, MethodReferenceSwingsBothWays, MethodRelated, MethodRequiresBody, MethodReturnsVoid, MethodVarargsArgumentNeedCast, MisplacedTypeAnnotations, MissingArgumentsForParameterizedMemberType, MissingDefaultCase, MissingEnclosingInstance, MissingEnclosingInstanceForConstructorCall, MissingEnumConstantCase, MissingEnumConstantCaseDespiteDefault, MissingEnumDefaultCase, MissingNonNullByDefaultAnnotationOnPackage, MissingNonNullByDefaultAnnotationOnType, MissingNullAnnotationImplicitlyUsed, MissingOverrideAnnotation, MissingOverrideAnnotationForInterfaceMethodImplementation, MissingRequiresTransitiveForTypeInAPI, MissingReturnType, MissingSemiColon, MissingSerialVersion, MissingSynchronizedModifierInInheritedMethod, MissingTypeInConstructor, MissingTypeInLambda, MissingTypeInMethod, MissingValueForAnnotationMember, MissingValueFromLambda, ModuleRelated, MultiCatchNotBelow17, MultiConstantCaseLabelsNotSupported, MultipleFunctionalInterfaces, MustDefineEitherDimensionExpressionsOrInitializer, MustSpecifyPackage, NamedPatternVariablesDisallowedHere, NativeMethodsCannotBeStrictfp, NeedToEmulateConstructorAccess, NeedToEmulateFieldReadAccess, NeedToEmulateFieldWriteAccess, NeedToEmulateMethodAccess, NestedServiceImpl, NoAdditionalBoundAfterTypeVariable, NoFieldOnBaseType, NoGenericLambda, NoImplicitStringConversionForCharArrayExpression, NoMessageSendOnArrayType, NoMessageSendOnBaseType, NonBlankFinalLocalAssignment, NonConstantExpression, NonDenotableTypeArgumentForAnonymousDiamond, NonExternalizedStringLiteral, NonGenericConstructor, NonGenericMethod, NonGenericType, NonNullArrayContentNotInitialized, NonNullDefaultDetailIsNotEvaluated, NonNullExpressionComparisonYieldsFalse, NonNullLocalVariableComparisonYieldsFalse, NonNullMessageSendComparisonYieldsFalse, NonNullMethodTypeVariableFromLegacyMethod, NonNullSpecdFieldComparisonYieldsFalse, NonNullTypeVariableFromLegacyMethod, NonPublicTypeInAPI, NonStaticAccessToStaticField, NonStaticAccessToStaticMethod, NonStaticContextForEnumMemberType, NonStaticFieldFromStaticInvocation, NonStaticOrAlienTypeReceiver, NonStaticTypeFromStaticInvocation, NoSuperInInterfaceContext, NotAccessibleConstructor, NotAccessibleField, NotAccessibleMethod, NotAccessiblePackage, NotAccessibleType, NotAnnotationType, NotExportedTypeInAPI, NotOwningResourceField, NotVisibleConstructor, NotVisibleConstructorInDefaultConstructor, NotVisibleConstructorInImplicitConstructorCall, NotVisibleField, NotVisibleMethod, NotVisibleType, NullableFieldReference, NullAnnotationAtQualifyingType, NullAnnotationUnsupportedLocation, NullAnnotationUnsupportedLocationAtType, NullExpressionReference, NullityMismatchAgainstFreeTypeVariable, NullityMismatchingTypeAnnotation, NullityMismatchingTypeAnnotationSuperHint, NullityMismatchTypeArgument, NullityUncheckedTypeAnnotation, NullityUncheckedTypeAnnotationDetail, NullityUncheckedTypeAnnotationDetailSuperHint, NullLocalVariableComparisonYieldsFalse, NullLocalVariableInstanceofYieldsFalse, NullLocalVariableReference, NullNotCompatibleToFreeTypeVariable, NullSourceString, NullUnboxing, NumericValueOutOfRange, ObjectCannotBeGeneric, ObjectCannotHaveSuperTypes, ObjectHasNoSuperclass, ObjectMustBeClass, OperandStackExceeds64KLimit, OperandStackSizeInappropriate, OuterLocalMustBeEffectivelyFinal, OuterLocalMustBeFinal, OverrideAddingReturnOwning, OverrideReducingParamterOwning, OverridingDeprecatedMethod, OverridingDeprecatedSinceVersionMethod, OverridingMethodWithoutSuperInvocation, OverridingNonVisibleMethod, OverridingTerminallyDeprecatedMethod, OverridingTerminallyDeprecatedSinceVersionMethod, OwningFieldInNonResourceClass, OwningFieldShouldImplementClose, PackageCollidesWithType, PackageDoesNotExistOrIsEmpty, PackageIsNotExpectedPackage, ParameterAssignment, ParameterizedConstructorArgumentTypeMismatch, ParameterizedMethodArgumentTypeMismatch, ParameterLackingNonNullAnnotation, ParameterLackingNullableAnnotation, ParameterMismatch, ParsingError, ParsingErrorDeleteToken, ParsingErrorDeleteTokens, ParsingErrorInsertToComplete, ParsingErrorInsertToCompletePhrase, ParsingErrorInsertToCompleteScope, ParsingErrorInsertTokenAfter, ParsingErrorInsertTokenBefore, ParsingErrorInvalidToken, ParsingErrorMergeTokens, ParsingErrorMisplacedConstruct, ParsingErrorNoSuggestion, ParsingErrorNoSuggestionForTokens, ParsingErrorOnKeyword, ParsingErrorOnKeywordNoSuggestion, ParsingErrorReplaceTokens, ParsingErrorUnexpectedEOF, PatternDominated, PatternSubtypeOfExpression, PatternSwitchCaseDefaultOnlyAsSecond, PatternSwitchNullOnlyOrFirstWithDefault, PatternTypeMismatch, PatternVariableNotInScope, PatternVariableRedeclared, PatternVariableRedefined, PolymorphicMethodNotBelow17, PossibleAccidentalBooleanAssignment, PotentialHeapPollutionFromVararg, PotentiallyUnclosedCloseable, PotentiallyUnclosedCloseableAtExit, PotentialNullExpressionReference, PotentialNullLocalVariableReference, PotentialNullMessageSendReference, PotentialNullUnboxing, PreviewAPIUsed, PreviewFeatureDisabled, PreviewFeatureNotSupported, PreviewFeaturesNotAllowed, PreviewFeatureUsed, PreviewRelated, ProblemNotAnalysed, ProviderMethodOrConstructorRequiredForServiceImpl, PublicClassMustMatchFileName, RawMemberTypeCannotBeParameterized, RawTypeInRecordPattern, RawTypeReference, RecordAccessorMethodHasThrowsClause, RecordAccessorMethodShouldBePublic, RecordAccessorMethodShouldNotBeGeneric, RecordAccessorMethodShouldNotBeStatic, RecordCannotDefineRecordInLocalType, RecordCannotExtendRecord, RecordCanonicalConstructorHasExplicitConstructorCall, RecordCanonicalConstructorHasReturnStatement, RecordCanonicalConstructorHasThrowsClause, RecordCanonicalConstructorShouldNotBeGeneric, RecordCanonicalConstructorVisibilityReduced, RecordCompactConstructorHasExplicitConstructorCall, RecordCompactConstructorHasReturnStatement, RecordComponentCannotBeVoid, RecordComponentsCannotHaveModifiers, RecordDuplicateComponent, RecordErasureIncompatibilityInCanonicalConstructor, RecordIllegalAccessorReturnType, RecordIllegalComponentNameInRecord, RecordIllegalExplicitFinalFieldAssignInCompactConstructor, RecordIllegalExtendedDimensionsForRecordComponent, RecordIllegalModifierForInnerRecord, RecordIllegalModifierForLocalRecord, RecordIllegalModifierForRecord, RecordIllegalNativeModifierInRecord, RecordIllegalParameterNameInCanonicalConstructor, RecordIllegalStaticModifierForLocalClassOrInterface, RecordIllegalVararg, RecordInstanceInitializerBlockInRecord, RecordMissingExplicitConstructorCallInNonCanonicalConstructor, RecordMultipleCanonicalConstructors, RecordNestedRecordInherentlyStatic, RecordNonStaticFieldDeclarationInRecord, RecordPatternMismatch, RecordStaticReferenceToOuterLocalVariable, RecursiveConstructorInvocation, RedefinedArgument, RedefinedLocal, RedundantLocalVariableNullAssignment, RedundantNullAnnotation, RedundantNullCheckAgainstNonNullType, RedundantNullCheckOnConstNonNullField, RedundantNullCheckOnField, RedundantNullCheckOnNonNullExpression, RedundantNullCheckOnNonNullLocalVariable, RedundantNullCheckOnNonNullMessageSend, RedundantNullCheckOnNonNullSpecdField, RedundantNullCheckOnNullLocalVariable, RedundantNullCheckOnSpecdNonNullLocalVariable, RedundantNullDefaultAnnotation, RedundantNullDefaultAnnotationField, RedundantNullDefaultAnnotationLocal, RedundantNullDefaultAnnotationMethod, RedundantNullDefaultAnnotationModule, RedundantNullDefaultAnnotationPackage, RedundantNullDefaultAnnotationType, RedundantSpecificationOfTypeArguments, RedundantSuperinterface, ReferenceExpressionParameterNullityMismatch, ReferenceExpressionParameterNullityUnchecked, ReferenceExpressionReturnNullRedef, ReferenceExpressionReturnNullRedefUnchecked, ReferenceToForwardField, ReferenceToForwardTypeVariable, RepeatableAnnotationTypeIsDocumented, RepeatableAnnotationTypeIsInherited, RepeatableAnnotationTypeTargetMismatch, RepeatableAnnotationWithRepeatingContainerAnnotation, RepeatedAnnotationWithContainerAnnotation, RequiredNonNullButProvidedFreeTypeVariable, RequiredNonNullButProvidedNull, RequiredNonNullButProvidedPotentialNull, RequiredNonNullButProvidedSpecdNullable, RequiredNonNullButProvidedUnknown, ResourceHasToImplementAutoCloseable, ResourceIsNotAValue, RestrictedTypeName, ReturnTypeAmbiguous, ReturnTypeCannotBeVoidArray, ReturnTypeInheritedNameHidesEnclosingName, ReturnTypeInternalNameProvided, ReturnTypeMismatch, ReturnTypeNotFound, ReturnTypeNotVisible, SafeVarargsOnFixedArityMethod, SafeVarargsOnNonFinalInstanceMethod, SafeVarargsOnSyntheticRecordAccessor, SealedAnonymousClassCannotExtendSealedType, SealedDisAllowedNonSealedModifierInClass, SealedDisAllowedNonSealedModifierInInterface, SealedDuplicateTypeInPermits, SealedInterfaceIsSealedAndNonSealed, SealedLocalDirectSuperTypeSealed, SealedMissingClassModifier, SealedMissingInterfaceModifier, SealedMissingSealedModifier, SealedNotDirectSuperClass, SealedNotDirectSuperInterface, SealedPermittedTypeOutsideOfModule, SealedPermittedTypeOutsideOfPackage, SealedSealedTypeMissingPermits, SealedSuperClassDoesNotPermit, SealedSuperInterfaceDoesNotPermit, SealedSuperTypeDisallowed, SealedSuperTypeInDifferentPackage, ServiceImplDefaultConstructorNotPublic, ServiceImplNotDefinedByModule, ShouldImplementHashcode, ShouldMarkMethodAsOwning, ShouldReturnValue, ShouldReturnValueHintMissingDefault, SpecdNonNullLocalVariableComparisonYieldsFalse, StaticInheritedMethodConflicts, StaticInterfaceMethodNotBelow18, StaticMemberOfParameterizedType, StaticMethodRequested, StaticMethodShouldBeAccessedStatically, StaticResourceField, StrictfpNotRequired, StringConstantIsExceedingUtf8Limit, SuperAccessCannotBypassDirectSuper, SuperCallCannotBypassOverride, SuperclassAmbiguous, SuperclassInheritedNameHidesEnclosingName, SuperclassInternalNameProvided, SuperclassMustBeAClass, SuperclassNotFound, SuperclassNotVisible, SuperfluousSemicolon, SuperInterfaceMustBeAnInterface, SuperInterfacesCollide, SuperTypeUsingWildcard, SwitchExpressionaYieldSwitchLabeledBlockCompletesNormally, SwitchExpressionBreakMissingValue, SwitchExpressionIllegalLastStatement, SwitchExpressionLastStatementCompletesNormally, SwitchExpressionMissingDefaultCase, SwitchExpressionMissingEnumConstantCase, SwitchExpressionsBreakOutOfSwitchExpression, SwitchExpressionsContinueOutOfSwitchExpression, SwitchExpressionsEmptySwitchBlock, SwitchExpressionsIncompatibleResultExpressionTypes, SwitchExpressionsNoResultExpression, SwitchExpressionsNotSupported, SwitchExpressionsReturnWithinSwitchExpression, SwitchExpressionSwitchLabeledBlockCompletesNormally, SwitchExpressionsYieldBreakNotAllowed, SwitchExpressionsYieldEmptySwitchBlock, SwitchExpressionsYieldIllegalLastStatement, SwitchExpressionsYieldIllegalStatement, SwitchExpressionsYieldIncompatibleResultExpressionTypes, SwitchExpressionsYieldLastStatementCompletesNormally, SwitchExpressionsYieldMissingDefaultCase, SwitchExpressionsYieldMissingEnumConstantCase, SwitchExpressionsYieldMissingValue, SwitchExpressionsYieldNoResultExpression, SwitchExpressionsYieldOutsideSwitchExpression, SwitchExpressionsYieldRestrictedGeneralWarning, SwitchExpressionsYieldTrailingSwitchLabels, SwitchExpressionsYieldTypeDeclarationError, SwitchExpressionsYieldTypeDeclarationWarning, SwitchExpressionsYieldUnqualifiedMethodError, SwitchExpressionsYieldUnqualifiedMethodWarning, SwitchExpressionTrailingSwitchLabels, switchMixedCase, SwitchOnEnumNotBelow15, SwitchOnStringsNotBelow17, SwitchPreviewMixedCase, Syntax, SyntheticAccessorNotEnclosingMethod, TargetTypeNotAFunctionalInterface, Task, ThisInStaticContext, ThisSuperDuringConstructorInvocation, ToleratedMisplacedTypeAnnotations, TooManyArgumentSlots, TooManyArrayDimensions, TooManyBytesForStringConstant, TooManyConstantsInConstantPool, TooManyFields, TooManyLocalVariableSlots, TooManyMethods, TooManyParametersForSyntheticMethod, TooManySyntheticArgumentSlots, TypeAnnotationAtQualifiedName, TypeArgumentMismatch, TypeArgumentsForRawGenericConstructor, TypeArgumentsForRawGenericMethod, TypeCollidesWithPackage, TypeHidingType, TypeHidingTypeParameterFromMethod, TypeHidingTypeParameterFromType, TypeMismatch, TypeMissingDeprecatedAnnotation, TypeParameterHidingType, TypeRelated, UnboxingConversion, UncheckedAccessOfValueOfFreeTypeVariable, Unclassified, UnclosedCloseable, UnclosedCloseableAtExit, UndefinedAnnotationMember, UndefinedConstructor, UndefinedConstructorInDefaultConstructor, UndefinedConstructorInImplicitConstructorCall, UndefinedField, UndefinedLabel, UndefinedMethod, UndefinedModule, UndefinedModuleAddReads, UndefinedName, UndefinedType, UndefinedTypeVariable, UnderscoreCannotBeUsedHere, UnderscoresInLiteralsNotBelow17, UndocumentedEmptyBlock, UnexpectedStaticModifierForField, UnexpectedStaticModifierForMethod, UnexpectedTypeinRecordPattern, UnexpectedTypeinSwitchPattern, UnhandledException, UnhandledExceptionInDefaultConstructor, UnhandledExceptionInImplicitConstructorCall, UnhandledExceptionOnAutoClose, UnhandledWarningToken, UninitializedBlankFinalField, UninitializedBlankFinalFieldHintMissingDefault, UninitializedFreeTypeVariableField, UninitializedFreeTypeVariableFieldHintMissingDefault, UninitializedLocalVariable, UninitializedLocalVariableHintMissingDefault, UninitializedNonNullField, UninitializedNonNullFieldHintMissingDefault, UninternedIdentityComparison, UnlikelyCollectionMethodArgumentType, UnlikelyEqualsArgumentType, UnmatchedBracket, UnnamedPackageInNamedModule, UnnamedVariableMustHaveInitializer, UnnecessaryArgumentCast, UnnecessaryCast, UnnecessaryElse, UnnecessaryInstanceof, UnnecessaryNLSTag, UnnecessaryNullCaseInSwitchOverNonNull, UnqualifiedFieldAccess, UnreachableCatch, UnresolvedVariable, UnsafeCast, UnsafeElementTypeConversion, UnsafeGenericArrayForVarargs, UnsafeGenericCast, UnsafeNullnessCast, UnsafeRawConstructorInvocation, UnsafeRawFieldAssignment, UnsafeRawGenericConstructorInvocation, UnsafeRawGenericMethodInvocation, UnsafeRawMethodInvocation, UnsafeReturnTypeOverride, UnsafeTypeConversion, UnstableAutoModuleName, UnterminatedComment, UnterminatedString, UnterminatedTextBlock, UnusedConstructorDeclaredThrownException, UnusedImport, UnusedLabel, UnusedMethodDeclaredThrownException, UnusedObjectAllocation, UnusedPrivateConstructor, UnusedPrivateField, UnusedPrivateMethod, UnusedPrivateType, UnusedTypeArgumentsForConstructorInvocation, UnusedTypeArgumentsForMethodInvocation, UnusedTypeParameter, UnusedWarningToken, UseAssertAsAnIdentifier, UseEnumAsAnIdentifier, UsingDeprecatedConstructor, UsingDeprecatedField, UsingDeprecatedMethod, UsingDeprecatedModule, UsingDeprecatedPackage, UsingDeprecatedSinceVersionConstructor, UsingDeprecatedSinceVersionField, UsingDeprecatedSinceVersionMethod, UsingDeprecatedSinceVersionModule, UsingDeprecatedSinceVersionPackage, UsingDeprecatedSinceVersionType, UsingDeprecatedType, UsingTerminallyDeprecatedConstructor, UsingTerminallyDeprecatedField, UsingTerminallyDeprecatedMethod, UsingTerminallyDeprecatedModule, UsingTerminallyDeprecatedPackage, UsingTerminallyDeprecatedSinceVersionConstructor, UsingTerminallyDeprecatedSinceVersionField, UsingTerminallyDeprecatedSinceVersionMethod, UsingTerminallyDeprecatedSinceVersionModule, UsingTerminallyDeprecatedSinceVersionPackage, UsingTerminallyDeprecatedSinceVersionType, UsingTerminallyDeprecatedType, VarargsConflict, VarargsElementTypeNotVisible, VarargsElementTypeNotVisibleForConstructor, VarCannotBeMixedWithNonVarParams, VarCannotBeUsedWithTypeArguments, VariableTypeCannotBeVoid, VariableTypeCannotBeVoidArray, VarIsNotAllowedHere, VarIsReserved, VarIsReservedInFuture, VarLocalCannotBeArray, VarLocalCannotBeArrayInitalizers, VarLocalCannotBeLambda, VarLocalCannotBeMethodReference, VarLocalInitializedToNull, VarLocalInitializedToVoid, VarLocalMultipleDeclarators, VarLocalReferencesItself, VarLocalWithoutInitizalier, VoidMethodReturnsValue, WildcardConstructorInvocation, WildcardFieldAssignment, WildcardMethodInvocation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
Returns an integer identifying the category of this problem.String[]
Returns the names of the extra marker attributes associated to this problem when persisted into a marker by the JavaBuilder.Object[]
Returns the respective values for the extra marker attributes associated to this problem when persisted into a marker by the JavaBuilder.abstract String
Returns the marker type associated to this problem, if it gets persisted into a marker by the JavaBuilder Standard Java problems are associated to marker type "org.eclipse.jdt.core.problem").boolean
isInfo()
Returns whether the severity of this problem is 'Info'.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jdt.core.compiler.IProblem
getArguments, getID, getMessage, getOriginatingFileName, getSourceEnd, getSourceLineNumber, getSourceStart, isError, isWarning, setSourceEnd, setSourceLineNumber, setSourceStart
-
Field Details
-
CAT_UNSPECIFIED
public static final int CAT_UNSPECIFIEDList of standard category IDs used by Java problems, more categories will be added in the future.- See Also:
-
CAT_BUILDPATH
public static final int CAT_BUILDPATHCategory for problems related to buildpath- See Also:
-
CAT_SYNTAX
public static final int CAT_SYNTAXCategory for fatal problems related to syntax- See Also:
-
CAT_IMPORT
public static final int CAT_IMPORTCategory for fatal problems in import statements- See Also:
-
CAT_TYPE
public static final int CAT_TYPECategory for fatal problems related to types, could be addressed by some type change- See Also:
-
CAT_MEMBER
public static final int CAT_MEMBERCategory for fatal problems related to type members, could be addressed by some field or method change- See Also:
-
CAT_INTERNAL
public static final int CAT_INTERNALCategory for fatal problems which could not be addressed by external changes, but require an edit to be addressed- See Also:
-
CAT_JAVADOC
public static final int CAT_JAVADOCCategory for optional problems in Javadoc- See Also:
-
CAT_CODE_STYLE
public static final int CAT_CODE_STYLECategory for optional problems related to coding style practices- See Also:
-
CAT_POTENTIAL_PROGRAMMING_PROBLEM
public static final int CAT_POTENTIAL_PROGRAMMING_PROBLEMCategory for optional problems related to potential programming flaws- See Also:
-
CAT_NAME_SHADOWING_CONFLICT
public static final int CAT_NAME_SHADOWING_CONFLICTCategory for optional problems related to naming conflicts- See Also:
-
CAT_DEPRECATION
public static final int CAT_DEPRECATIONCategory for optional problems related to deprecation- See Also:
-
CAT_UNNECESSARY_CODE
public static final int CAT_UNNECESSARY_CODECategory for optional problems related to unnecessary code- See Also:
-
CAT_UNCHECKED_RAW
public static final int CAT_UNCHECKED_RAWCategory for optional problems related to type safety in generics- See Also:
-
CAT_NLS
public static final int CAT_NLSCategory for optional problems related to internationalization of String literals- See Also:
-
CAT_RESTRICTION
public static final int CAT_RESTRICTIONCategory for optional problems related to access restrictions- See Also:
-
CAT_MODULE
public static final int CAT_MODULECategory for fatal problems relating to modules- Since:
- 3.14
- See Also:
-
CAT_COMPLIANCE
public static final int CAT_COMPLIANCE- Since:
- 3.18
- See Also:
-
CAT_PREVIEW_RELATED
public static final int CAT_PREVIEW_RELATEDCategory for problems related to preview features- Since:
- 3.20
- See Also:
-
-
Constructor Details
-
CategorizedProblem
public CategorizedProblem()
-
-
Method Details
-
getCategoryID
public abstract int getCategoryID()Returns an integer identifying the category of this problem. Categories, like problem IDs are defined in the context of some marker type. Custom implementations ofCategorizedProblem
may choose arbitrary values for problem/category IDs, as long as they are associated with a different marker type. Standard Java problem markers (i.e. marker type is "org.eclipse.jdt.core.problem") carry an attribute "categoryId" persisting the originating problem category ID as defined by this method).- Returns:
- id - an integer identifying the category of this problem
-
getMarkerType
Returns the marker type associated to this problem, if it gets persisted into a marker by the JavaBuilder Standard Java problems are associated to marker type "org.eclipse.jdt.core.problem"). Note: problem markers are expected to extend "org.eclipse.core.resources.problemmarker" marker type.- Returns:
- the type of the marker which would be associated to the problem
-
getExtraMarkerAttributeNames
Returns the names of the extra marker attributes associated to this problem when persisted into a marker by the JavaBuilder. Extra attributes are only optional, and are allowing client customization of generated markers. By default, no EXTRA attributes is persisted, and a categorized problem only persists the following attributes:-
IMarker#MESSAGE
->IProblem.getMessage()
-
IMarker#SEVERITY
->IMarker#SEVERITY_ERROR
,IMarker#SEVERITY_WARNING
, orIMarker#SEVERITY_INFO
, depending onIProblem.isError()
,IProblem.isWarning()
, or orIProblem.isInfo()
-
IJavaModelMarker#ID
->IProblem.getID()
-
IMarker#CHAR_START
->IProblem.getSourceStart()
-
IMarker#CHAR_END
->IProblem.getSourceEnd()
-
IMarker#LINE_NUMBER
->IProblem.getSourceLineNumber()
-
IJavaModelMarker#ARGUMENTS
-> someString[]
used to compute quickfixes -
IJavaModelMarker#CATEGORY_ID
->getCategoryID()
IMarker#setAttributes(String[], Object[])
, and there must be as many names as values according togetExtraMarkerAttributeValues()
. Note that extra marker attributes will be inserted after default ones (as described ingetMarkerType()
, and thus could be used to override defaults.- Returns:
- the names of the corresponding marker attributes
-
-
getExtraMarkerAttributeValues
Returns the respective values for the extra marker attributes associated to this problem when persisted into a marker by the JavaBuilder. Each value must correspond to a matching attribute name, as defined bygetExtraMarkerAttributeNames()
. The values must be eligible for marker creation, as defined byIMarker#setAttributes(String[], Object[])}
.- Returns:
- the values of the corresponding extra marker attributes
-
isInfo
public boolean isInfo()Returns whether the severity of this problem is 'Info'.Note: This implementation always returns
false
, subclasses can override.
-