You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/05/15 16:35:41 UTC

[maven-pmd-plugin] branch MPMD-342 created (now 6b7c642)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch MPMD-342
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git


      at 6b7c642  [MPMD-342] No debug log message issued when empty report shall be skipped and not issues have been found

This branch includes the following new commits:

     new 6b7c642  [MPMD-342] No debug log message issued when empty report shall be skipped and not issues have been found

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-pmd-plugin] 01/01: [MPMD-342] No debug log message issued when empty report shall be skipped and not issues have been found

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MPMD-342
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 6b7c6420f8857f9cd169129bc22006cb53911ec9
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun May 15 18:35:29 2022 +0200

    [MPMD-342] No debug log message issued when empty report shall be skipped and not issues have been found
    
    This closes #69
---
 src/main/java/org/apache/maven/plugins/pmd/CpdReport.java | 6 +++---
 src/main/java/org/apache/maven/plugins/pmd/PmdReport.java | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
index 8964e60..7bb71f5 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
@@ -185,7 +185,7 @@ public class CpdReport
                 if ( skipEmptyReport )
                 {
                     result = cpdResult.hasDuplications();
-                    if ( result )
+                    if ( !result )
                     {
                         getLog().debug( "Skipping report since skipEmptyReport is true and there are no CPD issues." );
                     }
@@ -232,11 +232,11 @@ public class CpdReport
             request.setLanguageProperties( languageProperties );
             request.setSourceEncoding( determineEncoding( !filesToProcess.isEmpty() ) );
             request.addFiles( filesToProcess.keySet() );
-            
+
             request.setShowPmdLog( showPmdLog );
             request.setColorizedLog( MessageUtils.isColorEnabled() );
             request.setLogLevel( determineCurrentRootLogLevel() );
-            
+
             request.setExcludeFromFailureFile( excludeFromFailureFile );
             request.setTargetDirectory( targetDirectory.getAbsolutePath() );
             request.setOutputEncoding( getOutputEncoding() );
diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
index b1a7c1e..8ccffd0 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
@@ -337,7 +337,7 @@ public class PmdReport
                 if ( skipEmptyReport )
                 {
                     result = pmdResult.hasViolations();
-                    if ( result )
+                    if ( !result )
                     {
                         getLog().debug( "Skipping report since skipEmptyReport is true and "
                                             + "there are no PMD violations." );