Skip to content

Commit

Permalink
8339260: Move rarely used constants out of ClassFile
Browse files Browse the repository at this point in the history
Reviewed-by: asotona
  • Loading branch information
liach committed Sep 26, 2024
1 parent 47c1069 commit 8c8f0d8
Show file tree
Hide file tree
Showing 37 changed files with 1,545 additions and 1,916 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -73,7 +73,7 @@ sealed interface OfAnnotation extends 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
*/
Expand Down Expand Up @@ -131,7 +131,7 @@ sealed interface OfConstant extends 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
*/
Expand Down Expand Up @@ -159,7 +159,7 @@ default String resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -187,7 +187,7 @@ default Double resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ default Float resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -243,7 +243,7 @@ default Long resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -271,7 +271,7 @@ default Integer resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -302,7 +302,7 @@ default Short resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -333,7 +333,7 @@ default Character resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -364,7 +364,7 @@ default Byte resolvedValue() {

/**
* 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
*/
Expand Down Expand Up @@ -395,7 +395,7 @@ default Boolean resolvedValue() {

/**
* 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
*/
Expand All @@ -413,7 +413,7 @@ default ClassDesc classSymbol() {

/**
* 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
*/
Expand All @@ -432,9 +432,52 @@ default ClassDesc classSymbol() {
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();

Expand Down
Loading

0 comments on commit 8c8f0d8

Please sign in to comment.