ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Tulley" <JTUL...@novell.com>
Subject Superfluous code in FileUtils.resolveFile(File, File)????
Date Thu, 11 Oct 2001 21:04:04 GMT
In the following code, taken from FileUtils:

    public File resolveFile(File file, String filename) {
        filename = filename.replace('/', File.separatorChar)
            .replace('\\', File.separatorChar);

        // deal with absolute files
        if (filename.startsWith(File.separator) ||

            (filename.length() >= 2 &&
             Character.isLetter(filename.charAt(0)) &&
             filename.charAt(1) == ':')

            ) {
            return normalize(filename);
        }

        if (filename.length() >= 2 &&
            Character.isLetter(filename.charAt(0)) &&
            filename.charAt(1) == ':') {
            return normalize(filename);
        }

If I am not mistaken, that secod if block is already completely covered by the first one,
due to the ||

If there are no objections, then I will end up getting rid of this block when I submit my
NetWare patch for FileUtils.java.


Jeff Tulley  (jtulley@novell.com)
(801)861-5322
Novell, Inc., the leading provider of Net services software.


Mime
View raw message