Skip to content

Commit 0c8519f

Browse files
hansonrhansonr
authored andcommitted
temp file issues nextInt(), not nextLong()
1 parent 67c3285 commit 0c8519f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sources/net.sf.j2s.java.core/src/java/nio/file/TempFileHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private TempFileHelper() { }
5555
// file name generation, same as java.io.File for now
5656
private static final SecureRandom random = new SecureRandom();
5757
private static Path generatePath(String prefix, String suffix, Path dir) {
58-
long n = random.nextLong();
58+
long n = random.nextInt();// was nextLong();
5959
n = (n == Long.MIN_VALUE) ? 0 : Math.abs(n);
6060
Path name = dir.getFileSystem().getPath(prefix + Long.toString(n) + suffix);
6161
// the generated name should be a simple file name

0 commit comments

Comments
 (0)