Skip to content

Commit ad7eb91

Browse files
committed
Improved support for experimental events
- correctly shown/hidden experimental properties for generic loader
1 parent 783cc89 commit ad7eb91

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

visualvm/jfr.generic/src/org/graalvm/visualvm/jfr/generic/model/impl/DisplayableSupport.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,8 @@ private IAccessorKey computeNext() {
7878
}
7979

8080
private boolean isDisplayable(IAccessorKey key) {
81-
return !ID_STACKTRACE.equals(key.getIdentifier());
81+
if (ID_STACKTRACE.equals(key.getIdentifier())) return false;
82+
return includeExperimental || !isExperimental(key);
8283
}
8384
};
8485
}
@@ -94,6 +95,13 @@ static JFRDataDescriptor getDataDescriptor(IAccessorKey key) {
9495
}
9596

9697

98+
private static boolean isExperimental(IAccessorKey key) {
99+
// TODO: should be turned into regexp and test matching, not startsWith!
100+
String accessorName = TypeHandling.getValueString(key);
101+
return accessorName.startsWith(JFRGenericEventType.EXPERIMENTAL_PREFIX);
102+
}
103+
104+
97105
private DisplayableSupport() {}
98106

99107

visualvm/jfr.generic/src/org/graalvm/visualvm/jfr/generic/model/impl/JFRGenericEventType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
final class JFRGenericEventType extends JFREventType {
4343

44-
private static final String EXPERIMENTAL_PREFIX = Messages.getString(Messages.TypeManager_EXPERIMENTAL_TYPE).replace("{0}", "").trim(); // NOI18N
44+
static final String EXPERIMENTAL_PREFIX = Messages.getString(Messages.TypeManager_EXPERIMENTAL_TYPE).replace("{0}", "").trim(); // NOI18N
4545

4646

4747
private final long typeId;

0 commit comments

Comments
 (0)