On Fri, 29 Nov 2024 17:53:43 GMT, Luca Kellermann <d...@openjdk.org> wrote:
>>> Your example is an exact antipattern from our data-oriented model: we would >>> want users to check the object type with `instanceof` (should be `is` in >>> kotlin) instead of checking these constants. >> >> I'm aware, this was just the first example I could come up with. >> >>> Yet I think we can consider promoting Constant Pool tag from byte or char, >>> short, or int to represent a u1 in case it goes over 127. >> >> Maybe just using `int` everywhere for consistency might be a good option too. > >> Yet I think we can consider promoting Constant Pool tag from byte or char, >> short, or int to represent a u1 in case it goes over 127. > > Is there any chance a change like this could make it into JDK 24? I'd imagine > it would be too late after that because it's a binary incompatible change. Don't think so. This imo is fixable in the future if we do have many new cp/annotation tags (see example of Thread::threadId), though I don't think that is likely ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20773#discussion_r1863861563