maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1592262 - /maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
Date Sat, 03 May 2014 18:51:13 GMT
Author: hboutemy
Date: Sat May  3 18:51:13 2014
New Revision: 1592262

URL: http://svn.apache.org/r1592262
Log:
limit debug output: display found class only when annotation is found

Modified:
    maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java

Modified: maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java?rev=1592262&r1=1592261&r2=1592262&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
Sat May  3 18:51:13 2014
@@ -210,9 +210,9 @@ public class DefaultMojoAnnotationsScann
             mojoAnnotatedClass.setMojo( null );
         }
 
-        if ( isStoreClass( mojoAnnotatedClass ) != null )
+        if ( mojoAnnotatedClass != null ) // see MPLUGIN-206 we can have intermediate classes
without annotations
         {
-            if ( getLogger().isDebugEnabled() )
+            if ( getLogger().isDebugEnabled() && hasMojoAnnotations( mojoAnnotatedClass
) )
             {
                 getLogger().debug( "found MojoAnnotatedClass:" + mojoAnnotatedClass.getClassName()
+ ":"
                                        + mojoAnnotatedClass );
@@ -222,22 +222,10 @@ public class DefaultMojoAnnotationsScann
         }
     }
 
-    private MojoAnnotatedClass isStoreClass( MojoAnnotatedClass mojoAnnotatedClass )
+    private boolean hasMojoAnnotations( MojoAnnotatedClass mojoAnnotatedClass )
     {
-        // see MPLUGIN-206 we can have intermediate classes without annotations
-        if ( mojoAnnotatedClass == null )
-        {
-            return null;
-        }
-        return mojoAnnotatedClass;
-        /**
-         if ( !mojoAnnotatedClass.getComponents().isEmpty() || !mojoAnnotatedClass.getParameters().isEmpty()
-         || mojoAnnotatedClass.getExecute() != null || mojoAnnotatedClass.getMojo() != null
)
-         {
-         return mojoAnnotatedClass;
-         }
-         return null;
-         **/
+        return !( mojoAnnotatedClass.getComponents().isEmpty() && mojoAnnotatedClass.getParameters().isEmpty()
+            && mojoAnnotatedClass.getExecute() == null && mojoAnnotatedClass.getMojo()
== null );
     }
 
     protected void populateAnnotationContent( Object content, MojoAnnotationVisitor mojoAnnotationVisitor
)



Mime
View raw message