8339329: ConstantPoolBuilder#constantValueEntry method doc typo and clarifications

Reviewed-by: liach
This commit is contained in:
David M. Lloyd 2024-10-06 16:26:45 +00:00 committed by Chen Liang
parent 50426b3841
commit 20f36c666c
2 changed files with 8 additions and 4 deletions
src/java.base/share/classes/java/lang/classfile/constantpool

@ -470,10 +470,11 @@ public sealed interface ConstantPoolBuilder
}
/**
* {@return A {@link ConstantValueEntry} descripbing the provided
* {@return A {@link ConstantValueEntry} describing the provided
* Integer, Long, Float, Double, or String constant}
*
* @param c the constant
* @see ConstantValueEntry#constantValue()
*/
default ConstantValueEntry constantValueEntry(ConstantDesc c) {
if (c instanceof Integer i) return intEntry(i);

@ -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
@ -24,13 +24,14 @@
*/
package java.lang.classfile.constantpool;
import java.lang.classfile.Attributes;
import java.lang.constant.ConstantDesc;
import jdk.internal.javac.PreviewFeature;
/**
* Models a constant pool entry that can be used as the constant in a
* {@code ConstantValue} attribute; this includes the four primitive constant
* types and {@linkplain String} constants.
* {@link Attributes#constantValue() ConstantValue} attribute; this includes the four
* primitive constant types and {@linkplain String} constants.
*
* @sealedGraph
* @since 22
@ -42,6 +43,8 @@ public sealed interface ConstantValueEntry extends LoadableConstantEntry
/**
* {@return the constant value} The constant value will be an {@link Integer},
* {@link Long}, {@link Float}, {@link Double}, or {@link String}.
*
* @see ConstantPoolBuilder#constantValueEntry(ConstantDesc)
*/
@Override
ConstantDesc constantValue();