Skip to content

Commit e82e92b

Browse files
committed
[MPMD-342] No debug log message issued when empty report shall be skipped and no issues have been found
This closes #69
1 parent 7467798 commit e82e92b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/apache/maven/plugins/pmd/CpdReport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public boolean canGenerateReport()
185185
if ( skipEmptyReport )
186186
{
187187
result = cpdResult.hasDuplications();
188-
if ( result )
188+
if ( !result )
189189
{
190190
getLog().debug( "Skipping report since skipEmptyReport is true and there are no CPD issues." );
191191
}
@@ -232,11 +232,11 @@ private void executeCpd()
232232
request.setLanguageProperties( languageProperties );
233233
request.setSourceEncoding( determineEncoding( !filesToProcess.isEmpty() ) );
234234
request.addFiles( filesToProcess.keySet() );
235-
235+
236236
request.setShowPmdLog( showPmdLog );
237237
request.setColorizedLog( MessageUtils.isColorEnabled() );
238238
request.setLogLevel( determineCurrentRootLogLevel() );
239-
239+
240240
request.setExcludeFromFailureFile( excludeFromFailureFile );
241241
request.setTargetDirectory( targetDirectory.getAbsolutePath() );
242242
request.setOutputEncoding( getOutputEncoding() );

src/main/java/org/apache/maven/plugins/pmd/PmdReport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public boolean canGenerateReport()
337337
if ( skipEmptyReport )
338338
{
339339
result = pmdResult.hasViolations();
340-
if ( result )
340+
if ( !result )
341341
{
342342
getLog().debug( "Skipping report since skipEmptyReport is true and "
343343
+ "there are no PMD violations." );

0 commit comments

Comments
 (0)