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: | PropertyUtils.resolveFile() should call FileUtil.normalizeFile | ||
---|---|---|---|
Product: | projects | Reporter: | David Konecny <dkonecny> |
Component: | Ant | Assignee: | David Konecny <dkonecny> |
Status: | CLOSED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 4.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 41535, 50433 |
Description
David Konecny
2004-10-14 15:26:40 UTC
This is cause of issue 50433. Note: I think PropertyUtils.resolveFile should *not* call FileUtil.normalizeFile if using the basedir; rather, the caller of PU.rF should have assured that the base dir is already normalized. The reason is that FU.nF is potentially expensive and it should only be called when receiving a file path from an uncontrolled external source. When doing internal filename manipulations, it is not necessary. However when ignoring the basedir and returning an absolute filename, then it does need to use FU.nF. The assumption is that a basedir should always be normalized already (could perhaps be confirmed using IllegalArgumentException if assertions are turned on - with assertions off, should not waste time checking it), whereas the "filename" argument is not tightly constrained and always needs to be sanitized. But even for relative paths, if user customize properties file and use incorrect case on Windows then they will have problems. Perhaps I could call FU.nF in PU.rF only when OS is Windows? "But even for relative paths, if user customize properties file and use incorrect case on Windows then they will have problems." - ah, true. Well I guess you always have to call FU.nF then. Fixed in: src/org/netbeans/spi/project/support/ant/PropertyUtils.java; new revision: 1.23; previous revision: 1.22 Verified. |