diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
index 6000a4b9eda2..00a973e4a306 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
@@ -474,17 +474,21 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
if (timeoutArg != null) {
timeoutArg.setValue("0"); // wait forever
}
- String listeningAddress = connector.startListening(myArguments);
- String port = StringUtil.substringAfter(listeningAddress, ":");
- if (port != null) {
- listeningAddress = port;
- }
- myConnection.setAddress(listeningAddress);
-
- myDebugProcessDispatcher.getMulticaster().connectorIsReady();
try {
+ String listeningAddress = connector.startListening(myArguments);
+ String port = StringUtil.substringAfter(listeningAddress, ":");
+ if (port != null) {
+ listeningAddress = port;
+ }
+ myConnection.setAddress(listeningAddress);
+
+ myDebugProcessDispatcher.getMulticaster().connectorIsReady();
+
return connector.accept(myArguments);
}
+ catch (IllegalArgumentException e) {
+ throw new CantRunException(e.getLocalizedMessage());
+ }
finally {
if(myArguments != null) {
try {
diff --git a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.form b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.form
index 4d422a7538c7..e2f091d39508 100644
--- a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.form
+++ b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.form
@@ -51,7 +51,7 @@
-
+
diff --git a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.java b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.java
index b364546d6af5..fa0407cc14df 100644
--- a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.java
+++ b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfigurable.java
@@ -1,18 +1,4 @@
-/*
- * Copyright 2000-2016 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Class RemoteConfigurable
@@ -31,6 +17,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.LabeledComponent;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.DocumentAdapter;
+import com.intellij.ui.components.fields.IntegerField;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -47,7 +34,7 @@ public class RemoteConfigurable extends SettingsEditor {
private JRadioButton myRbAttach;
private JTextField myAddressField;
private JTextField myHostField;
- private JTextField myPortField;
+ private IntegerField myPortField;
private JPanel myShmemPanel;
private JPanel mySocketPanel;
private ConfigurationArgumentsHelpArea myHelpArea;
@@ -147,6 +134,9 @@ public class RemoteConfigurable extends SettingsEditor {
configuration.SHMEM_ADDRESS = null;
}
configuration.USE_SOCKET_TRANSPORT = myRbSocket.isSelected();
+ if (configuration.USE_SOCKET_TRANSPORT) {
+ myPortField.validateContent();
+ }
configuration.SERVER_MODE = myRbListen.isSelected();
myModuleSelector.applyTo(configuration);
}
@@ -199,5 +189,7 @@ public class RemoteConfigurable extends SettingsEditor {
myJDK13HelpArea.updateText("-Xnoagent -Djava.compiler=NONE " + cmdLine);
}
-
+ private void createUIComponents() {
+ myPortField = new IntegerField("Port", 0, 0xFFFF);
+ }
}
\ No newline at end of file