On Mon, 13 Dec 2004, kj <[EMAIL PROTECTED]> wrote:
> -FileUtils now uses close to close inputstreams inside itself
I've applied this part of the patch, but have some more comments on
the rest:
> + int stackSize = s.size();
> while (tok.hasMoreTokens()) {
> String thisToken = tok.nextToken();
> if (".".equals(thisToken)) {
> continue;
> } else if ("..".equals(thisToken)) {
> - if (s.size() < 2) {
> - throw new BuildException("Cannot resolve path " + orig);
> - } else {
> + if (stackSize > 2) {
> s.pop();
> + } else {
> + throw new BuildException("Cannot resolve path " + orig);
> }
here s.pop() is going to change s.size(), but you don't update
stackSize.
> + /* If we have Java => 1.4, we can use NIO
> + * This buffer comparison simply maps the entire file into memory,
> + * it's not concerned with memory usage - for large files this
> + * may cause problems
> + */
> + if (JavaEnvUtils.getJavaVersion().equals(JavaEnvUtils.JAVA_1_4)
> + ||JavaEnvUtils.getJavaVersion().equals(JavaEnvUtils.JAVA_1_5)
> + ) {
If you want to assert JDK 1.4+, you better reverse the logic for
forwards compatibility reasons. I.e. check that we currently are not
running on JDK 1.2 or 1.3 (less than 1.2 is not possible anymore).
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]