Skip to content

Commit

Permalink
8317609: Classfile API fails to verify /jdk.jcmd/sun/tools/jstat/Alig…
Browse files Browse the repository at this point in the history
…nment.class

Reviewed-by: liach, alanb
  • Loading branch information
asotona committed Oct 31, 2023
1 parent 47624f6 commit f1e8787
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/jdk/tools/lib/tests/JImageValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import jdk.internal.classfile.ClassHierarchyResolver;

import jdk.internal.classfile.Classfile;
import jdk.internal.jimage.BasicImageReader;
Expand Down Expand Up @@ -222,7 +223,10 @@ public long getModuleLauncherExecutionTime() {
}

public static void readClass(byte[] clazz) throws IOException{
var errors = Classfile.of().parse(clazz).verify(null);
var errors = Classfile.of().parse(clazz).verify(
//resolution of all classes as interfaces cancels assignability verification
cls -> ClassHierarchyResolver.ClassHierarchyInfo.ofInterface(),
null);
if (!errors.isEmpty()) {
var itr = errors.iterator();
var thrown = itr.next();
Expand Down

1 comment on commit f1e8787

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.