Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,18 @@ public void isJavaLangObjectInitTest() throws NoSuchMethodException {
public void isScopedTest() throws NoSuchMethodException, ClassNotFoundException {
// Must use reflection as ScopedMemoryAccess$Scoped is package-private
Class<? extends Annotation> scopedAnnotationClass = Class.forName("jdk.internal.misc.ScopedMemoryAccess$Scoped").asSubclass(Annotation.class);
boolean scopedMethodFound = false;
for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
ResolvedJavaMethod m = e.getValue();
Method key = e.getKey();
boolean expect = key.isAnnotationPresent(scopedAnnotationClass);
boolean actual = m.isScoped();
assertEquals(m.toString(), expect, actual);
if (expect) {
scopedMethodFound = true;
}
}
assertTrue("At least one scoped method must be present", scopedMethodFound);
}

abstract static class UnlinkedType {
Expand Down