Skip to content

Commit 17affab

Browse files
committed
notifyJfrStopFailed() added
1 parent c8f40b1 commit 17affab

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

visualvm/jfr/src/org/graalvm/visualvm/jfr/impl/Bundle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ LBL_JFR_Dumps=JFR Dumps
6464

6565
MSG_Cannot_Take_JFR_dump=Cannot take JFR dump for {0}
6666

67+
MSG_Cannot_Stop_JFR=Cannot stop JFR recording for {0}
68+
6769
LBL_Creating_JFR_Dump=Creating JFR Dump...
6870

6971
LBL_Loading_JFR_Dump=Loading JFR dump...

visualvm/jfr/src/org/graalvm/visualvm/jfr/impl/JFRRecordingProvider.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void run() {
116116
pHandle.setInitialDelay(0);
117117
pHandle.start();
118118
if (!jvm.stopJfrRecording()) {
119-
notifyJfrDumpFailed(application);
119+
notifyJfrStopFailed(application);
120120
} else {
121121
Set<DataSource> ds = ActionUtils.getSelectedDataSources();
122122
JFRDumpAction.instance().updateState(ds);
@@ -369,6 +369,13 @@ private void notifyJfrDumpFailed(final DataSource dataSource) {
369369
NotifyDescriptor.ERROR_MESSAGE));
370370
}
371371

372+
private void notifyJfrStopFailed(final DataSource dataSource) {
373+
String displayName = DataSourceDescriptorFactory.getDescriptor(dataSource).getName();
374+
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(NbBundle.getMessage(JFRRecordingProvider.class,
375+
"MSG_Cannot_Stop_JFR", displayName), // NOI18N
376+
NotifyDescriptor.ERROR_MESSAGE));
377+
}
378+
372379
private class SnapshotListener implements DataChangeListener<Snapshot> {
373380

374381
public void dataChanged(DataChangeEvent<Snapshot> event) {

0 commit comments

Comments
 (0)