IDEA-372324 Unable to open debugger port (*:63992): java.net.ConnectException "Connection refused: connect"

implementing RemoteConnectionCreator to patch RemoteConnection with "*" host

GitOrigin-RevId: a05f60aec330697f6ca370ef9370ea96d4dfc16b
This commit is contained in:
Dmitry Avdeev
2025-05-12 17:16:56 +02:00
committed by intellij-monorepo-bot
parent e3d317a025
commit 61906fad53
2 changed files with 6 additions and 8 deletions

View File

@@ -125,10 +125,8 @@ public class GenericDebuggerRunner implements JvmPatchableProgramRunner<GenericD
return attachVirtualMachine(state, environment, connection, true);
}
if (state instanceof PatchedRunnableState patchedRunnableState) {
RemoteConnection connection =
doPatch(new JavaParameters(), environment.getRunnerSettings(), true, environment.getProject());
patchedRunnableState.patchConnection(connection);
if (state instanceof PatchedRunnableState) {
RemoteConnection connection = createPatchedConnection(environment);
return attachVirtualMachine(state, environment, connection, true);
}
@@ -217,6 +215,10 @@ public class GenericDebuggerRunner implements JvmPatchableProgramRunner<GenericD
.runCustomPatchers(javaParameters, Executor.EXECUTOR_EXTENSION_NAME.findExtensionOrFail(DefaultDebugExecutor.class), runProfile);
}
public static RemoteConnection createPatchedConnection(@NotNull ExecutionEnvironment environment) throws ExecutionException {
return doPatch(new JavaParameters(), environment.getRunnerSettings(), true, environment.getProject());
}
private static RemoteConnection doPatch(@NotNull JavaParameters javaParameters,
@NotNull RunnerSettings settings,
boolean beforeExecution,

View File

@@ -15,9 +15,5 @@
*/
package com.intellij.execution.configurations;
import org.jetbrains.annotations.ApiStatus;
public interface PatchedRunnableState extends RunProfileState {
@ApiStatus.Internal
default void patchConnection(RemoteConnection connection) {}
}