ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r578773 - in /ant/core/trunk/src/main/org/apache/tools/ant: taskdefs/rmic/DefaultRmicAdapter.java types/optional/depend/ClassfileSet.java
Date Mon, 24 Sep 2007 12:04:43 GMT
Author: jhm
Date: Mon Sep 24 05:04:43 2007
New Revision: 578773

URL: http://svn.apache.org/viewvc?rev=578773&view=rev
Log:
Use StringUtils.removeSuffix()

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java?rev=578773&r1=578772&r2=578773&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java Mon
Sep 24 05:04:43 2007
@@ -29,6 +29,7 @@
 import org.apache.tools.ant.types.Commandline;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.util.FileNameMapper;
+import org.apache.tools.ant.util.StringUtils;
 
 /**
  * This is the default implementation for the RmicAdapter interface.
@@ -365,7 +366,7 @@
             }
 
             // we know that name.endsWith(".class")
-            String base = name.substring(0, name.length() - ".class".length());
+            String base = StringUtils.removeSuffix(name, ".class");
 
             String classname = base.replace(File.separatorChar, '.');
             if (attributes.getVerify()

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java?rev=578773&r1=578772&r2=578773&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java Mon
Sep 24 05:04:43 2007
@@ -22,6 +22,7 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.util.StringUtils;
 
 /**
  * A ClassfileSet is a FileSet that enlists all classes that depend on a
@@ -125,9 +126,7 @@
             String[] files = additionalScanner.getIncludedFiles();
             for (int i = 0; i < files.length; ++i) {
                 if (files[i].endsWith(".class")) {
-                    String classFilePath
-                        = files[i].substring(
-                            0, files[i].length() - ".class".length());
+                    String classFilePath = StringUtils.removeSuffix(files[i], ".class");
                     String className
                         = classFilePath.replace('/', '.').replace('\\', '.');
                     allRootClasses.addElement(className);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message