diff --git a/qulice-checkstyle/pom.xml b/qulice-checkstyle/pom.xml index 24d94a34a..6e2e12ee0 100644 --- a/qulice-checkstyle/pom.xml +++ b/qulice-checkstyle/pom.xml @@ -70,7 +70,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. com.puppycrawl.tools checkstyle - 10.9.3 + 10.14.1 net.sf.saxon diff --git a/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java b/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java index 13d0d3b84..8da11f0a4 100644 --- a/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java +++ b/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java @@ -437,6 +437,9 @@ void allowsOnlyProperlyOrderedAtClauses() throws Exception { ), new ViolationMatcher( message, file, "48", name + ), + new ViolationMatcher( + "Class Class should be declared as final.", file, "59", "FinalClassCheck" ) ) ); diff --git a/qulice-pmd/src/main/java/com/qulice/pmd/SourceValidator.java b/qulice-pmd/src/main/java/com/qulice/pmd/SourceValidator.java index 707a73061..592bcbbac 100644 --- a/qulice-pmd/src/main/java/com/qulice/pmd/SourceValidator.java +++ b/qulice-pmd/src/main/java/com/qulice/pmd/SourceValidator.java @@ -101,7 +101,6 @@ public Collection validate( for (final DataSource source : sources) { final String name = source.getNiceFileName(false, path); Logger.debug(this, "Processing file: %s", name); - this.context.setSourceCodeFilename(name); this.context.setSourceCodeFile(new File(name)); this.validateOne(source); } diff --git a/qulice-pmd/src/main/resources/com/qulice/pmd/ruleset.xml b/qulice-pmd/src/main/resources/com/qulice/pmd/ruleset.xml index 35c1cbc86..6e7d2d1cd 100644 --- a/qulice-pmd/src/main/resources/com/qulice/pmd/ruleset.xml +++ b/qulice-pmd/src/main/resources/com/qulice/pmd/ruleset.xml @@ -35,6 +35,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. + @@ -158,6 +159,17 @@ OF THE POSSIBILITY OF SUCH DAMAGE. ]]> + + + @@ -191,10 +203,9 @@ OF THE POSSIBILITY OF SUCH DAMAGE. and not ( MethodDeclarator[ count(FormalParameters/FormalParameter)=1 - and @Image='main' and FormalParameters/FormalParameter[1]/Type/ReferenceType/ClassOrInterfaceType[@Image='String'] and FormalParameters/FormalParameter[@Varargs='true'] - ] and not(ResultType/Type) + ] and not(ResultType/Type) and @Name='main' ) ] and ( Annotation/MarkerAnnotation/Name[@Image!='BeforeClass' and @Image!='AfterClass' @@ -219,64 +230,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. - - - Any method that returns an collection (i.e. an array or a List), it is better to return - an empty one rather than a null reference. - - 1 - - - - - - - - - - - 3 - - - - - - - -