Skip to content

Commit 9e3405a

Browse files
committed
cleanup
1 parent f676a49 commit 9e3405a

File tree

16 files changed

+61
-197
lines changed

16 files changed

+61
-197
lines changed

application/org.openjdk.jmc.flightrecorder.ui/META-INF/MANIFEST.MF

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Require-Bundle: org.openjdk.jmc.rjmx,
1818
org.openjdk.jmc.flightrecorder.configuration,
1919
org.openjdk.jmc.commands,
2020
org.openjdk.jmc.browser,
21+
org.openjdk.jmc.ui.websocket,
2122
org.hdrhistogram.HdrHistogram,
2223
org.eclipse.jetty.io,
2324
org.eclipse.jetty.websocket.server,
@@ -28,9 +29,7 @@ Require-Bundle: org.openjdk.jmc.rjmx,
2829
org.eclipse.jetty.ee9.server,
2930
org.eclipse.jetty.server,
3031
org.eclipse.jetty.ee9.websocket.server,
31-
org.eclipse.jetty.servlet-api,
32-
org.openjdk.jmc.ui.websocket,
33-
org.openjdk.jmc.flightrecorder.ui
32+
org.eclipse.jetty.servlet-api
3433
Bundle-ActivationPolicy: lazy
3534
Bundle-Activator: org.openjdk.jmc.flightrecorder.ui.FlightRecorderUI
3635
Export-Package: org.openjdk.jmc.flightrecorder.ui,
@@ -39,4 +38,3 @@ Export-Package: org.openjdk.jmc.flightrecorder.ui,
3938
org.openjdk.jmc.flightrecorder.ui.preferences,
4039
org.openjdk.jmc.flightrecorder.ui.selection
4140
Automatic-Module-Name: org.openjdk.jmc.flightrecorder.ui
42-
Import-Package: org.openjdk.jmc.flightrecorder.ui

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/FlightRecorderUI.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,6 @@ public static IQuantity parseItemListSize(String size) {
143143
}
144144
}
145145

