We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5068751 commit 76e0327Copy full SHA for 76e0327
src/javarepl/Main.java
@@ -111,10 +111,10 @@ private static String welcomeInstructions() {
111
private static JavaREPLClient clientFor(Option<String> hostname, Option<Integer> port) throws Exception {
112
console.printInfo(welcomeMessage());
113
114
- if (hostname.isEmpty() && port.isEmpty()) {
115
- return startNewLocalInstance("localhost", randomServerPort());
+ if (hostname.isDefined() && port.isDefined()) {
+ return connectToRemoteInstance(hostname.get(), port.getOrElse(randomServerPort()));
116
} else {
117
- return connectToRemoteInstance(hostname.getOrElse("localhost"), port.getOrElse(randomServerPort()));
+ return startNewLocalInstance("localhost", port.getOrElse(randomServerPort()));
118
}
119
120
0 commit comments