harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6126) [classlib][luni] - remove unnecessary code in java.io.File
Date Tue, 24 Mar 2009 07:09:50 GMT
[classlib][luni] - remove unnecessary code in java.io.File
----------------------------------------------------------

                 Key: HARMONY-6126
                 URL: https://issues.apache.org/jira/browse/HARMONY-6126
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Regis Xu


two places:
1. in fixSlashes:
<code>
        String tempPath = new String(newPath, 0, newLength);
        // If it's the same keep it identical for SecurityManager purposes
        if (!tempPath.equals(origPath)) {
            return tempPath;
        }
        return origPath; 
</code>

could be simplified:
<code>
    return new String(newPath, 0, newLength); 
</code>

2. in properPath:
<code>
        if ((properPath = properPathImpl(pathBytes)) != null) {
            return properPath;
        }
</code>

on Linux, properPathImpl just return null; on Windows,  it will return not null only when
the path is absolute, 
but before above code segment, there is code:
<code>
        if (isAbsoluteImpl(pathBytes)) {
            return properPath = pathBytes;
        }
</code>
so properPathImpl always return null, can be safely removed.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message