Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
(backport-fix) Use JDK21's features, not JDK22
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jul 1, 2023
1 parent 1b5b9d7 commit 1ea4c47
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ void validatePackages() {
boolean hasModulePackages() throws IOException {
try (InputStream in = getInputStream()) {
// parse module-info.class
return Classfile.of().parse(in.readAllBytes()).elementStream()
return Classfile.parse(in.readAllBytes()).elementStream()
.anyMatch(e -> e instanceof ModulePackagesAttribute mpa
&& !mpa.packages().isEmpty());
}
Expand Down Expand Up @@ -605,7 +605,7 @@ private void dedups(ModuleDescriptor md) {
* Generate SystemModules class
*/
public byte[] genClassBytes(Configuration cf) {
return Classfile.of().build(classDesc,
return Classfile.build(classDesc,
clb -> {
clb.withFlags(ACC_FINAL + ACC_SUPER)
.withInterfaceSymbols(List.of(CD_SYSTEM_MODULES))
Expand Down Expand Up @@ -1817,7 +1817,7 @@ private String genSystemModulesMapClass(ClassDesc allSystemModules,

// write the class file to the pool as a resource
String rn = "/java.base/" + SYSTEM_MODULES_MAP_CLASSNAME + ".class";
ResourcePoolEntry e = ResourcePoolEntry.create(rn, Classfile.of().build(
ResourcePoolEntry e = ResourcePoolEntry.create(rn, Classfile.build(
CD_SYSTEM_MODULES_MAP,
clb -> clb.withFlags(ACC_FINAL + ACC_SUPER)
.withVersion(52, 0)
Expand Down

0 comments on commit 1ea4c47

Please sign in to comment.