Lines 902-905
Link Here
|
902 |
} |
902 |
} |
903 |
return (String) categoryNames.get(new Integer(category)); |
903 |
return (String) categoryNames.get(new Integer(category)); |
904 |
} |
904 |
} |
|
|
905 |
// compiler problems tuning |
906 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=218603 |
907 |
public void testONLY_012_compiler_problems_tuning() { |
908 |
try { |
909 |
class ProblemAttributes { |
910 |
boolean skip; |
911 |
String option; |
912 |
ProblemAttributes(String option) { |
913 |
this.option = option; |
914 |
} |
915 |
ProblemAttributes(boolean skip) { |
916 |
this.skip = skip; |
917 |
} |
918 |
} |
919 |
ProblemAttributes SKIP = new ProblemAttributes(true); |
920 |
Map expectedProblemAttributes = new HashMap(); |
921 |
expectedProblemAttributes.put("ObjectHasNoSuperclass", SKIP); |
922 |
expectedProblemAttributes.put("UndefinedType", SKIP); |
923 |
expectedProblemAttributes.put("NotVisibleType", SKIP); |
924 |
expectedProblemAttributes.put("AmbiguousType", SKIP); |
925 |
expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); |
926 |
expectedProblemAttributes.put("InternalTypeNameProvided", SKIP); |
927 |
expectedProblemAttributes.put("UnusedPrivateType", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); |
928 |
expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", SKIP); |
929 |
expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", SKIP); |
930 |
expectedProblemAttributes.put("TypeMismatch", SKIP); |
931 |
expectedProblemAttributes.put("IndirectAccessToStaticType", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); |
932 |
expectedProblemAttributes.put("MissingEnclosingInstanceForConstructorCall", SKIP); |
933 |
expectedProblemAttributes.put("MissingEnclosingInstance", SKIP); |
934 |
expectedProblemAttributes.put("IncorrectEnclosingInstanceReference", SKIP); |
935 |
expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP); |
936 |
expectedProblemAttributes.put("CannotDefineStaticInitializerInLocalType", SKIP); |
937 |
expectedProblemAttributes.put("OuterLocalMustBeFinal", SKIP); |
938 |
expectedProblemAttributes.put("CannotDefineInterfaceInLocalType", SKIP); |
939 |
expectedProblemAttributes.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", SKIP); |
940 |
expectedProblemAttributes.put("EnclosingInstanceInConstructorCall", SKIP); |
941 |
expectedProblemAttributes.put("AnonymousClassCannotExtendFinalClass", SKIP); |
942 |
expectedProblemAttributes.put("CannotDefineAnnotationInLocalType", SKIP); |
943 |
expectedProblemAttributes.put("CannotDefineEnumInLocalType", SKIP); |
944 |
expectedProblemAttributes.put("NonStaticContextForEnumMemberType", SKIP); |
945 |
expectedProblemAttributes.put("TypeHidingType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); |
946 |
expectedProblemAttributes.put("UndefinedName", SKIP); |
947 |
expectedProblemAttributes.put("UninitializedLocalVariable", SKIP); |
948 |
expectedProblemAttributes.put("VariableTypeCannotBeVoid", SKIP); |
949 |
expectedProblemAttributes.put("VariableTypeCannotBeVoidArray", SKIP); |
950 |
expectedProblemAttributes.put("CannotAllocateVoidArray", SKIP); |
951 |
expectedProblemAttributes.put("RedefinedLocal", SKIP); |
952 |
expectedProblemAttributes.put("RedefinedArgument", SKIP); |
953 |
expectedProblemAttributes.put("DuplicateFinalLocalInitialization", SKIP); |
954 |
expectedProblemAttributes.put("NonBlankFinalLocalAssignment", SKIP); |
955 |
expectedProblemAttributes.put("ParameterAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_PARAMETER_ASSIGNMENT)); |
956 |
expectedProblemAttributes.put("FinalOuterLocalAssignment", SKIP); |
957 |
expectedProblemAttributes.put("LocalVariableIsNeverUsed", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LOCAL)); |
958 |
expectedProblemAttributes.put("ArgumentIsNeverUsed", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PARAMETER)); |
959 |
expectedProblemAttributes.put("BytecodeExceeds64KLimit", SKIP); |
960 |
expectedProblemAttributes.put("BytecodeExceeds64KLimitForClinit", SKIP); |
961 |
expectedProblemAttributes.put("TooManyArgumentSlots", SKIP); |
962 |
expectedProblemAttributes.put("TooManyLocalVariableSlots", SKIP); |
963 |
expectedProblemAttributes.put("TooManySyntheticArgumentSlots", SKIP); |
964 |
expectedProblemAttributes.put("TooManyArrayDimensions", SKIP); |
965 |
expectedProblemAttributes.put("BytecodeExceeds64KLimitForConstructor", SKIP); |
966 |
expectedProblemAttributes.put("UndefinedField", SKIP); |
967 |
expectedProblemAttributes.put("NotVisibleField", SKIP); |
968 |
expectedProblemAttributes.put("AmbiguousField", SKIP); |
969 |
expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); |
970 |
expectedProblemAttributes.put("NonStaticFieldFromStaticInvocation", SKIP); |
971 |
expectedProblemAttributes.put("ReferenceToForwardField", SKIP); |
972 |
expectedProblemAttributes.put("NonStaticAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); |
973 |
expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); |
974 |
expectedProblemAttributes.put("IndirectAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); |
975 |
expectedProblemAttributes.put("UnqualifiedFieldAccess", new ProblemAttributes(JavaCore.COMPILER_PB_UNQUALIFIED_FIELD_ACCESS)); |
976 |
expectedProblemAttributes.put("FinalFieldAssignment", SKIP); |
977 |
expectedProblemAttributes.put("UninitializedBlankFinalField", SKIP); |
978 |
expectedProblemAttributes.put("DuplicateBlankFinalFieldInitialization", SKIP); |
979 |
expectedProblemAttributes.put("LocalVariableHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); |
980 |
expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); |
981 |
expectedProblemAttributes.put("FieldHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); |
982 |
expectedProblemAttributes.put("FieldHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); |
983 |
expectedProblemAttributes.put("ArgumentHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); |
984 |
expectedProblemAttributes.put("ArgumentHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); |
985 |
expectedProblemAttributes.put("MissingSerialVersion", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SERIAL_VERSION)); |
986 |
expectedProblemAttributes.put("UndefinedMethod", SKIP); |
987 |
expectedProblemAttributes.put("NotVisibleMethod", SKIP); |
988 |
expectedProblemAttributes.put("AmbiguousMethod", SKIP); |
989 |
expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); |
990 |
expectedProblemAttributes.put("DirectInvocationOfAbstractMethod", SKIP); |
991 |
expectedProblemAttributes.put("VoidMethodReturnsValue", SKIP); |
992 |
expectedProblemAttributes.put("MethodReturnsVoid", SKIP); |
993 |
expectedProblemAttributes.put("MethodRequiresBody", SKIP); |
994 |
expectedProblemAttributes.put("ShouldReturnValue", SKIP); |
995 |
expectedProblemAttributes.put("MethodButWithConstructorName", new ProblemAttributes(JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME)); |
996 |
expectedProblemAttributes.put("MissingReturnType", SKIP); |
997 |
expectedProblemAttributes.put("BodyForNativeMethod", SKIP); |
998 |
expectedProblemAttributes.put("BodyForAbstractMethod", SKIP); |
999 |
expectedProblemAttributes.put("NoMessageSendOnBaseType", SKIP); |
1000 |
expectedProblemAttributes.put("ParameterMismatch", SKIP); |
1001 |
expectedProblemAttributes.put("NoMessageSendOnArrayType", SKIP); |
1002 |
expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); |
1003 |
expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); |
1004 |
expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); |
1005 |
expectedProblemAttributes.put("MissingTypeInMethod", SKIP); |
1006 |
expectedProblemAttributes.put("MissingTypeInConstructor", SKIP); |
1007 |
expectedProblemAttributes.put("UndefinedConstructor", SKIP); |
1008 |
expectedProblemAttributes.put("NotVisibleConstructor", SKIP); |
1009 |
expectedProblemAttributes.put("AmbiguousConstructor", SKIP); |
1010 |
expectedProblemAttributes.put("UsingDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); |
1011 |
expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); |
1012 |
expectedProblemAttributes.put("InstanceFieldDuringConstructorInvocation", SKIP); |
1013 |
expectedProblemAttributes.put("InstanceMethodDuringConstructorInvocation", SKIP); |
1014 |
expectedProblemAttributes.put("RecursiveConstructorInvocation", SKIP); |
1015 |
expectedProblemAttributes.put("ThisSuperDuringConstructorInvocation", SKIP); |
1016 |
expectedProblemAttributes.put("InvalidExplicitConstructorCall", SKIP); |
1017 |
expectedProblemAttributes.put("UndefinedConstructorInDefaultConstructor", SKIP); |
1018 |
expectedProblemAttributes.put("NotVisibleConstructorInDefaultConstructor", SKIP); |
1019 |
expectedProblemAttributes.put("AmbiguousConstructorInDefaultConstructor", SKIP); |
1020 |
expectedProblemAttributes.put("UndefinedConstructorInImplicitConstructorCall", SKIP); |
1021 |
expectedProblemAttributes.put("NotVisibleConstructorInImplicitConstructorCall", SKIP); |
1022 |
expectedProblemAttributes.put("AmbiguousConstructorInImplicitConstructorCall", SKIP); |
1023 |
expectedProblemAttributes.put("UnhandledExceptionInDefaultConstructor", SKIP); |
1024 |
expectedProblemAttributes.put("UnhandledExceptionInImplicitConstructorCall", SKIP); |
1025 |
expectedProblemAttributes.put("ArrayReferenceRequired", SKIP); |
1026 |
expectedProblemAttributes.put("NoImplicitStringConversionForCharArrayExpression", new ProblemAttributes(JavaCore.COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION)); |
1027 |
expectedProblemAttributes.put("StringConstantIsExceedingUtf8Limit", SKIP); |
1028 |
expectedProblemAttributes.put("NonConstantExpression", SKIP); |
1029 |
expectedProblemAttributes.put("NumericValueOutOfRange", SKIP); |
1030 |
expectedProblemAttributes.put("IllegalCast", SKIP); |
1031 |
expectedProblemAttributes.put("InvalidClassInstantiation", SKIP); |
1032 |
expectedProblemAttributes.put("CannotDefineDimensionExpressionsWithInit", SKIP); |
1033 |
expectedProblemAttributes.put("MustDefineEitherDimensionExpressionsOrInitializer", SKIP); |
1034 |
expectedProblemAttributes.put("InvalidOperator", SKIP); |
1035 |
expectedProblemAttributes.put("CodeCannotBeReached", SKIP); |
1036 |
expectedProblemAttributes.put("CannotReturnInInitializer", SKIP); |
1037 |
expectedProblemAttributes.put("InitializerMustCompleteNormally", SKIP); |
1038 |
expectedProblemAttributes.put("InvalidVoidExpression", SKIP); |
1039 |
expectedProblemAttributes.put("MaskedCatch", new ProblemAttributes(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK)); |
1040 |
expectedProblemAttributes.put("DuplicateDefaultCase", SKIP); |
1041 |
expectedProblemAttributes.put("UnreachableCatch", SKIP); |
1042 |
expectedProblemAttributes.put("UnhandledException", SKIP); |
1043 |
expectedProblemAttributes.put("IncorrectSwitchType", SKIP); |
1044 |
expectedProblemAttributes.put("DuplicateCase", SKIP); |
1045 |
expectedProblemAttributes.put("DuplicateLabel", SKIP); |
1046 |
expectedProblemAttributes.put("InvalidBreak", SKIP); |
1047 |
expectedProblemAttributes.put("InvalidContinue", SKIP); |
1048 |
expectedProblemAttributes.put("UndefinedLabel", SKIP); |
1049 |
expectedProblemAttributes.put("InvalidTypeToSynchronized", SKIP); |
1050 |
expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP); |
1051 |
expectedProblemAttributes.put("CannotThrowNull", SKIP); |
1052 |
expectedProblemAttributes.put("AssignmentHasNoEffect", new ProblemAttributes(JavaCore.COMPILER_PB_NO_EFFECT_ASSIGNMENT)); |
1053 |
expectedProblemAttributes.put("PossibleAccidentalBooleanAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT)); |
1054 |
expectedProblemAttributes.put("SuperfluousSemicolon", new ProblemAttributes(JavaCore.COMPILER_PB_EMPTY_STATEMENT)); |
1055 |
expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); |
1056 |
expectedProblemAttributes.put("UnnecessaryArgumentCast", SKIP); |
1057 |
expectedProblemAttributes.put("UnnecessaryInstanceof", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); |
1058 |
expectedProblemAttributes.put("FinallyMustCompleteNormally", new ProblemAttributes(JavaCore.COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING)); |
1059 |
expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); |
1060 |
expectedProblemAttributes.put("UnusedConstructorDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); |
1061 |
expectedProblemAttributes.put("InvalidCatchBlockSequence", SKIP); |
1062 |
expectedProblemAttributes.put("EmptyControlFlowStatement", new ProblemAttributes(JavaCore.COMPILER_PB_EMPTY_STATEMENT)); |