RFR: 8186500: StringConcatFactory.makeConcatWithConstants throws AssertionError when recipe contains non-String constants
Aleksey Shipilev
shade at redhat.com
Mon Aug 21 18:17:54 UTC 2017
On 08/21/2017 08:06 PM, Paul Sandoz wrote:
>> On 21 Aug 2017, at 07:48, Claes Redestad <claes.redestad at oracle.com> wrote:
>> a trivial test[1] invoking the StringConcatFactory.makeConcatWithConstants fails
>> when providing an Integer as a constant, which appears to be due to failure to
>> coerce boxed types to the corresponding primitive types when looking up various
>> methods in StringConcatHelper:
>>
>> Webrev: http://cr.openjdk.java.net/~redestad/8186500/jdk.00/
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8186500
>>
>> Simply using Wrapper.asPrimitiveType coerces boxed types to their primitive
>> counterpart, and is a (semantical) no-op for other types, e.g., String.
>
> Looks good. Perhaps a token test would be useful (maybe hard to test all code paths here without some combinator test).
Please add tests. We have to at least assert that passing "null" works fine there -- I am not sure
it does right now. Since we are talking non-String constants, passing java/lang/Object is a good
test too.
-Aleksey
More information about the core-libs-dev
mailing list