RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v6]
Adam Sotona
asotona at openjdk.org
Wed May 15 10:47:24 UTC 2024
On Wed, 15 May 2024 10:06:42 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java line 205:
>>
>>> 203: private void verifyAttribute(AttributedElement ae, Attribute<?> a, List<VerifyError> errors) {
>>> 204: int size = -1;
>>> 205: switch (a) {
>>
>> Maybe use a switch expression to set `size` where `default` yields -1?
>
> For better readability I've recently turned it from switch expression (yielding values pre-calculated in temporary locals) into explicit assignments to the `size` variable.
I've turned it back to switch expression and compacted it a bit more.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16809#discussion_r1601399982
More information about the compiler-dev
mailing list