From b292163260096a50adcf906c7b19f43c1b18a0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20D=C3=A9camps?= Date: Thu, 18 Oct 2018 00:29:30 +0200 Subject: [PATCH 1/2] Add all error=prone checks --- .bazelrc | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 337 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 7a7c74b6b..544ce3ec6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,340 @@ -# https://errorprone.info/ +http://errorprone.info/bugpatterns +build --javacopt "-Xep:ArrayEquals:ERROR" +build --javacopt "-Xep:ArrayFillIncompatibleType:ERROR" +build --javacopt "-Xep:ArrayHashCode:ERROR" +build --javacopt "-Xep:ArrayToString:ERROR" +build --javacopt "-Xep:ArraysAsListPrimitiveArray:ERROR" +build --javacopt "-Xep:AsyncCallableReturnsNull:ERROR" +build --javacopt "-Xep:AsyncFunctionReturnsNull:ERROR" +build --javacopt "-Xep:AutoValueConstructorOrderChecker:ERROR" +build --javacopt "-Xep:BadShiftAmount:ERROR" +build --javacopt "-Xep:BundleDeserializationCast:ERROR" +build --javacopt "-Xep:ChainingConstructorIgnoresParameter:ERROR" +build --javacopt "-Xep:CheckReturnValue:ERROR" +build --javacopt "-Xep:CollectionIncompatibleType:ERROR" +build --javacopt "-Xep:ComparableType:ERROR" +build --javacopt "-Xep:ComparingThisWithNull:ERROR" +build --javacopt "-Xep:ComparisonOutOfRange:ERROR" +build --javacopt "-Xep:CompatibleWithAnnotationMisuse:ERROR" +build --javacopt "-Xep:CompileTimeConstant:ERROR" +build --javacopt "-Xep:ComplexBooleanConstant:ERROR" +build --javacopt "-Xep:ConditionalExpressionNumericPromotion:ERROR" +build --javacopt "-Xep:ConstantOverflow:ERROR" +build --javacopt "-Xep:DaggerProvidesNull:ERROR" +build --javacopt "-Xep:DeadException:ERROR" +build --javacopt "-Xep:DeadThread:ERROR" +build --javacopt "-Xep:DoNotCall:ERROR" +build --javacopt "-Xep:EqualsNaN:ERROR" +build --javacopt "-Xep:EqualsReference:ERROR" +build --javacopt "-Xep:EqualsWrongThing:ERROR" +build --javacopt "-Xep:ForOverride:ERROR" +build --javacopt "-Xep:FormatString:ERROR" +build --javacopt "-Xep:FormatStringAnnotation:ERROR" +build --javacopt "-Xep:FunctionalInterfaceMethodChanged:ERROR" +build --javacopt "-Xep:FuturesGetCheckedIllegalExceptionType:ERROR" +build --javacopt "-Xep:GetClassOnAnnotation:ERROR" +build --javacopt "-Xep:GetClassOnClass:ERROR" +build --javacopt "-Xep:GuardedBy:ERROR" +build --javacopt "-Xep:GuiceAssistedInjectScoping:ERROR" +build --javacopt "-Xep:GuiceAssistedParameters:ERROR" +build --javacopt "-Xep:GuiceInjectOnFinalField:ERROR" +build --javacopt "-Xep:HashtableContains:ERROR" +build --javacopt "-Xep:IdentityBinaryExpression:ERROR" +build --javacopt "-Xep:Immutable:ERROR" +build --javacopt "-Xep:ImmutableModification:ERROR" +build --javacopt "-Xep:IncompatibleArgumentType:ERROR" +build --javacopt "-Xep:IndexOfChar:ERROR" +build --javacopt "-Xep:InexactVarargsConditional:ERROR" +build --javacopt "-Xep:InfiniteRecursion:ERROR" +build --javacopt "-Xep:InjectMoreThanOneScopeAnnotationOnClass:ERROR" +build --javacopt "-Xep:InjectOnMemberAndConstructor:ERROR" +build --javacopt "-Xep:InvalidPatternSyntax:ERROR" +build --javacopt "-Xep:InvalidTimeZoneID:ERROR" +build --javacopt "-Xep:IsInstanceOfClass:ERROR" +build --javacopt "-Xep:IsLoggableTagLength:ERROR" +build --javacopt "-Xep:JUnit3TestNotRun:ERROR" +build --javacopt "-Xep:JUnit4ClassAnnotationNonStatic:ERROR" +build --javacopt "-Xep:JUnit4SetUpNotRun:ERROR" +build --javacopt "-Xep:JUnit4TearDownNotRun:ERROR" +build --javacopt "-Xep:JUnit4TestNotRun:ERROR" +build --javacopt "-Xep:JUnitAssertSameCheck:ERROR" +build --javacopt "-Xep:JavaxInjectOnAbstractMethod:ERROR" +build --javacopt "-Xep:LiteByteStringUtf8:ERROR" +build --javacopt "-Xep:This pattern will silently corrupt certain byte sequences from the serialized protocol message. Use ByteString or byte[] directly:ERROR" +build --javacopt "-Xep::ERROR" +build --javacopt "-Xep:LoopConditionChecker:ERROR" +build --javacopt "-Xep:MathRoundIntLong:ERROR" +build --javacopt "-Xep:MislabeledAndroidString:ERROR" +build --javacopt "-Xep:MissingSuperCall:ERROR" +build --javacopt "-Xep:MissingTestCall:ERROR" +build --javacopt "-Xep:MisusedWeekYear:ERROR" +build --javacopt "-Xep:MockitoCast:ERROR" +build --javacopt "-Xep:MockitoUsage:ERROR" +build --javacopt "-Xep:ModifyingCollectionWithItself:ERROR" +build --javacopt "-Xep:MoreThanOneInjectableConstructor:ERROR" +build --javacopt "-Xep:MustBeClosedChecker:ERROR" +build --javacopt "-Xep:NCopiesOfChar:ERROR" +build --javacopt "-Xep:NonCanonicalStaticImport:ERROR" +build --javacopt "-Xep:NonFinalCompileTimeConstant:ERROR" +build --javacopt "-Xep:NonRuntimeAnnotation:ERROR" +build --javacopt "-Xep:NullTernary:ERROR" +build --javacopt "-Xep:OptionalEquality:ERROR" +build --javacopt "-Xep:OverlappingQualifierAndScopeAnnotation:ERROR" +build --javacopt "-Xep:OverridesJavaxInjectableMethod:ERROR" +build --javacopt "-Xep:PackageInfo:ERROR" +build --javacopt "-Xep:ParcelableCreator:ERROR" +build --javacopt "-Xep:PreconditionsCheckNotNull:ERROR" +build --javacopt "-Xep:PreconditionsCheckNotNullPrimitive:ERROR" +build --javacopt "-Xep:PredicateIncompatibleType:ERROR" +build --javacopt "-Xep:PrivateSecurityContractProtoAccess:ERROR" +build --javacopt "-Xep:ProtoFieldNullComparison:ERROR" +build --javacopt "-Xep:ProtoStringFieldReferenceEquality:ERROR" +build --javacopt "-Xep:ProtocolBufferOrdinal:ERROR" +build --javacopt "-Xep:ProvidesMethodOutsideOfModule:ERROR" +build --javacopt "-Xep:RandomCast:ERROR" +build --javacopt "-Xep:RandomModInteger:ERROR" +build --javacopt "-Xep:RectIntersectReturnValueIgnored:ERROR" +build --javacopt "-Xep:RestrictedApiChecker:ERROR" +build --javacopt "-Xep:ReturnValueIgnored:ERROR" +build --javacopt "-Xep:SelfAssignment:ERROR" +build --javacopt "-Xep:SelfComparison:ERROR" +build --javacopt "-Xep:SelfEquals:ERROR" +build --javacopt "-Xep:ShouldHaveEvenArgs:ERROR" +build --javacopt "-Xep:SizeGreaterThanOrEqualsZero:ERROR" +build --javacopt "-Xep:StreamToString:ERROR" +build --javacopt "-Xep:StringBuilderInitWithChar:ERROR" +build --javacopt "-Xep:SubstringOfZero:ERROR" +build --javacopt "-Xep:SuppressWarningsDeprecated:ERROR" +build --javacopt "-Xep:ThrowIfUncheckedKnownChecked:ERROR" +build --javacopt "-Xep:ThrowNull:ERROR" +build --javacopt "-Xep:TruthSelfEquals:ERROR" +build --javacopt "-Xep:TryFailThrowable:ERROR" +build --javacopt "-Xep:TypeParameterQualifier:ERROR" +build --javacopt "-Xep:UnnecessaryTypeArgument:ERROR" +build --javacopt "-Xep:UnusedAnonymousClass:ERROR" +build --javacopt "-Xep:UnusedCollectionModifiedInPlace:ERROR" +build --javacopt "-Xep:VarTypeName:ERROR" +build --javacopt "-Xep:On by default : WARNING:ERROR" +build --javacopt "-Xep:AmbiguousMethodReference:ERROR" +build --javacopt "-Xep:ArgumentSelectionDefectChecker:ERROR" +build --javacopt "-Xep:ArrayAsKeyOfSetOrMap:ERROR" +build --javacopt "-Xep:AssertEqualsArgumentOrderChecker:ERROR" +build --javacopt "-Xep:AssertThrowsMultipleStatements:ERROR" +build --javacopt "-Xep:AssertionFailureIgnored:ERROR" +build --javacopt "-Xep:AutoValueFinalMethods:ERROR" +build --javacopt "-Xep:BadAnnotationImplementation:ERROR" +build --javacopt "-Xep:BadComparable:ERROR" +build --javacopt "-Xep:BadImport:ERROR" +build --javacopt "-Xep:BadInstanceof:ERROR" +build --javacopt "-Xep:BigDecimalEquals:ERROR" +build --javacopt "-Xep:BigDecimalLiteralDouble:ERROR" +build --javacopt "-Xep:BoxedPrimitiveConstructor:ERROR" +build --javacopt "-Xep:ByteBufferBackingArray:ERROR" +build --javacopt "-Xep:CannotMockFinalClass:ERROR" +build --javacopt "-Xep:CanonicalDuration:ERROR" +build --javacopt "-Xep:CatchAndPrintStackTrace:ERROR" +build --javacopt "-Xep:CatchFail:ERROR" +build --javacopt "-Xep:ClassCanBeStatic:ERROR" +build --javacopt "-Xep:ClassNewInstance:ERROR" +build --javacopt "-Xep:CloseableProvides:ERROR" +build --javacopt "-Xep:CollectionToArraySafeParameter:ERROR" +build --javacopt "-Xep:CollectorShouldNotUseState:ERROR" +build --javacopt "-Xep:ComparableAndComparator:ERROR" +build --javacopt "-Xep:DateFormatConstant:ERROR" +build --javacopt "-Xep:DefaultCharset:ERROR" +build --javacopt "-Xep:DeprecatedThreadMethods:ERROR" +build --javacopt "-Xep:DoubleBraceInitialization:ERROR" +build --javacopt "-Xep:DoubleCheckedLocking:ERROR" +build --javacopt "-Xep:EqualsGetClass:ERROR" +build --javacopt "-Xep:EqualsHashCode:ERROR" +build --javacopt "-Xep:EqualsIncompatibleType:ERROR" +build --javacopt "-Xep:EqualsUnsafeCast:ERROR" +build --javacopt "-Xep:EqualsUsingHashCode:ERROR" +build --javacopt "-Xep:ExtendingJUnitAssert:ERROR" # TODO(#222) Increase to error when we build from jflex-1.7.1 with a lexer annotated with # @SuppressWarnings build --javacopt "-Xep:FallThrough:WARN" +build --javacopt "-Xep:Finally:ERROR" +build --javacopt "-Xep:FloatCast:ERROR" +build --javacopt "-Xep:FloatingPointAssertionWithinEpsilon:ERROR" +build --javacopt "-Xep:FloatingPointLiteralPrecision:ERROR" +build --javacopt "-Xep:FragmentInjection:ERROR" +build --javacopt "-Xep:FragmentNotInstantiable:ERROR" +build --javacopt "-Xep:FutureReturnValueIgnored:ERROR" +build --javacopt "-Xep:GetClassOnEnum:ERROR" +build --javacopt "-Xep:HidingField:ERROR" +build --javacopt "-Xep:ImmutableAnnotationChecker:ERROR" +build --javacopt "-Xep:ImmutableEnumChecker:ERROR" +build --javacopt "-Xep:IncompatibleModifiers:ERROR" +build --javacopt "-Xep:InconsistentCapitalization:ERROR" +build --javacopt "-Xep:InconsistentHashCode:ERROR" +build --javacopt "-Xep:IncrementInForLoopAndHeader:ERROR" +build --javacopt "-Xep:InjectOnConstructorOfAbstractClass:ERROR" +build --javacopt "-Xep:InputStreamSlowMultibyteRead:ERROR" +build --javacopt "-Xep:InstanceOfAndCastMatchWrongType:ERROR" +build --javacopt "-Xep:IntLongMath:ERROR" +build --javacopt "-Xep:IterableAndIterator:ERROR" +build --javacopt "-Xep:JUnit3FloatingPointComparisonWithoutDelta:ERROR" +build --javacopt "-Xep:JUnit4ClassUsedInJUnit3:ERROR" +build --javacopt "-Xep:Some JUnit4 construct cannot be used in a JUnit3 context. Convert your class to JUnit4 style to use them.:ERROR" +build --javacopt "-Xep::ERROR" +build --javacopt "-Xep:JUnitAmbiguousTestClass:ERROR" +build --javacopt "-Xep:JavaLangClash:ERROR" +build --javacopt "-Xep:JdkObsolete:ERROR" +build --javacopt "-Xep:LockNotBeforeTry:ERROR" +build --javacopt "-Xep:LogicalAssignment:ERROR" +build --javacopt "-Xep:MathAbsoluteRandom:ERROR" +build --javacopt "-Xep:MissingCasesInEnumSwitch:ERROR" +build --javacopt "-Xep:MissingFail:ERROR" +build --javacopt "-Xep:MissingOverride:ERROR" +build --javacopt "-Xep:ModifiedButNotUsed:ERROR" +build --javacopt "-Xep:ModifyCollectionInEnhancedForLoop:ERROR" +build --javacopt "-Xep:MultipleParallelOrSequentialCalls:ERROR" +build --javacopt "-Xep:MutableConstantField:ERROR" +build --javacopt "-Xep:NarrowingCompoundAssignment:ERROR" +build --javacopt "-Xep:NestedInstanceOfConditions:ERROR" +build --javacopt "-Xep:NonAtomicVolatileUpdate:ERROR" +build --javacopt "-Xep:NonOverridingEquals:ERROR" +build --javacopt "-Xep:NullableConstructor:ERROR" +build --javacopt "-Xep:NullablePrimitive:ERROR" +build --javacopt "-Xep:NullableVoid:ERROR" +build --javacopt "-Xep:ObjectToString:ERROR" +build --javacopt "-Xep:ObjectsHashCodePrimitive:ERROR" +build --javacopt "-Xep:OperatorPrecedence:ERROR" +build --javacopt "-Xep:OptionalNotPresent:ERROR" +build --javacopt "-Xep:OrphanedFormatString:ERROR" +build --javacopt "-Xep:OverrideThrowableToString:ERROR" +build --javacopt "-Xep:Overrides:ERROR" +build --javacopt "-Xep:OverridesGuiceInjectableMethod:ERROR" +build --javacopt "-Xep:ParameterName:ERROR" +build --javacopt "-Xep:PreconditionsInvalidPlaceholder:ERROR" +build --javacopt "-Xep:ProtoRedundantSet:ERROR" +build --javacopt "-Xep:QualifierOrScopeOnInjectMethod:ERROR" +build --javacopt "-Xep:ReachabilityFenceUsage:ERROR" +build --javacopt "-Xep:ReferenceEquality:ERROR" +build --javacopt "-Xep:RequiredModifiers:ERROR" +build --javacopt "-Xep:ShortCircuitBoolean:ERROR" +build --javacopt "-Xep:StaticGuardedByInstance:ERROR" +build --javacopt "-Xep:StreamResourceLeak:ERROR" +build --javacopt "-Xep:StringSplitter:ERROR" +build --javacopt "-Xep:SwigMemoryLeak:ERROR" +build --javacopt "-Xep:SynchronizeOnNonFinalField:ERROR" +build --javacopt "-Xep:ThreadJoinLoop:ERROR" +build --javacopt "-Xep:ThreadLocalUsage:ERROR" +build --javacopt "-Xep:ThreadPriorityCheck:ERROR" +build --javacopt "-Xep:ThreeLetterTimeZoneID:ERROR" +build --javacopt "-Xep:ToStringReturnsNull:ERROR" +build --javacopt "-Xep:TruthAssertExpected:ERROR" +build --javacopt "-Xep:TruthConstantAsserts:ERROR" +build --javacopt "-Xep:TruthIncompatibleType:ERROR" +build --javacopt "-Xep:TypeNameShadowing:ERROR" +build --javacopt "-Xep:TypeParameterShadowing:ERROR" +build --javacopt "-Xep:TypeParameterUnusedInFormals:ERROR" +build --javacopt "-Xep:URLEqualsHashCode:ERROR" +build --javacopt "-Xep:UndefinedEquals:ERROR" +build --javacopt "-Xep:UnnecessaryParentheses:ERROR" +build --javacopt "-Xep:UnsafeFinalization:ERROR" +build --javacopt "-Xep:UnsafeReflectiveConstructionCast:ERROR" +build --javacopt "-Xep:UnsynchronizedOverridesSynchronized:ERROR" +build --javacopt "-Xep:UseCorrectAssertInTests:ERROR" +build --javacopt "-Xep:VariableNameSameAsType:ERROR" +build --javacopt "-Xep:WaitNotInLoop:ERROR" +build --javacopt "-Xep:WakelockReleasedDangerously:ERROR" +build --javacopt "-Xep:Experimental : ERROR:ERROR" +build --javacopt "-Xep:AndroidJdkLibsChecker:ERROR" +build --javacopt "-Xep:AssistedInjectAndInjectOnSameConstructor:ERROR" +build --javacopt "-Xep:AutoFactoryAtInject:ERROR" +build --javacopt "-Xep:ClassName:ERROR" +build --javacopt "-Xep:ComparisonContractViolated:ERROR" +build --javacopt "-Xep:DepAnn:ERROR" +build --javacopt "-Xep:DivZero:ERROR" +build --javacopt "-Xep:EmptyIf:ERROR" +build --javacopt "-Xep:FuzzyEqualsShouldNotBeUsedInEqualsMethod:ERROR" +build --javacopt "-Xep:InjectInvalidTargetingOnScopingAnnotation:ERROR" +build --javacopt "-Xep:InjectMoreThanOneQualifier:ERROR" +build --javacopt "-Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass:ERROR" +build --javacopt "-Xep:InjectScopeOrQualifierAnnotationRetention:ERROR" +build --javacopt "-Xep:InjectedConstructorAnnotations:ERROR" +build --javacopt "-Xep:InsecureCryptoUsage:ERROR" +build --javacopt "-Xep:IterablePathParameter:ERROR" +build --javacopt "-Xep:JMockTestWithoutRunWithOrRuleAnnotation:ERROR" +build --javacopt "-Xep:Java7ApiChecker:ERROR" +build --javacopt "-Xep:JavaxInjectOnFinalField:ERROR" +build --javacopt "-Xep:LockMethodChecker:ERROR" +build --javacopt "-Xep:LongLiteralLowerCaseSuffix:ERROR" +build --javacopt "-Xep:NoAllocation:ERROR" +build --javacopt "-Xep:NumericEquality:ERROR" +build --javacopt "-Xep:ParameterPackage:ERROR" +build --javacopt "-Xep:RestrictTo:ERROR" +build --javacopt "-Xep:StaticOrDefaultInterfaceMethod:ERROR" +build --javacopt "-Xep:UnlockMethod:ERROR" +build --javacopt "-Xep:Experimental : WARNING:ERROR" +build --javacopt "-Xep:AnnotateFormatMethod:ERROR" +build --javacopt "-Xep:AnnotationPosition:ERROR" +build --javacopt "-Xep:AssertFalse:ERROR" +build --javacopt "-Xep:AssistedInjectAndInjectOnConstructors:ERROR" +build --javacopt "-Xep:BinderIdentityRestoredDangerously:ERROR" +build --javacopt "-Xep:BindingToUnqualifiedCommonType:ERROR" +build --javacopt "-Xep:ConstructorInvokesOverridable:ERROR" +build --javacopt "-Xep:ConstructorLeaksThis:ERROR" +build --javacopt "-Xep:EmptyTopLevelDeclaration:ERROR" +build --javacopt "-Xep:EqualsBrokenForNull:ERROR" +build --javacopt "-Xep:ExpectedExceptionChecker:ERROR" +build --javacopt "-Xep:FunctionalInterfaceClash:ERROR" +build --javacopt "-Xep:HardCodedSdCardPath:ERROR" +build --javacopt "-Xep:InconsistentOverloads:ERROR" +build --javacopt "-Xep:InvalidParam:ERROR" +build --javacopt "-Xep:InvalidTag:ERROR" +build --javacopt "-Xep:InvalidThrows:ERROR" +build --javacopt "-Xep:MissingDefault:ERROR" +build --javacopt "-Xep:MutableMethodReturnType:ERROR" +build --javacopt "-Xep:NoFunctionalReturnType:ERROR" +build --javacopt "-Xep:NonCanonicalStaticMemberImport:ERROR" +build --javacopt "-Xep:NullableDereference:ERROR" +build --javacopt "-Xep:PrimitiveArrayPassedToVarargsMethod:ERROR" +build --javacopt "-Xep:ProtosAsKeyOfSetOrMap:ERROR" +build --javacopt "-Xep:ProvidesFix:ERROR" +build --javacopt "-Xep:QualifierWithTypeUse:ERROR" +build --javacopt "-Xep:RedundantThrows:ERROR" +build --javacopt "-Xep:ReturnFromVoid:ERROR" +build --javacopt "-Xep:StaticQualifiedUsingExpression:ERROR" +build --javacopt "-Xep:StringEquality:ERROR" +build --javacopt "-Xep:SystemExitOutsideMain:ERROR" +build --javacopt "-Xep:TestExceptionChecker:ERROR" +build --javacopt "-Xep:UnnecessaryDefaultInEnumSwitch:ERROR" +build --javacopt "-Xep:Unused:ERROR" +build --javacopt "-Xep:UnusedException:ERROR" +build --javacopt "-Xep:Var:ERROR" +build --javacopt "-Xep:Experimental : SUGGESTION:ERROR" +build --javacopt "-Xep:BooleanParameter:ERROR" +build --javacopt "-Xep:ClassNamedLikeTypeParameter:ERROR" +build --javacopt "-Xep:ConstantField:ERROR" +build --javacopt "-Xep:EmptySetMultibindingContributions:ERROR" +build --javacopt "-Xep:ExpectedExceptionRefactoring:ERROR" +build --javacopt "-Xep:FieldCanBeFinal:ERROR" +build --javacopt "-Xep:FieldMissingNullable:ERROR" +build --javacopt "-Xep:ImmutableRefactoring:ERROR" +build --javacopt "-Xep:LambdaFunctionalInterface:ERROR" +build --javacopt "-Xep:MethodCanBeStatic:ERROR" +build --javacopt "-Xep:MixedArrayDimensions:ERROR" +build --javacopt "-Xep:MultiVariableDeclaration:ERROR" +build --javacopt "-Xep:MultipleTopLevelClasses:ERROR" +build --javacopt "-Xep:MultipleUnaryOperatorsInMethodCall:ERROR" +build --javacopt "-Xep:PackageLocation:ERROR" +build --javacopt "-Xep:ParameterComment:ERROR" +build --javacopt "-Xep:ParameterNotNullable:ERROR" +build --javacopt "-Xep:PrivateConstructorForNoninstantiableModule:ERROR" +build --javacopt "-Xep:PrivateConstructorForUtilityClass:ERROR" +build --javacopt "-Xep:RemoveUnusedImports:ERROR" +build --javacopt "-Xep:ReturnMissingNullable:ERROR" +build --javacopt "-Xep:ScopeOnModule:ERROR" +build --javacopt "-Xep:SwitchDefault:ERROR" +build --javacopt "-Xep:TestExceptionRefactoring:ERROR" +build --javacopt "-Xep:ThrowsUncheckedException:ERROR" +build --javacopt "-Xep:TryFailRefactoring:ERROR" +build --javacopt "-Xep:TypeParameterNaming:ERROR" +build --javacopt "-Xep:UngroupedOverloads:ERROR" +build --javacopt "-Xep:UnnecessarySetDefault:ERROR" +build --javacopt "-Xep:UnnecessaryStaticImport:ERROR" +build --javacopt "-Xep:UseBinds:ERROR" +build --javacopt "-Xep:WildcardImport:ERROR" From 909006481f63c97e0ad702b43a11f10f0d311aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20D=C3=A9camps?= Date: Thu, 18 Oct 2018 01:33:13 +0200 Subject: [PATCH 2/2] Adjust levels to allow compilation Filed #470 to track resolution --- .bazelrc | 431 ++++++++++-------- cup/cup_runtime/BUILD | 5 +- .../java/jflex/testing/javac/BUILD | 4 + 3 files changed, 240 insertions(+), 200 deletions(-) diff --git a/.bazelrc b/.bazelrc index 544ce3ec6..b504d7f6d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,9 @@ http://errorprone.info/bugpatterns +# To avoid bugs in the code +# P1 Fix the errors and bump from :WARN to :ERROR +# P2 Fix the warnings and bump from :OFF to :WARN + +# On by default : ERROR build --javacopt "-Xep:ArrayEquals:ERROR" build --javacopt "-Xep:ArrayFillIncompatibleType:ERROR" build --javacopt "-Xep:ArrayHashCode:ERROR" @@ -60,11 +65,9 @@ build --javacopt "-Xep:JUnit4TestNotRun:ERROR" build --javacopt "-Xep:JUnitAssertSameCheck:ERROR" build --javacopt "-Xep:JavaxInjectOnAbstractMethod:ERROR" build --javacopt "-Xep:LiteByteStringUtf8:ERROR" -build --javacopt "-Xep:This pattern will silently corrupt certain byte sequences from the serialized protocol message. Use ByteString or byte[] directly:ERROR" -build --javacopt "-Xep::ERROR" build --javacopt "-Xep:LoopConditionChecker:ERROR" build --javacopt "-Xep:MathRoundIntLong:ERROR" -build --javacopt "-Xep:MislabeledAndroidString:ERROR" +#build --javacopt "-Xep:MislabeledAndroidString:ERROR" build --javacopt "-Xep:MissingSuperCall:ERROR" build --javacopt "-Xep:MissingTestCall:ERROR" build --javacopt "-Xep:MisusedWeekYear:ERROR" @@ -114,134 +117,146 @@ build --javacopt "-Xep:UnnecessaryTypeArgument:ERROR" build --javacopt "-Xep:UnusedAnonymousClass:ERROR" build --javacopt "-Xep:UnusedCollectionModifiedInPlace:ERROR" build --javacopt "-Xep:VarTypeName:ERROR" -build --javacopt "-Xep:On by default : WARNING:ERROR" -build --javacopt "-Xep:AmbiguousMethodReference:ERROR" -build --javacopt "-Xep:ArgumentSelectionDefectChecker:ERROR" -build --javacopt "-Xep:ArrayAsKeyOfSetOrMap:ERROR" -build --javacopt "-Xep:AssertEqualsArgumentOrderChecker:ERROR" -build --javacopt "-Xep:AssertThrowsMultipleStatements:ERROR" -build --javacopt "-Xep:AssertionFailureIgnored:ERROR" -build --javacopt "-Xep:AutoValueFinalMethods:ERROR" -build --javacopt "-Xep:BadAnnotationImplementation:ERROR" -build --javacopt "-Xep:BadComparable:ERROR" -build --javacopt "-Xep:BadImport:ERROR" -build --javacopt "-Xep:BadInstanceof:ERROR" -build --javacopt "-Xep:BigDecimalEquals:ERROR" -build --javacopt "-Xep:BigDecimalLiteralDouble:ERROR" -build --javacopt "-Xep:BoxedPrimitiveConstructor:ERROR" -build --javacopt "-Xep:ByteBufferBackingArray:ERROR" -build --javacopt "-Xep:CannotMockFinalClass:ERROR" -build --javacopt "-Xep:CanonicalDuration:ERROR" -build --javacopt "-Xep:CatchAndPrintStackTrace:ERROR" -build --javacopt "-Xep:CatchFail:ERROR" -build --javacopt "-Xep:ClassCanBeStatic:ERROR" -build --javacopt "-Xep:ClassNewInstance:ERROR" -build --javacopt "-Xep:CloseableProvides:ERROR" -build --javacopt "-Xep:CollectionToArraySafeParameter:ERROR" -build --javacopt "-Xep:CollectorShouldNotUseState:ERROR" -build --javacopt "-Xep:ComparableAndComparator:ERROR" -build --javacopt "-Xep:DateFormatConstant:ERROR" -build --javacopt "-Xep:DefaultCharset:ERROR" -build --javacopt "-Xep:DeprecatedThreadMethods:ERROR" -build --javacopt "-Xep:DoubleBraceInitialization:ERROR" -build --javacopt "-Xep:DoubleCheckedLocking:ERROR" -build --javacopt "-Xep:EqualsGetClass:ERROR" -build --javacopt "-Xep:EqualsHashCode:ERROR" -build --javacopt "-Xep:EqualsIncompatibleType:ERROR" -build --javacopt "-Xep:EqualsUnsafeCast:ERROR" -build --javacopt "-Xep:EqualsUsingHashCode:ERROR" -build --javacopt "-Xep:ExtendingJUnitAssert:ERROR" + +# On by default : WARNING +build --javacopt "-Xep:AmbiguousMethodReference:WARN" +build --javacopt "-Xep:ArgumentSelectionDefectChecker:WARN" +build --javacopt "-Xep:ArrayAsKeyOfSetOrMap:WARN" +build --javacopt "-Xep:AssertEqualsArgumentOrderChecker:WARN" +build --javacopt "-Xep:AssertThrowsMultipleStatements:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:AssertionFailureIgnored:OFF" +build --javacopt "-Xep:AutoValueFinalMethods:WARN" +build --javacopt "-Xep:BadAnnotationImplementation:WARN" +build --javacopt "-Xep:BadComparable:WARN" +build --javacopt "-Xep:BadImport:WARN" +build --javacopt "-Xep:BadInstanceof:WARN" +build --javacopt "-Xep:BigDecimalEquals:WARN" +build --javacopt "-Xep:BigDecimalLiteralDouble:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:BoxedPrimitiveConstructor:OFF" +build --javacopt "-Xep:ByteBufferBackingArray:WARN" +build --javacopt "-Xep:CannotMockFinalClass:WARN" +build --javacopt "-Xep:CanonicalDuration:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:CatchAndPrintStackTrace:OFF" +build --javacopt "-Xep:CatchFail:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:ClassCanBeStatic:WARN" +build --javacopt "-Xep:ClassNewInstance:WARN" +build --javacopt "-Xep:CloseableProvides:WARN" +build --javacopt "-Xep:CollectionToArraySafeParameter:WARN" +build --javacopt "-Xep:CollectorShouldNotUseState:WARN" +build --javacopt "-Xep:ComparableAndComparator:WARN" +build --javacopt "-Xep:DateFormatConstant:WARN" +# TODO(#469/#470) Fix these errors and re-enable violation +build --javacopt "-Xep:DefaultCharset:OFF" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:DeprecatedThreadMethods:OFF" +build --javacopt "-Xep:DoubleBraceInitialization:WARN" +build --javacopt "-Xep:DoubleCheckedLocking:WARN" +build --javacopt "-Xep:EqualsGetClass:WARN" +build --javacopt "-Xep:EqualsHashCode:WARN" +build --javacopt "-Xep:EqualsIncompatibleType:WARN" +build --javacopt "-Xep:EqualsUnsafeCast:WARN" +build --javacopt "-Xep:EqualsUsingHashCode:WARN" +build --javacopt "-Xep:ExtendingJUnitAssert:WARN" # TODO(#222) Increase to error when we build from jflex-1.7.1 with a lexer annotated with # @SuppressWarnings -build --javacopt "-Xep:FallThrough:WARN" -build --javacopt "-Xep:Finally:ERROR" -build --javacopt "-Xep:FloatCast:ERROR" -build --javacopt "-Xep:FloatingPointAssertionWithinEpsilon:ERROR" -build --javacopt "-Xep:FloatingPointLiteralPrecision:ERROR" -build --javacopt "-Xep:FragmentInjection:ERROR" -build --javacopt "-Xep:FragmentNotInstantiable:ERROR" -build --javacopt "-Xep:FutureReturnValueIgnored:ERROR" -build --javacopt "-Xep:GetClassOnEnum:ERROR" -build --javacopt "-Xep:HidingField:ERROR" -build --javacopt "-Xep:ImmutableAnnotationChecker:ERROR" -build --javacopt "-Xep:ImmutableEnumChecker:ERROR" -build --javacopt "-Xep:IncompatibleModifiers:ERROR" -build --javacopt "-Xep:InconsistentCapitalization:ERROR" -build --javacopt "-Xep:InconsistentHashCode:ERROR" -build --javacopt "-Xep:IncrementInForLoopAndHeader:ERROR" -build --javacopt "-Xep:InjectOnConstructorOfAbstractClass:ERROR" -build --javacopt "-Xep:InputStreamSlowMultibyteRead:ERROR" -build --javacopt "-Xep:InstanceOfAndCastMatchWrongType:ERROR" -build --javacopt "-Xep:IntLongMath:ERROR" -build --javacopt "-Xep:IterableAndIterator:ERROR" -build --javacopt "-Xep:JUnit3FloatingPointComparisonWithoutDelta:ERROR" -build --javacopt "-Xep:JUnit4ClassUsedInJUnit3:ERROR" -build --javacopt "-Xep:Some JUnit4 construct cannot be used in a JUnit3 context. Convert your class to JUnit4 style to use them.:ERROR" -build --javacopt "-Xep::ERROR" -build --javacopt "-Xep:JUnitAmbiguousTestClass:ERROR" -build --javacopt "-Xep:JavaLangClash:ERROR" -build --javacopt "-Xep:JdkObsolete:ERROR" -build --javacopt "-Xep:LockNotBeforeTry:ERROR" -build --javacopt "-Xep:LogicalAssignment:ERROR" -build --javacopt "-Xep:MathAbsoluteRandom:ERROR" -build --javacopt "-Xep:MissingCasesInEnumSwitch:ERROR" -build --javacopt "-Xep:MissingFail:ERROR" -build --javacopt "-Xep:MissingOverride:ERROR" -build --javacopt "-Xep:ModifiedButNotUsed:ERROR" -build --javacopt "-Xep:ModifyCollectionInEnhancedForLoop:ERROR" -build --javacopt "-Xep:MultipleParallelOrSequentialCalls:ERROR" -build --javacopt "-Xep:MutableConstantField:ERROR" -build --javacopt "-Xep:NarrowingCompoundAssignment:ERROR" -build --javacopt "-Xep:NestedInstanceOfConditions:ERROR" -build --javacopt "-Xep:NonAtomicVolatileUpdate:ERROR" -build --javacopt "-Xep:NonOverridingEquals:ERROR" -build --javacopt "-Xep:NullableConstructor:ERROR" -build --javacopt "-Xep:NullablePrimitive:ERROR" -build --javacopt "-Xep:NullableVoid:ERROR" -build --javacopt "-Xep:ObjectToString:ERROR" -build --javacopt "-Xep:ObjectsHashCodePrimitive:ERROR" -build --javacopt "-Xep:OperatorPrecedence:ERROR" -build --javacopt "-Xep:OptionalNotPresent:ERROR" -build --javacopt "-Xep:OrphanedFormatString:ERROR" -build --javacopt "-Xep:OverrideThrowableToString:ERROR" -build --javacopt "-Xep:Overrides:ERROR" -build --javacopt "-Xep:OverridesGuiceInjectableMethod:ERROR" -build --javacopt "-Xep:ParameterName:ERROR" -build --javacopt "-Xep:PreconditionsInvalidPlaceholder:ERROR" -build --javacopt "-Xep:ProtoRedundantSet:ERROR" -build --javacopt "-Xep:QualifierOrScopeOnInjectMethod:ERROR" -build --javacopt "-Xep:ReachabilityFenceUsage:ERROR" -build --javacopt "-Xep:ReferenceEquality:ERROR" -build --javacopt "-Xep:RequiredModifiers:ERROR" -build --javacopt "-Xep:ShortCircuitBoolean:ERROR" -build --javacopt "-Xep:StaticGuardedByInstance:ERROR" -build --javacopt "-Xep:StreamResourceLeak:ERROR" -build --javacopt "-Xep:StringSplitter:ERROR" -build --javacopt "-Xep:SwigMemoryLeak:ERROR" -build --javacopt "-Xep:SynchronizeOnNonFinalField:ERROR" -build --javacopt "-Xep:ThreadJoinLoop:ERROR" -build --javacopt "-Xep:ThreadLocalUsage:ERROR" -build --javacopt "-Xep:ThreadPriorityCheck:ERROR" -build --javacopt "-Xep:ThreeLetterTimeZoneID:ERROR" -build --javacopt "-Xep:ToStringReturnsNull:ERROR" -build --javacopt "-Xep:TruthAssertExpected:ERROR" -build --javacopt "-Xep:TruthConstantAsserts:ERROR" -build --javacopt "-Xep:TruthIncompatibleType:ERROR" -build --javacopt "-Xep:TypeNameShadowing:ERROR" -build --javacopt "-Xep:TypeParameterShadowing:ERROR" -build --javacopt "-Xep:TypeParameterUnusedInFormals:ERROR" -build --javacopt "-Xep:URLEqualsHashCode:ERROR" -build --javacopt "-Xep:UndefinedEquals:ERROR" -build --javacopt "-Xep:UnnecessaryParentheses:ERROR" -build --javacopt "-Xep:UnsafeFinalization:ERROR" -build --javacopt "-Xep:UnsafeReflectiveConstructionCast:ERROR" -build --javacopt "-Xep:UnsynchronizedOverridesSynchronized:ERROR" -build --javacopt "-Xep:UseCorrectAssertInTests:ERROR" -build --javacopt "-Xep:VariableNameSameAsType:ERROR" -build --javacopt "-Xep:WaitNotInLoop:ERROR" -build --javacopt "-Xep:WakelockReleasedDangerously:ERROR" -build --javacopt "-Xep:Experimental : ERROR:ERROR" -build --javacopt "-Xep:AndroidJdkLibsChecker:ERROR" +build --javacopt "-Xep:FallThrough:OFF" +build --javacopt "-Xep:Finally:WARN" +build --javacopt "-Xep:FloatCast:WARN" +build --javacopt "-Xep:FloatingPointAssertionWithinEpsilon:WARN" +build --javacopt "-Xep:FloatingPointLiteralPrecision:WARN" +build --javacopt "-Xep:FragmentInjection:WARN" +build --javacopt "-Xep:FragmentNotInstantiable:WARN" +build --javacopt "-Xep:FutureReturnValueIgnored:WARN" +build --javacopt "-Xep:GetClassOnEnum:WARN" +build --javacopt "-Xep:HidingField:WARN" +build --javacopt "-Xep:ImmutableAnnotationChecker:WARN" +build --javacopt "-Xep:ImmutableEnumChecker:WARN" +build --javacopt "-Xep:IncompatibleModifiers:WARN" +build --javacopt "-Xep:InconsistentCapitalization:WARN" +build --javacopt "-Xep:InconsistentHashCode:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:IncrementInForLoopAndHeader:OFF" +build --javacopt "-Xep:InjectOnConstructorOfAbstractClass:WARN" +build --javacopt "-Xep:InputStreamSlowMultibyteRead:WARN" +build --javacopt "-Xep:InstanceOfAndCastMatchWrongType:WARN" +build --javacopt "-Xep:IntLongMath:WARN" +build --javacopt "-Xep:IterableAndIterator:WARN" +build --javacopt "-Xep:JUnit3FloatingPointComparisonWithoutDelta:WARN" +build --javacopt "-Xep:JUnit4ClassUsedInJUnit3:WARN" +build --javacopt "-Xep:JUnitAmbiguousTestClass:WARN" +build --javacopt "-Xep:JavaLangClash:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:JdkObsolete:OFF" +build --javacopt "-Xep:LockNotBeforeTry:WARN" +build --javacopt "-Xep:LogicalAssignment:WARN" +build --javacopt "-Xep:MathAbsoluteRandom:WARN" +build --javacopt "-Xep:MissingCasesInEnumSwitch:WARN" +build --javacopt "-Xep:MissingFail:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:MissingOverride:OFF" +build --javacopt "-Xep:ModifiedButNotUsed:WARN" +build --javacopt "-Xep:ModifyCollectionInEnhancedForLoop:WARN" +build --javacopt "-Xep:MultipleParallelOrSequentialCalls:WARN" +build --javacopt "-Xep:MutableConstantField:WARN" +build --javacopt "-Xep:NarrowingCompoundAssignment:WARN" +build --javacopt "-Xep:NestedInstanceOfConditions:WARN" +build --javacopt "-Xep:NonAtomicVolatileUpdate:WARN" +build --javacopt "-Xep:NonOverridingEquals:WARN" +build --javacopt "-Xep:NullableConstructor:WARN" +build --javacopt "-Xep:NullablePrimitive:WARN" +build --javacopt "-Xep:NullableVoid:WARN" +build --javacopt "-Xep:ObjectToString:WARN" +build --javacopt "-Xep:ObjectsHashCodePrimitive:WARN" +build --javacopt "-Xep:OperatorPrecedence:WARN" +build --javacopt "-Xep:OptionalNotPresent:WARN" +build --javacopt "-Xep:OrphanedFormatString:WARN" +build --javacopt "-Xep:OverrideThrowableToString:WARN" +build --javacopt "-Xep:Overrides:WARN" +build --javacopt "-Xep:OverridesGuiceInjectableMethod:WARN" +build --javacopt "-Xep:ParameterName:WARN" +build --javacopt "-Xep:PreconditionsInvalidPlaceholder:WARN" +build --javacopt "-Xep:ProtoRedundantSet:WARN" +build --javacopt "-Xep:QualifierOrScopeOnInjectMethod:WARN" +build --javacopt "-Xep:ReachabilityFenceUsage:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:ReferenceEquality:OFF" +build --javacopt "-Xep:RequiredModifiers:WARN" +build --javacopt "-Xep:ShortCircuitBoolean:WARN" +build --javacopt "-Xep:StaticGuardedByInstance:WARN" +build --javacopt "-Xep:StreamResourceLeak:WARN" +build --javacopt "-Xep:StringSplitter:WARN" +build --javacopt "-Xep:SwigMemoryLeak:WARN" +build --javacopt "-Xep:SynchronizeOnNonFinalField:WARN" +build --javacopt "-Xep:ThreadJoinLoop:WARN" +build --javacopt "-Xep:ThreadLocalUsage:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:ThreadPriorityCheck:OFF" +build --javacopt "-Xep:ThreeLetterTimeZoneID:WARN" +build --javacopt "-Xep:ToStringReturnsNull:WARN" +build --javacopt "-Xep:TruthAssertExpected:WARN" +build --javacopt "-Xep:TruthConstantAsserts:WARN" +build --javacopt "-Xep:TruthIncompatibleType:WARN" +build --javacopt "-Xep:TypeNameShadowing:WARN" +build --javacopt "-Xep:TypeParameterShadowing:WARN" +build --javacopt "-Xep:TypeParameterUnusedInFormals:WARN" +build --javacopt "-Xep:URLEqualsHashCode:WARN" +build --javacopt "-Xep:UndefinedEquals:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:UnnecessaryParentheses:OFF" +build --javacopt "-Xep:UnsafeFinalization:WARN" +build --javacopt "-Xep:UnsafeReflectiveConstructionCast:WARN" +build --javacopt "-Xep:UnsynchronizedOverridesSynchronized:WARN" +build --javacopt "-Xep:UseCorrectAssertInTests:WARN" +build --javacopt "-Xep:VariableNameSameAsType:WARN" +build --javacopt "-Xep:WaitNotInLoop:WARN" +build --javacopt "-Xep:WakelockReleasedDangerously:WARN" + +#Experimental : ERROR +#build --javacopt "-Xep:AndroidJdkLibsChecker:ERROR" build --javacopt "-Xep:AssistedInjectAndInjectOnSameConstructor:ERROR" build --javacopt "-Xep:AutoFactoryAtInject:ERROR" build --javacopt "-Xep:ClassName:ERROR" @@ -268,73 +283,91 @@ build --javacopt "-Xep:ParameterPackage:ERROR" build --javacopt "-Xep:RestrictTo:ERROR" build --javacopt "-Xep:StaticOrDefaultInterfaceMethod:ERROR" build --javacopt "-Xep:UnlockMethod:ERROR" -build --javacopt "-Xep:Experimental : WARNING:ERROR" -build --javacopt "-Xep:AnnotateFormatMethod:ERROR" -build --javacopt "-Xep:AnnotationPosition:ERROR" -build --javacopt "-Xep:AssertFalse:ERROR" -build --javacopt "-Xep:AssistedInjectAndInjectOnConstructors:ERROR" -build --javacopt "-Xep:BinderIdentityRestoredDangerously:ERROR" -build --javacopt "-Xep:BindingToUnqualifiedCommonType:ERROR" -build --javacopt "-Xep:ConstructorInvokesOverridable:ERROR" -build --javacopt "-Xep:ConstructorLeaksThis:ERROR" -build --javacopt "-Xep:EmptyTopLevelDeclaration:ERROR" -build --javacopt "-Xep:EqualsBrokenForNull:ERROR" -build --javacopt "-Xep:ExpectedExceptionChecker:ERROR" -build --javacopt "-Xep:FunctionalInterfaceClash:ERROR" -build --javacopt "-Xep:HardCodedSdCardPath:ERROR" -build --javacopt "-Xep:InconsistentOverloads:ERROR" -build --javacopt "-Xep:InvalidParam:ERROR" -build --javacopt "-Xep:InvalidTag:ERROR" -build --javacopt "-Xep:InvalidThrows:ERROR" -build --javacopt "-Xep:MissingDefault:ERROR" -build --javacopt "-Xep:MutableMethodReturnType:ERROR" -build --javacopt "-Xep:NoFunctionalReturnType:ERROR" -build --javacopt "-Xep:NonCanonicalStaticMemberImport:ERROR" -build --javacopt "-Xep:NullableDereference:ERROR" -build --javacopt "-Xep:PrimitiveArrayPassedToVarargsMethod:ERROR" -build --javacopt "-Xep:ProtosAsKeyOfSetOrMap:ERROR" -build --javacopt "-Xep:ProvidesFix:ERROR" -build --javacopt "-Xep:QualifierWithTypeUse:ERROR" -build --javacopt "-Xep:RedundantThrows:ERROR" -build --javacopt "-Xep:ReturnFromVoid:ERROR" -build --javacopt "-Xep:StaticQualifiedUsingExpression:ERROR" -build --javacopt "-Xep:StringEquality:ERROR" -build --javacopt "-Xep:SystemExitOutsideMain:ERROR" -build --javacopt "-Xep:TestExceptionChecker:ERROR" -build --javacopt "-Xep:UnnecessaryDefaultInEnumSwitch:ERROR" -build --javacopt "-Xep:Unused:ERROR" -build --javacopt "-Xep:UnusedException:ERROR" -build --javacopt "-Xep:Var:ERROR" -build --javacopt "-Xep:Experimental : SUGGESTION:ERROR" -build --javacopt "-Xep:BooleanParameter:ERROR" -build --javacopt "-Xep:ClassNamedLikeTypeParameter:ERROR" -build --javacopt "-Xep:ConstantField:ERROR" -build --javacopt "-Xep:EmptySetMultibindingContributions:ERROR" -build --javacopt "-Xep:ExpectedExceptionRefactoring:ERROR" -build --javacopt "-Xep:FieldCanBeFinal:ERROR" -build --javacopt "-Xep:FieldMissingNullable:ERROR" -build --javacopt "-Xep:ImmutableRefactoring:ERROR" -build --javacopt "-Xep:LambdaFunctionalInterface:ERROR" -build --javacopt "-Xep:MethodCanBeStatic:ERROR" -build --javacopt "-Xep:MixedArrayDimensions:ERROR" -build --javacopt "-Xep:MultiVariableDeclaration:ERROR" -build --javacopt "-Xep:MultipleTopLevelClasses:ERROR" -build --javacopt "-Xep:MultipleUnaryOperatorsInMethodCall:ERROR" -build --javacopt "-Xep:PackageLocation:ERROR" -build --javacopt "-Xep:ParameterComment:ERROR" -build --javacopt "-Xep:ParameterNotNullable:ERROR" -build --javacopt "-Xep:PrivateConstructorForNoninstantiableModule:ERROR" -build --javacopt "-Xep:PrivateConstructorForUtilityClass:ERROR" -build --javacopt "-Xep:RemoveUnusedImports:ERROR" -build --javacopt "-Xep:ReturnMissingNullable:ERROR" -build --javacopt "-Xep:ScopeOnModule:ERROR" -build --javacopt "-Xep:SwitchDefault:ERROR" -build --javacopt "-Xep:TestExceptionRefactoring:ERROR" -build --javacopt "-Xep:ThrowsUncheckedException:ERROR" -build --javacopt "-Xep:TryFailRefactoring:ERROR" -build --javacopt "-Xep:TypeParameterNaming:ERROR" -build --javacopt "-Xep:UngroupedOverloads:ERROR" -build --javacopt "-Xep:UnnecessarySetDefault:ERROR" -build --javacopt "-Xep:UnnecessaryStaticImport:ERROR" -build --javacopt "-Xep:UseBinds:ERROR" -build --javacopt "-Xep:WildcardImport:ERROR" + +# Experimental : WARNING +build --javacopt "-Xep:AnnotateFormatMethod:WARN" +build --javacopt "-Xep:AnnotationPosition:WARN" +build --javacopt "-Xep:AssertFalse:WARN" +build --javacopt "-Xep:AssistedInjectAndInjectOnConstructors:WARN" +build --javacopt "-Xep:BinderIdentityRestoredDangerously:WARN" +build --javacopt "-Xep:BindingToUnqualifiedCommonType:WARN" +# TODO(#469) Fix these errors and re-enable violation +build --javacopt "-Xep:ConstructorInvokesOverridable:OFF" +build --javacopt "-Xep:ConstructorLeaksThis:WARN" +build --javacopt "-Xep:EmptyTopLevelDeclaration:WARN" +build --javacopt "-Xep:EqualsBrokenForNull:WARN" +build --javacopt "-Xep:ExpectedExceptionChecker:WARN" +build --javacopt "-Xep:FunctionalInterfaceClash:WARN" +build --javacopt "-Xep:HardCodedSdCardPath:WARN" +# TODO(#469) Fix these errors and re-enable violation +build --javacopt "-Xep:InconsistentOverloads:OFF" +build --javacopt "-Xep:InvalidParam:WARN" +build --javacopt "-Xep:InvalidTag:WARN" +build --javacopt "-Xep:InvalidThrows:WARN" +# TODO(#469) Fix these errors and re-enable violation +build --javacopt "-Xep:MissingDefault:OFF" +build --javacopt "-Xep:MutableMethodReturnType:WARN" +build --javacopt "-Xep:NoFunctionalReturnType:WARN" +build --javacopt "-Xep:NonCanonicalStaticMemberImport:WARN" +build --javacopt "-Xep:NullableDereference:WARN" +build --javacopt "-Xep:PrimitiveArrayPassedToVarargsMethod:WARN" +build --javacopt "-Xep:ProtosAsKeyOfSetOrMap:WARN" +build --javacopt "-Xep:ProvidesFix:WARN" +build --javacopt "-Xep:QualifierWithTypeUse:WARN" +build --javacopt "-Xep:RedundantThrows:WARN" +build --javacopt "-Xep:ReturnFromVoid:WARN" +build --javacopt "-Xep:StaticQualifiedUsingExpression:WARN" +build --javacopt "-Xep:StringEquality:WARN" +build --javacopt "-Xep:SystemExitOutsideMain:WARN" +build --javacopt "-Xep:TestExceptionChecker:WARN" +build --javacopt "-Xep:UnnecessaryDefaultInEnumSwitch:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:Unused:OFF" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:UnusedException:OFF" +# TODO(#469) Fix these warnings +# bazel-out/darwin-fastbuild/genfiles/jflex/LexParse.java:2260: error: [Var] Non-constant variable missing @Var annotation +# RegExp RESULT =null; +build --javacopt "-Xep:Var:OFF" + +# Experimental : SUGGESTION +build --javacopt "-Xep:ClassNamedLikeTypeParameter:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:ConstantField:OFF" +build --javacopt "-Xep:EmptySetMultibindingContributions:WARN" +build --javacopt "-Xep:ExpectedExceptionRefactoring:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:FieldCanBeFinal:OFF" +build --javacopt "-Xep:FieldMissingNullable:WARN" +build --javacopt "-Xep:ImmutableRefactoring:WARN" +build --javacopt "-Xep:LambdaFunctionalInterface:WARN" +build --javacopt "-Xep:MethodCanBeStatic:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:MixedArrayDimensions:OFF" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:MultiVariableDeclaration:OFF" +build --javacopt "-Xep:MultipleTopLevelClasses:WARN" +build --javacopt "-Xep:MultipleUnaryOperatorsInMethodCall:WARN" +build --javacopt "-Xep:PackageLocation:WARN" +build --javacopt "-Xep:ParameterComment:WARN" +build --javacopt "-Xep:ParameterNotNullable:WARN" +build --javacopt "-Xep:PrivateConstructorForNoninstantiableModule:WARN" +build --javacopt "-Xep:PrivateConstructorForUtilityClass:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:RemoveUnusedImports:OFF" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:ReturnMissingNullable:OFF" +build --javacopt "-Xep:ScopeOnModule:WARN" +build --javacopt "-Xep:SwitchDefault:WARN" +build --javacopt "-Xep:TestExceptionRefactoring:WARN" +build --javacopt "-Xep:ThrowsUncheckedException:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:TryFailRefactoring:OFF" +build --javacopt "-Xep:TypeParameterNaming:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:UngroupedOverloads:OFF" +build --javacopt "-Xep:UnnecessarySetDefault:WARN" +build --javacopt "-Xep:UnnecessaryStaticImport:WARN" +build --javacopt "-Xep:UseBinds:WARN" +# TODO(#469) Fix these warnings +build --javacopt "-Xep:WildcardImport:OFF" diff --git a/cup/cup_runtime/BUILD b/cup/cup_runtime/BUILD index c9eea2124..bcf37a086 100644 --- a/cup/cup_runtime/BUILD +++ b/cup/cup_runtime/BUILD @@ -2,5 +2,8 @@ licenses(["notice"]) # BSD-like java_library( name = "cup_runtime", srcs = glob(["src/main/java/**/*.java"]), - visibility=["//visibility:public"] + visibility=["//visibility:public"], + javacopts=[ + # Not our code, there is nothing we can do + "-XepDisableAllChecks"], ) \ No newline at end of file diff --git a/testsuite/bzltestsuite/java/jflex/testing/javac/BUILD b/testsuite/bzltestsuite/java/jflex/testing/javac/BUILD index 978e7a4ad..67d35ebf3 100644 --- a/testsuite/bzltestsuite/java/jflex/testing/javac/BUILD +++ b/testsuite/bzltestsuite/java/jflex/testing/javac/BUILD @@ -6,4 +6,8 @@ java_library( deps = [ "//third_party/com/google/guava", ], + javacopts = [ + # Only used for testing + "-Xep:Java7ApiChecker:OFF", + ], )