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.
Summary: | need for FileUtil.normalizePath | ||
---|---|---|---|
Product: | platform | Reporter: | Vladimir Voskresensky <vv159170> |
Component: | Filesystems | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, issues, jglick, jtulach |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST, PERFORMANCE |
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
proposed patch
final patch |
Description
Vladimir Voskresensky
2010-09-21 12:55:47 UTC
something like: public static String normalizePath(final String unnormalized) { Map<String, String> normalizedPaths = getNormalizedFilesMap(); String normalized = normalizedPaths.get(unnormalized); if (normalized == null) { File ret = normalizeFileImpl(new File(unnormalized)); normalized = ret.getPath(); normalizedPaths.put(unnormalized, normalized); } return normalized; } we need this in 6.10 to save quite a few memory (duplicated caches). I will prepare a patch for API review Created attachment 102113 [details]
proposed patch
Please, review proposed patch Generally looks good. Minor comments: [JG01] "that does prevent String to File to String conversion" - probably you mean "that does not require String to File to String conversion"? [JG02] The date of the change is set as the 22nd, today. Be sure to commit with the date it is actually committed. My custom is to submit a patch with a date seven days from today, i.e. assuming the review will pass on time. [JG03] nP Javadoc should just @see nF Javadoc for all details, so we do not have to maintain two copies of a complex specification. (In reply to comment #5) > Generally looks good. Minor comments: > > > [JG01] "that does prevent String to File to String conversion" - probably you > mean "that does not require String to File to String conversion"? I was not sure about right wording. The main idea is that if "client" is working with pure strings and is trying to prevent performance overhead "string to file to string conversion" (cnd's usecase) => he can use nP instead of nF. May be you can propose even better description? > > > [JG02] The date of the change is set as the 22nd, today. Be sure to commit with > the date it is actually committed. My custom is to submit a patch with a date > seven days from today, i.e. assuming the review will pass on time. Ok. will be correct date. > > > [JG03] nP Javadoc should just @see nF Javadoc for all details, so we do not > have to maintain two copies of a complex specification. Good idea. Thanks. (In reply to comment #6) > May be you can propose even better description? I think the wording I already proposed is what you want. The new method does not prevent conversion when there is a cache miss - but it does not require conversion when there is a cache hit. Created attachment 102200 [details]
final patch
will apply tomorrow
Rather than @see normalizeFile for details use See {@link #normalizeFile} for details. or @see #normalizeFile (In reply to comment #9) > Rather than > > @see normalizeFile for details > > use > > See {@link #normalizeFile} for details. Ok. Will use this variant Thanks integrated http://hg.netbeans.org/cnd-main/rev/4d11cccea60b Thanks for review |