Sponsor Request: 8241100: Make Boolean, Character, Byte, and Short implement Constable

David Holmes david.holmes at oracle.com
Wed Mar 18 21:59:53 UTC 2020


Hi Jorn,

This needs a CSR request before it can be pushed.

Thanks,
David

On 19/03/2020 12:08 am, Jorn Vernee wrote:
> Hi,
> 
> Can someone please sponsor this patch that makes Boolean, Character, 
> Byte, and Short implement Constable?
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8241100
> Webrev: http://cr.openjdk.java.net/~jvernee/8241100/webrev.00/
> 
> Having the other box types implement Constable makes them easier to use 
> with APIs that accept any Constable. Though I'm mostly interesting in 
> boolean, for which I'm currently falling back to "true" & "false" 
> strings, but the downside is that this also requires parsing the string 
> again and having to deal with random other strings.
> 
> This patch also adds the ConstantBootstraps::convert method that is used 
> to facilitate the conversion from int to (short|char|byte). This 
> currently takes a source type explicitly. In practice, it seems that 
> Object can always be used as a source type for the same behavior, but 
> explicitly specifying source and destination types seems more robust to 
> me in case this behavior ever changes, or we want to expand on the 
> supported kinds of conversion. (for instance it is currently not 
> possible to convert from an int to a Long directly, or from Short to 
> Integer, but maybe those cases could be supported in the future as well).
> 
> Testing: tier1-3 & downstream testing for my particular use case
> 
> Thanks,
> Jorn
> 


More information about the core-libs-dev mailing list