This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 168389
Collapse All | Expand All

(-)FileUtil.java (-1 / +13 lines)
Lines 819-824 Link Here
819
        return data;
819
        return data;
820
    }
820
    }
821
821
822
    private static final Map<FileObject,File> toFile = new WeakHashMap<FileObject, File>();
822
    /** Finds appropriate java.io.File to FileObject if possible.
823
    /** Finds appropriate java.io.File to FileObject if possible.
823
     * If not possible then null is returned.
824
     * If not possible then null is returned.
824
     * This is the inverse operation of {@link #toFileObject}.
825
     * This is the inverse operation of {@link #toFileObject}.
Lines 827-832 Link Here
827
     * @since 1.29
828
     * @since 1.29
828
     */
829
     */
829
    public static File toFile(FileObject fo) {
830
    public static File toFile(FileObject fo) {
831
        File cache = toFile.get(fo);
832
        if (cache != null) {
833
            return cache;
834
        }
835
830
        File retVal = (File) fo.getAttribute("java.io.File"); // NOI18N;        
836
        File retVal = (File) fo.getAttribute("java.io.File"); // NOI18N;        
831
837
832
        if (retVal == null) {
838
        if (retVal == null) {
Lines 842-850 Link Here
842
            }
848
            }
843
        }
849
        }
844
850
845
        return (retVal != null) ? normalizeFile(retVal) : null;
851
        if (retVal != null) {
852
            retVal = normalizeFile(retVal);
846
    }
853
    }
847
854
855
        toFile.put(fo, retVal);
856
857
        return retVal;
858
    }
859
848
    /**
860
    /**
849
     * Converts a disk file to a matching file object.
861
     * Converts a disk file to a matching file object.
850
     * This is the inverse operation of {@link #toFile}.
862
     * This is the inverse operation of {@link #toFile}.

Return to bug 168389