Skip to content

Commit

Permalink
console: cleaner java code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
nmschulte committed Mar 9, 2024
1 parent ff413f3 commit ba99bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ public static void startSimulator() {
public static File getSimulatorBinary(String binaryPath) {
File binary = new File(binaryPath + SIMULATOR_BINARY_NAME);

if (!binary.exists()) // try also for Windows/PE executable
if (!binary.exists()) { // try also for Windows/PE executable
binary = new File(binaryPath + ".exe");
}

if (!binary.exists() || binary.isDirectory() || !binary.canExecute())
if (!binary.exists() || binary.isDirectory() || !binary.canExecute()) {
throw new IllegalStateException("FOME Simulator program not found");
}

return binary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public static JComponent createSimulatorComponent(final StartupFrame portSelecto
return new JLabel(e.getMessage());
}

if (TcpConnector.isTcpPortOpened())
if (TcpConnector.isTcpPortOpened()) {
return new JLabel("Port " + TcpConnector.DEFAULT_PORT + " already busy. Simulator running?");
}

JButton simulatorButton = new JButton("Start Virtual Simulator");
simulatorButton.addActionListener(new ActionListener() {
Expand Down

0 comments on commit ba99bb7

Please sign in to comment.