# Control files for the warnings and tests-warnings Ant targets # # "warnings-check" does the absolutely required checks; # "warnings" adds some extra checks we're trying to drive out of existance. # "warnings-tests-check" and "warnings-tests" are similar for the tests/ directory # # warnings-check: java/ecj.warning.options-ci # warnings adds java/ecj.warning.options # tests-warnings-check adds: java/ecj.warning.options-test-ci # tests-warnings adds: java/ecj.warning.options-test # # # For more information, see # https://www.ibm.com/docs/en/wdfrhcw/1.4.0?topic=code-using-batch-compiler # https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm&anchor=warn # http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm # # # Case counts here are as of 12/15/2021 # # # Group (macro) checks - we accept the group, then adjust specific subitems # -err:+hiding # 81 cases of members hiding superclass members -err:-fieldHiding # thousands of places where parameters are named for members -err:-localHiding -err:+maskedCatchBlocks -err:+typeHiding -err:-allJavadoc -err:-javadoc -err:+invalidJavadoc -err:+invalidJavadocTag -err:+invalidJavadocTagDep -err:+invalidJavadocTagNotVisible # not all of our code has Javadoc comments -err:-missingJavadocTags -err:+missingJavadocTagsMethod -err:+missingJavadocTagsOverriding # not all of our code has Javadoc comments -err:-missingJavadocComments # not all of our code has Javadoc comments -err:-missingJavadocCommentsOverriding -err:+static-access # This tags Turnout.INCONSISTENT in favor of NamedBean.INCONSISTENT -err:-indirectStatic -err:+staticReceiver -err:+unused # This tags valid "new jmri.util.WaitHandler(this);" constructs -err:-unusedAllocation # cases of the `catch (FooException ex)` and then not using `ex` -err:-unusedExceptionParam # unused imports removed Oct 2023 -err:+unusedImport -err:+unusedLabel -err:+unusedLocal # our APIs routinely have "may need in future" parameters -err:-unusedParam -err:+unusedParamImplementing -err:+unusedParamIncludeDoc -err:+unusedParamOverriding -err:+unusedPrivate # This tags a "throws" clause that's not yet thrown by the specific implementation -err:-unusedThrown -err:+unusedThrownIncludeDocComment -err:+unusedThrownExemptExceptionThrowable -err:+unusedThrownWhenOverriding # 480 cases of the form List files = new LinkedList(); -err:-unusedTypeArgs -err:+unusedTypeParameter # # Individual Checks # -err:-allDeadCode -err:+allDeprecation -err:+allOver-ann -err:+assertIdentifier -err:+charConcat -err:+conditionAssign -err:+constructorName -err:+compareIdentical -err:+deadCode -err:+dep-ann -err:+deprecation -err:+discouraged -err:+enumIdentifier -err:+enumSwitch -err:+fallthrough -err:+finalBound -err:+finally -err:+forbidden -err:+hashCode -err:+includeAssertNull -err:+inheritNullAnnot -err:+intfAnnotation -err:+intfNonInherited -err:+intfRedundant -err:+noEffectAssign -err:+nonnullNotRepeated -err:+null -err:+nullAnnot -err:+nullAnnotConflict -err:+nullAnnotRedundant -err:+nullDereference -err:+nullUncheckedConversion -err:+over-ann -err:+pkgDefaultMethod -err:+raw -err:+semicolon -err:+specialParamHiding -err:+switchDefault -err:+unavoidableGenericProblems -err:+unchecked -err:+uselessTypeCheck -err:+varargsCast # # Checks we choose not to enforce as our common style # # no real cost to using implicit boxing/unboxing, and it's just easier -err:-boxing # non-NLS string literals (mostly missing // $ NON-NLS) -err:-nls # many of these in the code, and "final" for parameters is a matter of style -err:-paramAssign # JMRI doesn't anticipate use of Java serialization -warn:-serial # maybe a good idea, but too expensive now -err:-super # many of these aleady in the code, and the value is not clear -err:-syntheticAccess # we don't require "this." in every variable access to reduce verbosity -err:-unqualifiedField -err:-unqualified-field-access # our APIs routinely have "may need in future" parameters -err:-unusedArgument # missing enum switch cases even when default case is present; `default` can be convenient, # but is a risk if additional members are added to the enum -err:-enumSwitchPedantic # flags methods that can be made static because they don't access data member # but that just seems distracting somehow because then you have to change access -err:-all-static-method -err:-static-method # We often seem to _prefer_ the terminal else instead of bottom return -err:-unnecessaryElse # # Checks we plan to eventually put in place, but would be burdensome now # # Checks we plan to eventually put in place, but would be burdensome now # # missing synch in synchronized method override (enforced in tests-warnings) # 24 outstanding items -err:-syncOverride # 1270 "Empty block should be documented" -err:-emptyBlock # 291 cases of "Potential Resource Leak: '' may not be closed" -err:-resource # this tags some NetBeans and FindBugs tokens in @SuppressWarnings # Until that's fixed, useful to run occasionally to find "Unnecessary" annotations -warn:-warningToken # occasionally turn off @SuppressWarnings to see if there are occurrences to fix # Currently 370 cases -err:+suppress