maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/plugin DefaultPluginManager.java
Date Thu, 24 Mar 2005 07:54:34 GMT
brett       2005/03/23 23:54:34

  Modified:    maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
  Log:
  fix NPE when there is no goal configuration
  
  Revision  Changes    Path
  1.70      +10 -3     maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- DefaultPluginManager.java	24 Mar 2005 05:01:05 -0000	1.69
  +++ DefaultPluginManager.java	24 Mar 2005 07:54:34 -0000	1.70
  @@ -683,14 +683,21 @@
                       if ( index >= 0 )
                       {
                           String goalName = goalId.substring( index + 1 );
  -                        for ( Iterator j = plugin.getGoals().iterator(); j.hasNext(); )
  +                        for ( Iterator j = plugin.getGoals().iterator(); j.hasNext() &&
dom == null; )
                           {
                               Goal goal = (Goal) j.next();
                               if ( goal.getId().equals( goalName ) )
                               {
                                   Xpp3Dom goalConfiguration = (Xpp3Dom) goal.getConfiguration();
  -                                dom = Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom(
goalConfiguration ), dom );
  -                                break;
  +                                if ( goalConfiguration != null )
  +                                {
  +                                    dom =
  +                                        Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom(
goalConfiguration ), dom );
  +                                }
  +                                else
  +                                {
  +                                    dom = new Xpp3Dom( "configuration" );
  +                                }
                               }
                           }
                       }
  
  
  

Mime
View raw message