RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]
Coleen Phillimore
coleenp at openjdk.org
Sat Feb 22 14:49:38 UTC 2025
On Fri, 21 Feb 2025 21:08:33 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Indeed, even though this checks for the specific bit so widening has no effect, it is better to be cautious here.
>
>> I don't use the field directly because the field is a short and getModifiers makes it into Modifier.
>
> But getModifiers() returns `int`, not `Modifier` (which is all static).
I mis-remembered why I called getModifiers(), maybe because all the other calls to getModifiers() in Class.java which used be needed, but I did want to call Modifier.isInterface(). If using the 'modifiers' field directly is better, I'll change it to that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23572#discussion_r1966527692
More information about the core-libs-dev
mailing list