[9] RFR: 8168923: Use unsigned random long in a temp directory name (original) (raw)
Alan Bateman Alan.Bateman at oracle.com
Tue Nov 1 10:52:39 UTC 2016
- Previous message: RFR: 8152515: (logging) LogManager.resetLogger should ignore LinkageError
- Next message: [9] RFR: 8168923: Use unsigned random long in a temp directory name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 30/10/2016 03:43, Ivan Gerasimov 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/ Looks okay, this code predates Long.toUnsignedString of course.
-Alan
- Previous message: RFR: 8152515: (logging) LogManager.resetLogger should ignore LinkageError
- Next message: [9] RFR: 8168923: Use unsigned random long in a temp directory name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]