Browse Source

Math.abs(rand.nextInt()) may yield negative value. rand.nextInt(Integer.MAX_VALUE) seems to be what was meant.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@739575 13f79535-47bb-0310-9956-ffa450edef68
master
Jacobus Martinus Kruithof 16 years ago
parent
commit
d534f1e1a1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/util/FileUtils.java

+ 1
- 1
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -891,7 +891,7 @@ public class FileUtils {
synchronized (rand) {
do {
result = new File(parent, prefix
+ fmt.format(Math.abs(rand.nextInt())) + suffix);
+ fmt.format(rand.nextInt(Integer.MAX_VALUE)) + suffix);
} while (result.exists());
}
}


Loading…
Cancel
Save