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:
        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; 

could be simplified:
    return new String(newPath, 0, newLength); 

2. in properPath:
        if ((properPath = properPathImpl(pathBytes)) != null) {
            return properPath;

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:
        if (isAbsoluteImpl(pathBytes)) {
            return properPath = pathBytes;
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.

View raw message