ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1351053 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/util/PackageNameMapper.java src/tests/antunit/types/mappers/packagemapper-test.xml
Date Sun, 17 Jun 2012 06:01:27 GMT
Author: bodewig
Date: Sun Jun 17 06:01:27 2012
New Revision: 1351053

URL: http://svn.apache.org/viewvc?rev=1351053&view=rev
Log:
packagemapper mapped too uch with handlediresep true.  PR 53399

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/util/PackageNameMapper.java
    ant/core/trunk/src/tests/antunit/types/mappers/packagemapper-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1351053&r1=1351052&r2=1351053&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sun Jun 17 06:01:27 2012
@@ -37,6 +37,10 @@ Fixed bugs:
  * ExtensionPoint doesn't work with nested import/include
    Bugzilla Report 53405.
 
+ * <packagemapper> failed to strip the non-matched parts with
+   handledirsep="true".
+   Bugzilla Report 53399.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/PackageNameMapper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/PackageNameMapper.java?rev=1351053&r1=1351052&r2=1351053&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/PackageNameMapper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/PackageNameMapper.java Sun Jun 17 06:01:27
2012
@@ -41,7 +41,7 @@ public class PackageNameMapper extends G
         String var = name.substring(prefixLength,
                 name.length() - postfixLength);
         if (getHandleDirSep()) {
-            var = name.replace('/', '.').replace('\\', '.');
+            var = var.replace('/', '.').replace('\\', '.');
         }
         return var.replace(File.separatorChar, '.');
     }

Modified: ant/core/trunk/src/tests/antunit/types/mappers/packagemapper-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/mappers/packagemapper-test.xml?rev=1351053&r1=1351052&r2=1351053&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/mappers/packagemapper-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/types/mappers/packagemapper-test.xml Sun Jun 17 06:01:27
2012
@@ -31,6 +31,20 @@
       <string>foo\bar</string>
       <packagemapper from="*" to="*" handledirsep="true"/>
     </pathconvert>
+    <au:assertPropertyEquals name="p2" value="foo.bar"/>
+  </target>
+
+  <target name="testMapsOnlySubstring"
+          description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53399">
+    <pathconvert property="p1">
+      <string>xyzzy${file.separator}foo${file.separator}bar</string>
+      <packagemapper from="xyzzy/*" to="*" handledirsep="false"/>
+    </pathconvert>
     <au:assertPropertyEquals name="p1" value="foo.bar"/>
+    <pathconvert property="p2">
+      <string>xyzzy${file.separator}foo${file.separator}bar</string>
+      <packagemapper from="xyzzy/*" to="*" handledirsep="true"/>
+    </pathconvert>
+    <au:assertPropertyEquals name="p2" value="foo.bar"/>
   </target>
 </project>
\ No newline at end of file



Mime
View raw message