< prev index next >

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

Print this page

 67                         .map(this::mapRecordComponent).toList()));
 68             case ModuleAttribute ma ->
 69                 clb.with(ModuleAttribute.of(ma.moduleName(), ma.moduleFlagsMask(),
 70                         ma.moduleVersion().orElse(null),
 71                         ma.requires(), ma.exports(), ma.opens(),
 72                         ma.uses().stream().map(ce ->
 73                                 clb.constantPool().classEntry(map(ce.asSymbol()))).toList(),
 74                         ma.provides().stream().map(mp ->
 75                                 ModuleProvideInfo.of(map(mp.provides().asSymbol()),
 76                                         mp.providesWith().stream().map(pw ->
 77                                                 map(pw.asSymbol())).toList())).toList()));
 78             case NestHostAttribute nha ->
 79                 clb.with(NestHostAttribute.of(map(nha.nestHost().asSymbol())));
 80             case NestMembersAttribute nma ->
 81                 clb.with(NestMembersAttribute.ofSymbols(nma.nestMembers().stream()
 82                         .map(nm -> map(nm.asSymbol())).toList()));
 83             case PermittedSubclassesAttribute psa ->
 84                 clb.with(PermittedSubclassesAttribute.ofSymbols(
 85                         psa.permittedSubclasses().stream().map(ps ->
 86                                 map(ps.asSymbol())).toList()));


 87             case RuntimeVisibleAnnotationsAttribute aa ->
 88                 clb.with(RuntimeVisibleAnnotationsAttribute.of(
 89                         mapAnnotations(aa.annotations())));
 90             case RuntimeInvisibleAnnotationsAttribute aa ->
 91                 clb.with(RuntimeInvisibleAnnotationsAttribute.of(
 92                         mapAnnotations(aa.annotations())));
 93             case RuntimeVisibleTypeAnnotationsAttribute aa ->
 94                 clb.with(RuntimeVisibleTypeAnnotationsAttribute.of(
 95                         mapTypeAnnotations(aa.annotations())));
 96             case RuntimeInvisibleTypeAnnotationsAttribute aa ->
 97                 clb.with(RuntimeInvisibleTypeAnnotationsAttribute.of(
 98                         mapTypeAnnotations(aa.annotations())));
 99             default ->
100                 clb.with(cle);
101         }
102     }
103 
104     @Override
105     public FieldTransform asFieldTransform() {
106         return (FieldBuilder fb, FieldElement fe) -> {

 67                         .map(this::mapRecordComponent).toList()));
 68             case ModuleAttribute ma ->
 69                 clb.with(ModuleAttribute.of(ma.moduleName(), ma.moduleFlagsMask(),
 70                         ma.moduleVersion().orElse(null),
 71                         ma.requires(), ma.exports(), ma.opens(),
 72                         ma.uses().stream().map(ce ->
 73                                 clb.constantPool().classEntry(map(ce.asSymbol()))).toList(),
 74                         ma.provides().stream().map(mp ->
 75                                 ModuleProvideInfo.of(map(mp.provides().asSymbol()),
 76                                         mp.providesWith().stream().map(pw ->
 77                                                 map(pw.asSymbol())).toList())).toList()));
 78             case NestHostAttribute nha ->
 79                 clb.with(NestHostAttribute.of(map(nha.nestHost().asSymbol())));
 80             case NestMembersAttribute nma ->
 81                 clb.with(NestMembersAttribute.ofSymbols(nma.nestMembers().stream()
 82                         .map(nm -> map(nm.asSymbol())).toList()));
 83             case PermittedSubclassesAttribute psa ->
 84                 clb.with(PermittedSubclassesAttribute.ofSymbols(
 85                         psa.permittedSubclasses().stream().map(ps ->
 86                                 map(ps.asSymbol())).toList()));
 87             case LoadableDescriptorsAttribute pa ->
 88                 clb.with(LoadableDescriptorsAttribute.of(pa.loadableDescriptors()));
 89             case RuntimeVisibleAnnotationsAttribute aa ->
 90                 clb.with(RuntimeVisibleAnnotationsAttribute.of(
 91                         mapAnnotations(aa.annotations())));
 92             case RuntimeInvisibleAnnotationsAttribute aa ->
 93                 clb.with(RuntimeInvisibleAnnotationsAttribute.of(
 94                         mapAnnotations(aa.annotations())));
 95             case RuntimeVisibleTypeAnnotationsAttribute aa ->
 96                 clb.with(RuntimeVisibleTypeAnnotationsAttribute.of(
 97                         mapTypeAnnotations(aa.annotations())));
 98             case RuntimeInvisibleTypeAnnotationsAttribute aa ->
 99                 clb.with(RuntimeInvisibleTypeAnnotationsAttribute.of(
100                         mapTypeAnnotations(aa.annotations())));
101             default ->
102                 clb.with(cle);
103         }
104     }
105 
106     @Override
107     public FieldTransform asFieldTransform() {
108         return (FieldBuilder fb, FieldElement fe) -> {
< prev index next >