You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2014/03/13 11:15:02 UTC
svn commit: r1577083 - in /db/derby/code/trunk/java/engine/org/apache/derby:
iapi/services/io/FileUtil.java impl/services/monitor/FileMonitor.java
impl/services/reflect/DatabaseClasses.java
Author: kahatlen
Date: Thu Mar 13 10:15:02 2014
New Revision: 1577083
URL: http://svn.apache.org/r1577083
Log:
DERBY-6505: Clean up dead code in FileUtil
Remove FileUtil.newFile(), which is a workaround for a bug in old Java
versions that are no longer supported.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FileUtil.java?rev=1577083&r1=1577082&r2=1577083&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FileUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FileUtil.java Thu Mar 13 10:15:02 2014
@@ -445,20 +445,6 @@ public abstract class FileUtil {
} // end of copyFile
/**
- A replacement for new File(File, String) that correctly implements
- the case when the first argument is null. The documentation for java.io.File
- says that new File((File) null, name) is the same as new File(name).
- This is not the case in pre 1.1.8 vms, a NullPointerException is thrown instead.
- */
- public static File newFile(File parent, String name) {
-
- if (parent == null)
- return new File(name);
- else
- return new File(parent, name);
- }
-
- /**
Remove the leading 'file://' protocol from a filename which has been
expressed as an URL. If the filename is not an URL, then nothing is done.
Otherwise, an URL like 'file:///tmp/foo.txt' is transformed into the legal
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java?rev=1577083&r1=1577082&r2=1577083&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java Thu Mar 13 10:15:02 2014
@@ -63,7 +63,7 @@ public final class FileMonitor extends B
private InputStream PBapplicationPropertiesStream()
throws IOException {
- File sr = FileUtil.newFile(home, Property.PROPERTIES_FILE);
+ File sr = new File(home, Property.PROPERTIES_FILE);
if (!sr.exists())
return null;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java?rev=1577083&r1=1577082&r2=1577083&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java Thu Mar 13 10:15:02 2014
@@ -34,7 +34,6 @@ import org.apache.derby.iapi.reference.M
import org.apache.derby.iapi.reference.Property;
import org.apache.derby.iapi.reference.SQLState;
import org.apache.derby.iapi.services.i18n.MessageService;
-import org.apache.derby.iapi.services.io.FileUtil;
import org.apache.derby.iapi.services.loader.ClassFactory;
import org.apache.derby.iapi.services.loader.ClassInspector;
import org.apache.derby.iapi.services.loader.GeneratedClass;
@@ -172,7 +171,7 @@ abstract class DatabaseClasses
Object env = Monitor.getMonitor().getEnvironment();
File dir = env instanceof File ? (File) env : null;
- final File classFile = FileUtil.newFile(dir,filename);
+ final File classFile = new File(dir, filename);
// find the error stream
HeaderPrintWriter errorStream = Monitor.getStream();