Skip to content

Commit

Permalink
rework Optional.of(bytecodeDecompilerView.getLastClassloader()) to st…
Browse files Browse the repository at this point in the history
…op reformatting itself
  • Loading branch information
judovana committed Nov 21, 2023
1 parent 245ae81 commit ca4f208
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,8 @@ public void mouseClicked(MouseEvent mouseEvent) {
ActionEvent event = new ActionEvent(localVmList, 0, null);
vmChangingListener.actionPerformed(event);
} else if (SwingUtilities.isRightMouseButton(mouseEvent)) {
new JListPopupMenu<>(
localVmList, true, bytecodeDecompilerView.getDependenciesReader(),
bytecodeDecompilerView.isLastClassloader() ? Optional.of(bytecodeDecompilerView.getLastClassloader()) : Optional.empty()
).addItem("name(s)", VmInfo::getVmName, true).addItem("PID(s)", vmInfo -> String.valueOf(vmInfo.getVmPid()), false)
new JListPopupMenu<>(localVmList, true, bytecodeDecompilerView.getDependenciesReader(), getLoaderForPopup())
.addItem("name(s)", VmInfo::getVmName, true).addItem("PID(s)", vmInfo -> String.valueOf(vmInfo.getVmPid()), false)
.addItem("PORT(s)", vmInfo -> {
if (vmInfo.getVmDecompilerStatus() != null) {
return String.valueOf(vmInfo.getVmDecompilerStatus().getListenPort());
Expand All @@ -670,4 +668,12 @@ public void mouseClicked(MouseEvent mouseEvent) {
}
}

private Optional<String> getLoaderForPopup() {
if (bytecodeDecompilerView.isLastClassloader()) {
return Optional.of(bytecodeDecompilerView.getLastClassloader());
} else {
return Optional.empty();
}
}

}

0 comments on commit ca4f208

Please sign in to comment.