From 143e2d73093eae0897b8350e26e4bab4eaa126e1 Mon Sep 17 00:00:00 2001 From: Martin Dietze Date: Mon, 15 Apr 2019 19:14:49 +0200 Subject: [PATCH] Issue #734: Remove some paranoia checks not covered in the tests --- .../coding/checkstyle-metadata.properties | 6 +- sevntu-checks/pom.xml | 6 +- sevntu-checks/sevntu-checks.xml | 16 +- .../checks/coding/Jsr305AnnotationsCheck.java | 221 ++++----- .../coding/Jsr305AnnotationsCheckTest.java | 421 ++---------------- ...InputJsr305AnnotationsCheckWithArrays.java | 2 +- .../InputJsr305AnnotationsCheckWithCatch.java | 44 ++ .../InputJsr305AnnotationsCheckWithClass.java | 2 +- ...Jsr305AnnotationsCheckWithConstructor.java | 2 +- ...notationsCheckWithDefaultReturnValues.java | 2 +- ...AnnotationsCheckWithDefectConstructor.java | 2 +- .../InputJsr305AnnotationsCheckWithEnum.java | 2 +- ...Jsr305AnnotationsCheckWithInheritance.java | 2 +- ...InputJsr305AnnotationsCheckWithLambda.java | 2 +- ...utJsr305AnnotationsCheckWithParameter.java | 2 +- ...tJsr305AnnotationsCheckWithPrimitives.java | 2 +- ...notationsCheckWithRedundantClassLevel.java | 2 +- ...Jsr305AnnotationsCheckWithReturnValue.java | 2 +- .../sonar/checkstyle-extensions.xml | 4 +- 19 files changed, 188 insertions(+), 554 deletions(-) create mode 100644 sevntu-checks/src/test/resources/com/github/sevntu/checkstyle/checks/coding/InputJsr305AnnotationsCheckWithCatch.java diff --git a/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties b/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties index d6f785e827..e286278314 100755 --- a/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties +++ b/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties @@ -191,7 +191,7 @@ RequireFailForTryCatchInJunitCheck.desc = Checks if a try/catch block has a juni Jsr305AnnotationsCheck.name=Jsr305AnnotationsCheck Jsr305AnnotationsCheck.desc=Checks method parameters and return values for the presence of @Nonnull, @Nullable, or @CheckForNull annotations. -Jsr305AnnotationsCheck.packages=Packages to be checked. -Jsr305AnnotationsCheck.excludePackages=Packages excluded from checking. +Jsr305AnnotationsCheck.packages=Sets the parent package for all classes that will be checked. +Jsr305AnnotationsCheck.excludePackages=Packages excluded from checking. This can be useful if under the parent package set with "packages" there are subpackages which should not be checked. Jsr305AnnotationsCheck.allowOverridingReturnValue=Allow Overriding return values, useful for upgrading. -Jsr305AnnotationsCheck.allowOverridingParameter=Allow Overriding paramaters, useful for upgrading. +Jsr305AnnotationsCheck.allowOverridingParameter=Allow Overriding parameters, useful for upgrading. diff --git a/sevntu-checks/pom.xml b/sevntu-checks/pom.xml index 7298767531..e6cffcabc5 100644 --- a/sevntu-checks/pom.xml +++ b/sevntu-checks/pom.xml @@ -49,7 +49,7 @@ com.google.code.findbugs jsr305 - 3.0.1 + 3.0.2 com.google.code.findbugs @@ -294,8 +294,8 @@ .*.checks.coding.MapIterationInForEachLoopCheck9098 .*.checks.coding.NoNullForCollectionReturnCheck8596 .*.checks.coding.OverridableMethodInConstructorCheck9499 - .*.checks.coding.Jsr305AnnotationsCheck8493 - .*.checks.coding.Jsr305AnnotationsCheck.AbstractJsr305Check9598 + .*.checks.coding.Jsr305AnnotationsCheck97100 + .*.checks.coding.Jsr305AnnotationsCheck.AbstractJsr305Check99100 .*.checks.design.HideUtilityClassConstructorCheck94100 diff --git a/sevntu-checks/sevntu-checks.xml b/sevntu-checks/sevntu-checks.xml index dacefc8868..25cf1e5d33 100644 --- a/sevntu-checks/sevntu-checks.xml +++ b/sevntu-checks/sevntu-checks.xml @@ -159,6 +159,14 @@ + + + + + + + + @@ -216,14 +224,6 @@ - - - - - - - -