Author: dennisl
Date: Sat Jun 24 10:50:24 2006
New Revision: 416940

URL: http://svn.apache.org/viewvc?rev=416940&view=rev
Log:
Avoid possible NPE
Add more JavaDoc

Modified:
    
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java

Modified: 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java?rev=416940&r1=416939&r2=416940&view=diff
==============================================================================
--- 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
 (original)
+++ 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
 Sat Jun 24 10:50:24 2006
@@ -49,18 +49,18 @@
 
 /**
  * Converts a Maven 1 project.xml (v3 pom) to a Maven 2 pom.xml (v4 pom).
+ *
  * @goal convert
  * @requiresProject false
  * @author Fabrizio Giustina
  * @author Dennis Lundberg
  * @version $Id$
  */
-public class PomV3ConvertMojo
-    extends AbstractMojo
+public class PomV3ConvertMojo extends AbstractMojo
 {
-
     /**
      * Project basedir
+     *
      * @parameter expression="${basedir}"
      * @required
      * @readonly
@@ -239,12 +239,22 @@
      */
     private void removeDistributionManagementStatus( Model v4Model )
     {
-        if ( "converted".equals( 
v4Model.getDistributionManagement().getStatus() ) )
+        if ( v4Model.getDistributionManagement() != null )
         {
-            v4Model.getDistributionManagement().setStatus( null );
+            if ( "converted".equals( 
v4Model.getDistributionManagement().getStatus() ) )
+            {
+                v4Model.getDistributionManagement().setStatus( null );
+            }
         }
     }
 
+    /**
+     * Write the pom to <code>${basedir}/pom.xml</code>. If the file exists it
+     * will be overwritten.
+     *
+     * @param v4Model
+     * @throws MojoExecutionException
+     */
     private void writeV4Pom( Model v4Model )
         throws MojoExecutionException
     {


Reply via email to