Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk18 Public archive

Commit

Permalink
8272064: test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java needs up…
Browse files Browse the repository at this point in the history
…date for JEP 416

Reviewed-by: jbachorik
  • Loading branch information
egahlin committed Dec 15, 2021
1 parent d6b5544 commit 69b5d49
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, 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 Expand Up @@ -51,10 +51,10 @@
*/
public final class TestHiddenMethod {

public static void main(String[] args) throws Throwable {
try (Recording recording = new Recording()) {
recording.enable(MyEvent.class).withThreshold(Duration.ofMillis(0));
recording.start();
// Must call in separate thread because JTREG uses reflection
// to invoke main method, which uses hidden methods.
public static class TestThread extends Thread {
public void run() {
// doPrivileged calls a method that has the @Hidden
// annotation
AccessController.doPrivileged(new PrivilegedAction<Void>() {
Expand All @@ -65,8 +65,19 @@ public Void run() {
return null;
}
});

MyEvent event = new MyEvent();
event.commit();
}
}

public static void main(String[] args) throws Throwable {
try (Recording recording = new Recording()) {
recording.enable(MyEvent.class).withThreshold(Duration.ofMillis(0));
recording.start();
Thread t = new TestThread();
t.start();
t.join();
recording.stop();

List<RecordedEvent> events = Events.fromRecording(recording);
Expand All @@ -78,9 +89,7 @@ public Void run() {
System.out.println("visibleEvent:" + visibleEvent);

assertTrue(hasHiddenStackFrame(hiddenEvent), "No hidden frame in hidden event: " + hiddenEvent);

// Temporary disable this test until JDK-8272064 is resolved.
// assertFalse(hasHiddenStackFrame(visibleEvent), "Hidden frame in visible event: " + visibleEvent);
assertFalse(hasHiddenStackFrame(visibleEvent), "Hidden frame in visible event: " + visibleEvent);
}
}

Expand Down

1 comment on commit 69b5d49

@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.