Skip to content

Commit

Permalink
Update JDK
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Dec 4, 2024
1 parent 263b20d commit 8eac262
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion jdk
Submodule jdk updated 474 files
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,11 @@ default ClassDesc classSymbol() {
*
* @apiNote
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_INT},
* describe the possible return values of this method.
* describe the possible return values of this method. The return type is
* {@code int} for consistency with union indicator items in other union
* structures in the {@code class} file format.
*/
char tag();
int tag();

/**
* {@return an enum value for an element-value pair}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public sealed interface PoolEntry
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_UTF8},
* describe the possible return values of this method.
*/
byte tag();
int tag();

/**
* {@return the index within the constant pool corresponding to this entry}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public int hashCode() {
return hash;
}

public abstract byte tag();
public abstract int tag();

public int width() {
return 1;
Expand Down Expand Up @@ -181,7 +181,7 @@ enum State { RAW, BYTE, CHAR, STRING }
}

@Override
public byte tag() {
public int tag() {
return TAG_UTF8;
}

Expand Down Expand Up @@ -522,7 +522,7 @@ public static final class ClassEntryImpl extends AbstractNamedEntry implements C
}

@Override
public byte tag() {
public int tag() {
return TAG_CLASS;
}

Expand Down Expand Up @@ -582,7 +582,7 @@ public static final class PackageEntryImpl extends AbstractNamedEntry implements
}

@Override
public byte tag() {
public int tag() {
return TAG_PACKAGE;
}

Expand Down Expand Up @@ -613,7 +613,7 @@ public static final class ModuleEntryImpl extends AbstractNamedEntry implements
}

@Override
public byte tag() {
public int tag() {
return TAG_MODULE;
}

Expand Down Expand Up @@ -645,7 +645,7 @@ public static final class NameAndTypeEntryImpl extends AbstractRefsEntry<Utf8Ent
}

@Override
public byte tag() {
public int tag() {
return TAG_NAME_AND_TYPE;
}

Expand Down Expand Up @@ -719,7 +719,7 @@ public static final class FieldRefEntryImpl extends AbstractMemberRefEntry imple
}

@Override
public byte tag() {
public int tag() {
return TAG_FIELDREF;
}

Expand All @@ -737,7 +737,7 @@ public static final class MethodRefEntryImpl extends AbstractMemberRefEntry impl
}

@Override
public byte tag() {
public int tag() {
return TAG_METHODREF;
}

Expand All @@ -755,7 +755,7 @@ public static final class InterfaceMethodRefEntryImpl extends AbstractMemberRefE
}

@Override
public byte tag() {
public int tag() {
return TAG_INTERFACE_METHODREF;
}

Expand Down Expand Up @@ -849,7 +849,7 @@ public static final class InvokeDynamicEntryImpl
}

@Override
public byte tag() {
public int tag() {
return TAG_INVOKE_DYNAMIC;
}

Expand All @@ -874,7 +874,7 @@ public static final class ConstantDynamicEntryImpl extends AbstractDynamicConsta
}

@Override
public byte tag() {
public int tag() {
return TAG_DYNAMIC;
}

Expand Down Expand Up @@ -905,7 +905,7 @@ public static final class MethodHandleEntryImpl extends AbstractPoolEntry
}

@Override
public byte tag() {
public int tag() {
return TAG_METHOD_HANDLE;
}

Expand Down Expand Up @@ -964,7 +964,7 @@ public static final class MethodTypeEntryImpl
}

@Override
public byte tag() {
public int tag() {
return TAG_METHOD_TYPE;
}

Expand Down Expand Up @@ -1002,7 +1002,7 @@ public static final class StringEntryImpl
}

@Override
public byte tag() {
public int tag() {
return TAG_STRING;
}

Expand Down Expand Up @@ -1054,7 +1054,7 @@ public static final class IntegerEntryImpl extends AbstractPoolEntry implements
}

@Override
public byte tag() {
public int tag() {
return TAG_INTEGER;
}

Expand Down Expand Up @@ -1100,7 +1100,7 @@ public static final class FloatEntryImpl extends AbstractPoolEntry
}

@Override
public byte tag() {
public int tag() {
return TAG_FLOAT;
}

Expand Down Expand Up @@ -1145,7 +1145,7 @@ public static final class LongEntryImpl extends AbstractPoolEntry implements Lon
}

@Override
public byte tag() {
public int tag() {
return TAG_LONG;
}

Expand Down Expand Up @@ -1195,7 +1195,7 @@ public static final class DoubleEntryImpl extends AbstractPoolEntry implements D
}

@Override
public byte tag() {
public int tag() {
return TAG_DOUBLE;
}

Expand Down
26 changes: 13 additions & 13 deletions src/main/java/io/github/dmlloyd/classfile/impl/AnnotationImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String toString() {
public record OfStringImpl(Utf8Entry constant)
implements AnnotationValue.OfString {
@Override
public char tag() {
public int tag() {
return TAG_STRING;
}

Expand All @@ -85,7 +85,7 @@ public String stringValue() {
public record OfDoubleImpl(DoubleEntry constant)
implements AnnotationValue.OfDouble {
@Override
public char tag() {
public int tag() {
return TAG_DOUBLE;
}

Expand All @@ -98,7 +98,7 @@ public double doubleValue() {
public record OfFloatImpl(FloatEntry constant)
implements AnnotationValue.OfFloat {
@Override
public char tag() {
public int tag() {
return TAG_FLOAT;
}

Expand All @@ -111,7 +111,7 @@ public float floatValue() {
public record OfLongImpl(LongEntry constant)
implements AnnotationValue.OfLong {
@Override
public char tag() {
public int tag() {
return TAG_LONG;
}

Expand All @@ -124,7 +124,7 @@ public long longValue() {
public record OfIntImpl(IntegerEntry constant)
implements AnnotationValue.OfInt {
@Override
public char tag() {
public int tag() {
return TAG_INT;
}

Expand All @@ -137,7 +137,7 @@ public int intValue() {
public record OfShortImpl(IntegerEntry constant)
implements AnnotationValue.OfShort {
@Override
public char tag() {
public int tag() {
return TAG_SHORT;
}

Expand All @@ -150,7 +150,7 @@ public short shortValue() {
public record OfCharImpl(IntegerEntry constant)
implements AnnotationValue.OfChar {
@Override
public char tag() {
public int tag() {
return TAG_CHAR;
}

Expand All @@ -163,7 +163,7 @@ public char charValue() {
public record OfByteImpl(IntegerEntry constant)
implements AnnotationValue.OfByte {
@Override
public char tag() {
public int tag() {
return TAG_BYTE;
}

Expand All @@ -176,7 +176,7 @@ public byte byteValue() {
public record OfBooleanImpl(IntegerEntry constant)
implements AnnotationValue.OfBoolean {
@Override
public char tag() {
public int tag() {
return TAG_BOOLEAN;
}

Expand All @@ -193,31 +193,31 @@ public record OfArrayImpl(List<AnnotationValue> values)
}

@Override
public char tag() {
public int tag() {
return TAG_ARRAY;
}
}

public record OfEnumImpl(Utf8Entry className, Utf8Entry constantName)
implements AnnotationValue.OfEnum {
@Override
public char tag() {
public int tag() {
return TAG_ENUM;
}
}

public record OfAnnotationImpl(Annotation annotation)
implements AnnotationValue.OfAnnotation {
@Override
public char tag() {
public int tag() {
return TAG_ANNOTATION;
}
}

public record OfClassImpl(Utf8Entry className)
implements AnnotationValue.OfClass {
@Override
public char tag() {
public int tag() {
return TAG_CLASS;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public static void writeTypeAnnotations(BufWriter buf, List<TypeAnnotation> list
public static void writeAnnotationValue(BufWriterImpl buf, AnnotationValue value) {
var tag = value.tag();
buf.writeU1(tag);
switch (value.tag()) {
switch (tag) {
case TAG_BOOLEAN, TAG_BYTE, TAG_CHAR, TAG_DOUBLE, TAG_FLOAT, TAG_INT, TAG_LONG, TAG_SHORT, TAG_STRING ->
buf.writeIndex(((AnnotationValue.OfConstant) value).constant());
case TAG_CLASS -> buf.writeIndex(((AnnotationValue.OfClass) value).className());
Expand Down

0 comments on commit 8eac262

Please sign in to comment.