Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8272064: test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java needs up…
…date for JEP 416

Reviewed-by: jbachorik
  • Loading branch information
egahlin committed Dec 15, 2021
1 parent d6b5544 commit 69b5d49e4f3a6b1ea616c39815dd16530eb32887
Showing 1 changed file with 17 additions and 8 deletions.
@@ -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
@@ -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>() {
@@ -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);
@@ -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);
}
}

1 comment on commit 69b5d49

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 69b5d49 Dec 15, 2021

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.