<s> package org . eclipse . jdt . internal . compiler . impl ; import java . io . ByteArrayInputStream ; import java . io . InputStreamReader ; import java . io . UnsupportedEncodingException ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilerOptions { public static final String OPTION_LocalVariableAttribute = "" ; public static final String OPTION_LineNumberAttribute = "" ; public static final String OPTION_SourceFileAttribute = "" ; public static final String OPTION_PreserveUnusedLocal = "" ; public static final String OPTION_DocCommentSupport = "" ; public static final String OPTION_ReportMethodWithConstructorName = "" ; public static final String OPTION_ReportOverridingPackageDefaultMethod = "" ; public static final String OPTION_ReportDeprecation = "" ; public static final String OPTION_ReportDeprecationInDeprecatedCode = "" ; public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "" ; public static final String OPTION_ReportHiddenCatchBlock = "" ; public static final String OPTION_ReportUnusedLocal = "" ; public static final String OPTION_ReportUnusedParameter = "" ; public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "" ; public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "" ; public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "" ; public static final String OPTION_ReportUnusedImport = "" ; public static final String OPTION_ReportSyntheticAccessEmulation = "" ; public static final String OPTION_ReportNoEffectAssignment = "" ; public static final String OPTION_ReportLocalVariableHiding = "" ; public static final String OPTION_ReportSpecialParameterHidingField = "" ; public static final String OPTION_ReportFieldHiding = "" ; public static final String OPTION_ReportTypeParameterHiding = "" ; public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "" ; public static final String OPTION_ReportNonExternalizedStringLiteral = "" ; public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "" ; public static final String OPTION_ReportUnusedPrivateMember = "" ; public static final String OPTION_ReportNoImplicitStringConversion = "" ; public static final String OPTION_ReportAssertIdentifier = "" ; public static final String OPTION_ReportEnumIdentifier = "" ; public static final String OPTION_ReportNonStaticAccessToStatic = "" ; public static final String OPTION_ReportIndirectStaticAccess = "" ; public static final String OPTION_ReportEmptyStatement = "" ; public static final String OPTION_ReportUnnecessaryTypeCheck = "" ; public static final String OPTION_ReportUnnecessaryElse = "" ; public static final String OPTION_ReportUndocumentedEmptyBlock = "" ; public static final String OPTION_ReportInvalidJavadoc = "" ; public static final String OPTION_ReportInvalidJavadocTags = "" ; public static final String OPTION_ReportInvalidJavadocTagsDeprecatedRef = "" ; public static final String OPTION_ReportInvalidJavadocTagsNotVisibleRef = "" ; public static final String OPTION_ReportInvalidJavadocTagsVisibility = "" ; public static final String OPTION_ReportMissingJavadocTags = "" ; public static final String OPTION_ReportMissingJavadocTagsVisibility = "" ; public static final String OPTION_ReportMissingJavadocTagsOverriding = "" ; public static final String OPTION_ReportMissingJavadocTagsMethodTypeParameters = "" ; public static final String OPTION_ReportMissingJavadocComments = "" ; public static final String OPTION_ReportMissingJavadocTagDescription = "" ; public static final String OPTION_ReportMissingJavadocCommentsVisibility = "" ; public static final String OPTION_ReportMissingJavadocCommentsOverriding = "" ; public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "" ; public static final String OPTION_ReportUnusedDeclaredThrownException = "" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding = "" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference = "" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = "" ; public static final String OPTION_ReportUnqualifiedFieldAccess = "" ; public static final String OPTION_ReportUnavoidableGenericTypeProblems = "" ; public static final String OPTION_ReportUncheckedTypeOperation = "" ; public static final String OPTION_ReportRawTypeReference = "" ; public static final String OPTION_ReportFinalParameterBound = "" ; public static final String OPTION_ReportMissingSerialVersion = "" ; public static final String OPTION_ReportVarargsArgumentNeedCast = "" ; public static final String OPTION_ReportUnusedTypeArgumentsForMethodInvocation = "" ; public static final String OPTION_Source = "" ; public static final String OPTION_TargetPlatform = "" ; public static final String OPTION_Compliance = "" ; public static final String OPTION_Encoding = "" ; public static final String OPTION_MaxProblemPerUnit = "" ; public static final String OPTION_TaskTags = "" ; public static final String OPTION_TaskPriorities = "" ; public static final String OPTION_TaskCaseSensitive = "" ; public static final String OPTION_InlineJsr = "" ; public static final String OPTION_ReportNullReference = "" ; public static final String OPTION_ReportPotentialNullReference = "" ; public static final String OPTION_ReportRedundantNullCheck = "" ; public static final String OPTION_ReportAutoboxing = "" ; public static final String OPTION_ReportAnnotationSuperInterface = "" ; public static final String OPTION_ReportMissingOverrideAnnotation = "" ; public static final String OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation = "" ; public static final String OPTION_ReportMissingDeprecatedAnnotation = "" ; public static final String OPTION_ReportIncompleteEnumSwitch = "" ; public static final String OPTION_ReportForbiddenReference = "" ; public static final String OPTION_ReportDiscouragedReference = "" ; public static final String OPTION_SuppressWarnings = "" ; public static final String OPTION_SuppressOptionalErrors = "" ; public static final String OPTION_ReportUnhandledWarningToken = "" ; public static final String OPTION_ReportUnusedWarningToken = "" ; public static final String OPTION_ReportUnusedLabel = "" ; public static final String OPTION_FatalOptionalError = "" ; public static final String OPTION_ReportParameterAssignment = "" ; public static final String OPTION_ReportFallthroughCase = "" ; public static final String OPTION_ReportOverridingMethodWithoutSuperInvocation = "" ; public static final String OPTION_GenerateClassFiles = "" ; public static final String OPTION_Process_Annotations = "" ; public static final String OPTION_ReportRedundantSuperinterface = "" ; public static final String OPTION_ReportComparingIdentical = "" ; public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "" ; public static final String OPTION_ReportMissingHashCodeMethod = "" ; public static final String OPTION_ReportDeadCode = "" ; public static final String OPTION_ReportDeadCodeInTrivialIfStatement = "" ; public static final String OPTION_ReportTasks = "" ; public static final String OPTION_ReportUnusedObjectAllocation = "" ; public static final String OPTION_IncludeNullInfoFromAsserts = "" ; public static final String OPTION_ReportMethodCanBeStatic = "" ; public static final String OPTION_ReportMethodCanBePotentiallyStatic = "" ; public static final String OPTION_ReportRedundantSpecificationOfTypeArguments = "" ; public static final String OPTIONG_BuildGroovyFiles = "" ; public static final String OPTIONG_GroovyFlags = "" ; public static final String OPTIONG_GroovyClassLoaderPath = "" ; public static final String OPTIONG_GroovyProjectName = "" ; public static final String OPTIONG_GroovyExtraImports = "" ; public static final String OPTIONG_GroovyTransformsToRunOnReconcile = "" ; public static final String GENERATE = "generate" ; public static final String DO_NOT_GENERATE = "" ; public static final String PRESERVE = "preserve" ; public static final String OPTIMIZE_OUT = "optimize out" ; public static final String VERSION_1_1 = "1.1" ; public static final String VERSION_1_2 = "1.2" ; public static final String VERSION_1_3 = "1.3" ; public static final String VERSION_1_4 = "1.4" ; public static final String VERSION_JSR14 = "jsr14" ; public static final String VERSION_CLDC1_1 = "cldc1.1" ; public static final String VERSION_1_5 = "1.5" ; public static final String VERSION_1_6 = "1.6" ; public static final String VERSION_1_7 = "1.7" ; public static final String ERROR = "error" ; public static final String WARNING = "warning" ; public static final String IGNORE = "ignore" ; public static final String ENABLED = "enabled" ; public static final String DISABLED = "disabled" ; public static final String PUBLIC = "public" ; public static final String PROTECTED = "protected" ; public static final String DEFAULT = "default" ; public static final String PRIVATE = "private" ; public static final String RETURN_TAG = "return_tag" ; public static final String NO_TAG = "no_tag" ; public static final String ALL_STANDARD_TAGS = "" ; public static final int MethodWithConstructorName = IrritantSet . GROUP0 | ASTNode . Bit1 ; public static final int OverriddenPackageDefaultMethod = IrritantSet . GROUP0 | ASTNode . Bit2 ; public static final int UsingDeprecatedAPI = IrritantSet . GROUP0 | ASTNode . Bit3 ; public static final int MaskedCatchBlock = IrritantSet . GROUP0 | ASTNode . Bit4 ; public static final int UnusedLocalVariable = IrritantSet . GROUP0 | ASTNode . Bit5 ; public static final int UnusedArgument = IrritantSet . GROUP0 | ASTNode . Bit6 ; public static final int NoImplicitStringConversion = IrritantSet . GROUP0 | ASTNode . Bit7 ; public static final int AccessEmulation = IrritantSet . GROUP0 | ASTNode . Bit8 ; public static final int NonExternalizedString = IrritantSet . GROUP0 | ASTNode . Bit9 ; public static final int AssertUsedAsAnIdentifier = IrritantSet . GROUP0 | ASTNode . Bit10 ; public static final int UnusedImport = IrritantSet . GROUP0 | ASTNode . Bit11 ; public static final int NonStaticAccessToStatic = IrritantSet . GROUP0 | ASTNode . Bit12 ; public static final int Task = IrritantSet . GROUP0 | ASTNode . Bit13 ; public static final int NoEffectAssignment = IrritantSet . GROUP0 | ASTNode . Bit14 ; public static final int IncompatibleNonInheritedInterfaceMethod = IrritantSet . GROUP0 | ASTNode . Bit15 ; public static final int UnusedPrivateMember = IrritantSet . GROUP0 | ASTNode . Bit16 ; public static final int LocalVariableHiding = IrritantSet . GROUP0 | ASTNode . Bit17 ; public static final int FieldHiding = IrritantSet . GROUP0 | ASTNode . Bit18 ; public static final int AccidentalBooleanAssign = IrritantSet . GROUP0 | ASTNode . Bit19 ; public static final int EmptyStatement = IrritantSet . GROUP0 | ASTNode . Bit20 ; public static final int MissingJavadocComments = IrritantSet . GROUP0 | ASTNode . Bit21 ; public static final int MissingJavadocTags = IrritantSet . GROUP0 | ASTNode . Bit22 ; public static final int UnqualifiedFieldAccess = IrritantSet . GROUP0 | ASTNode . Bit23 ; public static final int UnusedDeclaredThrownException = IrritantSet . GROUP0 | ASTNode . Bit24 ; public static final int FinallyBlockNotCompleting = IrritantSet . GROUP0 | ASTNode . Bit25 ; public static final int InvalidJavadoc = IrritantSet . GROUP0 | ASTNode . Bit26 ; public static final int UnnecessaryTypeCheck = IrritantSet . GROUP0 | ASTNode . Bit27 ; public static final int UndocumentedEmptyBlock = IrritantSet . GROUP0 | ASTNode . Bit28 ; public static final int IndirectStaticAccess = IrritantSet . GROUP0 | ASTNode . Bit29 ; public static final int UnnecessaryElse = IrritantSet . GROUP1 | ASTNode . Bit1 ; public static final int UncheckedTypeOperation = IrritantSet . GROUP1 | ASTNode . Bit2 ; public static final int FinalParameterBound = IrritantSet . GROUP1 | ASTNode . Bit3 ; public static final int MissingSerialVersion = IrritantSet . GROUP1 | ASTNode . Bit4 ; public static final int EnumUsedAsAnIdentifier = IrritantSet . GROUP1 | ASTNode . Bit5 ; public static final int ForbiddenReference = IrritantSet . GROUP1 | ASTNode . Bit6 ; public static final int VarargsArgumentNeedCast = IrritantSet . GROUP1 | ASTNode . Bit7 ; public static final int NullReference = IrritantSet . GROUP1 | ASTNode . Bit8 ; public static final int AutoBoxing = IrritantSet . GROUP1 | ASTNode . Bit9 ; public static final int AnnotationSuperInterface = IrritantSet . GROUP1 | ASTNode . Bit10 ; public static final int TypeHiding = IrritantSet . GROUP1 | ASTNode . Bit11 ; public static final int MissingOverrideAnnotation = IrritantSet . GROUP1 | ASTNode . Bit12 ; public static final int IncompleteEnumSwitch = IrritantSet . GROUP1 | ASTNode . Bit13 ; public static final int MissingDeprecatedAnnotation = IrritantSet . GROUP1 | ASTNode . Bit14 ; public static final int DiscouragedReference = IrritantSet . GROUP1 | ASTNode . Bit15 ; public static final int UnhandledWarningToken = IrritantSet . GROUP1 | ASTNode . Bit16 ; public static final int RawTypeReference = IrritantSet . GROUP1 | ASTNode . Bit17 ; public static final int UnusedLabel = IrritantSet . GROUP1 | ASTNode . Bit18 ; public static final int ParameterAssignment = IrritantSet . GROUP1 | ASTNode . Bit19 ; public static final int FallthroughCase = IrritantSet . GROUP1 | ASTNode . Bit20 ; public static final int OverridingMethodWithoutSuperInvocation = IrritantSet . GROUP1 | ASTNode . Bit21 ; public static final int PotentialNullReference = IrritantSet . GROUP1 | ASTNode . Bit22 ; public static final int RedundantNullCheck = IrritantSet . GROUP1 | ASTNode . Bit23 ; public static final int MissingJavadocTagDescription = IrritantSet . GROUP1 | ASTNode . Bit24 ; public static final int UnusedTypeArguments = IrritantSet . GROUP1 | ASTNode . Bit25 ; public static final int UnusedWarningToken = IrritantSet . GROUP1 | ASTNode . Bit26 ; public static final int RedundantSuperinterface = IrritantSet . GROUP1 | ASTNode . Bit27 ; public static final int ComparingIdentical = IrritantSet . GROUP1 | ASTNode . Bit28 ; public static final int MissingSynchronizedModifierInInheritedMethod = IrritantSet . GROUP1 | ASTNode . Bit29 ; public static final int ShouldImplementHashcode = IrritantSet . GROUP2 | ASTNode . Bit1 ; public static final int DeadCode = IrritantSet . GROUP2 | ASTNode . Bit2 ; public static final int Tasks = IrritantSet . GROUP2 | ASTNode . Bit3 ; public static final int UnusedObjectAllocation = IrritantSet . GROUP2 | ASTNode . Bit4 ; public static final int MethodCanBeStatic = IrritantSet . GROUP2 | ASTNode . Bit5 ; public static final int MethodCanBePotentiallyStatic = IrritantSet . GROUP2 | ASTNode . Bit6 ; public static final int RedundantSpecificationOfTypeArguments = IrritantSet . GROUP2 | ASTNode . Bit7 ; protected IrritantSet errorThreshold ; protected IrritantSet warningThreshold ; public int produceDebugAttributes ; public long complianceLevel ; public long originalComplianceLevel ; public long sourceLevel ; public long originalSourceLevel ; public long targetJDK ; public String defaultEncoding ; public boolean verbose ; public boolean produceReferenceInfo ; public boolean preserveAllLocalVariables ; public boolean parseLiteralExpressionsAsConstants ; public int maxProblemsPerUnit ; public char [ ] [ ] taskTags ; public char [ ] [ ] taskPriorities ; public boolean isTaskCaseSensitive ; public boolean reportDeprecationInsideDeprecatedCode ; public boolean reportDeprecationWhenOverridingDeprecatedMethod ; public boolean reportUnusedParameterWhenImplementingAbstract ; public boolean reportUnusedParameterWhenOverridingConcrete ; public boolean reportUnusedParameterIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionWhenOverriding ; public boolean reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ; public boolean reportSpecialParameterHidingField ; public boolean reportDeadCodeInTrivialIfStatement ; public boolean docCommentSupport ; public boolean reportInvalidJavadocTags ; public int reportInvalidJavadocTagsVisibility ; public boolean reportInvalidJavadocTagsDeprecatedRef ; public boolean reportInvalidJavadocTagsNotVisibleRef ; public String reportMissingJavadocTagDescription ; public int reportMissingJavadocTagsVisibility ; public boolean reportMissingJavadocTagsOverriding ; public boolean reportMissingJavadocTagsMethodTypeParameters ; public int reportMissingJavadocCommentsVisibility ; public boolean reportMissingJavadocCommentsOverriding ; public boolean inlineJsrBytecode ; public boolean suppressWarnings ; public boolean suppressOptionalErrors ; public boolean treatOptionalErrorAsFatal ; public boolean performMethodsFullRecovery ; public boolean performStatementsRecovery ; public boolean processAnnotations ; public boolean storeAnnotations ; public boolean reportMissingOverrideAnnotationForInterfaceMethodImplementation ; public boolean generateClassFiles ; public boolean ignoreMethodBodies ; public boolean includeNullInfoFromAsserts ; public boolean reportUnavoidableGenericTypeProblems ; public int buildGroovyFiles = 0 ; public int groovyFlags = 0 ; public String groovyClassLoaderPath = null ; public String groovyExtraImports = null ; public String groovyProjectName = null ; public String groovyTransformsToRunOnReconcile = null ; public final static String [ ] warningTokens = { "all" , "boxing" , "cast" , "dep-ann" , "deprecation" , "fallthrough" , "finally" , "hiding" , "" , "javadoc" , "nls" , "null" , "restriction" , "rawtypes" , "serial" , "" , "" , "super" , "" , "unchecked" , "" , "unused" , } ; public CompilerOptions ( ) { this ( null ) ; } public CompilerOptions ( Map settings ) { resetDefaults ( ) ; if ( settings != null ) { set ( settings ) ; } } public CompilerOptions ( Map settings , boolean parseLiteralExpressionsAsConstants ) { this ( settings ) ; this . parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants ; } public static String optionKeyFromIrritant ( int irritant ) { switch ( irritant ) { case MethodWithConstructorName : return OPTION_ReportMethodWithConstructorName ; case OverriddenPackageDefaultMethod : return OPTION_ReportOverridingPackageDefaultMethod ; case UsingDeprecatedAPI : case ( InvalidJavadoc | UsingDeprecatedAPI ) : return OPTION_ReportDeprecation ; case MaskedCatchBlock : return OPTION_ReportHiddenCatchBlock ; case UnusedLocalVariable : return OPTION_ReportUnusedLocal ; case UnusedArgument : return OPTION_ReportUnusedParameter ; case NoImplicitStringConversion : return OPTION_ReportNoImplicitStringConversion ; case AccessEmulation : return OPTION_ReportSyntheticAccessEmulation ; case NonExternalizedString : return OPTION_ReportNonExternalizedStringLiteral ; case AssertUsedAsAnIdentifier : return OPTION_ReportAssertIdentifier ; case UnusedImport : return OPTION_ReportUnusedImport ; case NonStaticAccessToStatic : return OPTION_ReportNonStaticAccessToStatic ; case Task : return OPTION_TaskTags ; case NoEffectAssignment : return OPTION_ReportNoEffectAssignment ; case IncompatibleNonInheritedInterfaceMethod : return OPTION_ReportIncompatibleNonInheritedInterfaceMethod ; case UnusedPrivateMember : return OPTION_ReportUnusedPrivateMember ; case LocalVariableHiding : return OPTION_ReportLocalVariableHiding ; case FieldHiding : return OPTION_ReportFieldHiding ; case AccidentalBooleanAssign : return OPTION_ReportPossibleAccidentalBooleanAssignment ; case EmptyStatement : return OPTION_ReportEmptyStatement ; case MissingJavadocComments : return OPTION_ReportMissingJavadocComments ; case MissingJavadocTags : return OPTION_ReportMissingJavadocTags ; case UnqualifiedFieldAccess : return OPTION_ReportUnqualifiedFieldAccess ; case UnusedDeclaredThrownException : return OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ; case FinallyBlockNotCompleting : return OPTION_ReportFinallyBlockNotCompletingNormally ; case InvalidJavadoc : return OPTION_ReportInvalidJavadoc ; case UnnecessaryTypeCheck : return OPTION_ReportUnnecessaryTypeCheck ; case UndocumentedEmptyBlock : return OPTION_ReportUndocumentedEmptyBlock ; case IndirectStaticAccess : return OPTION_ReportIndirectStaticAccess ; case UnnecessaryElse : return OPTION_ReportUnnecessaryElse ; case UncheckedTypeOperation : return OPTION_ReportUncheckedTypeOperation ; case FinalParameterBound : return OPTION_ReportFinalParameterBound ; case MissingSerialVersion : return OPTION_ReportMissingSerialVersion ; case EnumUsedAsAnIdentifier : return OPTION_ReportEnumIdentifier ; case ForbiddenReference : return OPTION_ReportForbiddenReference ; case VarargsArgumentNeedCast : return OPTION_ReportVarargsArgumentNeedCast ; case NullReference : return OPTION_ReportNullReference ; case PotentialNullReference : return OPTION_ReportPotentialNullReference ; case RedundantNullCheck : return OPTION_ReportRedundantNullCheck ; case AutoBoxing : return OPTION_ReportAutoboxing ; case AnnotationSuperInterface : return OPTION_ReportAnnotationSuperInterface ; case TypeHiding : return OPTION_ReportTypeParameterHiding ; case MissingOverrideAnnotation : return OPTION_ReportMissingOverrideAnnotation ; case IncompleteEnumSwitch : return OPTION_ReportIncompleteEnumSwitch ; case MissingDeprecatedAnnotation : return OPTION_ReportMissingDeprecatedAnnotation ; case DiscouragedReference : return OPTION_ReportDiscouragedReference ; case UnhandledWarningToken : return OPTION_ReportUnhandledWarningToken ; case RawTypeReference : return OPTION_ReportRawTypeReference ; case UnusedLabel : return OPTION_ReportUnusedLabel ; case ParameterAssignment : return OPTION_ReportParameterAssignment ; case FallthroughCase : return OPTION_ReportFallthroughCase ; case OverridingMethodWithoutSuperInvocation : return OPTION_ReportOverridingMethodWithoutSuperInvocation ; case MissingJavadocTagDescription : return OPTION_ReportMissingJavadocTagDescription ; case UnusedTypeArguments : return OPTION_ReportUnusedTypeArgumentsForMethodInvocation ; case UnusedWarningToken : return OPTION_ReportUnusedWarningToken ; case RedundantSuperinterface : return OPTION_ReportRedundantSuperinterface ; case ComparingIdentical : return OPTION_ReportComparingIdentical ; case MissingSynchronizedModifierInInheritedMethod : return OPTION_ReportMissingSynchronizedOnInheritedMethod ; case ShouldImplementHashcode : return OPTION_ReportMissingHashCodeMethod ; case DeadCode : return OPTION_ReportDeadCode ; case UnusedObjectAllocation : return OPTION_ReportUnusedObjectAllocation ; case MethodCanBeStatic : return OPTION_ReportMethodCanBeStatic ; case MethodCanBePotentiallyStatic : return OPTION_ReportMethodCanBePotentiallyStatic ; case RedundantSpecificationOfTypeArguments : return OPTION_ReportRedundantSpecificationOfTypeArguments ; } return null ; } public static String versionFromJdkLevel ( long jdkLevel ) { switch ( ( int ) ( jdkLevel >> 16 ) ) { case ClassFileConstants . MAJOR_VERSION_1_1 : if ( jdkLevel == ClassFileConstants . JDK1_1 ) return VERSION_1_1 ; break ; case ClassFileConstants . MAJOR_VERSION_1_2 : if ( jdkLevel == ClassFileConstants . JDK1_2 ) return VERSION_1_2 ; break ; case ClassFileConstants . MAJOR_VERSION_1_3 : if ( jdkLevel == ClassFileConstants . JDK1_3 ) return VERSION_1_3 ; break ; case ClassFileConstants . MAJOR_VERSION_1_4 : if ( jdkLevel == ClassFileConstants . JDK1_4 ) return VERSION_1_4 ; break ; case ClassFileConstants . MAJOR_VERSION_1_5 : if ( jdkLevel == ClassFileConstants . JDK1_5 ) return VERSION_1_5 ; break ; case ClassFileConstants . MAJOR_VERSION_1_6 : if ( jdkLevel == ClassFileConstants . JDK1_6 ) return VERSION_1_6 ; break ; case ClassFileConstants . MAJOR_VERSION_1_7 : if ( jdkLevel == ClassFileConstants . JDK1_7 ) return VERSION_1_7 ; break ; } return Util . EMPTY_STRING ; } public static long versionToJdkLevel ( Object versionID ) { if ( versionID instanceof String ) { String version = ( String ) versionID ; if ( version . length ( ) == 3 && version . charAt ( 0 ) == '1' && version . charAt ( 1 ) == '.' ) { switch ( version . charAt ( 2 ) ) { case '1' : return ClassFileConstants . JDK1_1 ; case '2' : return ClassFileConstants . JDK1_2 ; case '3' : return ClassFileConstants . JDK1_3 ; case '4' : return ClassFileConstants . JDK1_4 ; case '5' : return ClassFileConstants . JDK1_5 ; case '6' : return ClassFileConstants . JDK1_6 ; case '7' : return ClassFileConstants . JDK1_7 ; default : return 0 ; } } if ( VERSION_JSR14 . equals ( versionID ) ) { return ClassFileConstants . JDK1_4 ; } if ( VERSION_CLDC1_1 . equals ( versionID ) ) { return ClassFileConstants . CLDC_1_1 ; } } return 0 ; } public static String [ ] warningOptionNames ( ) { String [ ] result = { OPTION_ReportAnnotationSuperInterface , OPTION_ReportAssertIdentifier , OPTION_ReportAutoboxing , OPTION_ReportComparingIdentical , OPTION_ReportDeadCode , OPTION_ReportDeadCodeInTrivialIfStatement , OPTION_ReportDeprecation , OPTION_ReportDeprecationInDeprecatedCode , OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , OPTION_ReportDiscouragedReference , OPTION_ReportEmptyStatement , OPTION_ReportEnumIdentifier , OPTION_ReportFallthroughCase , OPTION_ReportFieldHiding , OPTION_ReportFinallyBlockNotCompletingNormally , OPTION_ReportFinalParameterBound , OPTION_ReportForbiddenReference , OPTION_ReportHiddenCatchBlock , OPTION_ReportIncompatibleNonInheritedInterfaceMethod , OPTION_ReportIncompleteEnumSwitch , OPTION_ReportIndirectStaticAccess , OPTION_ReportInvalidJavadoc , OPTION_ReportInvalidJavadocTags , OPTION_ReportInvalidJavadocTagsDeprecatedRef , OPTION_ReportInvalidJavadocTagsNotVisibleRef , OPTION_ReportInvalidJavadocTagsVisibility , OPTION_ReportLocalVariableHiding , OPTION_ReportMethodCanBePotentiallyStatic , OPTION_ReportMethodCanBeStatic , OPTION_ReportMethodWithConstructorName , OPTION_ReportMissingDeprecatedAnnotation , OPTION_ReportMissingHashCodeMethod , OPTION_ReportMissingJavadocComments , OPTION_ReportMissingJavadocCommentsOverriding , OPTION_ReportMissingJavadocCommentsVisibility , OPTION_ReportMissingJavadocTagDescription , OPTION_ReportMissingJavadocTags , OPTION_ReportMissingJavadocTagsMethodTypeParameters , OPTION_ReportMissingJavadocTagsOverriding , OPTION_ReportMissingJavadocTagsVisibility , OPTION_ReportMissingOverrideAnnotation , OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , OPTION_ReportMissingSerialVersion , OPTION_ReportMissingSynchronizedOnInheritedMethod , OPTION_ReportNoEffectAssignment , OPTION_ReportNoImplicitStringConversion , OPTION_ReportNonExternalizedStringLiteral , OPTION_ReportNonStaticAccessToStatic , OPTION_ReportNullReference , OPTION_ReportOverridingMethodWithoutSuperInvocation , OPTION_ReportOverridingPackageDefaultMethod , OPTION_ReportParameterAssignment , OPTION_ReportPossibleAccidentalBooleanAssignment , OPTION_ReportPotentialNullReference , OPTION_ReportRawTypeReference , OPTION_ReportRedundantNullCheck , OPTION_ReportRedundantSuperinterface , OPTION_ReportRedundantSpecificationOfTypeArguments , OPTION_ReportSpecialParameterHidingField , OPTION_ReportSyntheticAccessEmulation , OPTION_ReportTasks , OPTION_ReportTypeParameterHiding , OPTION_ReportUnavoidableGenericTypeProblems , OPTION_ReportUncheckedTypeOperation , OPTION_ReportUndocumentedEmptyBlock , OPTION_ReportUnhandledWarningToken , OPTION_ReportUnnecessaryElse , OPTION_ReportUnnecessaryTypeCheck , OPTION_ReportUnqualifiedFieldAccess , OPTION_ReportUnusedDeclaredThrownException , OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , OPTION_ReportUnusedImport , OPTION_ReportUnusedLabel , OPTION_ReportUnusedLocal , OPTION_ReportUnusedObjectAllocation , OPTION_ReportUnusedParameter , OPTION_ReportUnusedParameterIncludeDocCommentReference , OPTION_ReportUnusedParameterWhenImplementingAbstract , OPTION_ReportUnusedParameterWhenOverridingConcrete , OPTION_ReportUnusedPrivateMember , OPTION_ReportUnusedTypeArgumentsForMethodInvocation , OPTION_ReportUnusedWarningToken , OPTION_ReportVarargsArgumentNeedCast , } ; return result ; } public static String warningTokenFromIrritant ( int irritant ) { switch ( irritant ) { case ( InvalidJavadoc | UsingDeprecatedAPI ) : case UsingDeprecatedAPI : return "deprecation" ; case FinallyBlockNotCompleting : return "finally" ; case FieldHiding : case LocalVariableHiding : case MaskedCatchBlock : return "hiding" ; case NonExternalizedString : return "nls" ; case UnnecessaryTypeCheck : return "cast" ; case IndirectStaticAccess : case NonStaticAccessToStatic : return "" ; case AccessEmulation : return "" ; case UnqualifiedFieldAccess : return "" ; case UncheckedTypeOperation : return "unchecked" ; case MissingSerialVersion : return "serial" ; case AutoBoxing : return "boxing" ; case TypeHiding : return "hiding" ; case IncompleteEnumSwitch : return "" ; case MissingDeprecatedAnnotation : return "dep-ann" ; case RawTypeReference : return "rawtypes" ; case UnusedLabel : case UnusedTypeArguments : case RedundantSuperinterface : case UnusedLocalVariable : case UnusedArgument : case UnusedImport : case UnusedPrivateMember : case UnusedDeclaredThrownException : case DeadCode : case UnusedObjectAllocation : case RedundantSpecificationOfTypeArguments : return "unused" ; case DiscouragedReference : case ForbiddenReference : return "restriction" ; case NullReference : case PotentialNullReference : case RedundantNullCheck : return "null" ; case FallthroughCase : return "fallthrough" ; case OverridingMethodWithoutSuperInvocation : return "super" ; case MethodCanBeStatic : case MethodCanBePotentiallyStatic : return "" ; case InvalidJavadoc : case MissingJavadocComments : case MissingJavadocTags : return "javadoc" ; } return null ; } public static IrritantSet warningTokenToIrritants ( String warningToken ) { if ( warningToken == null || warningToken . length ( ) == 0 ) return null ; switch ( warningToken . charAt ( 0 ) ) { case 'a' : if ( "all" . equals ( warningToken ) ) return IrritantSet . ALL ; break ; case 'b' : if ( "boxing" . equals ( warningToken ) ) return IrritantSet . BOXING ; break ; case 'c' : if ( "cast" . equals ( warningToken ) ) return IrritantSet . CAST ; break ; case 'd' : if ( "deprecation" . equals ( warningToken ) ) return IrritantSet . DEPRECATION ; if ( "dep-ann" . equals ( warningToken ) ) return IrritantSet . DEP_ANN ; break ; case 'f' : if ( "fallthrough" . equals ( warningToken ) ) return IrritantSet . FALLTHROUGH ; if ( "finally" . equals ( warningToken ) ) return IrritantSet . FINALLY ; break ; case 'h' : if ( "hiding" . equals ( warningToken ) ) return IrritantSet . HIDING ; break ; case 'i' : if ( "" . equals ( warningToken ) ) return IrritantSet . INCOMPLETE_SWITCH ; break ; case 'j' : if ( "javadoc" . equals ( warningToken ) ) return IrritantSet . JAVADOC ; break ; case 'n' : if ( "nls" . equals ( warningToken ) ) return IrritantSet . NLS ; if ( "null" . equals ( warningToken ) ) return IrritantSet . NULL ; break ; case 'r' : if ( "rawtypes" . equals ( warningToken ) ) return IrritantSet . RAW ; if ( "restriction" . equals ( warningToken ) ) return IrritantSet . RESTRICTION ; break ; case 's' : if ( "serial" . equals ( warningToken ) ) return IrritantSet . SERIAL ; if ( "" . equals ( warningToken ) ) return IrritantSet . STATIC_ACCESS ; if ( "" . equals ( warningToken ) ) return IrritantSet . STATIC_METHOD ; if ( "" . equals ( warningToken ) ) return IrritantSet . SYNTHETIC_ACCESS ; if ( "super" . equals ( warningToken ) ) { return IrritantSet . SUPER ; } break ; case 'u' : if ( "unused" . equals ( warningToken ) ) return IrritantSet . UNUSED ; if ( "unchecked" . equals ( warningToken ) ) return IrritantSet . UNCHECKED ; if ( "" . equals ( warningToken ) ) return IrritantSet . UNQUALIFIED_FIELD_ACCESS ; break ; } return null ; } public Map getMap ( ) { Map optionsMap = new HashMap ( 30 ) ; optionsMap . put ( OPTION_LocalVariableAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != 0 ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_LineNumberAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != 0 ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_SourceFileAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != 0 ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_PreserveUnusedLocal , this . preserveAllLocalVariables ? PRESERVE : OPTIMIZE_OUT ) ; optionsMap . put ( OPTION_DocCommentSupport , this . docCommentSupport ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodWithConstructorName , getSeverityString ( MethodWithConstructorName ) ) ; optionsMap . put ( OPTION_ReportOverridingPackageDefaultMethod , getSeverityString ( OverriddenPackageDefaultMethod ) ) ; optionsMap . put ( OPTION_ReportDeprecation , getSeverityString ( UsingDeprecatedAPI ) ) ; optionsMap . put ( OPTION_ReportDeprecationInDeprecatedCode , this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportHiddenCatchBlock , getSeverityString ( MaskedCatchBlock ) ) ; optionsMap . put ( OPTION_ReportUnusedLocal , getSeverityString ( UnusedLocalVariable ) ) ; optionsMap . put ( OPTION_ReportUnusedParameter , getSeverityString ( UnusedArgument ) ) ; optionsMap . put ( OPTION_ReportUnusedImport , getSeverityString ( UnusedImport ) ) ; optionsMap . put ( OPTION_ReportSyntheticAccessEmulation , getSeverityString ( AccessEmulation ) ) ; optionsMap . put ( OPTION_ReportNoEffectAssignment , getSeverityString ( NoEffectAssignment ) ) ; optionsMap . put ( OPTION_ReportNonExternalizedStringLiteral , getSeverityString ( NonExternalizedString ) ) ; optionsMap . put ( OPTION_ReportNoImplicitStringConversion , getSeverityString ( NoImplicitStringConversion ) ) ; optionsMap . put ( OPTION_ReportNonStaticAccessToStatic , getSeverityString ( NonStaticAccessToStatic ) ) ; optionsMap . put ( OPTION_ReportIndirectStaticAccess , getSeverityString ( IndirectStaticAccess ) ) ; optionsMap . put ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod , getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; optionsMap . put ( OPTION_ReportUnusedPrivateMember , getSeverityString ( UnusedPrivateMember ) ) ; optionsMap . put ( OPTION_ReportLocalVariableHiding , getSeverityString ( LocalVariableHiding ) ) ; optionsMap . put ( OPTION_ReportFieldHiding , getSeverityString ( FieldHiding ) ) ; optionsMap . put ( OPTION_ReportTypeParameterHiding , getSeverityString ( TypeHiding ) ) ; optionsMap . put ( OPTION_ReportPossibleAccidentalBooleanAssignment , getSeverityString ( AccidentalBooleanAssign ) ) ; optionsMap . put ( OPTION_ReportEmptyStatement , getSeverityString ( EmptyStatement ) ) ; optionsMap . put ( OPTION_ReportAssertIdentifier , getSeverityString ( AssertUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportEnumIdentifier , getSeverityString ( EnumUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportUndocumentedEmptyBlock , getSeverityString ( UndocumentedEmptyBlock ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryTypeCheck , getSeverityString ( UnnecessaryTypeCheck ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryElse , getSeverityString ( UnnecessaryElse ) ) ; optionsMap . put ( OPTION_ReportAutoboxing , getSeverityString ( AutoBoxing ) ) ; optionsMap . put ( OPTION_ReportAnnotationSuperInterface , getSeverityString ( AnnotationSuperInterface ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadoc , getSeverityString ( InvalidJavadoc ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsVisibility , getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTags , this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsDeprecatedRef , this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsNotVisibleRef , this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTags , getSeverityString ( MissingJavadocTags ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsVisibility , getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsOverriding , this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsMethodTypeParameters , this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocComments , getSeverityString ( MissingJavadocComments ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagDescription , this . reportMissingJavadocTagDescription ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsVisibility , getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsOverriding , this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportFinallyBlockNotCompletingNormally , getSeverityString ( FinallyBlockNotCompleting ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownException , getSeverityString ( UnusedDeclaredThrownException ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnqualifiedFieldAccess , getSeverityString ( UnqualifiedFieldAccess ) ) ; optionsMap . put ( OPTION_ReportUnavoidableGenericTypeProblems , this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUncheckedTypeOperation , getSeverityString ( UncheckedTypeOperation ) ) ; optionsMap . put ( OPTION_ReportRawTypeReference , getSeverityString ( RawTypeReference ) ) ; optionsMap . put ( OPTION_ReportFinalParameterBound , getSeverityString ( FinalParameterBound ) ) ; optionsMap . put ( OPTION_ReportMissingSerialVersion , getSeverityString ( MissingSerialVersion ) ) ; optionsMap . put ( OPTION_ReportForbiddenReference , getSeverityString ( ForbiddenReference ) ) ; optionsMap . put ( OPTION_ReportDiscouragedReference , getSeverityString ( DiscouragedReference ) ) ; optionsMap . put ( OPTION_ReportVarargsArgumentNeedCast , getSeverityString ( VarargsArgumentNeedCast ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotation , getSeverityString ( MissingOverrideAnnotation ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingDeprecatedAnnotation , getSeverityString ( MissingDeprecatedAnnotation ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportUnusedLabel , getSeverityString ( UnusedLabel ) ) ; optionsMap . put ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation , getSeverityString ( UnusedTypeArguments ) ) ; optionsMap . put ( OPTION_Compliance , versionFromJdkLevel ( this . complianceLevel ) ) ; optionsMap . put ( OPTION_Source , versionFromJdkLevel ( this . sourceLevel ) ) ; optionsMap . put ( OPTION_TargetPlatform , versionFromJdkLevel ( this . targetJDK ) ) ; optionsMap . put ( OPTION_FatalOptionalError , this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; if ( this . defaultEncoding != null ) { optionsMap . put ( OPTION_Encoding , this . defaultEncoding ) ; } optionsMap . put ( OPTION_TaskTags , this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , ',' ) ) ) ; optionsMap . put ( OPTION_TaskPriorities , this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , ',' ) ) ) ; optionsMap . put ( OPTION_TaskCaseSensitive , this . isTaskCaseSensitive ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenImplementingAbstract , this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenOverridingConcrete , this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterIncludeDocCommentReference , this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportSpecialParameterHidingField , this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_MaxProblemPerUnit , String . valueOf ( this . maxProblemsPerUnit ) ) ; optionsMap . put ( OPTION_InlineJsr , this . inlineJsrBytecode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportNullReference , getSeverityString ( NullReference ) ) ; optionsMap . put ( OPTION_ReportPotentialNullReference , getSeverityString ( PotentialNullReference ) ) ; optionsMap . put ( OPTION_ReportRedundantNullCheck , getSeverityString ( RedundantNullCheck ) ) ; optionsMap . put ( OPTION_SuppressWarnings , this . suppressWarnings ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_SuppressOptionalErrors , this . suppressOptionalErrors ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnhandledWarningToken , getSeverityString ( UnhandledWarningToken ) ) ; optionsMap . put ( OPTION_ReportUnusedWarningToken , getSeverityString ( UnusedWarningToken ) ) ; optionsMap . put ( OPTION_ReportParameterAssignment , getSeverityString ( ParameterAssignment ) ) ; optionsMap . put ( OPTION_ReportFallthroughCase , getSeverityString ( FallthroughCase ) ) ; optionsMap . put ( OPTION_ReportOverridingMethodWithoutSuperInvocation , getSeverityString ( OverridingMethodWithoutSuperInvocation ) ) ; optionsMap . put ( OPTION_GenerateClassFiles , this . generateClassFiles ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_Process_Annotations , this . processAnnotations ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportRedundantSuperinterface , getSeverityString ( RedundantSuperinterface ) ) ; optionsMap . put ( OPTION_ReportComparingIdentical , getSeverityString ( ComparingIdentical ) ) ; optionsMap . put ( OPTION_ReportMissingSynchronizedOnInheritedMethod , getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; optionsMap . put ( OPTION_ReportMissingHashCodeMethod , getSeverityString ( ShouldImplementHashcode ) ) ; optionsMap . put ( OPTION_ReportDeadCode , getSeverityString ( DeadCode ) ) ; optionsMap . put ( OPTION_ReportDeadCodeInTrivialIfStatement , this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportTasks , getSeverityString ( Tasks ) ) ; optionsMap . put ( OPTION_ReportUnusedObjectAllocation , getSeverityString ( UnusedObjectAllocation ) ) ; optionsMap . put ( OPTION_IncludeNullInfoFromAsserts , this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodCanBeStatic , getSeverityString ( MethodCanBeStatic ) ) ; optionsMap . put ( OPTION_ReportMethodCanBePotentiallyStatic , getSeverityString ( MethodCanBePotentiallyStatic ) ) ; optionsMap . put ( OPTION_ReportRedundantSpecificationOfTypeArguments , getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; optionsMap . put ( OPTIONG_GroovyTransformsToRunOnReconcile , "" ) ; return optionsMap ; } public int getSeverity ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) { if ( ( irritant & ( IrritantSet . GROUP_MASK | UnusedWarningToken ) ) == UnusedWarningToken ) { return ProblemSeverities . Error | ProblemSeverities . Optional ; } return this . treatOptionalErrorAsFatal ? ProblemSeverities . Error | ProblemSeverities . Optional | ProblemSeverities . Fatal : ProblemSeverities . Error | ProblemSeverities . Optional ; } if ( this . warningThreshold . isSet ( irritant ) ) { return ProblemSeverities . Warning | ProblemSeverities . Optional ; } return ProblemSeverities . Ignore ; } public String getSeverityString ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) return ERROR ; if ( this . warningThreshold . isSet ( irritant ) ) return WARNING ; return IGNORE ; } public String getVisibilityString ( int level ) { switch ( level & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return PUBLIC ; case ClassFileConstants . AccProtected : return PROTECTED ; case ClassFileConstants . AccPrivate : return PRIVATE ; default : return DEFAULT ; } } public boolean isAnyEnabled ( IrritantSet irritants ) { return this . warningThreshold . isAnySet ( irritants ) || this . errorThreshold . isAnySet ( irritants ) ; } protected void resetDefaults ( ) { this . errorThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_ERRORS ) ; this . warningThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_WARNINGS ) ; this . produceDebugAttributes = ClassFileConstants . ATTR_SOURCE | ClassFileConstants . ATTR_LINES ; this . complianceLevel = this . originalComplianceLevel = ClassFileConstants . JDK1_4 ; this . sourceLevel = this . originalSourceLevel = ClassFileConstants . JDK1_3 ; this . targetJDK = ClassFileConstants . JDK1_2 ; this . defaultEncoding = null ; this . verbose = Compiler . DEBUG ; this . produceReferenceInfo = false ; this . preserveAllLocalVariables = false ; this . parseLiteralExpressionsAsConstants = true ; this . maxProblemsPerUnit = 100 ; this . taskTags = null ; this . taskPriorities = null ; this . isTaskCaseSensitive = true ; this . reportDeprecationInsideDeprecatedCode = false ; this . reportDeprecationWhenOverridingDeprecatedMethod = false ; this . reportUnusedParameterWhenImplementingAbstract = false ; this . reportUnusedParameterWhenOverridingConcrete = false ; this . reportUnusedParameterIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; this . reportSpecialParameterHidingField = false ; this . reportUnavoidableGenericTypeProblems = true ; this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportInvalidJavadocTags = false ; this . reportInvalidJavadocTagsDeprecatedRef = false ; this . reportInvalidJavadocTagsNotVisibleRef = false ; this . reportMissingJavadocTagDescription = RETURN_TAG ; this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocTagsOverriding = false ; this . reportMissingJavadocTagsMethodTypeParameters = false ; this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocCommentsOverriding = false ; this . inlineJsrBytecode = false ; this . docCommentSupport = false ; this . suppressWarnings = true ; this . suppressOptionalErrors = false ; this . treatOptionalErrorAsFatal = false ; this . performMethodsFullRecovery = true ; this . performStatementsRecovery = true ; this . storeAnnotations = false ; this . generateClassFiles = true ; this . processAnnotations = false ; this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; this . reportDeadCodeInTrivialIfStatement = false ; this . ignoreMethodBodies = false ; this . includeNullInfoFromAsserts = false ; } public void set ( Map optionsMap ) { Object optionValue ; if ( ( optionValue = optionsMap . get ( OPTION_LocalVariableAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_VARS ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_VARS ; } } if ( ( optionValue = optionsMap . get ( OPTION_LineNumberAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_LINES ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_LINES ; } } if ( ( optionValue = optionsMap . get ( OPTION_SourceFileAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_SOURCE ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_SOURCE ; } } if ( ( optionValue = optionsMap . get ( OPTION_PreserveUnusedLocal ) ) != null ) { if ( PRESERVE . equals ( optionValue ) ) { this . preserveAllLocalVariables = true ; } else if ( OPTIMIZE_OUT . equals ( optionValue ) ) { this . preserveAllLocalVariables = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationInDeprecatedCode ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Compliance ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != 0 ) this . complianceLevel = this . originalComplianceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_Source ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != 0 ) this . sourceLevel = this . originalSourceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_TargetPlatform ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != 0 ) { this . targetJDK = level ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 ) this . inlineJsrBytecode = true ; } if ( ( optionValue = optionsMap . get ( OPTION_Encoding ) ) != null ) { if ( optionValue instanceof String ) { this . defaultEncoding = null ; String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ 0 ] ) , stringValue ) ; this . defaultEncoding = stringValue ; } catch ( UnsupportedEncodingException e ) { } } } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenImplementingAbstract ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenOverridingConcrete ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportSpecialParameterHidingField ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnavoidableGenericTypeProblems ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCodeInTrivialIfStatement ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_MaxProblemPerUnit ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; try { int val = Integer . parseInt ( stringValue ) ; if ( val >= 0 ) this . maxProblemsPerUnit = val ; } catch ( NumberFormatException e ) { } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskTags ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == 0 ) { this . taskTags = null ; } else { this . taskTags = CharOperation . splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskPriorities ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == 0 ) { this . taskPriorities = null ; } else { this . taskPriorities = CharOperation . splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskCaseSensitive ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_InlineJsr ) ) != null ) { if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( ENABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = false ; } } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressWarnings ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressWarnings = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressWarnings = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressOptionalErrors ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_FatalOptionalError ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_IncludeNullInfoFromAsserts ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodWithConstructorName ) ) != null ) updateSeverity ( MethodWithConstructorName , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingPackageDefaultMethod ) ) != null ) updateSeverity ( OverriddenPackageDefaultMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecation ) ) != null ) updateSeverity ( UsingDeprecatedAPI , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportHiddenCatchBlock ) ) != null ) updateSeverity ( MaskedCatchBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLocal ) ) != null ) updateSeverity ( UnusedLocalVariable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameter ) ) != null ) updateSeverity ( UnusedArgument , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedImport ) ) != null ) updateSeverity ( UnusedImport , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedPrivateMember ) ) != null ) updateSeverity ( UnusedPrivateMember , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownException ) ) != null ) updateSeverity ( UnusedDeclaredThrownException , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoImplicitStringConversion ) ) != null ) updateSeverity ( NoImplicitStringConversion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportSyntheticAccessEmulation ) ) != null ) updateSeverity ( AccessEmulation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportLocalVariableHiding ) ) != null ) updateSeverity ( LocalVariableHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFieldHiding ) ) != null ) updateSeverity ( FieldHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTypeParameterHiding ) ) != null ) updateSeverity ( TypeHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPossibleAccidentalBooleanAssignment ) ) != null ) updateSeverity ( AccidentalBooleanAssign , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEmptyStatement ) ) != null ) updateSeverity ( EmptyStatement , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonExternalizedStringLiteral ) ) != null ) updateSeverity ( NonExternalizedString , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAssertIdentifier ) ) != null ) updateSeverity ( AssertUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEnumIdentifier ) ) != null ) updateSeverity ( EnumUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonStaticAccessToStatic ) ) != null ) updateSeverity ( NonStaticAccessToStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIndirectStaticAccess ) ) != null ) updateSeverity ( IndirectStaticAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod ) ) != null ) updateSeverity ( IncompatibleNonInheritedInterfaceMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUndocumentedEmptyBlock ) ) != null ) updateSeverity ( UndocumentedEmptyBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryTypeCheck ) ) != null ) updateSeverity ( UnnecessaryTypeCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryElse ) ) != null ) updateSeverity ( UnnecessaryElse , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinallyBlockNotCompletingNormally ) ) != null ) updateSeverity ( FinallyBlockNotCompleting , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnqualifiedFieldAccess ) ) != null ) updateSeverity ( UnqualifiedFieldAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoEffectAssignment ) ) != null ) updateSeverity ( NoEffectAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUncheckedTypeOperation ) ) != null ) updateSeverity ( UncheckedTypeOperation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRawTypeReference ) ) != null ) updateSeverity ( RawTypeReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinalParameterBound ) ) != null ) updateSeverity ( FinalParameterBound , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSerialVersion ) ) != null ) updateSeverity ( MissingSerialVersion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportForbiddenReference ) ) != null ) updateSeverity ( ForbiddenReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDiscouragedReference ) ) != null ) updateSeverity ( DiscouragedReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportVarargsArgumentNeedCast ) ) != null ) updateSeverity ( VarargsArgumentNeedCast , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNullReference ) ) != null ) updateSeverity ( NullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPotentialNullReference ) ) != null ) updateSeverity ( PotentialNullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantNullCheck ) ) != null ) updateSeverity ( RedundantNullCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAutoboxing ) ) != null ) updateSeverity ( AutoBoxing , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAnnotationSuperInterface ) ) != null ) updateSeverity ( AnnotationSuperInterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotation ) ) != null ) updateSeverity ( MissingOverrideAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingDeprecatedAnnotation ) ) != null ) updateSeverity ( MissingDeprecatedAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompleteEnumSwitch ) ) != null ) updateSeverity ( IncompleteEnumSwitch , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnhandledWarningToken ) ) != null ) updateSeverity ( UnhandledWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedWarningToken ) ) != null ) updateSeverity ( UnusedWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLabel ) ) != null ) updateSeverity ( UnusedLabel , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportParameterAssignment ) ) != null ) updateSeverity ( ParameterAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFallthroughCase ) ) != null ) updateSeverity ( FallthroughCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingMethodWithoutSuperInvocation ) ) != null ) updateSeverity ( OverridingMethodWithoutSuperInvocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation ) ) != null ) updateSeverity ( UnusedTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSuperinterface ) ) != null ) updateSeverity ( RedundantSuperinterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportComparingIdentical ) ) != null ) updateSeverity ( ComparingIdentical , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSynchronizedOnInheritedMethod ) ) != null ) updateSeverity ( MissingSynchronizedModifierInInheritedMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingHashCodeMethod ) ) != null ) updateSeverity ( ShouldImplementHashcode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCode ) ) != null ) updateSeverity ( DeadCode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTasks ) ) != null ) updateSeverity ( Tasks , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedObjectAllocation ) ) != null ) updateSeverity ( UnusedObjectAllocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBeStatic ) ) != null ) updateSeverity ( MethodCanBeStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBePotentiallyStatic ) ) != null ) updateSeverity ( MethodCanBePotentiallyStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSpecificationOfTypeArguments ) ) != null ) updateSeverity ( RedundantSpecificationOfTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_DocCommentSupport ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . docCommentSupport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . docCommentSupport = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadoc ) ) != null ) { updateSeverity ( InvalidJavadoc , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTags ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsDeprecatedRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsNotVisibleRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTags ) ) != null ) { updateSeverity ( MissingJavadocTags , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsMethodTypeParameters ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocComments ) ) != null ) { updateSeverity ( MissingJavadocComments , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagDescription ) ) != null ) { this . reportMissingJavadocTagDescription = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_GenerateClassFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . generateClassFiles = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . generateClassFiles = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Process_Annotations ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . processAnnotations = true ; this . storeAnnotations = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . processAnnotations = false ; this . storeAnnotations = false ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_BuildGroovyFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . buildGroovyFiles = 2 ; this . storeAnnotations = true ; String s = ( String ) optionsMap . get ( OPTIONG_GroovyFlags ) ; if ( s != null && s . equals ( "1" ) ) { this . groovyFlags = 0x01 ; } else { this . groovyFlags = 0 ; } } else if ( DISABLED . equals ( optionValue ) ) { this . buildGroovyFiles = 1 ; this . groovyFlags = 0 ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyClassLoaderPath ) ) != null ) { this . groovyClassLoaderPath = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyExtraImports ) ) != null ) { this . groovyExtraImports = ( String ) optionValue ; } else { if ( sysPropConfiguredExtraImports != null ) { this . groovyExtraImports = sysPropConfiguredExtraImports ; } } optionValue = optionsMap . get ( OPTIONG_GroovyTransformsToRunOnReconcile ) ; if ( optionValue != null && ( ( String ) optionValue ) . length ( ) != 0 ) { this . groovyTransformsToRunOnReconcile = ( String ) optionValue ; } else { if ( sysPropConfiguredGroovyTransforms != null ) { this . groovyTransformsToRunOnReconcile = sysPropConfiguredGroovyTransforms ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyProjectName ) ) != null ) { this . groovyProjectName = ( String ) optionValue ; } } static String sysPropConfiguredExtraImports = null ; static String sysPropConfiguredGroovyTransforms = null ; static { try { sysPropConfiguredExtraImports = System . getProperty ( "" ) ; } catch ( Exception e ) { sysPropConfiguredExtraImports = null ; } try { sysPropConfiguredGroovyTransforms = System . getProperty ( "" ) ; } catch ( Exception e ) { sysPropConfiguredGroovyTransforms = null ; } } public String toString ( ) { StringBuffer buf = new StringBuffer ( "" ) ; buf . append ( "" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != 0 ? "ON" : " OFF" ) ; buf . append ( "" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != 0 ? "ON" : " OFF" ) ; buf . append ( "" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != 0 ? "ON" : " OFF" ) ; buf . append ( "" ) . append ( this . preserveAllLocalVariables ? "ON" : " OFF" ) ; buf . append ( "" ) . append ( getSeverityString ( MethodWithConstructorName ) ) ; buf . append ( "" ) . append ( getSeverityString ( OverriddenPackageDefaultMethod ) ) ; buf . append ( "" ) . append ( getSeverityString ( UsingDeprecatedAPI ) ) ; buf . append ( "" ) . append ( getSeverityString ( MaskedCatchBlock ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedLocalVariable ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedArgument ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedImport ) ) ; buf . append ( "" ) . append ( getSeverityString ( AccessEmulation ) ) ; buf . append ( "" ) . append ( getSeverityString ( NoEffectAssignment ) ) ; buf . append ( "" ) . append ( getSeverityString ( NonExternalizedString ) ) ; buf . append ( "" ) . append ( getSeverityString ( NonStaticAccessToStatic ) ) ; buf . append ( "" ) . append ( getSeverityString ( IndirectStaticAccess ) ) ; buf . append ( "" ) . append ( getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedPrivateMember ) ) ; buf . append ( "" ) . append ( getSeverityString ( LocalVariableHiding ) ) ; buf . append ( "" ) . append ( getSeverityString ( FieldHiding ) ) ; buf . append ( "" ) . append ( getSeverityString ( TypeHiding ) ) ; buf . append ( "" ) . append ( getSeverityString ( AccidentalBooleanAssign ) ) ; buf . append ( "" ) . append ( getSeverityString ( EmptyStatement ) ) ; buf . append ( "" ) . append ( getSeverityString ( UndocumentedEmptyBlock ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnnecessaryTypeCheck ) ) ; buf . append ( "" ) . append ( this . docCommentSupport ? "ON" : " OFF" ) ; buf . append ( "" ) . append ( getSeverityString ( InvalidJavadoc ) ) ; buf . append ( "" ) . append ( this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; buf . append ( "" ) . append ( getSeverityString ( MissingJavadocTags ) ) ; buf . append ( "" ) . append ( getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; buf . append ( "" ) . append ( this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( MissingJavadocComments ) ) ; buf . append ( "" ) . append ( this . reportMissingJavadocTagDescription ) ; buf . append ( "" ) . append ( getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; buf . append ( "" ) . append ( this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( FinallyBlockNotCompleting ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedDeclaredThrownException ) ) ; buf . append ( "" ) . append ( this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( UnnecessaryElse ) ) ; buf . append ( "" + versionFromJdkLevel ( this . complianceLevel ) ) ; buf . append ( "" + versionFromJdkLevel ( this . sourceLevel ) ) ; buf . append ( "" + versionFromJdkLevel ( this . targetJDK ) ) ; buf . append ( "" ) . append ( this . verbose ? "ON" : "OFF" ) ; buf . append ( "" ) . append ( this . produceReferenceInfo ? "ON" : "OFF" ) ; buf . append ( "" ) . append ( this . parseLiteralExpressionsAsConstants ? "ON" : "OFF" ) ; buf . append ( "" ) . append ( this . defaultEncoding == null ? "<default>" : this . defaultEncoding ) ; buf . append ( "" ) . append ( this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , ',' ) ) ) ; buf . append ( "" ) . append ( this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , ',' ) ) ) ; buf . append ( "" ) . append ( this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . inlineJsrBytecode ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( UncheckedTypeOperation ) ) ; buf . append ( "" ) . append ( getSeverityString ( RawTypeReference ) ) ; buf . append ( "" ) . append ( getSeverityString ( FinalParameterBound ) ) ; buf . append ( "" ) . append ( getSeverityString ( MissingSerialVersion ) ) ; buf . append ( "" ) . append ( getSeverityString ( VarargsArgumentNeedCast ) ) ; buf . append ( "" ) . append ( getSeverityString ( ForbiddenReference ) ) ; buf . append ( "" ) . append ( getSeverityString ( DiscouragedReference ) ) ; buf . append ( "" ) . append ( getSeverityString ( NullReference ) ) ; buf . append ( "" ) . append ( getSeverityString ( PotentialNullReference ) ) ; buf . append ( "" ) . append ( getSeverityString ( RedundantNullCheck ) ) ; buf . append ( "" ) . append ( getSeverityString ( AutoBoxing ) ) ; buf . append ( "" ) . append ( getSeverityString ( AnnotationSuperInterface ) ) ; buf . append ( "" ) . append ( getSeverityString ( MissingOverrideAnnotation ) ) ; buf . append ( "" ) . append ( this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( MissingDeprecatedAnnotation ) ) ; buf . append ( "" ) . append ( getSeverityString ( IncompleteEnumSwitch ) ) ; buf . append ( "" ) . append ( this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . suppressWarnings ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . suppressOptionalErrors ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( UnhandledWarningToken ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedWarningToken ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedLabel ) ) ; buf . append ( "" ) . append ( this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( ParameterAssignment ) ) ; buf . append ( "" ) . append ( this . generateClassFiles ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( this . processAnnotations ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedTypeArguments ) ) ; buf . append ( "" ) . append ( getSeverityString ( RedundantSuperinterface ) ) ; buf . append ( "" ) . append ( getSeverityString ( ComparingIdentical ) ) ; buf . append ( "" ) . append ( getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; buf . append ( "" ) . append ( getSeverityString ( ShouldImplementHashcode ) ) ; buf . append ( "" ) . append ( getSeverityString ( DeadCode ) ) ; buf . append ( "" ) . append ( this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; buf . append ( "" ) . append ( getSeverityString ( Tasks ) ) ; buf . append ( "" ) . append ( getSeverityString ( UnusedObjectAllocation ) ) ; buf . append ( "" ) . append ( getSeverityString ( MethodCanBeStatic ) ) ; buf . append ( "" ) . append ( getSeverityString ( MethodCanBePotentiallyStatic ) ) ; buf . append ( "" ) . append ( getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; buf . append ( "" ) . append ( ( this . buildGroovyFiles == 0 ) ? "dontknow" : ( this . buildGroovyFiles == 1 ? "no" : "yes" ) ) ; buf . append ( "" ) . append ( Integer . toHexString ( this . groovyFlags ) ) ; buf . append ( "" ) . append ( this . groovyClassLoaderPath ) ; buf . append ( "" ) . append ( this . groovyProjectName ) ; buf . append ( "" ) . append ( this . groovyExtraImports ) ; return buf . toString ( ) ; } protected void updateSeverity ( int irritant , Object severityString ) { if ( ERROR . equals ( severityString ) ) { this . errorThreshold . set ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } else if ( WARNING . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . set ( irritant ) ; } else if ( IGNORE . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } } } </s>