Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asotona committed May 24, 2024
1 parent 37f7f63 commit db73c2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/jdk/java/lang/StackWalker/TestBCI.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static class MethodInfo {
this.name = m.methodName().stringValue();
this.desc = m.methodTypeSymbol();
m.code().orElseThrow(() -> new IllegalArgumentException("Missing Code in " + m))
.findAttribute(Attributes.LINE_NUMBER_TABLE)
.findAttribute(Attributes.lineNumberTable())
.orElseThrow(() -> new IllegalArgumentException("Missing LineNumberTable in " + m))
.lineNumbers().forEach(entry ->
bciToLineNumbers.computeIfAbsent(entry.startPc(), _ -> new TreeSet<>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public List<String> run(Stream<Path> classes)throws IOException, InterruptedExce

private static final String CALLER_SENSITIVE_ANNOTATION = "Ljdk/internal/reflect/CallerSensitive;";
private static boolean isCallerSensitive(MethodModel m) {
var attr = m.findAttribute(Attributes.RUNTIME_VISIBLE_ANNOTATIONS).orElse(null);
var attr = m.findAttribute(Attributes.runtimeVisibleAnnotations()).orElse(null);
if (attr != null) {
for (var ann : attr.annotations()) {
if (ann.className().equalsString(CALLER_SENSITIVE_ANNOTATION)) {
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static boolean csmWithCallerParameter(ClassModel cf, MethodModel csm, Me
private static boolean isCallerSensitive(MethodModel m)
throws IllegalArgumentException
{
var attr = m.findAttribute(Attributes.RUNTIME_VISIBLE_ANNOTATIONS).orElse(null);
var attr = m.findAttribute(Attributes.runtimeVisibleAnnotations()).orElse(null);
if (attr != null) {
for (var ann : attr.annotations()) {
if (ann.className().equalsString(CALLER_SENSITIVE_ANNOTATION)) {
Expand All @@ -250,7 +250,7 @@ private static boolean isCallerSensitive(MethodModel m)
}

private static boolean isCallerSensitiveAdapter(MethodModel m) {
var attr = m.findAttribute(Attributes.RUNTIME_INVISIBLE_ANNOTATIONS).orElse(null);
var attr = m.findAttribute(Attributes.runtimeInvisibleAnnotations()).orElse(null);

if (attr != null) {
for (var ann : attr.annotations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
import jdk.test.lib.compiler.CompilerUtils;
import toolbox.ToolBox;

import java.lang.classfile.Attributes;
import java.lang.classfile.BootstrapMethodEntry;
import java.lang.classfile.ClassFile;
import java.lang.classfile.ClassModel;
import java.lang.classfile.CodeElement;
import java.lang.classfile.CodeModel;
import java.lang.classfile.MethodModel;
import java.lang.classfile.attribute.CodeAttribute;
import java.lang.classfile.constantpool.MethodHandleEntry;
import java.lang.classfile.instruction.InvokeDynamicInstruction;
import java.nio.file.Path;
Expand Down Expand Up @@ -87,7 +86,7 @@ public static boolean hasStringConcatFactoryCall(Path file, String methodName) t

for (MethodModel method : classFile.methods()) {
if (method.methodName().equalsString(methodName)) {
CodeAttribute code = method.findAttribute(Attributes.CODE).orElseThrow();
CodeModel code = method.code().orElseThrow();
for (CodeElement i : code.elementList()) {
if (i instanceof InvokeDynamicInstruction indy) {
BootstrapMethodEntry bsmSpec = indy.invokedynamic().bootstrap();
Expand Down

0 comments on commit db73c2d

Please sign in to comment.