8334714: Implement JEP 484: Class-File API

Reviewed-by: liach, vromero
This commit is contained in:
Adam Sotona 2024-11-15 14:38:17 +00:00
parent 6cdebf0e4c
commit 84ffb64cd7
165 changed files with 312 additions and 799 deletions

View File

@ -28,16 +28,14 @@ import java.lang.reflect.AccessFlag;
import java.util.Set;
import jdk.internal.classfile.impl.AccessFlagsImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Models the access flags for a class, method, or field. Delivered as a
* {@link ClassElement}, {@link FieldElement}, or {@link MethodElement}
* when traversing the corresponding model type.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface AccessFlags
extends ClassElement, MethodElement, FieldElement
permits AccessFlagsImpl {

View File

@ -35,7 +35,6 @@ import java.util.List;
import jdk.internal.classfile.impl.AnnotationImpl;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models an {@code annotation} structure (JVMS {@jvms 4.7.16}) or part of a {@code
@ -63,9 +62,8 @@ import jdk.internal.javac.PreviewFeature;
* @see RuntimeVisibleParameterAnnotationsAttribute
* @see RuntimeInvisibleParameterAnnotationsAttribute
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Annotation
permits AnnotationImpl {

View File

@ -29,7 +29,6 @@ import java.lang.constant.ClassDesc;
import jdk.internal.classfile.impl.AnnotationImpl;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.javac.PreviewFeature;
/**
* Models an element-value pair in the {@code element_value_pairs}
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
* @see Annotation
* @see AnnotationValue
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface AnnotationElement
permits AnnotationImpl.AnnotationElementImpl {

View File

@ -33,7 +33,6 @@ import java.util.List;
import jdk.internal.classfile.impl.AnnotationImpl;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -48,18 +47,16 @@ import static java.util.Objects.requireNonNull;
* @see AnnotationElement
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface AnnotationValue {
/**
* Models an annotation value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_ANNOTATION}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfAnnotation extends AnnotationValue
permits AnnotationImpl.OfAnnotationImpl {
/** {@return the annotation value} */
@ -70,9 +67,8 @@ public sealed interface AnnotationValue {
* Models an array value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_ARRAY}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfArray extends AnnotationValue
permits AnnotationImpl.OfArrayImpl {
/**
@ -91,9 +87,8 @@ public sealed interface AnnotationValue {
* Models a constant value of an element-value pair.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfConstant extends AnnotationValue {
/**
* {@return the constant pool entry backing this constant element}
@ -128,9 +123,8 @@ public sealed interface AnnotationValue {
* Models a string value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_STRING}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfString extends OfConstant
permits AnnotationImpl.OfStringImpl {
/** {@return the backing UTF8 entry} */
@ -156,9 +150,8 @@ public sealed interface AnnotationValue {
* Models a double value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_DOUBLE}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfDouble extends OfConstant
permits AnnotationImpl.OfDoubleImpl {
/** {@return the backing double entry} */
@ -184,9 +177,8 @@ public sealed interface AnnotationValue {
* Models a float value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_FLOAT}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfFloat extends OfConstant
permits AnnotationImpl.OfFloatImpl {
/** {@return the backing float entry} */
@ -212,9 +204,8 @@ public sealed interface AnnotationValue {
* Models a long value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_LONG}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfLong extends OfConstant
permits AnnotationImpl.OfLongImpl {
/** {@return the backing long entry} */
@ -240,9 +231,8 @@ public sealed interface AnnotationValue {
* Models an int value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_INT}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfInt extends OfConstant
permits AnnotationImpl.OfIntImpl {
/** {@return the backing integer entry} */
@ -268,9 +258,8 @@ public sealed interface AnnotationValue {
* Models a short value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_SHORT}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfShort extends OfConstant
permits AnnotationImpl.OfShortImpl {
/** {@return the backing integer entry} */
@ -299,9 +288,8 @@ public sealed interface AnnotationValue {
* Models a char value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_CHAR}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfChar extends OfConstant
permits AnnotationImpl.OfCharImpl {
/** {@return the backing integer entry} */
@ -330,9 +318,8 @@ public sealed interface AnnotationValue {
* Models a byte value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_BYTE}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfByte extends OfConstant
permits AnnotationImpl.OfByteImpl {
/** {@return the backing integer entry} */
@ -361,9 +348,8 @@ public sealed interface AnnotationValue {
* Models a boolean value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_BOOLEAN}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfBoolean extends OfConstant
permits AnnotationImpl.OfBooleanImpl {
/** {@return the backing integer entry} */
@ -392,9 +378,8 @@ public sealed interface AnnotationValue {
* Models a class value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_CLASS}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfClass extends AnnotationValue
permits AnnotationImpl.OfClassImpl {
/** {@return the class descriptor string} */
@ -410,9 +395,8 @@ public sealed interface AnnotationValue {
* Models an enum value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value TAG_ENUM}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OfEnum extends AnnotationValue
permits AnnotationImpl.OfEnumImpl {
/** {@return the enum class descriptor string} */

View File

@ -29,7 +29,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models a classfile attribute (JVMS {@jvms 4.7}). Many, though not all, subtypes of
@ -42,9 +41,8 @@ import jdk.internal.javac.PreviewFeature;
* @param <A> the attribute type
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Attribute<A extends Attribute<A>>
extends ClassFileElement
permits AnnotationDefaultAttribute, BootstrapMethodsAttribute,

View File

@ -24,8 +24,6 @@
*/
package java.lang.classfile;
import jdk.internal.javac.PreviewFeature;
/**
* Bidirectional mapper between the classfile representation of an attribute and
* how that attribute is modeled in the API. The attribute mapper is used
@ -37,17 +35,15 @@ import jdk.internal.javac.PreviewFeature;
* CustomAttribute}.
* @param <A> the attribute type
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public interface AttributeMapper<A extends Attribute<A>> {
/**
* Attribute stability indicator
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum AttributeStability {
/**

View File

@ -31,7 +31,6 @@ import java.util.List;
import java.util.Optional;
import jdk.internal.classfile.impl.AbstractUnboundModel;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -40,9 +39,8 @@ import static java.util.Objects.requireNonNull;
* as a class, field, method, code attribute, or record component.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface AttributedElement extends ClassFileElement
permits ClassModel, CodeModel, FieldModel, MethodModel,
RecordComponentInfo, AbstractUnboundModel {

View File

@ -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
@ -28,7 +28,6 @@ import java.lang.classfile.AttributeMapper.AttributeStability;
import java.lang.classfile.attribute.*;
import jdk.internal.classfile.impl.AbstractAttributeMapper.*;
import jdk.internal.javac.PreviewFeature;
/**
* Attribute mappers for standard classfile attributes.
@ -89,9 +88,8 @@ import jdk.internal.javac.PreviewFeature;
*
* @see AttributeMapper
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public final class Attributes {
/** AnnotationDefault */
@ -207,7 +205,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code AnnotationDefault} attribute}
* @since 23
*/
public static AttributeMapper<AnnotationDefaultAttribute> annotationDefault() {
return AnnotationDefaultMapper.INSTANCE;
@ -215,7 +212,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code BootstrapMethods} attribute}
* @since 23
*/
public static AttributeMapper<BootstrapMethodsAttribute> bootstrapMethods() {
return BootstrapMethodsMapper.INSTANCE;
@ -224,7 +220,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code CharacterRangeTable} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<CharacterRangeTableAttribute> characterRangeTable() {
return CharacterRangeTableMapper.INSTANCE;
@ -232,7 +227,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Code} attribute}
* @since 23
*/
public static AttributeMapper<CodeAttribute> code() {
return CodeMapper.INSTANCE;
@ -240,7 +234,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code CompilationID} attribute}
* @since 23
*/
public static AttributeMapper<CompilationIDAttribute> compilationId() {
return CompilationIDMapper.INSTANCE;
@ -248,7 +241,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ConstantValue} attribute}
* @since 23
*/
public static AttributeMapper<ConstantValueAttribute> constantValue() {
return ConstantValueMapper.INSTANCE;
@ -257,7 +249,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Deprecated} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<DeprecatedAttribute> deprecated() {
return DeprecatedMapper.INSTANCE;
@ -265,7 +256,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code EnclosingMethod} attribute}
* @since 23
*/
public static AttributeMapper<EnclosingMethodAttribute> enclosingMethod() {
return EnclosingMethodMapper.INSTANCE;
@ -273,7 +263,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Exceptions} attribute}
* @since 23
*/
public static AttributeMapper<ExceptionsAttribute> exceptions() {
return ExceptionsMapper.INSTANCE;
@ -281,7 +270,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code InnerClasses} attribute}
* @since 23
*/
public static AttributeMapper<InnerClassesAttribute> innerClasses() {
return InnerClassesMapper.INSTANCE;
@ -290,7 +278,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code LineNumberTable} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<LineNumberTableAttribute> lineNumberTable() {
return LineNumberTableMapper.INSTANCE;
@ -299,7 +286,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code LocalVariableTable} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<LocalVariableTableAttribute> localVariableTable() {
return LocalVariableTableMapper.INSTANCE;
@ -308,7 +294,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code LocalVariableTypeTable} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<LocalVariableTypeTableAttribute> localVariableTypeTable() {
return LocalVariableTypeTableMapper.INSTANCE;
@ -316,7 +301,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code MethodParameters} attribute}
* @since 23
*/
public static AttributeMapper<MethodParametersAttribute> methodParameters() {
return MethodParametersMapper.INSTANCE;
@ -324,7 +308,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Module} attribute}
* @since 23
*/
public static AttributeMapper<ModuleAttribute> module() {
return ModuleMapper.INSTANCE;
@ -332,7 +315,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ModuleHashes} attribute}
* @since 23
*/
public static AttributeMapper<ModuleHashesAttribute> moduleHashes() {
return ModuleHashesMapper.INSTANCE;
@ -340,7 +322,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ModuleMainClass} attribute}
* @since 23
*/
public static AttributeMapper<ModuleMainClassAttribute> moduleMainClass() {
return ModuleMainClassMapper.INSTANCE;
@ -348,7 +329,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ModulePackages} attribute}
* @since 23
*/
public static AttributeMapper<ModulePackagesAttribute> modulePackages() {
return ModulePackagesMapper.INSTANCE;
@ -356,7 +336,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ModuleResolution} attribute}
* @since 23
*/
public static AttributeMapper<ModuleResolutionAttribute> moduleResolution() {
return ModuleResolutionMapper.INSTANCE;
@ -364,7 +343,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code ModuleTarget} attribute}
* @since 23
*/
public static AttributeMapper<ModuleTargetAttribute> moduleTarget() {
return ModuleTargetMapper.INSTANCE;
@ -372,7 +350,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code NestHost} attribute}
* @since 23
*/
public static AttributeMapper<NestHostAttribute> nestHost() {
return NestHostMapper.INSTANCE;
@ -380,7 +357,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code NestMembers} attribute}
* @since 23
*/
public static AttributeMapper<NestMembersAttribute> nestMembers() {
return NestMembersMapper.INSTANCE;
@ -388,7 +364,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code PermittedSubclasses} attribute}
* @since 23
*/
public static AttributeMapper<PermittedSubclassesAttribute> permittedSubclasses() {
return PermittedSubclassesMapper.INSTANCE;
@ -396,7 +371,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Record} attribute}
* @since 23
*/
public static AttributeMapper<RecordAttribute> record() {
return RecordMapper.INSTANCE;
@ -404,7 +378,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeInvisibleAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeInvisibleAnnotationsAttribute> runtimeInvisibleAnnotations() {
return RuntimeInvisibleAnnotationsMapper.INSTANCE;
@ -412,7 +385,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeInvisibleParameterAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeInvisibleParameterAnnotationsAttribute> runtimeInvisibleParameterAnnotations() {
return RuntimeInvisibleParameterAnnotationsMapper.INSTANCE;
@ -420,7 +392,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeInvisibleTypeAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeInvisibleTypeAnnotationsAttribute> runtimeInvisibleTypeAnnotations() {
return RuntimeInvisibleTypeAnnotationsMapper.INSTANCE;
@ -428,7 +399,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeVisibleAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeVisibleAnnotationsAttribute> runtimeVisibleAnnotations() {
return RuntimeVisibleAnnotationsMapper.INSTANCE;
@ -436,7 +406,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeVisibleParameterAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeVisibleParameterAnnotationsAttribute> runtimeVisibleParameterAnnotations() {
return RuntimeVisibleParameterAnnotationsMapper.INSTANCE;
@ -444,7 +413,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code RuntimeVisibleTypeAnnotations} attribute}
* @since 23
*/
public static AttributeMapper<RuntimeVisibleTypeAnnotationsAttribute> runtimeVisibleTypeAnnotations() {
return RuntimeVisibleTypeAnnotationsMapper.INSTANCE;
@ -452,7 +420,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Signature} attribute}
* @since 23
*/
public static AttributeMapper<SignatureAttribute> signature() {
return SignatureMapper.INSTANCE;
@ -460,7 +427,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code SourceDebugExtension} attribute}
* @since 23
*/
public static AttributeMapper<SourceDebugExtensionAttribute> sourceDebugExtension() {
return SourceDebugExtensionMapper.INSTANCE;
@ -468,7 +434,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code SourceFile} attribute}
* @since 23
*/
public static AttributeMapper<SourceFileAttribute> sourceFile() {
return SourceFileMapper.INSTANCE;
@ -476,7 +441,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code SourceID} attribute}
* @since 23
*/
public static AttributeMapper<SourceIDAttribute> sourceId() {
return SourceIDMapper.INSTANCE;
@ -484,7 +448,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code StackMapTable} attribute}
* @since 23
*/
public static AttributeMapper<StackMapTableAttribute> stackMapTable() {
return StackMapTableMapper.INSTANCE;
@ -493,7 +456,6 @@ public final class Attributes {
/**
* {@return Attribute mapper for the {@code Synthetic} attribute}
* The mapper permits multiple instances in a given location.
* @since 23
*/
public static AttributeMapper<SyntheticAttribute> synthetic() {
return SyntheticMapper.INSTANCE;

View File

@ -31,7 +31,6 @@ import java.lang.classfile.constantpool.MethodHandleEntry;
import java.util.List;
import jdk.internal.classfile.impl.BootstrapMethodEntryImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Models an entry in the bootstrap method table. The bootstrap method table
@ -39,9 +38,8 @@ import jdk.internal.javac.PreviewFeature;
* the {@link ConstantPool}, since the bootstrap method table is logically
* part of the constant pool.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface BootstrapMethodEntry
permits BootstrapMethodEntryImpl {

View File

@ -29,16 +29,14 @@ import java.lang.classfile.constantpool.ConstantPoolBuilder;
import java.lang.classfile.constantpool.PoolEntry;
import jdk.internal.classfile.impl.BufWriterImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Supports writing portions of a classfile to a growable buffer. Methods
* are provided to write various standard entities (e.g., {@code u2}, {@code u4})
* to the end of the buffer, as well as to create constant pool entries.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface BufWriter
permits BufWriterImpl {

View File

@ -39,7 +39,6 @@ import jdk.internal.classfile.impl.AccessFlagsImpl;
import jdk.internal.classfile.impl.ChainedClassBuilder;
import jdk.internal.classfile.impl.DirectClassBuilder;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* A builder for classfiles. Builders are not created directly; they are passed
@ -50,9 +49,8 @@ import jdk.internal.javac.PreviewFeature;
*
* @see ClassTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassBuilder
extends ClassFileBuilder<ClassElement, ClassBuilder>
permits ChainedClassBuilder, DirectClassBuilder {

View File

@ -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
@ -26,16 +26,13 @@ package java.lang.classfile;
import java.lang.classfile.attribute.*;
import jdk.internal.javac.PreviewFeature;
/**
* A marker interface for elements that can appear when traversing
* a {@link ClassModel} or be presented to a {@link ClassBuilder}.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassElement extends ClassFileElement
permits AccessFlags, Superclass, Interfaces, ClassFileVersion,
FieldModel, MethodModel,

View File

@ -43,7 +43,6 @@ import java.util.function.Function;
import jdk.internal.classfile.impl.ClassFileImpl;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
import static jdk.internal.constant.ConstantUtils.CD_module_info;
@ -53,9 +52,8 @@ import static jdk.internal.constant.ConstantUtils.CD_module_info;
* A {@code ClassFile} has a set of options that condition how parsing and
* generation is done.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassFile
permits ClassFileImpl {
@ -84,9 +82,8 @@ public sealed interface ClassFile
* An option that affects the parsing and writing of classfiles.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface Option {
}
@ -94,9 +91,8 @@ public sealed interface ClassFile
* Option describing attribute mappers for custom attributes.
* Default is only to process standard attributes.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface AttributeMapperOption extends Option
permits ClassFileImpl.AttributeMapperOptionImpl {
@ -119,9 +115,8 @@ public sealed interface ClassFile
* Option describing the class hierarchy resolver to use when generating
* stack maps.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface ClassHierarchyResolverOption extends Option
permits ClassFileImpl.ClassHierarchyResolverOptionImpl {
@ -150,9 +145,8 @@ public sealed interface ClassFile
* Default is {@code SHARED_POOL} to preserve the original constant
* pool.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum ConstantPoolSharingOption implements Option {
/** Preserves the original constant pool when transforming classfile */
@ -167,9 +161,8 @@ public sealed interface ClassFile
* Default is {@code PATCH_DEAD_CODE} to automatically patch out unreachable
* code with NOPs.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum DeadCodeOption implements Option {
/** Patch unreachable code */
@ -188,9 +181,8 @@ public sealed interface ClassFile
* Setting this option to {@code DROP_DEAD_LABELS} filters the above
* elements instead.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum DeadLabelsOption implements Option {
/** Fail on unresolved labels */
@ -207,9 +199,8 @@ public sealed interface ClassFile
* reduce the overhead of parsing or transforming classfiles.
* Default is {@code PASS_DEBUG} to process debug elements.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum DebugElementsOption implements Option {
/** Process debug elements */
@ -225,9 +216,8 @@ public sealed interface ClassFile
* classfiles.
* Default is {@code PASS_LINE_NUMBERS} to process line numbers.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum LineNumbersOption implements Option {
/** Process line numbers */
@ -243,9 +233,8 @@ public sealed interface ClassFile
* Default is {@code FIX_SHORT_JUMPS} to automatically rewrite jump
* instructions.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum ShortJumpsOption implements Option {
/** Automatically convert short jumps to long when necessary */
@ -262,9 +251,8 @@ public sealed interface ClassFile
* {@link #JAVA_6_VERSION} the stack maps may not be generated.
* @jvms 4.10.1 Verification by Type Checking
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum StackMapsOption implements Option {
/** Generate stack maps when required */
@ -284,9 +272,8 @@ public sealed interface ClassFile
* Default is {@code PASS_ALL_ATTRIBUTES} to process all original attributes.
* @see AttributeMapper.AttributeStability
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
enum AttributesProcessingOption implements Option {
/** Process all original attributes during transformation */
@ -648,16 +635,10 @@ public sealed interface ClassFile
/** The class major version of JAVA_22. */
int JAVA_22_VERSION = 66;
/**
* The class major version of JAVA_23.
* @since 23
*/
/** The class major version of JAVA_23. */
int JAVA_23_VERSION = 67;
/**
* The class major version of JAVA_24.
* @since 24
*/
/** The class major version of JAVA_24. */
int JAVA_24_VERSION = 68;
/**

View File

@ -29,7 +29,6 @@ import java.lang.constant.ClassDesc;
import java.util.function.Consumer;
import jdk.internal.classfile.impl.TransformImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A builder for a classfile or portion of a classfile. Builders are rarely
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* @see ClassFileTransform
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassFileBuilder<E extends ClassFileElement, B extends ClassFileBuilder<E, B>>
extends Consumer<E> permits ClassBuilder, FieldBuilder, MethodBuilder, CodeBuilder {

View File

@ -24,8 +24,6 @@
*/
package java.lang.classfile;
import jdk.internal.javac.PreviewFeature;
/**
* Immutable model for a portion of (or the entirety of) a classfile. Elements
* that model parts of the classfile that have attributes will implement {@link
@ -35,9 +33,8 @@ import jdk.internal.javac.PreviewFeature;
* will implement {@link ClassElement}, {@link MethodElement}, etc.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassFileElement
permits AttributedElement, CompoundElement, Attribute,
ClassElement, CodeElement, FieldElement, MethodElement {

View File

@ -27,8 +27,6 @@ package java.lang.classfile;
import java.lang.classfile.attribute.RuntimeVisibleAnnotationsAttribute;
import java.util.function.Supplier;
import jdk.internal.javac.PreviewFeature;
/**
* A transformation on streams of elements. Transforms are used during
* transformation of classfile entities; a transform is provided to a method like
@ -73,9 +71,8 @@ import jdk.internal.javac.PreviewFeature;
* @param <B> the builder type
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassFileTransform<
C extends ClassFileTransform<C, E, B>,
E extends ClassFileElement,

View File

@ -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
@ -25,16 +25,14 @@
package java.lang.classfile;
import jdk.internal.classfile.impl.ClassFileVersionImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Models the classfile version information for a class. Delivered as a {@link
* java.lang.classfile.ClassElement} when traversing the elements of a {@link
* ClassModel}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassFileVersion
extends ClassElement
permits ClassFileVersionImpl {

View File

@ -37,7 +37,6 @@ import jdk.internal.classfile.impl.ClassHierarchyImpl;
import jdk.internal.classfile.impl.ClassHierarchyImpl.ClassLoadingClassHierarchyResolver;
import jdk.internal.classfile.impl.ClassHierarchyImpl.StaticClassHierarchyResolver;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
import static java.lang.constant.ConstantDescs.CD_Object;
import static java.util.Objects.requireNonNull;
@ -46,9 +45,8 @@ import static java.util.Objects.requireNonNull;
* Provides class hierarchy information for generating correct stack maps
* during code building.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
@FunctionalInterface
public interface ClassHierarchyResolver {
@ -71,9 +69,8 @@ public interface ClassHierarchyResolver {
/**
* Information about a resolved class.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface ClassHierarchyInfo permits ClassHierarchyImpl.ClassHierarchyInfoImpl {
/**

View File

@ -31,16 +31,14 @@ import java.util.List;
import java.util.Optional;
import jdk.internal.classfile.impl.ClassImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Models a classfile. The contents of the classfile can be traversed via
* a streaming view, or via random access (e.g.,
* {@link #flags()}), or by freely mixing the two.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassModel
extends CompoundElement<ClassElement>, AttributedElement
permits ClassImpl {

View File

@ -33,7 +33,6 @@ import java.util.Optional;
import java.util.function.Function;
import jdk.internal.classfile.impl.ClassReaderImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Supports reading from a classfile. Methods are provided to read data of
@ -42,9 +41,8 @@ import jdk.internal.javac.PreviewFeature;
* Encapsulates additional reading context such as mappers for custom attributes
* and processing options.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassReader extends ConstantPool
permits ClassReaderImpl {
@ -122,7 +120,6 @@ public sealed interface ClassReader extends ConstantPool
* @param cls the entry type
* @throws ConstantPoolException if the index is out of range of the
* constant pool size, or zero, or the entry is not of the given type
* @since 23
*/
<T extends PoolEntry> T readEntryOrNull(int offset, Class<T> cls);

View File

@ -27,27 +27,21 @@ package java.lang.classfile;
import java.util.List;
import jdk.internal.classfile.impl.SignaturesImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
/**
* Models the generic signature of a class file, as defined by JVMS {@jvms 4.7.9}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassSignature
permits SignaturesImpl.ClassSignatureImpl {
/** {@return the type parameters of this class} */
List<Signature.TypeParam> typeParameters();
/**
* {@return the instantiation of the superclass in this signature}
*
* @since 23
*/
/** {@return the instantiation of the superclass in this signature} */
Signature.ClassTypeSig superclassSignature();
/** {@return the instantiation of the interfaces in this signature} */
@ -60,7 +54,6 @@ public sealed interface ClassSignature
* {@return a class signature}
* @param superclassSignature the superclass
* @param superinterfaceSignatures the interfaces
* @since 23
*/
public static ClassSignature of(Signature.ClassTypeSig superclassSignature,
Signature.ClassTypeSig... superinterfaceSignatures) {
@ -72,7 +65,6 @@ public sealed interface ClassSignature
* @param typeParameters the type parameters
* @param superclassSignature the superclass
* @param superinterfaceSignatures the interfaces
* @since 23
*/
public static ClassSignature of(List<Signature.TypeParam> typeParameters,
Signature.ClassTypeSig superclassSignature,

View File

@ -30,7 +30,6 @@ import java.util.function.Predicate;
import java.util.function.Supplier;
import jdk.internal.classfile.impl.TransformImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -39,9 +38,8 @@ import static java.util.Objects.requireNonNull;
*
* @see ClassFileTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
@FunctionalInterface
public non-sealed interface ClassTransform
extends ClassFileTransform<ClassTransform, ClassElement, ClassBuilder> {

View File

@ -39,7 +39,6 @@ import java.util.Optional;
import java.util.function.Consumer;
import jdk.internal.classfile.impl.*;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
import static jdk.internal.classfile.impl.BytecodeHelpers.handleDescToHandleInfo;
@ -75,9 +74,8 @@ import static jdk.internal.classfile.impl.BytecodeHelpers.handleDescToHandleInfo
*
* @see CodeTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeBuilder
extends ClassFileBuilder<CodeElement, CodeBuilder>
permits CodeBuilder.BlockCodeBuilder, ChainedCodeBuilder, TerminalCodeBuilder, NonterminalCodeBuilder {
@ -149,9 +147,8 @@ public sealed interface CodeBuilder
/**
* A builder for blocks of code.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface BlockCodeBuilder extends CodeBuilder
permits BlockCodeBuilderImpl {
/**
@ -290,9 +287,8 @@ public sealed interface CodeBuilder
*
* @see #trying
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface CatchBuilder permits CatchBuilderImpl {
/**
* Adds a catch block that catches an exception of the given type.
@ -385,7 +381,6 @@ public sealed interface CodeBuilder
* @return this builder
* @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void}
* or {@code slot} is out of range
* @since 23
*/
default CodeBuilder loadLocal(TypeKind tk, int slot) {
return with(LoadInstruction.of(tk, slot));
@ -398,7 +393,6 @@ public sealed interface CodeBuilder
* @return this builder
* @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void}
* or {@code slot} is out of range
* @since 23
*/
default CodeBuilder storeLocal(TypeKind tk, int slot) {
return with(StoreInstruction.of(tk, slot));
@ -410,7 +404,6 @@ public sealed interface CodeBuilder
* @param op the branch opcode
* @param target the branch target
* @return this builder
* @since 23
*/
default CodeBuilder branch(Opcode op, Label target) {
return with(BranchInstruction.of(op, target));
@ -420,7 +413,6 @@ public sealed interface CodeBuilder
* Generate return instruction
* @param tk the return type
* @return this builder
* @since 23
*/
default CodeBuilder return_(TypeKind tk) {
return with(ReturnInstruction.of(tk));
@ -432,7 +424,6 @@ public sealed interface CodeBuilder
* @param opcode the field access opcode
* @param ref the field reference
* @return this builder
* @since 23
*/
default CodeBuilder fieldAccess(Opcode opcode, FieldRefEntry ref) {
return with(FieldInstruction.of(opcode, ref));
@ -446,7 +437,6 @@ public sealed interface CodeBuilder
* @param name the field name
* @param type the field type
* @return this builder
* @since 23
*/
default CodeBuilder fieldAccess(Opcode opcode, ClassDesc owner, String name, ClassDesc type) {
return fieldAccess(opcode, constantPool().fieldRefEntry(owner, name, type));
@ -458,7 +448,6 @@ public sealed interface CodeBuilder
* @param opcode the invoke opcode
* @param ref the interface method or method reference
* @return this builder
* @since 23
*/
default CodeBuilder invoke(Opcode opcode, MemberRefEntry ref) {
return with(InvokeInstruction.of(opcode, ref));
@ -473,7 +462,6 @@ public sealed interface CodeBuilder
* @param desc the method type
* @param isInterface the interface method invocation indication
* @return this builder
* @since 23
*/
default CodeBuilder invoke(Opcode opcode, ClassDesc owner, String name, MethodTypeDesc desc, boolean isInterface) {
return invoke(opcode,
@ -485,7 +473,6 @@ public sealed interface CodeBuilder
* Generate an instruction to load from an array
* @param tk the array element type
* @return this builder
* @since 23
*/
default CodeBuilder arrayLoad(TypeKind tk) {
Opcode opcode = BytecodeHelpers.arrayLoadOpcode(tk);
@ -496,7 +483,6 @@ public sealed interface CodeBuilder
* Generate an instruction to store into an array
* @param tk the array element type
* @return this builder
* @since 23
*/
default CodeBuilder arrayStore(TypeKind tk) {
Opcode opcode = BytecodeHelpers.arrayStoreOpcode(tk);
@ -510,7 +496,6 @@ public sealed interface CodeBuilder
* @return this builder
* @throws IllegalArgumentException for conversions of {@link TypeKind#VOID void} or
* {@link TypeKind#REFERENCE reference}
* @since 23
*/
default CodeBuilder conversion(TypeKind fromType, TypeKind toType) {
var computationalFrom = fromType.asLoadable();
@ -566,7 +551,6 @@ public sealed interface CodeBuilder
* Generate an instruction pushing a constant onto the operand stack
* @param value the constant value
* @return this builder
* @since 23
*/
default CodeBuilder loadConstant(ConstantDesc value) {
//avoid switch expressions here
@ -1740,7 +1724,6 @@ public sealed interface CodeBuilder
*
* @param target the target type
* @return this builder
* @since 23
*/
default CodeBuilder instanceOf(ClassEntry target) {
return with(TypeCheckInstruction.of(Opcode.INSTANCEOF, target));
@ -1756,7 +1739,6 @@ public sealed interface CodeBuilder
* @param target the target type
* @return this builder
* @throws IllegalArgumentException if {@code target} represents a primitive type
* @since 23
*/
default CodeBuilder instanceOf(ClassDesc target) {
return instanceOf(constantPool().classEntry(target));

View File

@ -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
@ -28,8 +28,6 @@ import java.lang.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute;
import java.lang.classfile.attribute.RuntimeVisibleTypeAnnotationsAttribute;
import java.lang.classfile.attribute.StackMapTableAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* A marker interface for elements that can appear when traversing
* a {@link CodeModel} or be presented to a {@link CodeBuilder}. Code elements
@ -39,9 +37,8 @@ import jdk.internal.javac.PreviewFeature;
* exception metadata, label target metadata, etc.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeElement extends ClassFileElement
permits Instruction, PseudoInstruction,
CustomAttribute, RuntimeVisibleTypeAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute,

View File

@ -31,15 +31,13 @@ import java.util.List;
import java.util.Optional;
import jdk.internal.classfile.impl.BufferedCodeBuilder;
import jdk.internal.javac.PreviewFeature;
/**
* Models the body of a method (the {@code Code} attribute). The instructions
* of the method body are accessed via a streaming view.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeModel
extends CompoundElement<CodeElement>, AttributedElement, MethodElement
permits CodeAttribute, BufferedCodeBuilder.Model {

View File

@ -28,7 +28,6 @@ import java.util.function.Consumer;
import java.util.function.Supplier;
import jdk.internal.classfile.impl.TransformImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -37,9 +36,8 @@ import static java.util.Objects.requireNonNull;
*
* @see ClassFileTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
@FunctionalInterface
public non-sealed interface CodeTransform
extends ClassFileTransform<CodeTransform, CodeElement, CodeBuilder> {

View File

@ -34,8 +34,6 @@ import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jdk.internal.javac.PreviewFeature;
/**
* A {@link ClassFileElement} that has complex structure defined in terms of
* other classfile elements, such as a method, field, method body, or entire
@ -46,9 +44,8 @@ import jdk.internal.javac.PreviewFeature;
* @param <E> the element type
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CompoundElement<E extends ClassFileElement>
extends ClassFileElement, Iterable<E>
permits ClassModel, CodeModel, FieldModel, MethodModel, jdk.internal.classfile.impl.AbstractUnboundModel {

View File

@ -26,7 +26,6 @@ package java.lang.classfile;
import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.javac.PreviewFeature;
/**
* Models a non-standard attribute of a classfile. Clients should extend
@ -35,9 +34,8 @@ import jdk.internal.javac.PreviewFeature;
* format and the {@linkplain CustomAttribute} representation.
* @param <T> the custom attribute type
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public abstract non-sealed class CustomAttribute<T extends CustomAttribute<T>>
implements Attribute<T>, CodeElement, ClassElement, MethodElement, FieldElement {

View File

@ -32,7 +32,6 @@ import java.util.function.Consumer;
import jdk.internal.classfile.impl.AccessFlagsImpl;
import jdk.internal.classfile.impl.ChainedFieldBuilder;
import jdk.internal.classfile.impl.TerminalFieldBuilder;
import jdk.internal.javac.PreviewFeature;
/**
* A builder for fields. Builders are not created directly; they are passed
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
*
* @see FieldTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface FieldBuilder
extends ClassFileBuilder<FieldElement, FieldBuilder>
permits TerminalFieldBuilder, ChainedFieldBuilder {

View File

@ -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
@ -26,16 +26,13 @@ package java.lang.classfile;
import java.lang.classfile.attribute.*;
import jdk.internal.javac.PreviewFeature;
/**
* A marker interface for elements that can appear when traversing
* a {@link FieldModel} or be presented to a {@link FieldBuilder}.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface FieldElement extends ClassFileElement
permits AccessFlags,
CustomAttribute, ConstantValueAttribute, DeprecatedAttribute,

View File

@ -32,16 +32,14 @@ import java.util.Optional;
import jdk.internal.classfile.impl.BufferedFieldBuilder;
import jdk.internal.classfile.impl.FieldImpl;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a field. The contents of the field can be traversed via
* a streaming view, or via random access (e.g.,
* {@link #flags()}), or by freely mixing the two.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface FieldModel
extends CompoundElement<FieldElement>, AttributedElement, ClassElement
permits BufferedFieldBuilder.Model, FieldImpl {

View File

@ -29,7 +29,6 @@ import java.util.function.Predicate;
import java.util.function.Supplier;
import jdk.internal.classfile.impl.TransformImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -38,9 +37,8 @@ import static java.util.Objects.requireNonNull;
*
* @see ClassFileTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
@FunctionalInterface
public non-sealed interface FieldTransform
extends ClassFileTransform<FieldTransform, FieldElement, FieldBuilder> {

View File

@ -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
@ -28,14 +28,12 @@ package java.lang.classfile;
import java.lang.classfile.instruction.*;
import jdk.internal.classfile.impl.AbstractInstruction;
import jdk.internal.javac.PreviewFeature;
/**
* Models an executable instruction in a method body.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Instruction extends CodeElement
permits ArrayLoadInstruction, ArrayStoreInstruction, BranchInstruction,
ConstantInstruction, ConvertInstruction, DiscontinuedInstruction,

View File

@ -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
@ -31,15 +31,13 @@ import java.util.List;
import jdk.internal.classfile.impl.InterfacesImpl;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the interfaces of a class. Delivered as a {@link
* java.lang.classfile.ClassElement} when traversing a {@link ClassModel}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Interfaces
extends ClassElement
permits InterfacesImpl {

View File

@ -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
@ -25,7 +25,6 @@
package java.lang.classfile;
import jdk.internal.classfile.impl.LabelImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A marker for a position within the instructions of a method body. The
@ -40,9 +39,8 @@ import jdk.internal.javac.PreviewFeature;
* can be bound to the current position within a {@linkplain CodeBuilder} via
* {@link CodeBuilder#labelBinding(Label)} or {@link CodeBuilder#with(ClassFileElement)}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Label
permits LabelImpl {
}

View File

@ -32,7 +32,6 @@ import java.util.function.Consumer;
import jdk.internal.classfile.impl.AccessFlagsImpl;
import jdk.internal.classfile.impl.ChainedMethodBuilder;
import jdk.internal.classfile.impl.TerminalMethodBuilder;
import jdk.internal.javac.PreviewFeature;
/**
* A builder for methods. Builders are not created directly; they are passed
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
*
* @see MethodTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodBuilder
extends ClassFileBuilder<MethodElement, MethodBuilder>
permits ChainedMethodBuilder, TerminalMethodBuilder {

View File

@ -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
@ -26,16 +26,13 @@ package java.lang.classfile;
import java.lang.classfile.attribute.*;
import jdk.internal.javac.PreviewFeature;
/**
* A marker interface for elements that can appear when traversing
* a {@link MethodModel} or be presented to a {@link MethodBuilder}.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodElement
extends ClassFileElement
permits AccessFlags, CodeModel, CustomAttribute,

View File

@ -32,16 +32,14 @@ import java.util.Optional;
import jdk.internal.classfile.impl.BufferedMethodBuilder;
import jdk.internal.classfile.impl.MethodImpl;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a method. The contents of the method can be traversed via
* a streaming view, or via random access (e.g.,
* {@link #flags()}), or by freely mixing the two.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodModel
extends CompoundElement<MethodElement>, AttributedElement, ClassElement
permits BufferedMethodBuilder.Model, MethodImpl {

View File

@ -29,16 +29,14 @@ import java.util.List;
import jdk.internal.classfile.impl.SignaturesImpl;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
/**
* Models the generic signature of a method, as defined by JVMS {@jvms 4.7.9}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodSignature
permits SignaturesImpl.MethodSignatureImpl {

View File

@ -29,7 +29,6 @@ import java.util.function.Predicate;
import java.util.function.Supplier;
import jdk.internal.classfile.impl.TransformImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -38,9 +37,8 @@ import static java.util.Objects.requireNonNull;
*
* @see ClassFileTransform
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
@FunctionalInterface
public non-sealed interface MethodTransform
extends ClassFileTransform<MethodTransform, MethodElement, MethodBuilder> {

View File

@ -25,7 +25,6 @@
package java.lang.classfile;
import jdk.internal.classfile.impl.RawBytecodeHelper;
import jdk.internal.javac.PreviewFeature;
/**
* Describes the opcodes of the JVM instruction set, as described in JVMS {@jvms 6.5}.
@ -35,9 +34,8 @@ import jdk.internal.javac.PreviewFeature;
* @see Instruction
* @see PseudoInstruction
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum Opcode {
/** Do nothing */
@ -697,9 +695,8 @@ public enum Opcode {
/**
* Kinds of opcodes.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public static enum Kind {
/**

View File

@ -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
@ -33,7 +33,6 @@ import java.lang.classfile.instruction.LocalVariable;
import java.lang.classfile.instruction.LocalVariableType;
import jdk.internal.classfile.impl.AbstractPseudoInstruction;
import jdk.internal.javac.PreviewFeature;
/**
* Models metadata about a {@link CodeAttribute}, such as entries in the
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
* pseudo-instructions can be disabled by modifying the value of classfile
* options (e.g., {@link ClassFile.DebugElementsOption}).
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface PseudoInstruction
extends CodeElement
permits CharacterRange, ExceptionCatch, LabelTarget, LineNumber, LocalVariable, LocalVariableType, AbstractPseudoInstruction {

View File

@ -30,7 +30,6 @@ import java.util.Optional;
import jdk.internal.classfile.impl.SignaturesImpl;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -38,9 +37,8 @@ import static java.util.Objects.requireNonNull;
* Models generic Java type signatures, as defined in JVMS {@jvms 4.7.9.1}.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Signature {
/** {@return the raw signature string} */
@ -71,9 +69,8 @@ public sealed interface Signature {
/**
* Models the signature of a primitive type or void
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface BaseTypeSig extends Signature
permits SignaturesImpl.BaseTypeSigImpl {
@ -108,9 +105,8 @@ public sealed interface Signature {
* type variable, or array type.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RefTypeSig
extends Signature
permits ArrayTypeSig, ClassTypeSig, TypeVarSig {
@ -119,9 +115,8 @@ public sealed interface Signature {
/**
* Models the signature of a possibly-parameterized class or interface type.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassTypeSig
extends RefTypeSig, ThrowableSig
permits SignaturesImpl.ClassTypeSigImpl {
@ -187,31 +182,27 @@ public sealed interface Signature {
* Models the type argument.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface TypeArg {
/**
* Models an unbounded type argument {@code *}.
* @since 23
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Unbounded extends TypeArg permits SignaturesImpl.UnboundedTypeArgImpl {
}
/**
* Models a type argument with an explicit bound type.
* @since 23
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Bounded extends TypeArg permits SignaturesImpl.TypeArgImpl {
/**
* Models a type argument's wildcard indicator.
* @since 23
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum WildcardIndicator {
/**
@ -243,7 +234,6 @@ public sealed interface Signature {
/**
* {@return a bounded type arg}
* @param boundType the bound
* @since 23
*/
public static TypeArg.Bounded of(RefTypeSig boundType) {
requireNonNull(boundType);
@ -252,7 +242,6 @@ public sealed interface Signature {
/**
* {@return an unbounded type arg}
* @since 23
*/
public static TypeArg.Unbounded unbounded() {
return SignaturesImpl.UnboundedTypeArgImpl.INSTANCE;
@ -261,7 +250,6 @@ public sealed interface Signature {
/**
* {@return an upper-bounded type arg}
* @param boundType the upper bound
* @since 23
*/
public static TypeArg.Bounded extendsOf(RefTypeSig boundType) {
requireNonNull(boundType);
@ -271,7 +259,6 @@ public sealed interface Signature {
/**
* {@return a lower-bounded type arg}
* @param boundType the lower bound
* @since 23
*/
public static TypeArg.Bounded superOf(RefTypeSig boundType) {
requireNonNull(boundType);
@ -282,7 +269,6 @@ public sealed interface Signature {
* {@return a bounded type arg}
* @param wildcard the wild card
* @param boundType optional bound type
* @since 23
*/
public static TypeArg.Bounded bounded(Bounded.WildcardIndicator wildcard, RefTypeSig boundType) {
requireNonNull(wildcard);
@ -294,9 +280,8 @@ public sealed interface Signature {
/**
* Models the signature of a type variable.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface TypeVarSig
extends RefTypeSig, ThrowableSig
permits SignaturesImpl.TypeVarSigImpl {
@ -316,9 +301,8 @@ public sealed interface Signature {
/**
* Models the signature of an array type.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ArrayTypeSig
extends RefTypeSig
permits SignaturesImpl.ArrayTypeSigImpl {
@ -352,9 +336,8 @@ public sealed interface Signature {
/**
* Models a signature for a type parameter of a generic class or method.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface TypeParam
permits SignaturesImpl.TypeParamImpl {
@ -398,9 +381,8 @@ public sealed interface Signature {
* Models a signature for a throwable type.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ThrowableSig extends Signature {
}
}

View File

@ -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
@ -27,15 +27,13 @@ package java.lang.classfile;
import java.lang.classfile.constantpool.ClassEntry;
import jdk.internal.classfile.impl.SuperclassImpl;
import jdk.internal.javac.PreviewFeature;
/**
* Models the superclass of a class. Delivered as a {@link
* java.lang.classfile.ClassElement} when traversing a {@link ClassModel}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Superclass
extends ClassElement
permits SuperclassImpl {

View File

@ -31,7 +31,6 @@ import java.util.List;
import jdk.internal.classfile.impl.TargetInfoImpl;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
import static java.lang.classfile.TypeAnnotation.TargetInfo.*;
@ -52,18 +51,16 @@ import static java.lang.classfile.TypeAnnotation.TargetInfo.*;
* @see RuntimeVisibleTypeAnnotationsAttribute
* @see RuntimeInvisibleTypeAnnotationsAttribute
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface TypeAnnotation
permits UnboundAttribute.UnboundTypeAnnotation {
/**
* The kind of target on which the annotation appears, as defined in JVMS {@jvms 4.7.20.1}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum TargetType {
/** For annotations on a class type parameter declaration. */
CLASS_TYPE_PARAMETER(TARGET_CLASS_TYPE_PARAMETER, 1),
@ -193,9 +190,8 @@ public sealed interface TypeAnnotation
* Specifies which type in a declaration or expression is being annotated.
*
* @sealedGraph
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface TargetInfo {
/**
@ -611,9 +607,8 @@ public sealed interface TypeAnnotation
* parameter of a generic class, generic interface, generic method, or
* generic constructor.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface TypeParameterTarget extends TargetInfo
permits TargetInfoImpl.TypeParameterTargetImpl {
@ -630,9 +625,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on a type in the extends or implements
* clause of a class or interface declaration.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface SupertypeTarget extends TargetInfo
permits TargetInfoImpl.SupertypeTargetImpl {
@ -654,9 +648,8 @@ public sealed interface TypeAnnotation
* type parameter declaration of a generic class, interface, method, or
* constructor.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface TypeParameterBoundTarget extends TargetInfo
permits TargetInfoImpl.TypeParameterBoundTargetImpl {
@ -680,9 +673,8 @@ public sealed interface TypeAnnotation
* declaration, the return type of a method, the type of a newly constructed
* object, or the receiver type of a method or constructor.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface EmptyTarget extends TargetInfo
permits TargetInfoImpl.EmptyTargetImpl {
}
@ -691,9 +683,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on the type in a formal parameter
* declaration of a method, constructor, or lambda expression.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface FormalParameterTarget extends TargetInfo
permits TargetInfoImpl.FormalParameterTargetImpl {
@ -710,9 +701,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on the i'th type in the throws
* clause of a method or constructor declaration.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface ThrowsTarget extends TargetInfo
permits TargetInfoImpl.ThrowsTargetImpl {
@ -730,9 +720,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on the type in a local variable declaration,
* including a variable declared as a resource in a try-with-resources statement.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface LocalVarTarget extends TargetInfo
permits TargetInfoImpl.LocalVarTargetImpl {
@ -747,9 +736,8 @@ public sealed interface TypeAnnotation
* has a value, and the index into the local variable array of the current
* frame at which that local variable can be found.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface LocalVarTargetInfo
permits TargetInfoImpl.LocalVarTargetInfoImpl {
@ -794,9 +782,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on the i'th type in an exception parameter
* declaration.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface CatchTarget extends TargetInfo
permits TargetInfoImpl.CatchTargetImpl {
@ -813,9 +800,8 @@ public sealed interface TypeAnnotation
* Indicates that an annotation appears on either the type in an instanceof expression
* or a new expression, or the type before the :: in a method reference expression.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface OffsetTarget extends TargetInfo
permits TargetInfoImpl.OffsetTargetImpl {
@ -835,9 +821,8 @@ public sealed interface TypeAnnotation
* expression, an explicit constructor invocation statement, a method invocation expression, or a method reference
* expression.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface TypeArgumentTarget extends TargetInfo
permits TargetInfoImpl.TypeArgumentTargetImpl {
@ -871,18 +856,16 @@ public sealed interface TypeAnnotation
* JVMS: Type_path structure identifies which part of the type is annotated,
* as defined in JVMS {@jvms 4.7.20.2}
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface TypePathComponent
permits UnboundAttribute.TypePathComponentImpl {
/**
* Type path kind, as defined in JVMS {@jvms 4.7.20.2}
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum Kind {
/** Annotation is deeper in an array type */

View File

@ -30,7 +30,6 @@ import java.lang.constant.ClassDesc;
import java.lang.constant.ConstantDescs;
import java.lang.invoke.TypeDescriptor;
import jdk.internal.javac.PreviewFeature;
import jdk.internal.vm.annotation.Stable;
/**
@ -54,9 +53,8 @@ import jdk.internal.vm.annotation.Stable;
*
* @jvms 2.2 Data Types
* @jvms 2.11.1 Types and the Java Virtual Machine
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum TypeKind {
// Elements are grouped so frequently used switch ranges such as
// primitives (boolean - double) and computational (int - void) are together.
@ -166,7 +164,6 @@ public enum TypeKind {
/**
* {@return the code used by the {@link Opcode#NEWARRAY newarray} instruction to create an array
* of this component type, or {@code -1} if this type is not supported by {@code newarray}}
* @since 23
* @jvms 6.5.newarray <i>newarray</i>
*/
public int newarrayCode() {
@ -198,7 +195,6 @@ public enum TypeKind {
* newarray}}
* @param newarrayCode the operand of the {@code newarray} instruction
* @throws IllegalArgumentException if the code is invalid
* @since 23
* @jvms 6.5.newarray <i>newarray</i>
*/
public static TypeKind fromNewarrayCode(int newarrayCode) {

View File

@ -32,7 +32,6 @@ import java.lang.classfile.MethodModel;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code AnnotationDefault} attribute (JVMS {@jvms 4.7.22}), which can
@ -46,9 +45,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface AnnotationDefaultAttribute
extends Attribute<AnnotationDefaultAttribute>, MethodElement
permits BoundAttribute.BoundAnnotationDefaultAttr,

View File

@ -32,7 +32,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code BootstrapMethods} attribute (JVMS {@jvms 4.7.23}), which serves as
@ -45,9 +44,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 7.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface BootstrapMethodsAttribute
extends Attribute<BootstrapMethodsAttribute>
permits BoundAttribute.BoundBootstrapMethodsAttribute,

View File

@ -27,14 +27,12 @@ package java.lang.classfile.attribute;
import java.lang.classfile.instruction.CharacterRange;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single character range in the {@link CharacterRangeTableAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CharacterRangeInfo
permits UnboundAttribute.UnboundCharacterRangeInfo {

View File

@ -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
@ -30,7 +30,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* The CharacterRangeTable attribute is an optional variable-length attribute in
@ -58,9 +57,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute permits multiple instances in a given location.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CharacterRangeTableAttribute
extends Attribute<CharacterRangeTableAttribute>
permits BoundAttribute.BoundCharacterRangeTableAttribute,

View File

@ -30,7 +30,6 @@ import java.lang.classfile.CodeModel;
import java.lang.classfile.Label;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Code} attribute (JVMS {@jvms 4.7.3}), appears on non-native,
@ -42,9 +41,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeAttribute extends Attribute<CodeAttribute>, CodeModel
permits BoundAttribute.BoundCodeAttribute {

View File

@ -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
@ -32,7 +32,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code CompilationID} attribute (@@@ need reference), which can
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CompilationIDAttribute
extends Attribute<CompilationIDAttribute>, ClassElement
permits BoundAttribute.BoundCompilationIDAttribute,

View File

@ -32,7 +32,6 @@ import java.lang.constant.ConstantDesc;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ConstantValue} attribute (JVMS {@jvms 4.7.2}), which can appear on
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ConstantValueAttribute
extends Attribute<ConstantValueAttribute>, FieldElement
permits BoundAttribute.BoundConstantValueAttribute,

View File

@ -31,7 +31,6 @@ import java.lang.classfile.MethodElement;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Deprecated} attribute (JVMS {@jvms 4.7.15}), which can appear on
@ -41,9 +40,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute permits multiple instances in a given location.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface DeprecatedAttribute
extends Attribute<DeprecatedAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -37,7 +37,6 @@ import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code EnclosingMethod} attribute (JVMS {@jvms 4.7.7}), which can appear
@ -51,9 +50,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface EnclosingMethodAttribute
extends Attribute<EnclosingMethodAttribute>, ClassElement
permits BoundAttribute.BoundEnclosingMethodAttribute,

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Exceptions} attribute (JVMS {@jvms 4.7.5}), which can appear on
@ -46,9 +45,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ExceptionsAttribute
extends Attribute<ExceptionsAttribute>, MethodElement
permits BoundAttribute.BoundExceptionsAttribute,

View File

@ -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
@ -34,14 +34,12 @@ import java.util.Set;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single inner class in the {@link InnerClassesAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface InnerClassInfo
permits UnboundAttribute.UnboundInnerClassInfo {

View File

@ -31,7 +31,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code InnerClasses} attribute (JVMS {@jvms 4.7.6}), which can
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface InnerClassesAttribute
extends Attribute<InnerClassesAttribute>, ClassElement
permits BoundAttribute.BoundInnerClassesAttribute,

View File

@ -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
@ -25,14 +25,12 @@
package java.lang.classfile.attribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single line number in the {@link LineNumberTableAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LineNumberInfo
permits UnboundAttribute.UnboundLineNumberInfo {

View File

@ -29,7 +29,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code LineNumberTable} attribute (JVMS {@jvms 4.7.12}), which can appear
@ -41,9 +40,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute permits multiple instances in a given location.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LineNumberTableAttribute
extends Attribute<LineNumberTableAttribute>
permits BoundAttribute.BoundLineNumberTableAttribute,

View File

@ -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
@ -30,14 +30,12 @@ import java.lang.constant.ClassDesc;
import jdk.internal.classfile.impl.BoundLocalVariable;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single local variable in the {@link LocalVariableTableAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LocalVariableInfo
permits UnboundAttribute.UnboundLocalVariableInfo, BoundLocalVariable {

View File

@ -29,7 +29,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code LocalVariableTable} attribute (JVMS {@jvms 4.7.13}), which can appear
@ -41,9 +40,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute permits multiple instances in a given location.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LocalVariableTableAttribute
extends Attribute<LocalVariableTableAttribute>
permits BoundAttribute.BoundLocalVariableTableAttribute, UnboundAttribute.UnboundLocalVariableTableAttribute {

View File

@ -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
@ -28,14 +28,12 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundLocalVariableType;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single local variable in the {@link LocalVariableTypeTableAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LocalVariableTypeInfo
permits UnboundAttribute.UnboundLocalVariableTypeInfo, BoundLocalVariableType {

View File

@ -30,7 +30,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code LocalVariableTypeTable} attribute (JVMS {@jvms 4.7.14}), which can appear
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LocalVariableTypeTableAttribute
extends Attribute<LocalVariableTypeTableAttribute>
permits BoundAttribute.BoundLocalVariableTypeTableAttribute, UnboundAttribute.UnboundLocalVariableTypeTableAttribute {

View File

@ -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
@ -33,14 +33,12 @@ import java.util.Set;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single method parameter in the {@link MethodParametersAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodParameterInfo
permits UnboundAttribute.UnboundMethodParameterInfo {
/**

View File

@ -31,7 +31,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code MethodParameters} attribute (JVMS {@jvms 4.7.24}), which can
@ -45,9 +44,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 8.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MethodParametersAttribute
extends Attribute<MethodParametersAttribute>, MethodElement
permits BoundAttribute.BoundMethodParametersAttribute,

View File

@ -43,7 +43,6 @@ import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.ModuleAttributeBuilderImpl;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Module} attribute (JVMS {@jvms 4.7.25}), which can
@ -57,9 +56,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 9.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleAttribute
extends Attribute<ModuleAttribute>, ClassElement
permits BoundAttribute.BoundModuleAttribute, UnboundAttribute.UnboundModuleAttribute {
@ -172,9 +170,8 @@ public sealed interface ModuleAttribute
/**
* A builder for module attributes.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleAttributeBuilder
permits ModuleAttributeBuilderImpl {

View File

@ -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
@ -37,14 +37,12 @@ import java.util.Set;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single "exports" declaration in the {@link ModuleAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleExportInfo
permits UnboundAttribute.UnboundModuleExportInfo {

View File

@ -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
@ -29,14 +29,12 @@ import java.lang.constant.ModuleDesc;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models hash information for a single module in the {@link ModuleHashesAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleHashInfo
permits UnboundAttribute.UnboundModuleHashInfo {

View File

@ -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
@ -33,7 +33,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ModuleHashes} attribute, which can
@ -68,9 +67,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleHashesAttribute
extends Attribute<ModuleHashesAttribute>, ClassElement
permits BoundAttribute.BoundModuleHashesAttribute, UnboundAttribute.UnboundModuleHashesAttribute {

View File

@ -33,7 +33,6 @@ import java.lang.constant.ClassDesc;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ModuleMainClass} attribute (JVMS {@jvms 4.7.27}), which can
@ -47,9 +46,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 9.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleMainClassAttribute
extends Attribute<ModuleMainClassAttribute>, ClassElement
permits BoundAttribute.BoundModuleMainClassAttribute, UnboundAttribute.UnboundModuleMainClassAttribute {

View File

@ -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
@ -36,14 +36,12 @@ import java.util.Set;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single "opens" declaration in the {@link ModuleAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleOpenInfo
permits UnboundAttribute.UnboundModuleOpenInfo {

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ModulePackages} attribute (JVMS {@jvms 4.7.26}), which can
@ -48,9 +47,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 9.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModulePackagesAttribute
extends Attribute<ModulePackagesAttribute>, ClassElement
permits BoundAttribute.BoundModulePackagesAttribute,

View File

@ -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
@ -32,14 +32,12 @@ import java.util.List;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single "provides" declaration in the {@link ModuleAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleProvideInfo
permits UnboundAttribute.UnboundModuleProvideInfo {

View File

@ -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
@ -35,14 +35,12 @@ import java.util.Set;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single "requires" declaration in the {@link ModuleAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleRequireInfo
permits UnboundAttribute.UnboundModuleRequiresInfo {

View File

@ -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
@ -30,7 +30,6 @@ import java.lang.classfile.ClassElement;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ModuleResolution} attribute, which can
@ -63,9 +62,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleResolutionAttribute
extends Attribute<ModuleResolutionAttribute>, ClassElement
permits BoundAttribute.BoundModuleResolutionAttribute, UnboundAttribute.UnboundModuleResolutionAttribute {

View File

@ -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
@ -32,7 +32,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code ModuleTarget} attribute, which can
@ -58,9 +57,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ModuleTargetAttribute
extends Attribute<ModuleTargetAttribute>, ClassElement
permits BoundAttribute.BoundModuleTargetAttribute, UnboundAttribute.UnboundModuleTargetAttribute {

View File

@ -33,7 +33,6 @@ import java.lang.constant.ClassDesc;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code NestHost} attribute (JVMS {@jvms 4.7.28}), which can
@ -47,9 +46,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 11.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface NestHostAttribute extends Attribute<NestHostAttribute>, ClassElement
permits BoundAttribute.BoundNestHostAttribute,
UnboundAttribute.UnboundNestHostAttribute {

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code NestMembers} attribute (JVMS {@jvms 4.7.29}), which can
@ -48,9 +47,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 11.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface NestMembersAttribute extends Attribute<NestMembersAttribute>, ClassElement
permits BoundAttribute.BoundNestMembersAttribute, UnboundAttribute.UnboundNestMembersAttribute {

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code PermittedSubclasses} attribute (JVMS {@jvms 4.7.31}), which can
@ -48,9 +47,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 17.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface PermittedSubclassesAttribute
extends Attribute<PermittedSubclassesAttribute>, ClassElement
permits BoundAttribute.BoundPermittedSubclassesAttribute, UnboundAttribute.UnboundPermittedSubclassesAttribute {

View File

@ -31,7 +31,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Record} attribute (JVMS {@jvms 4.7.30}), which can
@ -45,9 +44,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 16.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RecordAttribute extends Attribute<RecordAttribute>, ClassElement
permits BoundAttribute.BoundRecordAttribute, UnboundAttribute.UnboundRecordAttribute {

View File

@ -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
@ -34,14 +34,12 @@ import jdk.internal.classfile.impl.BoundRecordComponentInfo;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
* Models a single record component in the {@link java.lang.classfile.attribute.RecordAttribute}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RecordComponentInfo
extends AttributedElement
permits BoundRecordComponentInfo, UnboundAttribute.UnboundRecordComponentInfo {

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeInvisibleAnnotations} attribute (JVMS {@jvms 4.7.17}), which
@ -48,9 +47,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeInvisibleAnnotationsAttribute
extends Attribute<RuntimeInvisibleAnnotationsAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -33,7 +33,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeInvisibleParameterAnnotations} attribute
@ -46,9 +45,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeInvisibleParameterAnnotationsAttribute
extends Attribute<RuntimeInvisibleParameterAnnotationsAttribute>, MethodElement
permits BoundAttribute.BoundRuntimeInvisibleParameterAnnotationsAttribute,

View File

@ -35,7 +35,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeInvisibleTypeAnnotations} attribute (JVMS {@jvms 4.7.21}), which
@ -50,9 +49,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 8.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeInvisibleTypeAnnotationsAttribute
extends Attribute<RuntimeInvisibleTypeAnnotationsAttribute>,
ClassElement, MethodElement, FieldElement, CodeElement

View File

@ -34,7 +34,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeVisibleAnnotations} attribute (JVMS {@jvms 4.7.16}), which
@ -48,9 +47,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeVisibleAnnotationsAttribute
extends Attribute<RuntimeVisibleAnnotationsAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -33,7 +33,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeVisibleParameterAnnotations} attribute (JVMS {@jvms 4.7.18}), which
@ -46,9 +45,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeVisibleParameterAnnotationsAttribute
extends Attribute<RuntimeVisibleParameterAnnotationsAttribute>, MethodElement
permits BoundAttribute.BoundRuntimeVisibleParameterAnnotationsAttribute,

View File

@ -35,7 +35,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code RuntimeVisibleTypeAnnotations} attribute (JVMS {@jvms 4.7.20}), which
@ -50,9 +49,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 8.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface RuntimeVisibleTypeAnnotationsAttribute
extends Attribute<RuntimeVisibleTypeAnnotationsAttribute>,
ClassElement, MethodElement, FieldElement, CodeElement

View File

@ -31,7 +31,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Signature} attribute (JVMS {@jvms 4.7.9}), which
@ -46,9 +45,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface SignatureAttribute
extends Attribute<SignatureAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -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
@ -30,7 +30,6 @@ import java.lang.classfile.ClassElement;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code SourceDebugExtension} attribute.
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 5.0.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface SourceDebugExtensionAttribute
extends Attribute<SourceDebugExtensionAttribute>, ClassElement
permits BoundAttribute.BoundSourceDebugExtensionAttribute, UnboundAttribute.UnboundSourceDebugExtensionAttribute {

View File

@ -33,7 +33,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code SourceFile} attribute (JVMS {@jvms 4.7.10}), which
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface SourceFileAttribute
extends Attribute<SourceFileAttribute>, ClassElement
permits BoundAttribute.BoundSourceFileAttribute, UnboundAttribute.UnboundSourceFileAttribute {

View File

@ -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
@ -33,7 +33,6 @@ import java.lang.classfile.constantpool.Utf8Entry;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code SourceID} attribute, which can
@ -44,9 +43,8 @@ import jdk.internal.javac.PreviewFeature;
* Subsequent occurrence of the attribute takes precedence during the attributed
* element build or transformation.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface SourceIDAttribute
extends Attribute<SourceIDAttribute>, ClassElement
permits BoundAttribute.BoundSourceIDAttribute, UnboundAttribute.UnboundSourceIDAttribute {

View File

@ -32,14 +32,12 @@ import java.util.List;
import jdk.internal.classfile.impl.StackMapDecoder;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.javac.PreviewFeature;
/**
* Models stack map frame of {@code StackMapTable} attribute (JVMS {@jvms 4.7.4}).
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface StackMapFrameInfo
permits StackMapDecoder.StackMapFrameImpl {
@ -79,9 +77,8 @@ public sealed interface StackMapFrameInfo
/**
* The type of a stack value.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface VerificationTypeInfo {
/** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#TOP TOP}. */
@ -124,9 +121,8 @@ public sealed interface StackMapFrameInfo
/**
* A simple stack value.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum SimpleVerificationTypeInfo implements VerificationTypeInfo {
/** verification type top */
@ -166,9 +162,8 @@ public sealed interface StackMapFrameInfo
/**
* A stack value for an object type. Its {@link #tag() tag} is {@value #ITEM_OBJECT}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface ObjectVerificationTypeInfo extends VerificationTypeInfo
permits StackMapDecoder.ObjectVerificationTypeInfoImpl {
@ -205,9 +200,8 @@ public sealed interface StackMapFrameInfo
/**
* An uninitialized stack value. Its {@link #tag() tag} is {@value #ITEM_UNINITIALIZED}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
sealed interface UninitializedVerificationTypeInfo extends VerificationTypeInfo
permits StackMapDecoder.UninitializedVerificationTypeInfoImpl {

View File

@ -31,7 +31,6 @@ import java.util.List;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code StackMapTable} attribute (JVMS {@jvms 4.7.4}), which can appear
@ -43,9 +42,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute was introduced in the Java SE Platform version 6.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface StackMapTableAttribute
extends Attribute<StackMapTableAttribute>, CodeElement
permits BoundAttribute.BoundStackMapTableAttribute, UnboundAttribute.UnboundStackMapTableAttribute {

View File

@ -32,7 +32,6 @@ import java.lang.classfile.MethodElement;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.UnboundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models the {@code Synthetic} attribute (JVMS {@jvms 4.7.8}), which can appear on
@ -42,9 +41,8 @@ import jdk.internal.javac.PreviewFeature;
* <p>
* The attribute permits multiple instances in a given location.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface SyntheticAttribute
extends Attribute<SyntheticAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -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
@ -31,14 +31,12 @@ import java.lang.classfile.FieldElement;
import java.lang.classfile.MethodElement;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.javac.PreviewFeature;
/**
* Models an unknown attribute on a class, method, or field.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface UnknownAttribute
extends Attribute<UnknownAttribute>,
ClassElement, MethodElement, FieldElement

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 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
@ -28,9 +28,7 @@
*
* The {@code java.lang.classfile.attribute} package contains interfaces describing classfile attributes.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
package java.lang.classfile.attribute;
import jdk.internal.javac.PreviewFeature;

View File

@ -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
@ -36,7 +36,6 @@ import java.util.function.Consumer;
import java.util.stream.Stream;
import jdk.internal.classfile.impl.ClassPrinterImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A printer of classfiles and its elements.
@ -60,9 +59,8 @@ import jdk.internal.javac.PreviewFeature;
* Another use case for {@link ClassPrinter} is to simplify writing of automated tests:
* {@snippet lang="java" class="PackageSnippets" region="printNodesInTest"}
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public final class ClassPrinter {
private ClassPrinter() {
@ -71,9 +69,8 @@ public final class ClassPrinter {
/**
* Level of detail to print or export.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public enum Verbosity {
/**
@ -106,9 +103,8 @@ public final class ClassPrinter {
/**
* Named, traversable, and printable node parent.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface Node {
/**
@ -151,9 +147,8 @@ public final class ClassPrinter {
/**
* A leaf node holding single printable value.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface LeafNode extends Node
permits ClassPrinterImpl.LeafNodeImpl {
@ -167,9 +162,8 @@ public final class ClassPrinter {
/**
* A tree node holding {@link List} of nested nodes.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ListNode extends Node, List<Node>
permits ClassPrinterImpl.ListNodeImpl {
}
@ -179,9 +173,8 @@ public final class ClassPrinter {
* <p>
* Each {@link Map.Entry#getKey()} == {@link Map.Entry#getValue()}.{@link #name()}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface MapNode extends Node, Map<ConstantDesc, Node>
permits ClassPrinterImpl.MapNodeImpl {
}

View File

@ -35,7 +35,6 @@ import java.util.Map;
import java.util.function.Function;
import jdk.internal.classfile.impl.ClassRemapperImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
@ -55,9 +54,8 @@ import static java.util.Objects.requireNonNull;
* Arrays of reference types are always decomposed, mapped as the base reference
* types and composed back to arrays.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassRemapper extends ClassTransform permits ClassRemapperImpl {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, 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
@ -31,7 +31,6 @@ import java.lang.constant.MethodTypeDesc;
import java.lang.reflect.AccessFlag;
import jdk.internal.classfile.impl.CodeLocalsShifterImpl;
import jdk.internal.javac.PreviewFeature;
/**
* {@link CodeLocalsShifter} is a {@link CodeTransform} shifting locals to
@ -39,9 +38,8 @@ import jdk.internal.javac.PreviewFeature;
* Locals pointing to the receiver or to method arguments slots are never shifted.
* All locals pointing beyond the method arguments are re-indexed in order of appearance.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeLocalsShifter extends CodeTransform permits CodeLocalsShifterImpl {
/**

Some files were not shown because too many files have changed in this diff Show More