maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r552950 - /maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java
Date Tue, 03 Jul 2007 19:04:02 GMT
Author: jmcconnell
Date: Tue Jul  3 12:04:01 2007
New Revision: 552950

URL: http://svn.apache.org/viewvc?view=rev&rev=552950
Log:
commit bugfix I missed a while back

Modified:
    maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java

Modified: maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java?view=diff&rev=552950&r1=552949&r2=552950
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java
(original)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugins/pom/AddByXPathMojo.java
Tue Jul  3 12:04:01 2007
@@ -87,7 +87,7 @@
 
             xmlTool.removeNamespaces();
 
-            if( xmlTool.hasElement( skipXPath ) )
+            if( skipXPath != null && xmlTool.hasElement( skipXPath ) )
             {
             	getLog().info( "skipXPath element located, skipping execution" );
             	return;
@@ -97,11 +97,11 @@
             {
             	Element node = xmlTool.getElement( xpath );
             	
-            	node.addElement( newElement );
+            	Element newNode = node.addElement( newElement );
             	
             	if ( newValue != null )
             	{
-            		node.setText( newValue );
+            		newNode.setText( newValue );
             	}
             } 
             else if ( failFast )



Mime
View raw message