8339260: Move rarely used constants out of ClassFile

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-09-26 06:34:18 +00:00
parent 47c10694c6
commit 8c8f0d85ce
37 changed files with 1545 additions and 1916 deletions

View file

@ -60,7 +60,7 @@ public sealed interface AnnotationValue {
/**
* Models an annotation value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ANNOTATION}.
* The {@linkplain #tag tag} of this value is {@value TAG_ANNOTATION}.
*
* @since 22
*/
@ -73,7 +73,7 @@ public sealed interface AnnotationValue {
/**
* Models an array value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ARRAY}.
* The {@linkplain #tag tag} of this value is {@value TAG_ARRAY}.
*
* @since 22
*/
@ -131,7 +131,7 @@ public sealed interface AnnotationValue {
/**
* Models a string value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_STRING}.
* The {@linkplain #tag tag} of this value is {@value TAG_STRING}.
*
* @since 22
*/
@ -159,7 +159,7 @@ public sealed interface AnnotationValue {
/**
* Models a double value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_DOUBLE}.
* The {@linkplain #tag tag} of this value is {@value TAG_DOUBLE}.
*
* @since 22
*/
@ -187,7 +187,7 @@ public sealed interface AnnotationValue {
/**
* Models a float value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_FLOAT}.
* The {@linkplain #tag tag} of this value is {@value TAG_FLOAT}.
*
* @since 22
*/
@ -215,7 +215,7 @@ public sealed interface AnnotationValue {
/**
* Models a long value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_LONG}.
* The {@linkplain #tag tag} of this value is {@value TAG_LONG}.
*
* @since 22
*/
@ -243,7 +243,7 @@ public sealed interface AnnotationValue {
/**
* Models an int value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_INT}.
* The {@linkplain #tag tag} of this value is {@value TAG_INT}.
*
* @since 22
*/
@ -271,7 +271,7 @@ public sealed interface AnnotationValue {
/**
* Models a short value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_SHORT}.
* The {@linkplain #tag tag} of this value is {@value TAG_SHORT}.
*
* @since 22
*/
@ -302,7 +302,7 @@ public sealed interface AnnotationValue {
/**
* Models a char value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CHAR}.
* The {@linkplain #tag tag} of this value is {@value TAG_CHAR}.
*
* @since 22
*/
@ -333,7 +333,7 @@ public sealed interface AnnotationValue {
/**
* Models a byte value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BYTE}.
* The {@linkplain #tag tag} of this value is {@value TAG_BYTE}.
*
* @since 22
*/
@ -364,7 +364,7 @@ public sealed interface AnnotationValue {
/**
* Models a boolean value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BOOLEAN}.
* The {@linkplain #tag tag} of this value is {@value TAG_BOOLEAN}.
*
* @since 22
*/
@ -395,7 +395,7 @@ public sealed interface AnnotationValue {
/**
* Models a class value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CLASS}.
* The {@linkplain #tag tag} of this value is {@value TAG_CLASS}.
*
* @since 22
*/
@ -413,7 +413,7 @@ public sealed interface AnnotationValue {
/**
* Models an enum value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ENUM}.
* The {@linkplain #tag tag} of this value is {@value TAG_ENUM}.
*
* @since 22
*/
@ -432,9 +432,52 @@ public sealed interface AnnotationValue {
Utf8Entry constantName();
}
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfByte}. */
int TAG_BYTE = 'B';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfChar}. */
int TAG_CHAR = 'C';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfDouble}. */
int TAG_DOUBLE = 'D';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfFloat}. */
int TAG_FLOAT = 'F';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfInt}. */
int TAG_INT = 'I';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfLong}. */
int TAG_LONG = 'J';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfShort}. */
int TAG_SHORT = 'S';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfBoolean}. */
int TAG_BOOLEAN = 'Z';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfString}. */
int TAG_STRING = 's';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfEnum}. */
int TAG_ENUM = 'e';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfClass}. */
int TAG_CLASS = 'c';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfAnnotation}. */
int TAG_ANNOTATION = '@';
/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfArray}. */
int TAG_ARRAY = '[';
/**
* {@return the tag character for this value as per JVMS {@jvms 4.7.16.1}}
* The tag characters have a one-to-one mapping to the types of annotation element values.
*
* @apiNote
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_INT},
* describe the possible return values of this method.
*/
char tag();