< prev index next >

src/java.base/share/classes/jdk/internal/classfile/impl/BoundAttribute.java

Print this page

 922         }
 923     }
 924 
 925     public static final class BoundPermittedSubclassesAttribute extends BoundAttribute<PermittedSubclassesAttribute>
 926             implements PermittedSubclassesAttribute {
 927         private List<ClassEntry> permittedSubclasses = null;
 928 
 929         public BoundPermittedSubclassesAttribute(ClassReader cf, AttributeMapper<PermittedSubclassesAttribute> mapper, int pos) {
 930             super(cf, mapper, pos);
 931         }
 932 
 933         @Override
 934         public List<ClassEntry> permittedSubclasses() {
 935             if (permittedSubclasses == null) {
 936                 permittedSubclasses = readEntryList(payloadStart, ClassEntry.class);
 937             }
 938             return permittedSubclasses;
 939         }
 940     }
 941 

















 942     public abstract static sealed class BoundCodeAttribute
 943             extends BoundAttribute<CodeAttribute>
 944             implements CodeAttribute
 945             permits CodeImpl {
 946         protected final int codeStart;
 947         protected final int codeLength;
 948         protected final int codeEnd;
 949         protected final int attributePos;
 950         protected final int exceptionHandlerPos;
 951         protected final int exceptionHandlerCnt;
 952         protected final MethodModel enclosingMethod;
 953 
 954         public BoundCodeAttribute(AttributedElement enclosing,
 955                                   ClassReader reader,
 956                                   AttributeMapper<CodeAttribute> mapper,
 957                                   int payloadStart) {
 958             super(reader, mapper, payloadStart);
 959             this.codeLength = classReader.readInt(payloadStart + 4);
 960             this.enclosingMethod = (MethodModel) enclosing;
 961             this.codeStart = payloadStart + 8;

1001             case 0x5208e184 ->
1002                 name.equalsString(NAME_BOOTSTRAP_METHODS) ? bootstrapMethods() : null;
1003             case 0xcb60907a ->
1004                 name.equalsString(NAME_CHARACTER_RANGE_TABLE) ? characterRangeTable() : null;
1005             case 0x4020220d ->
1006                 name.equalsString(NAME_CODE) ? code() : null;
1007             case 0xc20dd1fe ->
1008                 name.equalsString(NAME_COMPILATION_ID) ? compilationId() : null;
1009             case 0xcab1940d ->
1010                 name.equalsString(NAME_CONSTANT_VALUE) ? constantValue() : null;
1011             case 0x558641d3 ->
1012                 name.equalsString(NAME_DEPRECATED) ? deprecated() : null;
1013             case 0x51d443cd ->
1014                 name.equalsString(NAME_ENCLOSING_METHOD) ? enclosingMethod() : null;
1015             case 0x687c1624 ->
1016                 name.equalsString(NAME_EXCEPTIONS) ? exceptions() : null;
1017             case 0x7adb2910 ->
1018                 name.equalsString(NAME_INNER_CLASSES) ? innerClasses() : null;
1019             case 0x653f0551 ->
1020                 name.equalsString(NAME_LINE_NUMBER_TABLE) ? lineNumberTable() : null;


1021             case 0x64c75927 ->
1022                 name.equalsString(NAME_LOCAL_VARIABLE_TABLE) ? localVariableTable() : null;
1023             case 0x6697f98d ->
1024                 name.equalsString(NAME_LOCAL_VARIABLE_TYPE_TABLE) ? localVariableTypeTable() : null;
1025             case 0xdbb0cdcb ->
1026                 name.equalsString(NAME_METHOD_PARAMETERS) ? methodParameters() : null;
1027             case 0xc9b0928c ->
1028                 name.equalsString(NAME_MODULE) ? module() : null;
1029             case 0x41cd27e8 ->
1030                 name.equalsString(NAME_MODULE_HASHES) ? moduleHashes() : null;
1031             case 0x7deb0a13 ->
1032                 name.equalsString(NAME_MODULE_MAIN_CLASS) ? moduleMainClass() : null;
1033             case 0x6706ff99 ->
1034                 name.equalsString(NAME_MODULE_PACKAGES) ? modulePackages() : null;
1035             case 0x60272858 ->
1036                 name.equalsString(NAME_MODULE_RESOLUTION) ? moduleResolution() : null;
1037             case 0x5646d73d ->
1038                 name.equalsString(NAME_MODULE_TARGET) ? moduleTarget() : null;
1039             case 0x50336c40 ->
1040                 name.equalsString(NAME_NEST_HOST) ? nestHost() : null;

 922         }
 923     }
 924 
 925     public static final class BoundPermittedSubclassesAttribute extends BoundAttribute<PermittedSubclassesAttribute>
 926             implements PermittedSubclassesAttribute {
 927         private List<ClassEntry> permittedSubclasses = null;
 928 
 929         public BoundPermittedSubclassesAttribute(ClassReader cf, AttributeMapper<PermittedSubclassesAttribute> mapper, int pos) {
 930             super(cf, mapper, pos);
 931         }
 932 
 933         @Override
 934         public List<ClassEntry> permittedSubclasses() {
 935             if (permittedSubclasses == null) {
 936                 permittedSubclasses = readEntryList(payloadStart, ClassEntry.class);
 937             }
 938             return permittedSubclasses;
 939         }
 940     }
 941 
 942     public static final class BoundLoadableDescriptorsAttribute extends BoundAttribute<LoadableDescriptorsAttribute>
 943             implements LoadableDescriptorsAttribute {
 944         private List<Utf8Entry> loadableDescriptors = null;
 945 
 946         public BoundLoadableDescriptorsAttribute(ClassReader cf, AttributeMapper<LoadableDescriptorsAttribute> mapper, int pos) {
 947             super(cf, mapper, pos);
 948         }
 949 
 950         @Override
 951         public List<Utf8Entry> loadableDescriptors() {
 952             if (loadableDescriptors == null) {
 953                 loadableDescriptors = readEntryList(payloadStart, Utf8Entry.class);
 954             }
 955             return loadableDescriptors;
 956         }
 957     }
 958 
 959     public abstract static sealed class BoundCodeAttribute
 960             extends BoundAttribute<CodeAttribute>
 961             implements CodeAttribute
 962             permits CodeImpl {
 963         protected final int codeStart;
 964         protected final int codeLength;
 965         protected final int codeEnd;
 966         protected final int attributePos;
 967         protected final int exceptionHandlerPos;
 968         protected final int exceptionHandlerCnt;
 969         protected final MethodModel enclosingMethod;
 970 
 971         public BoundCodeAttribute(AttributedElement enclosing,
 972                                   ClassReader reader,
 973                                   AttributeMapper<CodeAttribute> mapper,
 974                                   int payloadStart) {
 975             super(reader, mapper, payloadStart);
 976             this.codeLength = classReader.readInt(payloadStart + 4);
 977             this.enclosingMethod = (MethodModel) enclosing;
 978             this.codeStart = payloadStart + 8;

1018             case 0x5208e184 ->
1019                 name.equalsString(NAME_BOOTSTRAP_METHODS) ? bootstrapMethods() : null;
1020             case 0xcb60907a ->
1021                 name.equalsString(NAME_CHARACTER_RANGE_TABLE) ? characterRangeTable() : null;
1022             case 0x4020220d ->
1023                 name.equalsString(NAME_CODE) ? code() : null;
1024             case 0xc20dd1fe ->
1025                 name.equalsString(NAME_COMPILATION_ID) ? compilationId() : null;
1026             case 0xcab1940d ->
1027                 name.equalsString(NAME_CONSTANT_VALUE) ? constantValue() : null;
1028             case 0x558641d3 ->
1029                 name.equalsString(NAME_DEPRECATED) ? deprecated() : null;
1030             case 0x51d443cd ->
1031                 name.equalsString(NAME_ENCLOSING_METHOD) ? enclosingMethod() : null;
1032             case 0x687c1624 ->
1033                 name.equalsString(NAME_EXCEPTIONS) ? exceptions() : null;
1034             case 0x7adb2910 ->
1035                 name.equalsString(NAME_INNER_CLASSES) ? innerClasses() : null;
1036             case 0x653f0551 ->
1037                 name.equalsString(NAME_LINE_NUMBER_TABLE) ? lineNumberTable() : null;
1038            case 0x5f348b64 ->
1039                 name.equalsString(NAME_LOADABLE_DESCRIPTORS) ? loadableDescriptors() : null;
1040             case 0x64c75927 ->
1041                 name.equalsString(NAME_LOCAL_VARIABLE_TABLE) ? localVariableTable() : null;
1042             case 0x6697f98d ->
1043                 name.equalsString(NAME_LOCAL_VARIABLE_TYPE_TABLE) ? localVariableTypeTable() : null;
1044             case 0xdbb0cdcb ->
1045                 name.equalsString(NAME_METHOD_PARAMETERS) ? methodParameters() : null;
1046             case 0xc9b0928c ->
1047                 name.equalsString(NAME_MODULE) ? module() : null;
1048             case 0x41cd27e8 ->
1049                 name.equalsString(NAME_MODULE_HASHES) ? moduleHashes() : null;
1050             case 0x7deb0a13 ->
1051                 name.equalsString(NAME_MODULE_MAIN_CLASS) ? moduleMainClass() : null;
1052             case 0x6706ff99 ->
1053                 name.equalsString(NAME_MODULE_PACKAGES) ? modulePackages() : null;
1054             case 0x60272858 ->
1055                 name.equalsString(NAME_MODULE_RESOLUTION) ? moduleResolution() : null;
1056             case 0x5646d73d ->
1057                 name.equalsString(NAME_MODULE_TARGET) ? moduleTarget() : null;
1058             case 0x50336c40 ->
1059                 name.equalsString(NAME_NEST_HOST) ? nestHost() : null;
< prev index next >