RFR: Here are some easy patches

Paul Sandoz paul.sandoz at oracle.com
Mon Apr 30 17:35:02 UTC 2018



> On Apr 30, 2018, at 9:05 AM, Martin Buchholz <martinrb at google.com> wrote:
> 
> Off by one pixel!
> 
> 8202397: Typo in X-Buffer javadoc
> http://cr.openjdk.java.net/~martin/webrevs/jdk/X-Buffer-typo/ <http://cr.openjdk.java.net/~martin/webrevs/jdk/X-Buffer-typo/>
> https://bugs.openjdk.java.net/browse/JDK-8202397 <https://bugs.openjdk.java.net/browse/JDK-8202397>
> 

+1


> Fixes a long-term micro-embarrassment:
> 
> 8201634: Random seedUniquifier uses incorrect LCG
> http://cr.openjdk.java.net/~martin/webrevs/jdk/Random-Ecuyer/ <http://cr.openjdk.java.net/~martin/webrevs/jdk/Random-Ecuyer/>
> https://bugs.openjdk.java.net/browse/JDK-8201634 <https://bugs.openjdk.java.net/browse/JDK-8201634>
> 

Finally! that should put to rest any numerology on the matter :-)


> An obvious optimization:
> 
> 8202398: Optimize Arrays.deepHashCode
> http://cr.openjdk.java.net/~martin/webrevs/jdk/deepHashCode-optimize/ <http://cr.openjdk.java.net/~martin/webrevs/jdk/deepHashCode-optimize/>
> https://bugs.openjdk.java.net/browse/JDK-8202398 <https://bugs.openjdk.java.net/browse/JDK-8202398>
> 


I would prefer that the deeply nested ternary expressions be changed to a more expected if/else if/else, and the last else throws an InternalError(“Should not reach here”) with some such message if you really want to express the case of an undetected array type.

—

For performance i suppose we could, when value types arrive, special case arrays of values, where the component value type has no references (direct or indirect) if that is even possible to efficiently detect i.e. a value type that is like a primitive. (Note, at the moment in the Valhalla L-world proposal arrays of values are subtypes of Object[]). 

Paul.



More information about the core-libs-dev mailing list