lahodaj commented on PR #7993:
URL: https://github.com/apache/netbeans/pull/7993#issuecomment-2501385783
This may need a bit more, to avoid the `mainClass`/`mainFilePath` being
re-computed in `NbLaunchRequestHandler`. Unless I am missing something. Seems
like something like this:
```
diff --git
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
index 8fe3046049..0b1a26d387 100644
---
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
+++
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
@@ -87,9 +87,10 @@ public final class NbLaunchRequestHandler {
String filePath = (String)launchArguments.get("file");
String projectFilePath = (String)launchArguments.get("projectFile");
String mainFilePath = (String)launchArguments.get("mainClass");
+ boolean testRun = (Boolean) launchArguments.getOrDefault("testRun",
Boolean.FALSE);
if (!isNative && (StringUtils.isBlank(mainFilePath) &&
StringUtils.isBlank(filePath) && StringUtils.isBlank(projectFilePath)
- || modulePaths.isEmpty() &&
classPaths.isEmpty())) {
+ || modulePaths.isEmpty() && classPaths.isEmpty())
&& !testRun) {
if (modulePaths.isEmpty() && classPaths.isEmpty()) {
ErrorUtilities.completeExceptionally(resultFuture,
"Failed to launch debuggee VM. Missing
modulePaths/classPaths options in launch configuration.",
@@ -244,7 +245,6 @@ public final class NbLaunchRequestHandler {
context.setSourcePaths((String[])
launchArguments.get("sourcePaths"));
}
String singleMethod = (String)launchArguments.get("methodName");
- boolean testRun = (Boolean) launchArguments.getOrDefault("testRun",
Boolean.FALSE);
activeLaunchHandler.nbLaunch(file, preferProjActions,
nativeImageFile, singleMethod, launchArguments, context, !noDebug, testRun, new
OutputListener(context)).thenRun(() -> {
activeLaunchHandler.postLaunch(launchArguments, context);
resultFuture.complete(null);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists