8342468: Improve API documentation for java.lang.classfile.constantpool

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2025-01-08 03:37:28 +00:00
parent 40f0a398fa
commit bcefab5e55
31 changed files with 1070 additions and 371 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2025, 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
@ -29,10 +29,15 @@ import java.lang.classfile.TypeKind;
import jdk.internal.classfile.impl.AbstractPoolEntry;
/**
* Models a {@code CONSTANT_Integer_info} constant in the constant pool of a
* classfile.
* @jvms 4.4.4 The CONSTANT_Integer_info and CONSTANT_Float_info Structures
* Models a {@code CONSTANT_Integer_info} structure, or an {@code int} constant,
* in the constant pool of a {@code class} file.
* <p>
* The use of a {@code IntegerEntry} is modeled by an {@code int}. Conversions
* are through {@link ConstantPoolBuilder#intEntry(int)} and {@link #intValue()}.
*
* @see ConstantPoolBuilder#intEntry ConstantPoolBuilder::intEntry
* @jvms 4.4.4 The {@code CONSTANT_Integer_info} and {@code CONSTANT_Float_info}
* Structures
* @since 24
*/
public sealed interface IntegerEntry
@ -40,13 +45,12 @@ public sealed interface IntegerEntry
permits AbstractPoolEntry.IntegerEntryImpl {
/**
* {@return the integer value}
* {@return the {@code int} value}
*
* @see ConstantPoolBuilder#intEntry(int)
*/
int intValue();
/**
* {@return the type of the constant}
*/
@Override
default TypeKind typeKind() {
return TypeKind.INT;