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 no issues have been found

This closes #69
  • Loading branch information
michael-o committed May 15, 2022
1 parent 7467798 commit e82e92b
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 e82e92b

Please sign in to comment.