< prev index next >

core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/parser/synthetic/SettingsTransformer.java

Print this page

        

*** 51,61 **** import org.openjdk.jmc.flightrecorder.parser.IEventSink; import org.openjdk.jmc.flightrecorder.parser.IEventSinkFactory; import org.openjdk.jmc.flightrecorder.parser.ValueField; /** ! * Event sink that transforms pre JDK 9 event types to their equivalent JDK 9 types. JDK 9 input * data will be passed through mostly untouched. */ class SettingsTransformer implements IEventSink { /** --- 51,61 ---- import org.openjdk.jmc.flightrecorder.parser.IEventSink; import org.openjdk.jmc.flightrecorder.parser.IEventSinkFactory; import org.openjdk.jmc.flightrecorder.parser.ValueField; /** ! * Event sink that transforms pre JDK 11 event types to their equivalent JDK 11 types. JDK 11 input * data will be passed through mostly untouched. */ class SettingsTransformer implements IEventSink { /**
*** 101,111 **** Messages.getString(Messages.SettingsTransformer_REC_SETTINGS_ATTR_PERIOD), TIMESPAN); private static final List<ValueField> FIELDS = Arrays.asList(new ValueField(JfrAttributes.END_TIME), new ValueField(SyntheticAttributeExtension.REC_SETTING_EVENT_ID_ATTRIBUTE), new ValueField(JdkAttributes.REC_SETTING_NAME), new ValueField(JdkAttributes.REC_SETTING_VALUE)); ! // Renamed attributes from pre JDK 9: <event id, <pre 9 attribute id, 9 attribute id>> private static final Map<String, Map<String, String>> attributeRenameMap; // JDK-8157024 constant for the field id private static final String UNALLOCATED_CAPACITY_FIELD_ID = "unallocatedCapacity"; //$NON-NLS-1$ --- 101,111 ---- Messages.getString(Messages.SettingsTransformer_REC_SETTINGS_ATTR_PERIOD), TIMESPAN); private static final List<ValueField> FIELDS = Arrays.asList(new ValueField(JfrAttributes.END_TIME), new ValueField(SyntheticAttributeExtension.REC_SETTING_EVENT_ID_ATTRIBUTE), new ValueField(JdkAttributes.REC_SETTING_NAME), new ValueField(JdkAttributes.REC_SETTING_VALUE)); ! // Renamed attributes from pre JDK 11: <event id, <pre 11 attribute id, 11 attribute id>> private static final Map<String, Map<String, String>> attributeRenameMap; // JDK-8157024 constant for the field id private static final String UNALLOCATED_CAPACITY_FIELD_ID = "unallocatedCapacity"; //$NON-NLS-1$
*** 212,225 **** @Override public void addEvent(Object[] values) { LabeledIdentifier type = (LabeledIdentifier) values[typeIndex]; if (type != null) { - if (JdkTypeIDsPreJdk11.needTransform(type.getInterfaceId())) { type = new LabeledIdentifier(JdkTypeIDsPreJdk11.translate(type.getInterfaceId()), type.getImplementationId(), type.getName(), type.getDeclaredDescription()); - } if (endTimeIndex < 0) { values[typeIndex] = type; sink.addEvent(values); return; } --- 212,223 ----
*** 278,294 **** @Override public IEventSink create( String identifier, String label, String[] category, String description, List<ValueField> dataStructure) { - boolean needsTransform = JdkTypeIDsPreJdk11.needTransform(identifier); if (JdkTypeIDsPreJdk11.RECORDING_SETTING.equals(identifier) || ! (needsTransform && ! JdkTypeIDs.RECORDING_SETTING.equals(JdkTypeIDsPreJdk11.translate(identifier)))) { SettingsTransformer st = new SettingsTransformer(subFactory, label, category, description, dataStructure); ! if (st.isValid() || (needsTransform && st.isValidV1())) { return st; } else { // FIXME: Avoid System.err.println System.err .println("Cannot create SettingsTransformer from fields: " + dataStructure.toString()); //$NON-NLS-1$ --- 276,290 ---- @Override public IEventSink create( String identifier, String label, String[] category, String description, List<ValueField> dataStructure) { if (JdkTypeIDsPreJdk11.RECORDING_SETTING.equals(identifier) || ! JdkTypeIDsPreJdk11.JDK9_RECORDING_SETTING.equals(identifier)) { SettingsTransformer st = new SettingsTransformer(subFactory, label, category, description, dataStructure); ! if (st.isValid() || st.isValidV1()) { return st; } else { // FIXME: Avoid System.err.println System.err .println("Cannot create SettingsTransformer from fields: " + dataStructure.toString()); //$NON-NLS-1$
< prev index next >