Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPMD-342] No debug log message issued when empty report shall be ski… #69

Merged
merged 1 commit into from May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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