maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r360386 - /maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java
Date Sat, 31 Dec 2005 18:18:17 GMT
Author: carlos
Date: Sat Dec 31 10:18:11 2005
New Revision: 360386

URL: http://svn.apache.org/viewcvs?rev=360386&view=rev
Log:
StringIndexOutOfBoundsException in custom ant task referencing 'basedir'
PR: MANTRUN-34
Submitted By: Marcel Schutte

Modified:
    maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java

Modified: maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java?rev=360386&r1=360385&r2=360386&view=diff
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java
(original)
+++ maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntPropertyHelper.java
Sat Dec 31 10:18:11 2005
@@ -44,19 +44,24 @@
     {
         log.debug( "getProperty(ns="+ns+", name="+name+", user="+user+")" );
 
+        Object val = null;
         try
         {
-            if ( name.startsWith( "project." ) || name.equals( "basedir" ) )
+            if ( name.startsWith( "project." ) )
             {
-                Object val = ReflectionValueExtractor.evaluate(
-                    name.substring( "project.".length() ),
-                    mavenProject
+                val = ReflectionValueExtractor.evaluate(
+                    name,
+                    mavenProject,
+                    true
+                );
+            }
+            else if ( name.equals("basedir") )
+            {
+                val = ReflectionValueExtractor.evaluate(
+                    "basedir.path",
+                    mavenProject,
+                    false
                 );
-
-                if ( val != null )
-                {
-                    return val;
-                }
             }
         }
         catch ( Exception e )
@@ -65,11 +70,13 @@
             e.printStackTrace();
         }
 
-        Object val = super.getPropertyHook( ns, name, user );
-
         if ( val == null )
         {
-            val = System.getProperty( name.toString() );
+            val = super.getPropertyHook( ns, name, user );
+            if ( val == null )
+            {
+                val = System.getProperty( name.toString() );
+            }
         }
 
         return val;



Mime
View raw message