8331744: java.lang.classfile.TypeKind improvements

Reviewed-by: asotona, redestad
This commit is contained in:
Chen Liang 2024-05-10 10:50:51 +00:00 committed by Claes Redestad
parent dea8076a58
commit 784b8fce7a
5 changed files with 183 additions and 16 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,7 +56,7 @@ public sealed interface NewPrimitiveArrayInstruction extends Instruction
*/
static NewPrimitiveArrayInstruction of(TypeKind typeKind) {
// Implicit null-check:
if (typeKind.newarraycode() < 0) {
if (typeKind.newarrayCode() < 0) {
throw new IllegalArgumentException("Illegal component type: " + typeKind.typeName());
}
return new AbstractInstruction.UnboundNewPrimitiveArrayInstruction(typeKind);