maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r936081 - in /maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd: CpdReport.java PmdReport.java
Date Tue, 20 Apr 2010 22:07:00 GMT
Author: hboutemy
Date: Tue Apr 20 22:07:00 2010
New Revision: 936081

URL: http://svn.apache.org/viewvc?rev=936081&view=rev
Log:
[MPMD-95] don't fail when format=none

Modified:
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java

Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java?rev=936081&r1=936080&r2=936081&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
Tue Apr 20 22:07:00 2010
@@ -167,6 +167,12 @@ public class CpdReport
         throws MavenReportException
     {
         Renderer r = createRenderer();
+
+        if ( r == null )
+        {
+            return;
+        }
+
         String buffer = r.render( cpd.getMatches() );
         Writer writer = null;
         try
@@ -231,15 +237,10 @@ public class CpdReport
             catch ( Exception e )
             {
                 throw new MavenReportException(
-                    "Can't find the custom format " + format + ": " + e.getClass().getName()
);
+                    "Can't find CPD custom format " + format + ": " + e.getClass().getName()
);
             }
         }
 
-        if ( renderer == null )
-        {
-            throw new MavenReportException( "Can't create report with format of " + format
);
-        }
-
         return renderer;
     }
 }

Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java?rev=936081&r1=936080&r2=936081&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
Tue Apr 20 22:07:00 2010
@@ -458,7 +458,7 @@ public class PmdReport
             catch ( Exception e )
             {
                 throw new MavenReportException(
-                    "Can't find the custom format " + format + ": " + e.getClass().getName(),
e );
+                    "Can't find PMD custom format " + format + ": " + e.getClass().getName(),
e );
             }
         }
 



Mime
View raw message