mbenson 2004/04/20 12:27:54
Modified: src/main/org/apache/tools/ant Main.java
Log:
Switch getParentFile(File) to delegate to File.getParentFile() and deprecate.
Revision Changes Path
1.106 +5 -6 ant/src/main/org/apache/tools/ant/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Main.java,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- Main.java 17 Mar 2004 22:06:47 -0000 1.105
+++ Main.java 20 Apr 2004 19:27:54 -0000 1.106
@@ -506,20 +506,19 @@
* Helper to get the parent file for a given file.
* <p>
* Added to simulate File.getParentFile() from JDK 1.2.
+ * @deprecated
*
* @param file File to find parent of. Must not be <code>null</code>.
* @return Parent file or null if none
*/
private File getParentFile(File file) {
- String filename = file.getAbsolutePath();
- file = new File(filename);
- filename = file.getParent();
+ File parent = file.getParentFile();
- if (filename != null && msgOutputLevel >= Project.MSG_VERBOSE) {
- System.out.println("Searching in " + filename);
+ if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) {
+ System.out.println("Searching in " + parent.getAbsolutePath());
}
- return (filename == null) ? null : new File(filename);
+ return parent;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]