146-
// public static int parseWebsocketPort(String port) {
147-
// try {
148-
// return Integer.parseInt(port);
149-
// } catch (NumberFormatException e) {
150-
// return PreferenceKeys.DEFAULT_WEBSOCKET_PORT;
151-
// }
152-
// }
153-
154-
// public int getWebsocketPort() {
155-
// return parseWebsocketPort(getPreferenceStore().getString(PreferenceKeys.PROPERTY_WEBSOCKET_SERVER_PORT));
156-
// }
157-
158-
// public boolean isWebsocketServerEnabled() {
159-
// int port = getWebsocketPort();
160-
// return port > 0 && port < 65535;
161-
// }
162-
163146
public static String validateDumpTimespan(String text) {
164147
try {
165148
IQuantity timespan = UnitLookup.TIMESPAN.parseInteractive(text);

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/JfrEditor.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
import org.openjdk.jmc.ui.misc.DisplayToolkit;
9191
import org.openjdk.jmc.ui.misc.SelectionProvider;
9292
import org.openjdk.jmc.ui.websocket.WebsocketPlugin;
93-
// import org.openjdk.jmc.ui.websocket.WebsocketServer;
9493

9594
public class JfrEditor extends EditorPart implements INavigationLocationProvider, IPageContainer {
9695

@@ -114,7 +113,6 @@ public class JfrEditor extends EditorPart implements INavigationLocationProvider
114113
private Reference<ResultPage> resultPageRef = new WeakReference<>(null);
115114
private RuleManager ruleEngine;
116115
private IPropertyChangeListener analysisEnabledListener;
117-
// private IPropertyChangeListener websocketServerEnabledListener;
118116

119117
public JfrEditor() {
120118
super();
@@ -126,29 +124,7 @@ public JfrEditor() {
126124
}
127125
}
128126
};
129-
// if (FlightRecorderUI.getDefault().isWebsocketServerEnabled()) {
130-
// int websocketServerPort = FlightRecorderUI.getDefault().getWebsocketPort();
131-
// websocketServer = new WebsocketServer(websocketServerPort);
132-
// }
133-
// websocketServerEnabledListener = e -> {
134-
// if (e.getProperty().equals(PreferenceKeys.PROPERTY_WEBSOCKET_SERVER_PORT)) {
135-
// int newWebsocketServerPort = FlightRecorderUI.parseWebsocketPort((String) e.getNewValue());
136-
// if (newWebsocketServerPort > 0) {
137-
// if (websocketServer != null) {
138-
// websocketServer.shutdown();
139-
// websocketServer = null;
140-
// }
141-
// websocketServer = new WebsocketServer(newWebsocketServerPort);
142-
// } else {
143-
// if (websocketServer != null) {
144-
// websocketServer.shutdown();
145-
// websocketServer = null;
146-
// }
147-
// }
148-
// }
149-
// };
150127
FlightRecorderUI.getDefault().getPreferenceStore().addPropertyChangeListener(analysisEnabledListener);
151-
// FlightRecorderUI.getDefault().getPreferenceStore().addPropertyChangeListener(websocketServerEnabledListener);
152128
}
153129

154130
@Override
@@ -429,7 +405,6 @@ public RuleManager getRuleManager() {
429405
public void dispose() {
430406
ruleEngine.dispose();
431407
FlightRecorderUI.getDefault().getPreferenceStore().removePropertyChangeListener(analysisEnabledListener);
432-
// FlightRecorderUI.getDefault().getPreferenceStore().removePropertyChangeListener(websocketServerEnabledListener);
433408
super.dispose();
434409
}
435410

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/messages/internal/Messages.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,6 @@ public class Messages extends NLS {
470470
public static String PREFERENCES_RULES_CONFIGURE_SELECTED;
471471
public static String PREFERENCES_SHOW_MONITORING_WARNING_TEXT;
472472
public static String PREFERENCES_STACKTRACE_SHOW_HIDDEN_FRAMES;
473-
public static String PREFERENCES_WEBSOCKET_SERVER_PORT_INVALID;
474-
public static String PREFERENCES_WEBSOCKET_SERVER_PORT_TEXT;
475-
public static String PREFERENCES_WEBSOCKET_SERVER_PORT_TOOLTIP;
476473
public static String ProcessesPage_AGGR_CONCURRENT_PROCESSES;
477474
public static String ProcessesPage_AGGR_CONCURRENT_PROCESSES_DESC;
478475
public static String ProcessesPage_AGGR_FIRST_SAMPLE;

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/preferences/GeneralPage.java

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public void setToDefault() {
9393
private Text itemListValue;
9494
private Text propertiesArrayStringSizeValue;
9595
private Text editorRuleEvaluationThreadsValue;
96-
private Text websocketPortValue;
9796

9897
@Override
9998
protected Control createContents(Composite parent) {
@@ -172,21 +171,12 @@ protected Control createContents(Composite parent) {
172171
editorRuleEvaluationThreadsValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
173172
QuantityKindProposal.install(editorRuleEvaluationThreadsValue, UnitLookup.NUMBER);
174173

175-
Label websocketPortLabel = new Label(defaultTimespanContainer, SWT.NONE);
176-
websocketPortLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
177-
websocketPortLabel.setText(Messages.PREFERENCES_WEBSOCKET_SERVER_PORT_TEXT);
178-
websocketPortLabel.setToolTipText(Messages.PREFERENCES_WEBSOCKET_SERVER_PORT_TOOLTIP);
179-
websocketPortValue = new Text(defaultTimespanContainer, SWT.BORDER);
180-
websocketPortValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
181-
QuantityKindProposal.install(websocketPortValue, UnitLookup.NUMBER);
182-
183174
loadDumpTypeFromPrefStore(false);
184175
loadTimespanFromPrefStore(false);
185176
loadSelectionStoreSizeFromPrefStore(false);
186177
loadItemListSizeFromPrefStore(false);
187178
loadPropertiesArrayStringSizeFromPrefStore(false);
188179
loadEditorRuleEvaluationThreadsFromPrefStore(false);
189-
// loadWebsocketPortFromPrefStore(false);
190180
timespanValue.addModifyListener(new ModifyListener() {
191181
@Override
192182
public void modifyText(ModifyEvent e) {
@@ -217,12 +207,6 @@ public void modifyText(ModifyEvent e) {
217207
validatePage();
218208
}
219209
});
220-
websocketPortValue.addModifyListener(new ModifyListener() {
221-
@Override
222-
public void modifyText(ModifyEvent e) {
223-
validatePage();
224-
}
225-
});
226210

227211
return container;
228212
}
@@ -243,23 +227,7 @@ private void validatePage() {
243227
if (error == null && error2 == null && error3 == null) {
244228
setErrorMessage(error4);
245229
}
246-
String error5 = validateWebsocketPort(websocketPortValue.getText());
247-
if (error == null && error2 == null && error3 == null) {
248-
setErrorMessage(error5);
249-
}
250-
setValid(error == null && error2 == null && error3 == null && error4 == null && error5 == null);
251-
}
252-
253-
public static String validateWebsocketPort(String text) {
254-
try {
255-
int port = Integer.parseInt(text);
256-
if (port < 0 || port > 65535) {
257-
return Messages.PREFERENCES_WEBSOCKET_SERVER_PORT_INVALID;
258-
}
259-
} catch (NumberFormatException e) {
260-
return Messages.PREFERENCES_WEBSOCKET_SERVER_PORT_INVALID;
261-
}
262-
return null;
230+
setValid(error == null && error2 == null && error3 == null && error4 == null);
263231
}
264232

265233
public static String validateNumEvaluationThreads(String text) {
@@ -339,52 +307,6 @@ private void loadEditorRuleEvaluationThreadsFromPrefStore(boolean loadDefault) {
339307
editorRuleEvaluationThreadsValue.setText(FlightRecorderUI.parseItemListSize(size).interactiveFormat());
340308
}
341309

342-
// private void loadWebsocketPortFromPrefStore(boolean loadDefault) {
343-
// String port = loadDefault ? getPreferenceStore().getDefaultString(PreferenceKeys.PROPERTY_WEBSOCKET_SERVER_PORT)
344-
// : getPreferenceStore().getString(PreferenceKeys.PROPERTY_WEBSOCKET_SERVER_PORT);
345-
// websocketPortValue.setText(Integer.toString(FlightRecorderUI.parseWebsocketPort(port)));
346-
// }
347-
348-
// private Button createClearButton(Composite parent) {
349-
// Button button = new Button(parent, SWT.NONE);
350-
// button.setText(Messages.PREFERENCES_CLEAR_USER_SETTINGS_TEXT);
351-
// button.addSelectionListener(new SelectionAdapter() {
352-
// @Override
353-
// public void widgetSelected(SelectionEvent e) {
354-
// if (ensureAllEditorsClosed()) {
355-
// showConfirmUserSettingReset();
356-
// }
357-
// }
358-
// });
359-
// return button;
360-
// }
361-
//
362-
// private boolean ensureAllEditorsClosed() {
363-
// for (IEditorReference ref : m_workbench.getActiveWorkbenchWindow().getActivePage().getEditorReferences()) {
364-
// if (JfrEditor.EDITOR_ID.equals(ref.getId())) {
365-
// showMustCloseEditor();
366-
// return false;
367-
// }
368-
// }
369-
// return true;
370-
// }
371-
//
372-
// private void showMustCloseEditor() {
373-
// MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_INFORMATION);
374-
// messageBox.setMessage(Messages.PREFERENCES_OPEN_FLIGHT_RECORDING_DIALOG_TEXT);
375-
// messageBox.setText(Messages.PREFERENCES_OPEN_FLIGHT_RECORDING_DIALOG_TITLE);
376-
// messageBox.open();
377-
// }
378-
//
379-
// private void showConfirmUserSettingReset() {
380-
// MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_WARNING | SWT.YES | SWT.NO);
381-
// messageBox.setMessage(Messages.PREFERENCES_RESET_USER_SETTINGS_DIALOG_TEXT);
382-
// messageBox.setText(Messages.PREFERENCES_RESET_USER_SETTINGS_DIALOG_TITLE);
383-
// if (messageBox.open() == SWT.YES) {
384-
// ComponentsPlugin.getDefault().getUserInterfaceRepository().clearUserSettings(JfrEditor.EDITOR_ID);
385-
// }
386-
// }
387-
388310
private Button createRemoveRecordingsCheckBox(Composite parent) {
389311
return createCheckBox(parent, Messages.PREFERENCES_REMOVE_FINISHED_RECORDING_TEXT,
390312
PreferenceKeys.PROPERTY_REMOVE_FINISHED_RECORDING);
@@ -431,7 +353,6 @@ protected void performDefaults() {
431353
loadItemListSizeFromPrefStore(true);
432354
loadPropertiesArrayStringSizeFromPrefStore(true);
433355
loadEditorRuleEvaluationThreadsFromPrefStore(true);
434-
// loadWebsocketPortFromPrefStore(true);
435356
super.performDefaults();
436357
}
437358

@@ -483,13 +404,6 @@ public boolean performOk() {
483404
setErrorMessage(qce.getLocalizedMessage());
484405
return false;
485406
}
486-
try {
487-
int port = Integer.parseInt(websocketPortValue.getText());
488-
getPreferenceStore().setValue(PreferenceKeys.PROPERTY_WEBSOCKET_SERVER_PORT, Integer.toString(port));
489-
} catch (NumberFormatException e) {
490-
setErrorMessage(Messages.PREFERENCES_WEBSOCKET_SERVER_PORT_INVALID);
491-
return false;
492-
}
493407

494408
setErrorMessage(null);
495409
if (timespanRadio.getSelection()) {

application/org.openjdk.jmc.flightrecorder.ui/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal/messages.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ NAVIGATOR_ZOOM_OUT_TEXT=Zoom Out
405405

406406
PREFERENCES_CONFIRM_REMOVE_TEMPLATE_TEXT=Ask for confirmation before removing flight recording templates
407407
PREFERENCES_ENABLE_RECORDING_ANALYSIS=Enable flight recording analysis
408-
PREFERENCES_WEBSOCKET_SERVER_PORT_TEXT=Websocket server port (set to 0 to disable)
409-
PREFERENCES_WEBSOCKET_SERVER_PORT_TOOLTIP=Start a websocket server bound to 127.0.0.1 and the selected port. The server pushes updates whenever the selection changes in the UI.
410408
PREFERENCES_INCLUDE_EXPERIMENTAL_EVENTS_AND_FIELDS=Include experimental events and fields when reading flight recording files
411409
PREFERENCES_ALLOW_INCOMPLETE_RECORDING_FILE=Enable reading of incomplete flight recording files
412410
PREFERENCES_STACKTRACE_SHOW_HIDDEN_FRAMES=Show hidden frames in stacktraces
@@ -417,7 +415,6 @@ PREFERENCES_ENABLED_RULES=Enabled Rules
417415
PREFERENCES_EVALUATION_THREAD_NUMBER_TEXT=Number of rule evaluation threads:
418416
PREFERENCES_EVALUATION_THREAD_NUMBER_TOOLTIP=This sets the number of threads each editor will create and run in parallel to evaluate rules for that flight recording.
419417
PREFERENCES_EVALUATION_THREAD_NUMBER_LESS_THAN_ONE=Number of rule evaluation threads: Must be at least 1
420-
PREFERENCES_WEBSOCKET_SERVER_PORT_INVALID=Websocket server port must be a number between 0 and 65535
421418
# {0} is an exception message
422419
PREFERENCES_EVALUATION_THREAD_NUMBER_UNPARSEABLE=Number of rule evaluation threads: {0}
423420
PREFERENCES_PROPERTIES_ARRAY_STRING_SIZE_TEXT=Maximum display length of arrays in Properties view

application/org.openjdk.jmc.ui.websocket/build.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
#
55
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
#
7-
# The contents of this file are subject to the terms of either the Universal Permissive License
7+
# The contents of this file are subject to the terms of either the Universal Permissive License
88
# v 1.0 as shown at https://oss.oracle.com/licenses/upl
9-
#
9+
#
1010
# or the following license:
11-
#
11+
#
1212
# Redistribution and use in source and binary forms, with or without modification, are permitted
1313
# provided that the following conditions are met:
14-
#
14+
#
1515
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
1616
# and the following disclaimer.
17-
#
17+
#
1818
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
1919
# conditions and the following disclaimer in the documentation and/or other materials provided with
2020
# the distribution.
21-
#
21+
#
2222
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to
2323
# endorse or promote products derived from this software without specific prior written permission.
2424
#

application/org.openjdk.jmc.ui.websocket/plugin.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
#
55
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
#
7-
# The contents of this file are subject to the terms of either the Universal Permissive License
7+
# The contents of this file are subject to the terms of either the Universal Permissive License
88
# v 1.0 as shown at https://oss.oracle.com/licenses/upl
9-
#
9+
#
1010
# or the following license:
11-
#
11+
#
1212
# Redistribution and use in source and binary forms, with or without modification, are permitted
1313
# provided that the following conditions are met:
14-
#
14+
#
1515
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
1616
# and the following disclaimer.
17-
#
17+
#
1818
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
1919
# conditions and the following disclaimer in the documentation and/or other materials provided with
2020
# the distribution.
21-
#
21+
#
2222
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to
2323
# endorse or promote products derived from this software without specific prior written permission.
2424
#

application/org.openjdk.jmc.ui.websocket/plugin.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
<!--
33
Copyright (c) 2025 Oracle and/or its affiliates. All rights reserved.
44
Copyright (c) 2025 IBM Corporation. All rights reserved.
5-
5+
66
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7-
8-
The contents of this file are subject to the terms of either the Universal Permissive License
7+
8+
The contents of this file are subject to the terms of either the Universal Permissive License
99
v 1.0 as shown at https://oss.oracle.com/licenses/upl
10-
10+
1111
or the following license:
12-
12+
1313
Redistribution and use in source and binary forms, with or without modification, are permitted
1414
provided that the following conditions are met:
15-
15+
1616
1. Redistributions of source code must retain the above copyright notice, this list of conditions
1717
and the following disclaimer.
18-
18+
1919
2. Redistributions in binary form must reproduce the above copyright notice, this list of
2020
conditions and the following disclaimer in the documentation and/or other materials provided with
2121
the distribution.
22-
22+
2323
3. Neither the name of the copyright holder nor the names of its contributors may be used to
2424
endorse or promote products derived from this software without specific prior written permission.
25-
25+
2626
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
2727
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
2828
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR

0 commit comments

Comments
 (0)