[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-dev
Subject:    svn commit: r690677 -
From:       vsiveton () apache ! org
Date:       2008-08-31 11:37:34
Message-ID: 20080831113734.75A7E2388888 () eris ! apache ! org
[Download RAW message or body]

Author: vsiveton
Date: Sun Aug 31 04:37:33 2008
New Revision: 690677

URL: http://svn.apache.org/viewvc?rev=690677&view=rev
Log:
o fixed potential NPE if no goals

Modified:
    maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java


Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/ \
org/apache/maven/plugins/help/DescribeMojo.java?rev=690677&r1=690676&r2=690677&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java \
                (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java \
Sun Aug 31 04:37:33 2008 @@ -573,14 +573,20 @@
         append( buffer, "Goal Prefix", pd.getGoalPrefix(), 0 );
         buffer.append( "\n" );
 
+        List mojos = pd.getMojos();
+
+        if ( mojos == null )
+        {
+            append( buffer, "This plugin has no goals.", 0 );
+            return;
+        }
+
         if ( ( detail || medium ) && !minimal )
         {
             append( buffer, "This plugin has " + pd.getMojos().size() + " goal"
                 + ( pd.getMojos().size() > 1 ? "s" : "" ) + ":", 0 );
             buffer.append( "\n" );
 
-            List mojos = pd.getMojos();
-
             PluginUtils.sortMojos( mojos );
 
             for ( Iterator it = mojos.iterator(); it.hasNext(); )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic