Request for reviews (S): 7009359: HS with -XX:+AggressiveOpts optimize new StringBuffer(null) so it does not throw NPE as expected

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Dec 28 12:48:14 PST 2010


http://cr.openjdk.java.net/~kvn/7009359/webrev

Fixed 7009359: HS with -XX:+AggressiveOpts optimize new StringBuffer(null) so it does not throw NPE as expected

StringConcat optimization replace new StringBuffer(null).toString()
with new String("null") because new StringBuffer.append(null) is
producing such string. Passing null to StringBuffer constructor
is a special case which was not checked.

Bailout StringConcat optimization if null is passed to
StringBuffer constructor. Added regression test.



More information about the hotspot-compiler-dev mailing list