mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-07 00:48:38 +00:00
8299031: JFR: Clean up jdk.management.jfr
Reviewed-by: mgronlun
This commit is contained in:
parent
c5a4a7a679
commit
318526b01e
@ -70,17 +70,15 @@ public final class ConfigurationInfo {
|
||||
}
|
||||
|
||||
private static Map<String, String> createMap(Object o) {
|
||||
if (o instanceof TabularData) {
|
||||
TabularData td = (TabularData) o;
|
||||
if (o instanceof TabularData td) {
|
||||
Collection<?> values = td.values();
|
||||
Map<String, String> map = HashMap.newHashMap(values.size());
|
||||
for (Object value : td.values()) {
|
||||
if (value instanceof CompositeData) {
|
||||
CompositeData cdRow = (CompositeData) value;
|
||||
if (value instanceof CompositeData cdRow) {
|
||||
Object k = cdRow.get("key");
|
||||
Object v = cdRow.get("value");
|
||||
if (k instanceof String && v instanceof String) {
|
||||
map.put((String) k, (String) v);
|
||||
if (k instanceof String sk && v instanceof String sv) {
|
||||
map.put(sk, sv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,12 +88,11 @@ public final class EventTypeInfo {
|
||||
}
|
||||
|
||||
private static List<SettingDescriptorInfo> createSettings(Object settings) {
|
||||
if (settings != null && settings.getClass().isArray()) {
|
||||
Object[] settingsArray = (Object[]) settings;
|
||||
if (settings instanceof Object[] settingsArray) {
|
||||
List<SettingDescriptorInfo> list = new ArrayList<>(settingsArray.length);
|
||||
for (Object cd : settingsArray) {
|
||||
if (cd instanceof CompositeData) {
|
||||
list.add(SettingDescriptorInfo.from((CompositeData) cd));
|
||||
for (Object element : settingsArray) {
|
||||
if (element instanceof CompositeData cd) {
|
||||
list.add(SettingDescriptorInfo.from(cd));
|
||||
}
|
||||
}
|
||||
return Collections.unmodifiableList(list);
|
||||
|
||||
@ -106,8 +106,7 @@ public final class RecordingInfo {
|
||||
durationInSeconds = (long) cd.get("duration");
|
||||
settings = new LinkedHashMap<>();
|
||||
Object map = cd.get("settings");
|
||||
if (map instanceof TabularData) {
|
||||
TabularData td = (TabularData) map;
|
||||
if (map instanceof TabularData td) {
|
||||
List<String> keyNames = td.getTabularType().getIndexNames();
|
||||
int size = keyNames.size();
|
||||
for (Object keys : td.keySet()) {
|
||||
@ -115,8 +114,8 @@ public final class RecordingInfo {
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = keyNames.get(i);
|
||||
Object value = keyValues[i];
|
||||
if (value instanceof String) {
|
||||
settings.put(key, (String) value);
|
||||
if (value instanceof String s) {
|
||||
settings.put(key, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,14 +295,6 @@ public final class RemoteRecordingStream implements EventStream {
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, String> getRecordingOptions() throws IOException {
|
||||
try {
|
||||
return mbean.getRecordingOptions(recordingId);
|
||||
} catch (Exception e) {
|
||||
throw new IOException("Could not get recording options: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces all settings for this recording stream.
|
||||
* <p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user