Skip to content

Commit

Permalink
[MPMD-342] No debug log message issued when empty report shall be ski…
Browse files Browse the repository at this point in the history
…pped and not issues have been found

This closes #69
  • Loading branch information
michael-o committed May 15, 2022
1 parent 7467798 commit 6b7c642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
Expand Up @@ -185,7 +185,7 @@ public boolean canGenerateReport()
if ( skipEmptyReport )
{
result = cpdResult.hasDuplications();
if ( result )
if ( !result )
{
getLog().debug( "Skipping report since skipEmptyReport is true and there are no CPD issues." );
}
Expand Down Expand Up @@ -232,11 +232,11 @@ private void executeCpd()
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() );
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
Expand Up @@ -337,7 +337,7 @@ public boolean canGenerateReport()
if ( skipEmptyReport )
{
result = pmdResult.hasViolations();
if ( result )
if ( !result )
{
getLog().debug( "Skipping report since skipEmptyReport is true and "
+ "there are no PMD violations." );
Expand Down

0 comments on commit 6b7c642

Please sign in to comment.