[9] RFR: 8168923: Use unsigned random long in a temp directory name (original) (raw)

Ivan Gerasimov ivan.gerasimov at oracle.com
Wed Nov 2 14:39:56 UTC 2016


Thank you Brian for review!

On 31.10.2016 21:23, Brian Burkhalter wrote:

One more thing …

In [1] lines 58-59 could be corrected in the same way.

Yes, right. Thanks for catching it!

Here's the updated webrev: http://cr.openjdk.java.net/~igerasim/8168923/01/webrev/

Thanks,

Brian [1] http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/0086eb10182b/src/java.base/share/classes/java/nio/file/TempFileHelper.java On Oct 31, 2016, at 9:00 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

Hello, Ivan,

Aside from the inevitable copyright year update this looks fine to me. What effect does it have on the regression test run?

Tested (jdk_io|jdk_nio) on all platforms, no failures.

With kind regards, Ivan

Thanks,

Brian On Oct 29, 2016, at 8:43 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:

Hello everyone!

When File.createTempFile() is called, a random long value is generated, which is then made positive with Math.abs() and then used as a part of the directory name. Instead of using Math.abs() and Long.toString(), it would be better to use Long.toUnsignedString(): 1) no need to deal with the corner case of Long.MINVALUE, 2) increase the space of random values by the factor of 2. Would you please help review the fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8168923 WEBREV: http://cr.openjdk.java.net/~igerasim/8168923/00/webrev/ With kind regards, Ivan



More information about the core-libs-dev mailing list