conor 01/02/28 04:34:31
Modified: src/main/org/apache/tools/ant/taskdefs/optional/depend Tag:
ANT_13_BRANCH ClassFileUtils.java
Log:
Clean up code by using replace
Submitted by: Fernando Padilla <[EMAIL PROTECTED]>
Revision Changes Path
No revision
No revision
1.2.2.1 +2 -50
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/ClassFileUtils.java
Index: ClassFileUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/ClassFileUtils.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- ClassFileUtils.java 2001/01/03 14:18:36 1.2
+++ ClassFileUtils.java 2001/02/28 12:34:30 1.2.2.1
@@ -73,31 +73,7 @@
* @return the class name in dot notation (eg. java.lang.Object).
*/
static public String convertSlashName(String name) {
- String dotName = null;
- int startIndex = 0;
- int sepIndex = 0;
-
- String slashName = name.replace('\\', '/');
- do {
- String component = null;
-
- sepIndex = slashName.indexOf('/', startIndex);
-
- if (sepIndex == -1) {
- component = slashName.substring(startIndex);
- } else {
- component = slashName.substring(startIndex, sepIndex);
- startIndex = sepIndex + 1;
- }
-
- if (dotName == null) {
- dotName = component;
- } else {
- dotName += "." + component;
- }
- } while (sepIndex != -1);
-
- return dotName;
+ return name.replace('\\', '.').replace( '/', '.' );
}
/**
@@ -108,31 +84,7 @@
* @return the class name in slash notation (eg. java/lang/Object).
*/
static public String convertDotName(String dotName) {
- String slashName = null;
- int startIndex = 0;
- int sepIndex = 0;
-
- do {
- String component = null;
-
- sepIndex = dotName.indexOf('.', startIndex);
-
- if (sepIndex == -1) {
- component = dotName.substring(startIndex);
- } else {
- component = dotName.substring(startIndex, sepIndex);
- startIndex = sepIndex + 1;
- }
-
- if (slashName == null) {
- slashName = component;
- } else {
- slashName += "/" + component;
- }
- } while (sepIndex != -1);
-
- return slashName;
+ return dotName.replace( '.', '/');
}
-
}