[netbeans] branch master updated: Add debugger listening connector to LSP.

2022-10-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new dfe012cdd4 Add debugger listening connector to LSP.
dfe012cdd4 is described below

commit dfe012cdd4a5a488d6f55e33bb7f2b47c08d7080
Author: Martin Entlicher 
AuthorDate: Fri Oct 7 17:24:58 2022 +0200

Add debugger listening connector to LSP.
---
 .../debugging/attach/AttachConfigurations.java | 18 ---
 .../debugging/attach/ConfigurationAttributes.java  | 22 ++
 .../debugging/attach/NbAttachRequestHandler.java   | 27 ++
 java/java.lsp.server/vscode/package.json   |  5 
 4 files changed, 56 insertions(+), 16 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurations.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurations.java
index 6e501784cb..3a79ead521 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurations.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurations.java
@@ -20,6 +20,8 @@ package org.netbeans.modules.java.lsp.server.debugging.attach;
 
 import com.sun.jdi.Bootstrap;
 import com.sun.jdi.connect.AttachingConnector;
+import com.sun.jdi.connect.Connector;
+import com.sun.jdi.connect.ListeningConnector;
 import com.sun.tools.attach.AttachNotSupportedException;
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.VirtualMachineDescriptor;
@@ -59,16 +61,21 @@ public final class AttachConfigurations {
 
 private final List configurations;
 
-private AttachConfigurations(List attachingConnectors) 
{
+private AttachConfigurations(List attachingConnectors) {
 List configs = new ArrayList<>(5);
-for (AttachingConnector ac : attachingConnectors) {
+for (Connector ac : attachingConnectors) {
 configs.add(new ConfigurationAttributes(ac));
 }
 this.configurations = Collections.unmodifiableList(configs);
 }
 
 public static AttachConfigurations get() {
-return new 
AttachConfigurations(Bootstrap.virtualMachineManager().attachingConnectors());
+List attachingConnectors = 
Bootstrap.virtualMachineManager().attachingConnectors();
+List listeningConnectors = 
Bootstrap.virtualMachineManager().listeningConnectors();
+List connectors = new 
ArrayList<>(attachingConnectors.size() + listeningConnectors.size());
+connectors.addAll(attachingConnectors);
+connectors.addAll(listeningConnectors);
+return new AttachConfigurations(connectors);
 }
 
 public static CompletableFuture findConnectors() {
@@ -111,7 +118,12 @@ public final class AttachConfigurations {
 return null;
 }
 Set names = attributes.keySet();
+Object listenValue = attributes.get("listen");
+boolean listen = listenValue != null && ("true".equals(listenValue) || 
Boolean.TRUE.equals(listenValue));
 for (ConfigurationAttributes config : configurations) {
+if (listen != (config.getConnector() instanceof 
ListeningConnector)) {
+continue;
+}
 if (config.areMandatoryAttributesIn(names)) {
 return config;
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/ConfigurationAttributes.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/ConfigurationAttributes.java
index 82d4083faf..58ba4f9d21 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/ConfigurationAttributes.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/ConfigurationAttributes.java
@@ -20,6 +20,7 @@ package org.netbeans.modules.java.lsp.server.debugging.attach;
 
 import com.sun.jdi.connect.AttachingConnector;
 import com.sun.jdi.connect.Connector;
+import com.sun.jdi.connect.ListeningConnector;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -39,13 +40,14 @@ final class ConfigurationAttributes {
 private static final String CONNECTOR_PROCESS = 
"com.sun.jdi.ProcessAttach";// NOI18N
 private static final String CONNECTOR_SOCKET = "com.sun.jdi.SocketAttach"; 
 // NOI18N
 private static final String CONNECTOR_SHMEM = 
"com.sun.jdi.SharedMemoryAttach"; // NOI18N
+private static final String CONNECTOR_SOCKET_LISTEN = 
"com.sun.jdi.SocketListen";  // NOI18N
 
 static final String PROCESS_ARG_PID = "processId";  // NOI18N
 static final String SOCKET_ARG_HOST = "hostName&q

[netbeans] branch master updated: The CPPLight debugger works on aarch64.

2022-09-22 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 98957f72c9 The CPPLight debugger works on aarch64.
98957f72c9 is described below

commit 98957f72c993a3b801ce77ca83d9bd73c722b5cc
Author: Martin Entlicher 
AuthorDate: Fri Jul 1 21:08:10 2022 +0200

The CPPLight debugger works on aarch64.
---
 .../modules/cpplite/debugger/CPPLiteDebugger.java  |   2 +-
 ide/dlight.nativeexecution/external/binaries-list  |   2 +-
 ...hlp-1.0-license.txt => exechlp-1.2-license.txt} |   2 +-
 .../nbproject/project.properties   | 143 +++--
 .../release/bin/nativeexecution/hostinfo.sh|   4 +-
 .../modules/nativeexecution/api/HostInfo.java  |   1 +
 .../nativeexecution/api/pty/PtySupport.java|   3 +-
 .../api/util/MacroExpanderFactory.java |   2 +-
 .../nativeexecution/api/util/UnbufferSupport.java  |   5 +-
 ide/dlight.nativeexecution/tools/Makefile  |   1 +
 ide/dlight.nativeexecution/tools/killall/Makefile  |   2 +
 ide/dlight.nativeexecution/tools/pty/Makefile  |   1 +
 ide/dlight.nativeexecution/tools/unbuffer/Makefile |   2 +
 13 files changed, 93 insertions(+), 77 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 2f143c6a14..7435261f83 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -388,7 +388,7 @@ public final class CPPLiteDebugger {
 return ;
 }
 breakpointsHandler.dispose();
-if (sendExit) {
+if (sendExit && proxy != null) {
 proxy.send(new Command("-gdb-exit"));
 }
 Utils.unmarkCurrent ();
diff --git a/ide/dlight.nativeexecution/external/binaries-list 
b/ide/dlight.nativeexecution/external/binaries-list
index f33e33e755..e2eb41e8c8 100644
--- a/ide/dlight.nativeexecution/external/binaries-list
+++ b/ide/dlight.nativeexecution/external/binaries-list
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-89E5CF21801B51580FF00D6CC1209676EDE420FA exechlp-1.0.zip
+4B4DCA62F8C4A1954AE6D286955C36CC50B8CC3A exechlp-1.2.zip
diff --git a/ide/dlight.nativeexecution/external/exechlp-1.0-license.txt 
b/ide/dlight.nativeexecution/external/exechlp-1.2-license.txt
similarity index 99%
rename from ide/dlight.nativeexecution/external/exechlp-1.0-license.txt
rename to ide/dlight.nativeexecution/external/exechlp-1.2-license.txt
index b71517ad3a..6235148193 100644
--- a/ide/dlight.nativeexecution/external/exechlp-1.0-license.txt
+++ b/ide/dlight.nativeexecution/external/exechlp-1.2-license.txt
@@ -1,6 +1,6 @@
 Name: exechlp
 Description: binaries that used by dlight.nativeexecution module 
(process_start, pty, pty_open - used for dealing with pseude terminals; 
sigqueue, killall - sending signals to processes; stat - getting detailed file 
information; unbuffer.so - used when unbuffering is required)
-Version: 1.0
+Version: 1.2
 License: CDDL-1.0
 Origin: NetBeans
 Comment: needed for dlight.nativeexecution module to provide system-dependent 
services
diff --git a/ide/dlight.nativeexecution/nbproject/project.properties 
b/ide/dlight.nativeexecution/nbproject/project.properties
index 350e9d08b1..5562ead990 100644
--- a/ide/dlight.nativeexecution/nbproject/project.properties
+++ b/ide/dlight.nativeexecution/nbproject/project.properties
@@ -40,72 +40,79 @@ test.config.stableBTD.excludes=\
 **/TerminalConfigurationProviderTest.class,\
 **/WindowsSupportTest.class
 
-release.external/exechlp-1.0.zip!/Linux-x86/process_start   = 
bin/nativeexecution/Linux-x86/process_start
-release.external/exechlp-1.0.zip!/Linux-x86/pty = 
bin/nativeexecution/Linux-x86/pty
-release.external/exechlp-1.0.zip!/Linux-x86/pty_open= 
bin/nativeexecution/Linux-x86/pty_open
-release.external/exechlp-1.0.zip!/Linux-x86/sigqueue= 
bin/nativeexecution/Linux-x86/sigqueue
-release.external/exechlp-1.0.zip!/Linux-x86/stat= 
bin/nativeexecution/Linux-x86/stat
-release.external/exechlp-1.0.zip!/Linux-x86/unbuffer.so = 
bin/nativeexecution/Linux-x86/unbuffer.so
-release.external/exechlp-1.0.zip!/Linux-x86/killall = 
bin/nativeexecution/Linux-x86/killall
-release.external/exechlp-1.0.zip!/Linux-x86_64/process_start= 
bin/nativeexecution/Linux-x86_64/process_start
-release.external/exechlp-1.0.zip!/Linux-x86_64/pty  = 
bin/nativeexecution/Linux-x86_64/pty
-release.external/exechlp-1.0.zip!/

[netbeans] branch master updated: Output from pty is fully read after debugger exit.

2022-07-11 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1b0f60d47a Output from pty is fully read after debugger exit.
1b0f60d47a is described below

commit 1b0f60d47a0a5b8b208aec55a76aa5f93cb154fe
Author: Martin Entlicher 
AuthorDate: Tue Jun 28 23:13:30 2022 +0200

Output from pty is fully read after debugger exit.
---
 .../modules/cpplite/debugger/CPPLiteDebugger.java  | 106 +++--
 .../utils/InputStreamWithCloseDetection.java   | 105 +
 .../modules/cpplite/debugger/OutputTest.java   | 126 +
 .../extexecution/base/ProcessInputStream.java  |  11 +-
 .../base/input/DefaultInputReader.java |   2 +-
 5 files changed, 308 insertions(+), 42 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index bb41a6fec1..2f143c6a14 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -60,6 +60,7 @@ import org.netbeans.modules.cnd.debugger.gdb2.mi.MITList;
 import org.netbeans.modules.cnd.debugger.gdb2.mi.MITListItem;
 import org.netbeans.modules.cnd.debugger.gdb2.mi.MIValue;
 import org.netbeans.modules.cpplite.debugger.breakpoints.CPPLiteBreakpoint;
+import 
org.netbeans.modules.cpplite.debugger.utils.InputStreamWithCloseDetection;
 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
 import org.netbeans.modules.nativeexecution.api.pty.Pty;
 import org.netbeans.modules.nativeexecution.api.pty.PtySupport;
@@ -77,6 +78,7 @@ import org.openide.text.Annotatable;
 import org.openide.text.Line;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
 import org.openide.util.Pair;
 import org.openide.util.RequestProcessor;
 
@@ -89,10 +91,8 @@ public final class CPPLiteDebugger {
 
 private static final Logger LOGGER = 
Logger.getLogger(CPPLiteDebugger.class.getName());
 
-private CPPLiteDebuggerConfig   configuration;
-private CPPLiteDebuggerEngineProvider   engineProvider;
-private ContextProvider contextProvider;
-private Process debuggee;
+private final CPPLiteDebuggerEngineProvider   engineProvider;
+private final ContextProvider   contextProvider;
 private LiteMIProxy proxy;
 private volatile Object currentLine;
 private volatile booleansuspended = false;
@@ -102,18 +102,15 @@ public final class CPPLiteDebugger {
 private final ThreadsCollector  threadsCollector = new 
ThreadsCollector(this);
 private volatile CPPThread  currentThread;
 private volatile CPPFrame   currentFrame;
-private AtomicInteger   exitCode = new AtomicInteger();
+private final AtomicInteger exitCode = new AtomicInteger();
 
 public CPPLiteDebugger(ContextProvider contextProvider) {
 this.contextProvider = contextProvider;
-configuration = contextProvider.lookupFirst(null, 
CPPLiteDebuggerConfig.class);
 // init engineProvider
 engineProvider = (CPPLiteDebuggerEngineProvider) 
contextProvider.lookupFirst(null, DebuggerEngineProvider.class);
 }
 
 void setDebuggee(Process debuggee, boolean printObjects) {
-this.debuggee = debuggee;
-
 CPPLiteInjector injector = new 
CPPLiteInjector(debuggee.getOutputStream());
 
 this.proxy = new LiteMIProxy(injector, "(gdb)", "UTF-8");
@@ -129,7 +126,7 @@ public final class CPPLiteDebugger {
 Exceptions.printStackTrace(ex);
 }
 // Debug I/O has finished.
-finish(false);
+proxy.close();
 }).start();
 
 proxy.waitStarted();
@@ -148,6 +145,7 @@ public final class CPPLiteDebugger {
 proxy.send(new Command("-exec-run"));
 }
 
+@NbBundle.Messages("MSG_DebuggerDisconnected=Debugger is disconnected")
 private static class CPPLiteInjector implements MICommandInjector {
 
 private final OutputStream out;
@@ -163,10 +161,16 @@ public final class CPPLiteDebugger {
 out.write(data.getBytes());
 out.flush();
 } catch (IOException ex) {
-throw new IllegalStateException(ex);
+
Exceptions.printStackTrace(Exceptions.attachLocalizedMessage(ex, 
Bundle.MSG_DebuggerDisconnected()));
 }
 }
 
+void close() {
+try {
+out.close();
+} catch (IOException ex) {}
+}
+
   

[netbeans] branch master updated: Groovy debugger in a separate module, depends on Groovy parser to retrieve names of Groovy classes.

2022-05-27 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 70b588e4c8 Groovy debugger in a separate module, depends on Groovy 
parser to retrieve names of Groovy classes.
70b588e4c8 is described below

commit 70b588e4c8245d5075821405b9012d35363bbf71
Author: Martin Entlicher 
AuthorDate: Thu May 26 00:52:13 2022 +0200

Groovy debugger in a separate module, depends on Groovy parser to retrieve 
names of Groovy classes.
---
 groovy/groovy.debug/build.xml  |  25 
 groovy/groovy.debug/manifest.mf|   6 +
 .../nbproject/project.properties}  |   6 +-
 groovy/groovy.debug/nbproject/project.xml  | 154 
 .../netbeans/modules/groovy}/debug/Context.java|   6 +-
 .../debug/GroovyBreakpointActionsProvider.java |   9 +-
 .../debug/GroovyBreakpointAnnotationListener.java  |  27 ++--
 .../groovy/debug/GroovyBreakpointStratifier.java   | 157 +
 .../modules/groovy}/debug/GroovySmartStepping.java |   2 +-
 .../GroovyToggleBreakpointActionProvider.java  |  43 +++---
 .../groovy/debug/resources/Bundle.properties}  |   5 +-
 .../modules/groovy/debug}/resources/layer.xml  |  17 +--
 groovy/groovy.editor/nbproject/project.xml |   1 +
 groovy/groovy.kit/nbproject/project.xml|   7 +
 groovy/groovy.support/nbproject/project.xml|  18 ---
 ...etbeans.spi.viewmodel.NodeActionsProviderFilter |  18 ---
 .../support/debug/GroovyLineBreakpointFactory.java | 121 
 .../modules/groovy/support/resources/layer.xml |  12 +-
 groovy/libs.groovy/nbproject/project.xml   |   1 +
 java/api.debugger.jpda/apichanges.xml  |  14 ++
 java/api.debugger.jpda/manifest.mf |   2 +-
 .../netbeans/api/debugger/jpda/LineBreakpoint.java |   8 ++
 .../spi/debugger/jpda/BreakpointStratifier.java|  52 +++
 .../jpda/breakpoints/BreakpointsReader.java|   7 +-
 java/java.lsp.server/nbproject/project.xml |   2 +-
 .../breakpoints/GroovyBreakpointFactory.java   | 110 ---
 .../server/debugging/breakpoints/NbBreakpoint.java |   8 +-
 nbbuild/cluster.properties |   1 +
 28 files changed, 488 insertions(+), 351 deletions(-)

diff --git a/groovy/groovy.debug/build.xml b/groovy/groovy.debug/build.xml
new file mode 100644
index 00..6f5b102f70
--- /dev/null
+++ b/groovy/groovy.debug/build.xml
@@ -0,0 +1,25 @@
+
+
+
+Builds, tests, and runs the project 
org.netbeans.modules.groovy.debug
+
+
diff --git a/groovy/groovy.debug/manifest.mf b/groovy/groovy.debug/manifest.mf
new file mode 100644
index 00..e04d36c7fe
--- /dev/null
+++ b/groovy/groovy.debug/manifest.mf
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+AutoUpdate-Show-In-Client: false
+OpenIDE-Module: org.netbeans.modules.groovy.debug/1
+OpenIDE-Module-Layer: org/netbeans/modules/groovy/debug/resources/layer.xml
+OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/groovy/debug/resources/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
diff --git 
a/groovy/groovy.support/src/META-INF.debugger/org.netbeans.api.debugger.LazyDebuggerManagerListener
 b/groovy/groovy.debug/nbproject/project.properties
similarity index 86%
rename from 
groovy/groovy.support/src/META-INF.debugger/org.netbeans.api.debugger.LazyDebuggerManagerListener
rename to groovy/groovy.debug/nbproject/project.properties
index 358ce86cc0..c0d9833995 100644
--- 
a/groovy/groovy.support/src/META-INF.debugger/org.netbeans.api.debugger.LazyDebuggerManagerListener
+++ b/groovy/groovy.debug/nbproject/project.properties
@@ -14,5 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-org.netbeans.modules.groovy.support.debug.GroovyBreakpointAnnotationListener
+javac.compilerargs=-Xlint -Xlint:-serial
+javac.source=1.8
+cp.extra=${tools.jar}
+nbm.homepage=http://wiki.netbeans.org/groovy
diff --git a/groovy/groovy.debug/nbproject/project.xml 
b/groovy/groovy.debug/nbproject/project.xml
new file mode 100644
index 00..60ed07c1a2
--- /dev/null
+++ b/groovy/groovy.debug/nbproject/project.xml
@@ -0,0 +1,154 @@
+
+
+http://www.netbeans.org/ns/project/1";>
+org.netbeans.modules.apisupport.project
+
+http://www.netbeans.org/ns/nb-module-project/3";>
+org.netbeans.modules.groovy.debug
+
+
+
org.netbeans.api.annotations.common
+
+
+
+1
+1.1
+
+
+
+org.netbe

[netbeans] branch master updated: Correction of getOwningClass(), including a test.

2022-05-27 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new ef8fcd7339 Correction of getOwningClass(), including a test.
ef8fcd7339 is described below

commit ef8fcd7339e69845c646aa028672c4b26f13a3ef
Author: Martin Entlicher 
AuthorDate: Thu May 26 00:31:47 2022 +0200

Correction of getOwningClass(), including a test.
---
 .../modules/groovy/editor/api/ASTUtils.java|  2 +-
 .../editor/language/GroovyDeclarationFinder.java   | 16 ---
 .../declarationfinder/ClassWithInner.groovy| 23 ++
 .../editor/api/GroovyDeclarationFinderTest.java| 15 ++
 4 files changed, 48 insertions(+), 8 deletions(-)

diff --git 
a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java 
b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java
index eee0861bef..04f0c78807 100644
--- 
a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java
+++ 
b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java
@@ -528,7 +528,7 @@ public class ASTUtils {
 }
 
 public static ClassNode getOwningClass(AstPath path) {
-Iterator it = path.rootToLeaf();
+Iterator it = path.leafToRoot();
 while (it.hasNext()) {
 ASTNode node = it.next();
 if (node instanceof ClassNode) {
diff --git 
a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/language/GroovyDeclarationFinder.java
 
b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/language/GroovyDeclarationFinder.java
index 14e21c6097..2bd81a8b7d 100644
--- 
a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/language/GroovyDeclarationFinder.java
+++ 
b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/language/GroovyDeclarationFinder.java
@@ -265,10 +265,7 @@ public class GroovyDeclarationFinder implements 
DeclarationFinder {
 if (scope != null) {
 ASTNode variable = ASTUtils.getVariable(scope, 
variableExpression.getName(), path, doc, lexOffset);
 if (variable != null) {
-// I am using getRange and not getOffset, because 
getRange is adding 'def_' to offset of field
-int offset = ASTUtils.getRange(variable, 
doc).getStart();
-// FIXME parsing API
-return new 
DeclarationLocation(info.getSnapshot().getSource().getFileObject(), offset);
+return getVariableLocation(variable, doc, info);
 }
 }
 // find a field ?
@@ -289,9 +286,7 @@ public class GroovyDeclarationFinder implements 
DeclarationFinder {
 }
 ASTNode variable = ASTUtils.getVariable(scope, 
((ConstantExpression) property).getText(), path, doc, lexOffset);
 if (variable != null) {
-int offset = ASTUtils.getOffset(doc, 
variable.getLineNumber(), variable.getColumnNumber());
-// FIXME parsing API
-return new 
DeclarationLocation(info.getSnapshot().getSource().getFileObject(), offset);
+return getVariableLocation(variable, doc, info);
 }
 } else {
 // find variable type
@@ -384,6 +379,13 @@ public class GroovyDeclarationFinder implements 
DeclarationFinder {
 return DeclarationLocation.NONE;
 }
 
+private DeclarationLocation getVariableLocation(ASTNode variable, 
BaseDocument doc, ParserResult info) {
+// I am using getRange and not getOffset, because getRange is adding 
'def_' to offset of field
+int offset = ASTUtils.getRange(variable, doc).getStart();
+// FIXME parsing API
+return new 
DeclarationLocation(info.getSnapshot().getSource().getFileObject(), offset);
+}
+
 private DeclarationLocation findType(String fqName, OffsetRange range,
 BaseDocument doc, ParserResult info, GroovyIndex index) throws 
BadLocationException {
 
diff --git 
a/groovy/groovy.editor/test/unit/data/testfiles/declarationfinder/ClassWithInner.groovy
 
b/groovy/groovy.editor/test/unit/data/testfiles/declarationfinder/ClassWithInner.groovy
new file mode 100644
index 00..0c397e3bfc
--- /dev/null
+++ 
b/groovy/groovy.editor/test/unit/data/testfiles/declarationfinder/ClassWithInner.groovy
@@ -0,0 +1,23 @@
+class ClassWithInner {
+
+String x = "A"
+String y = "B"
+
+class Inner {
+
+Point x = new Point();
+
+def method() {
+this.x = null
+y.isEmpty()
+}
+}
+
+def method() {
+thi

[netbeans] branch master updated (0011e80e81 -> ac86e59bd7)

2022-05-17 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 0011e80e81 Merge pull request #4117 from apache/delivery
 new d299087e12 Quote arguments.
 new ac86e59bd7 Adapt Native Image debugging for CE images.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/cpplite/debugger/CPPFrame.java |   4 +-
 .../modules/cpplite/debugger/CPPLiteDebugger.java  |   8 +-
 .../modules/cpplite/debugger/CPPVariable.java  |   2 +-
 .../nativeimage/debugger/displayer/DynamicHub.java | 126 +
 .../debugger/displayer/JavaFrameDisplayer.java |  31 +-
 .../debugger/displayer/JavaVariablesDisplayer.java | 522 +
 .../java/nativeimage/debugger/displayer/Utils.java | 146 ++
 7 files changed, 728 insertions(+), 111 deletions(-)
 create mode 100644 
java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/DynamicHub.java
 create mode 100644 
java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/Utils.java


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/02: Quote arguments.

2022-05-17 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit d299087e12d12c975145a12d23b372e239f7d9a9
Author: Martin Entlicher 
AuthorDate: Mon May 16 13:19:29 2022 +0200

Quote arguments.
---
 .../src/org/netbeans/modules/cpplite/debugger/CPPFrame.java   | 4 ++--
 .../org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java| 8 
 .../src/org/netbeans/modules/cpplite/debugger/CPPVariable.java| 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
index c7315f5fdc..2c36d6d5d5 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
@@ -158,7 +158,7 @@ public final class CPPFrame implements DVFrame {
 record = 
frame.thread.getDebugger().sendAndGet("-stack-list-variables --thread " + 
frame.thread.getId() + " --frame " + frame.level + " --no-frame-filters 2");
 } else {
 // from to
-record = 
frame.thread.getDebugger().sendAndGet("-var-list-children --thread " + 
frame.thread.getId() + " --frame " + frame.level + " --all-values " + 
parentVar.getUniqueName());
+record = 
frame.thread.getDebugger().sendAndGet("-var-list-children --thread " + 
frame.thread.getId() + " --frame " + frame.level + " --all-values " + "\"" + 
parentVar.getUniqueName() + "\"");
 }
 } catch (InterruptedException ex) {
 return Collections.emptyMap();
@@ -257,7 +257,7 @@ public final class CPPFrame implements DVFrame {
 result.complete(value);
 return result;
 }
-thread.getDebugger().send(new Command("-var-create --thread " + 
thread.getId() + " --frame " + level + " - * " + expression) {
+thread.getDebugger().send(new Command("-var-create --thread " + 
thread.getId() + " --frame " + level + " - * \"" + expression + "\"") {
 @Override
 protected void onDone(MIRecord record) {
 MITList results = record.results();
diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index bda4bce1a3..bb41a6fec1 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -398,12 +398,12 @@ public final class CPPLiteDebugger {
 MIRecord memory;
 String offsetArg;
 if (offset != 0) {
-offsetArg = "-o " + offset + " ";
+offsetArg = "-o " + offset + " \"";
 } else {
-offsetArg = "";
+offsetArg = "\"";
 }
 try {
-memory = sendAndGet("-data-read-memory-bytes " + offsetArg + 
address + " " + length);
+memory = sendAndGet("-data-read-memory-bytes " + offsetArg + 
address + "\" " + length);
 } catch (InterruptedException ex) {
 return null;
 }
@@ -434,7 +434,7 @@ public final class CPPLiteDebugger {
 public List listLocations(String filePath) {
 MIRecord lines;
 try {
-lines = sendAndGet("-symbol-list-lines " + filePath);
+lines = sendAndGet("-symbol-list-lines \"" + filePath + "\"");
 } catch (InterruptedException ex) {
 return null;
 }
diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
index ec1ef374a7..2b6683d230 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
@@ -121,7 +121,7 @@ public final class CPPVariable implements NIVariable {
 public String getExpressionPath() {
 MIRecord pathRecord;
 try {
-pathRecord = 
frame.getThread().getDebugger().sendAndGet("-var-info-path-expression " + 
uniqueName);
+pathRecord = 
frame.getThread().getDebugger().sendAndGet("-var-info-path-expression \"" + 
uniqueName + "\"");
 } catch (InterruptedException ex) {
 return null;
 }


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Adapt Native Image debugging for CE images.

2022-05-17 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit ac86e59bd7d72027e8138150c148b1f5bd3510cb
Author: Martin Entlicher 
AuthorDate: Mon May 16 13:20:16 2022 +0200

Adapt Native Image debugging for CE images.
---
 .../nativeimage/debugger/displayer/DynamicHub.java | 126 +
 .../debugger/displayer/JavaFrameDisplayer.java |  31 +-
 .../debugger/displayer/JavaVariablesDisplayer.java | 522 +
 .../java/nativeimage/debugger/displayer/Utils.java | 146 ++
 4 files changed, 721 insertions(+), 104 deletions(-)

diff --git 
a/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/DynamicHub.java
 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/DynamicHub.java
new file mode 100644
index 00..542a4469ed
--- /dev/null
+++ 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/DynamicHub.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.netbeans.modules.java.nativeimage.debugger.displayer;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.api.annotations.common.CheckForNull;
+import org.netbeans.modules.nativeimage.api.debug.NIVariable;
+
+import static 
org.netbeans.modules.java.nativeimage.debugger.displayer.JavaVariablesDisplayer.PRIVATE;
+import static 
org.netbeans.modules.java.nativeimage.debugger.displayer.JavaVariablesDisplayer.PUBLIC;
+import static 
org.netbeans.modules.java.nativeimage.debugger.displayer.Utils.findChild;
+import static 
org.netbeans.modules.java.nativeimage.debugger.displayer.Utils.getVarsByName;
+
+/**
+ * Hub of the native image object.
+ */
+final class DynamicHub {
+
+private static final String HUB = "hub"; // NOI18N
+private static final String HUB_TYPE = "hubType";// NOI18N
+private static final int HUB_TYPE_INSTANCE = 2; // Instances are less than 
or equal to 2
+private static final int HUB_TYPE_ARRAY = 4; // Arrays are greater than or 
equal to 4
+private static final String OBJ_HEADER = "_objhdr";  // NOI18N
+private static final String NAME = "name";   // NOI18N
+
+private final NIVariable hub;
+private final Map childrenByName;
+
+enum HubType {
+
+OBJECT,
+ARRAY;
+
+static HubType getFrom(int hubType) {
+if (hubType <= HUB_TYPE_INSTANCE) {
+return OBJECT;
+}
+if (hubType >= HUB_TYPE_ARRAY) {
+return ARRAY;
+}
+return null;
+}
+}
+
+private DynamicHub(NIVariable hub) {
+this.hub = hub;
+this.childrenByName = getVarsByName(hub.getChildren());
+}
+
+@CheckForNull
+static DynamicHub find(NIVariable var) {
+NIVariable object = findObjectType(var);
+if (object == null) {
+return null;
+}
+NIVariable[] children = object.getChildren();
+NIVariable hub = findChild(children, OBJ_HEADER, PUBLIC, HUB, 
Class.class.getName(), PRIVATE);
+if (hub != null) {
+return new DynamicHub(hub);
+} else {
+return null;
+}
+}
+
+@CheckForNull
+private static NIVariable findObjectType(NIVariable var) {
+NIVariable[] children = var.getChildren();
+if (children.length < 1) {
+return null;
+}
+if (children[0].getName().equals(Object.class.getName())) {
+return children[0];
+}
+// Prevent from infinite recursion
+Set visitedNames = new HashSet<>();
+var = children[0];
+do {
+children = var.getChildren();
+if (children.length < 1) {
+return null;
+}
+var = children[0];
+if (var.getName().equals(Object.class.getName())) {
+return var;
+}
+} while (visit

[netbeans] branch master updated: Repair failing TrufleSuiteTest.testParseTruffleSourcesWithoutError().

2022-05-12 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f117b5568a Repair failing 
TrufleSuiteTest.testParseTruffleSourcesWithoutError().
f117b5568a is described below

commit f117b5568a12b59e085be02076bc2df1be489258
Author: Martin Entlicher 
AuthorDate: Tue May 10 17:52:52 2022 +0200

Repair failing TrufleSuiteTest.testParseTruffleSourcesWithoutError().
---
 .../unit/src/org/netbeans/modules/java/mx/project/DumpStack.java | 4 ++--
 .../modules/java/mx/project/SuiteActionProviderTest.java | 9 +
 .../org/netbeans/modules/java/mx/project/TrufleSuiteTest.java| 3 ---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/DumpStack.java
 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/DumpStack.java
index 96b4c57445..24d931cec3 100644
--- 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/DumpStack.java
+++ 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/DumpStack.java
@@ -43,8 +43,8 @@ final class DumpStack extends TimerTask {
 }
 
 public static void start() {
-final int threeMinutes = 1000 * 60 * 3;
+final int tenMinutes = 1000 * 60 * 10;
 final int tenSeconds = 1;
-TIMER.schedule(new DumpStack(), threeMinutes, tenSeconds);
+TIMER.schedule(new DumpStack(), tenMinutes, tenSeconds);
 }
 }
diff --git 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/SuiteActionProviderTest.java
 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/SuiteActionProviderTest.java
index 2120ae5c14..95b8a2de25 100644
--- 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/SuiteActionProviderTest.java
+++ 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/SuiteActionProviderTest.java
@@ -44,7 +44,7 @@ public class SuiteActionProviderTest extends SuiteCheck {
 }
 
 public void testActionsEnabledWithProgress() throws Exception {
-File sdkSibling = findSuite("sdk");
+File sdkSibling = findSuite("regex");
 
 FileObject fo = FileUtil.toFileObject(sdkSibling);
 assertNotNull("project directory found", fo);
@@ -86,11 +86,12 @@ public class SuiteActionProviderTest extends SuiteCheck {
 MockProgress progress = new MockProgress();
 
 Lookup ctx = Lookups.fixed(fo, p, progress);
-assertTrue("Clean is supported", 
ap.isActionEnabled(ActionProvider.COMMAND_CLEAN, ctx));
-ap.invokeAction(ActionProvider.COMMAND_CLEAN, ctx);
+assertTrue("Build is supported", 
ap.isActionEnabled(ActionProvider.COMMAND_BUILD, ctx));
+// Do not run clean action here as it breaks next tests.
+ap.invokeAction(ActionProvider.COMMAND_BUILD, ctx);
 
 assertTrue("Progress started", progress.started);
-progress.finished.await(10, TimeUnit.SECONDS);
+progress.finished.await(45, TimeUnit.SECONDS);
 assertNotNull("Progress finished", progress.success);
 }
 
diff --git 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/TrufleSuiteTest.java
 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/TrufleSuiteTest.java
index 5a8490c013..60164e07ae 100644
--- 
a/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/TrufleSuiteTest.java
+++ 
b/java/java.mx.project/test/unit/src/org/netbeans/modules/java/mx/project/TrufleSuiteTest.java
@@ -18,8 +18,6 @@
  */
 package org.netbeans.modules.java.mx.project;
 
-import org.netbeans.junit.RandomlyFails;
-
 public class TrufleSuiteTest extends SuiteCheck {
 public TrufleSuiteTest(String n) {
 super(n);
@@ -29,7 +27,6 @@ public class TrufleSuiteTest extends SuiteCheck {
 return SuiteCheck.suite(TrufleSuiteTest.class);
 }
 
-@RandomlyFails
 public void testParseTruffleSourcesWithoutError() throws Exception {
 verifyNoErrorsInSuite("truffle");
 }


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Corrected array and String inspection for various versions of GDB.

2022-04-11 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c2e5944e6c Corrected array and String inspection for various versions 
of GDB.
c2e5944e6c is described below

commit c2e5944e6c3ab56ffc28882817e81cc3e25cba45
Author: Martin Entlicher 
AuthorDate: Mon Apr 11 09:55:44 2022 +0200

Corrected array and String inspection for various versions of GDB.
---
 .../debugger/displayer/JavaVariablesDisplayer.java | 397 +++--
 1 file changed, 296 insertions(+), 101 deletions(-)

diff --git 
a/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/JavaVariablesDisplayer.java
 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/JavaVariablesDisplayer.java
index eed890c473..a4009387e5 100644
--- 
a/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/JavaVariablesDisplayer.java
+++ 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/displayer/JavaVariablesDisplayer.java
@@ -28,6 +28,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.WeakHashMap;
 
 import org.netbeans.modules.nativeimage.api.debug.EvaluateException;
 import org.netbeans.modules.nativeimage.api.debug.NIDebugger;
@@ -54,7 +55,11 @@ public final class JavaVariablesDisplayer implements 
VariableDisplayer {
 
 private static final String[] STRING_TYPES = new String[] { 
String.class.getName(), StringBuilder.class.getName(), 
StringBuffer.class.getName() };
 
+// Variable names with this prefix contain space-separated variable name 
and expression path
+private static final String PREFIX_VAR_PATH = "{ ";
+
 private NIDebugger debugger;
+private final Map variablePaths = 
Collections.synchronizedMap(new WeakHashMap<>());
 
 public JavaVariablesDisplayer() {
 }
@@ -67,28 +72,40 @@ public final class JavaVariablesDisplayer implements 
VariableDisplayer {
 public NIVariable[] displayed(NIVariable[] variables) {
 List displayedVars = new ArrayList<>(variables.length);
 for (NIVariable var : variables) {
-   String value = var.getValue();
+String value = var.getValue();
 if (UNSET.equals(value)) {
 continue;
 }
+if (var instanceof AbstractVar) {
+// Translated already
+displayedVars.add(var);
+continue;
+}
+String name = var.getName();
+String path = null;
+if (name.startsWith(PREFIX_VAR_PATH)) {
+int i = name.indexOf(' ', PREFIX_VAR_PATH.length());
+if (i > 0) {
+path = name.substring(i + 1);
+name = name.substring(PREFIX_VAR_PATH.length(), i);
+}
+}
+if (path != null) {
+variablePaths.put(var, path);
+}
 int nch = var.getNumChildren();
 NIVariable displayedVar;
 if (nch == 0) {
-String name = var.getName();
-if (!name.equals(getNameOrIndex(name))) {
-displayedVar = new Var(var);
-} else {
-displayedVar = var;
-}
+displayedVar = new Var(var, name, path);
 } else {
 NIVariable[] children = var.getChildren();
-NIVariable[] subChildren = children[0].getChildren();
+NIVariable[] subChildren = children.length > 0 ? 
children[0].getChildren() : new NIVariable[]{};
 // Check for Array
 if (subChildren.length == 3 &&
 //HUB.equals(subChildren[0].getName()) &&
 ARRAY_LENGTH.equals(subChildren[1].getName()) &&
 ARRAY.equals(subChildren[2].getName())) {
-displayedVar = new ArrayVar(var, subChildren[1], 
subChildren[2]);
+displayedVar = new ArrayVar(var, name, path, 
subChildren[1], subChildren[2]);
 } else {
 // Check for String
 String type = getSimpleType(var.getType());
@@ -103,22 +120,22 @@ public final class JavaVariablesDisplayer implements 
VariableDisplayer {
 }
 }
 if (likeString) {
-displayedVar = new StringVar(var, type, isString ? 
null : subChildren);
+displayedVar = new StringVar(var, name, path, type, 
isString ? null : subChildren);
 } else {
 

[netbeans] branch master updated: Export the Truffle packages explicitly, since TruffleJDKServices class was removed.

2022-02-24 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 7fe5a90  Export the Truffle packages explicitly, since 
TruffleJDKServices class was removed.
7fe5a90 is described below

commit 7fe5a907401aac2be35744586c710a49e6699823
Author: Martin Entlicher 
AuthorDate: Wed Feb 23 19:11:06 2022 +0100

Export the Truffle packages explicitly, since TruffleJDKServices class was 
removed.
---
 .../debugger/jpda/truffle/DebugManagerHandler.java | 12 --
 .../debugger/jpda/truffle/RemoteServices.java  | 33 +--
 .../debugger/jpda/truffle/TruffleDebugManager.java | 48 --
 3 files changed, 72 insertions(+), 21 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/DebugManagerHandler.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/DebugManagerHandler.java
index f2b03f6..396aa72 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/DebugManagerHandler.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/DebugManagerHandler.java
@@ -118,9 +118,7 @@ final class DebugManagerHandler {
 
 void newPolyglotEngineInstance(ObjectReference engine, JPDAThreadImpl 
thread) {
 LOG.log(Level.FINE, "Engine created breakpoint hit: engine = {0} in 
thread = {1}", new Object[] { engine, thread.getThreadReference()});
-if (inited.compareAndSet(false, true)) {
-initDebuggerRemoteService(thread);
-}
+assert inited.get(): "The remote services should have been initialized 
already from a Truffle class.";
 if (accessorClass == null) {
 // No accessor
 return ;
@@ -163,7 +161,13 @@ final class DebugManagerHandler {
 }
 }
 
-private void initDebuggerRemoteService(JPDAThread thread) {
+void initDebuggerRemoteService(JPDAThread thread) {
+if (inited.compareAndSet(false, true)) {
+doInitDebuggerRemoteService(thread);
+}
+}
+
+private void doInitDebuggerRemoteService(JPDAThread thread) {
 if (LOG.isLoggable(Level.FINE)) {
 LOG.log(Level.FINE, "initDebuggerRemoteService({0})", thread);
 }
diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
index 69af7cb..7c18aeb 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
@@ -98,9 +98,13 @@ public final class RemoteServices {
 static final String REMOTE_CLASSES_ZIPFILE = 
"/org/netbeans/modules/debugger/jpda/truffle/resources/JPDATruffleBackend.jar"; 
   // NOI18N
 
 private static final String TRUFFLE_CLASS = 
"com.oracle.truffle.api.Truffle";   // NOI18N
-private static final String EXPORT_TRUFFLE_CLASS = 
"com.oracle.truffle.api.impl.TruffleJDKServices";// NOI18N
-private static final String EXPORT_TRUFFLE_METHOD = "exportTo";
 // NOI18N
-private static final String EXPORT_TRUFFLE_SIGNAT = 
"(Ljava/lang/ClassLoader;Ljava/lang/String;)V"; // NOI18N
+private static final String[] TRUFFLE_PACKAGES = {
+"com.oracle.truffle.api",   // NOI18N
+"com.oracle.truffle.api.debug", // NOI18N
+"com.oracle.truffle.api.frame", // NOI18N
+"com.oracle.truffle.api.instrumentation",   // NOI18N
+"com.oracle.truffle.api.nodes", // NOI18N
+"com.oracle.truffle.api.source" };  // NOI18N
 
 private static final Map 
remoteServiceClasses = new WeakHashMap<>();
 private static final Map 
remoteServiceAccess = new WeakHashMap<>();
@@ -269,17 +273,20 @@ public final class RemoteServices {
 
 // We have an agent class loader that we'll use to define 
Truffle backend debugging classes.
 // We need to export the agent class loader to Truffle so that 
we can upload classes that access Truffle APIs.
-ClassType languageLoader = getClass(vm, EXPORT_TRUFFLE_CLASS);
-if (languageLoader == null) {
-Exceptions.printStackTrace(new 
IllegalStateException("Class " + EXPORT_TRUFFLE_CLASS + " not found in the 
debuggee."));
-return null;
+// We need to export packages from Truffle to our unnamed 
module.
+// We must c

[netbeans] branch master updated: A bogus Cyclic Reference issue resolved by making fields volatile. NETBEANS-6458

2022-02-21 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c07fe19  A bogus Cyclic Reference issue resolved by making fields 
volatile. NETBEANS-6458
c07fe19 is described below

commit c07fe190473840887b0d6f7090151d17ebb0686f
Author: Martin Entlicher 
AuthorDate: Sat Feb 19 11:10:50 2022 +0100

A bogus Cyclic Reference issue resolved by making fields volatile. 
NETBEANS-6458
---
 .../src/org/openide/loaders/FolderInstance.java| 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/loaders/FolderInstance.java 
b/platform/openide.loaders/src/org/openide/loaders/FolderInstance.java
index 84c24b0..fe8707e 100644
--- a/platform/openide.loaders/src/org/openide/loaders/FolderInstance.java
+++ b/platform/openide.loaders/src/org/openide/loaders/FolderInstance.java
@@ -107,28 +107,28 @@ public abstract class FolderInstance extends Task 
implements InstanceCookie { //
 protected DataFolder folder;
 
 /** container to work with */
-private DataObject.Container container;
+private final DataObject.Container container;
 
 /** map of primary file to their cookies (FileObject, HoldInstance) */
-private HashMap map = new HashMap (17);
+private final HashMap map = new HashMap<>(17);
 
 /** Array of tasks that we have to check before we are ok. These are the 
tasks
  *  associated with children of the current folder.
  */
-private Task[] waitFor;
+private volatile Task[] waitFor;
 
 /** object for this cookie. Either the right instance of object or
 * an instance of IOException or ClassNotFoundException. By default 
 * it is assigned to some private object in this class to signal that
 * it is uninitialized.
 */
-private Object object = CURRENT;
+private volatile Object object = CURRENT;
 
 /** Listener and runner  for this object */
-private Listener listener;
+private final Listener listener;
 
 /** error manager for this instance */
-private Logger err;
+private final Logger err;
 
 /** Task that computes the children list of the folder */
 private Task recognizingTask;
@@ -136,7 +136,7 @@ public abstract class FolderInstance extends Task 
implements InstanceCookie { //
 /** A task that gets objects from InstanceCookie's and calls 
createInstance.
  *  Started immediately after the recognizingTask is finished.
  */
-private Task creationTask;
+private volatile Task creationTask;
 /** Sequence number for creationTask */
 private volatile int creationSequence;
 /** shall instances be precreated before postCreationTask is called? */

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Fixed processing env variables with '=' in value

2022-02-18 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0f3de8c  Fixed processing env variables with '=' in value
0f3de8c is described below

commit 0f3de8c2ef4387574ae9f09030eddb37c190d068
Author: Jiri Sedlacek 
AuthorDate: Thu Feb 17 13:14:38 2022 +0100

Fixed processing env variables with '=' in value
---
 java/java.lsp.server/vscode/src/runConfiguration.ts | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/java/java.lsp.server/vscode/src/runConfiguration.ts 
b/java/java.lsp.server/vscode/src/runConfiguration.ts
index be6c37e..b0dbfa6 100644
--- a/java/java.lsp.server/vscode/src/runConfiguration.ts
+++ b/java/java.lsp.server/vscode/src/runConfiguration.ts
@@ -70,8 +70,11 @@ class RunConfigurationProvider implements 
vscode.DebugConfigurationProvider {
config.env = {};
}
for (let val of envs) {
-   const vals = val.trim().split('=');
-   config.env[vals[0]] = vals[1];
+   val = val.trim();
+   const div = val.indexOf('=');
+   if (div > 0) { // div === 0 means bad 
format (no ENV name)
+   config.env[val.substring(0, 
div)] = val.substring(div + 1, val.length);
+   }
}
}
 

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (5686358 -> 6554cbb)

2022-02-17 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 5686358  Merge pull request #3585 from sdedic/lsp/icon-resources
 add 6554cbb  Native Image debugger does not set print objects on. Checks 
added to prevent from exceptions.

No new revisions were added by this update.

Summary of changes:
 cpplite/cpplite.debugger/nbproject/project.xml |  2 +-
 .../modules/cpplite/debugger/CPPLiteDebugger.java  |  8 +--
 .../cpplite/debugger/CPPLiteDebuggerConfig.java|  8 ++-
 .../modules/cpplite/debugger/api/Debugger.java |  2 +-
 .../debugger/ni/NIDebuggerProviderImpl.java| 49 +++--
 .../cpplite/debugger/AbstractDebugTest.java|  2 +-
 ide/nativeimage.api/manifest.mf|  2 +-
 .../modules/nativeimage/api/debug/NIDebugger.java  |  2 +
 .../api/debug/StartDebugParameters.java| 61 +-
 .../nativeimage/spi/debug/NIDebuggerProvider.java  |  2 +
 java/java.lsp.server/nbproject/project.xml |  2 +-
 .../lsp/server/debugging/NbProtocolServer.java |  5 ++
 .../debugging/attach/NbAttachRequestHandler.java   | 10 +++-
 .../server/debugging/launch/NbLaunchDelegate.java  |  1 +
 .../nbproject/project.xml  |  2 +-
 .../debugger/actions/NIAttachCustomizer.java   | 13 +++--
 .../nativeimage/debugger/api/NIDebugRunner.java|  2 +
 .../debugger/displayer/JavaVariablesDisplayer.java | 39 --
 18 files changed, 148 insertions(+), 64 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Integration tests of Truffle/Graal scripts debugger.

2022-02-11 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new aa1f69f  Integration tests of Truffle/Graal scripts debugger.
aa1f69f is described below

commit aa1f69f3fb50defdda5aab682275d35be49557fa
Author: Martin Entlicher 
AuthorDate: Sun Feb 6 11:22:23 2022 +0100

Integration tests of Truffle/Graal scripts debugger.
---
 .../nbproject/project.properties   |   1 +
 java/debugger.jpda.truffle/nbproject/project.xml   |  23 ++
 .../debugger/jpda/truffle/TruffleDebugManager.java |   5 +-
 .../impl/TruffleBreakpointsHandler.java|   2 +
 .../debugger/jpda/truffle/DebugAllBaseTest.java| 247 +
 .../modules/debugger/jpda/truffle/DebugJSTest.java |  99 +
 .../debugger/jpda/truffle/DebugPythonTest.java |  87 
 .../modules/debugger/jpda/truffle/DebugRTest.java  |  86 +++
 .../debugger/jpda/truffle/DebugRubyTest.java   | 101 +
 .../modules/debugger/jpda/truffle/DebugSLTest.java | 193 
 .../debugger/jpda/truffle/JPDATestCase.java| 144 
 .../debugger/jpda/truffle/PolyglotTest.java| 194 
 .../TestApp.sl => scripts/DebuggerBase.js} |  35 ++-
 .../debugger/jpda/truffle/scripts/DebuggerBase.py} |  41 +++-
 .../debugger/jpda/truffle/scripts/DebuggerBase.r}  |  41 +++-
 .../jpda/truffle/scripts/DebuggerBase.ruby}|  41 +++-
 .../{testapps/TestApp.sl => scripts/Types.js}  |  47 +++-
 .../debugger/jpda/truffle/scripts/Types.py}|  33 ++-
 .../modules/debugger/jpda/truffle/scripts/Types.r} |  33 ++-
 .../debugger/jpda/truffle/scripts/Types.ruby}  |  43 +++-
 .../debugger/jpda/truffle/scripts/Weather.js   | 124 +++
 .../debugger/jpda/truffle/scripts/Weather.py}  |  28 ++-
 .../debugger/jpda/truffle/scripts/Weather.r|  56 +
 .../debugger/jpda/truffle/scripts/Weather.rb}  |  21 +-
 ...{SLAppFromFile.java => PolyglotWeatherApp.java} |  25 +--
 .../debugger/jpda/truffle/testapps/SLApp.java  |  65 --
 .../jpda/truffle/testapps/WeatherCity.java |  52 +
 .../jpda/truffle/testapps/WeatherCityService.java  |  67 ++
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |   1 +
 .../netbeans/api/debugger/jpda/JPDASupport.java| 148 
 nbbuild/travis/scripting.sh|   2 +
 31 files changed, 1684 insertions(+), 401 deletions(-)

diff --git a/java/debugger.jpda.truffle/nbproject/project.properties 
b/java/debugger.jpda.truffle/nbproject/project.properties
index adfab1c..3d3ba96 100644
--- a/java/debugger.jpda.truffle/nbproject/project.properties
+++ b/java/debugger.jpda.truffle/nbproject/project.properties
@@ -23,4 +23,5 @@ requires.nb.javac=true
 truffle.sl=external/antlr4-runtime-4.7.2.jar:external/truffle-sl-1.0.0-rc6.jar
 cp.extra=${tools.jar}:${truffle.sl}
 test-unit-sys-prop.test.dir.src=${basedir}/test/unit/src/
+test-unit-sys-prop.test.dir.classes=${basedir}/build/test/unit/classes
 test-unit-sys-prop.netbeans.user=${basedir}/work/nb_user_dir
diff --git a/java/debugger.jpda.truffle/nbproject/project.xml 
b/java/debugger.jpda.truffle/nbproject/project.xml
index f15d913..3d345ab 100644
--- a/java/debugger.jpda.truffle/nbproject/project.xml
+++ b/java/debugger.jpda.truffle/nbproject/project.xml
@@ -259,12 +259,35 @@
 
 unit
 
+
org.netbeans.core.startup
+
+
+
+
org.netbeans.libs.freemarker
+
+
+
+
org.netbeans.libs.javacapi
+
+
+
 
org.netbeans.modules.debugger.jpda
+   
+
+
+
+
org.netbeans.api.debugger.jpda
+
 
 
 
+   
+
org.netbeans.libs.junit4
+
+
 
 
org.netbeans.modules.nbjunit
+
 
 
 
diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/TruffleDebugManager.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/TruffleDebugManager.java
index 01f209f..14aa3f0 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/TruffleDebugManager.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/TruffleDebugMan

[netbeans] branch master updated: Convert source path to URI String.

2022-01-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0a29c23  Convert source path to URI String.
0a29c23 is described below

commit 0a29c233239a2ecd321f83534694c50ac477cbf0
Author: Martin Entlicher 
AuthorDate: Sat Jan 8 01:59:24 2022 +0100

Convert source path to URI String.
---
 .../netbeans/modules/java/lsp/server/debugging/NbSourceProvider.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbSourceProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbSourceProvider.java
index 35167ee..a305a0c 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbSourceProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbSourceProvider.java
@@ -125,7 +125,7 @@ public final class NbSourceProvider {
 for (String path : sourcePaths) {
 Path fullpath = Paths.get(path, relativeSourcePath);
 if (Files.isRegularFile(fullpath)) {
-uri = fullpath.toString();
+uri = fullpath.toUri().toString();
 break;
 }
 }

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Use -f option when submitting breakpoints to have pending breakpoints and submit breakpoints based on relative path in sources folder.

2022-01-08 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 25064b0  Use -f option when submitting breakpoints to have pending 
breakpoints and submit breakpoints based on relative path in sources folder.
25064b0 is described below

commit 25064b041ee66049aebcc868740e73ed7786c8bb
Author: Martin Entlicher 
AuthorDate: Fri Jan 7 23:15:35 2022 +0100

Use -f option when submitting breakpoints to have pending breakpoints and 
submit breakpoints based on relative path in sources folder.
---
 .../modules/cpplite/debugger/CPPLiteDebugger.java|  2 +-
 .../debugger/breakpoints/JPDABreakpointsHandler.java | 20 +---
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 7c30f7c..56d52e3 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -968,7 +968,7 @@ public final class CPPLiteDebugger {
 private void addBreakpoint(CPPLiteBreakpoint breakpoint) {
 String path = breakpoint.getFilePath();
 int lineNumber = breakpoint.getLineNumber();
-String disabled = breakpoint.isEnabled() ? "" : "-d ";
+String disabled = breakpoint.isEnabled() ? "-f " : "-d ";
 Command command = new Command("-break-insert " + disabled + path + 
":" + lineNumber) {
 @Override
 protected void onDone(MIRecord record) {
diff --git 
a/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
index 2f43091..8ce968b 100644
--- 
a/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
+++ 
b/java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
@@ -46,6 +46,8 @@ import org.openide.filesystems.URLMapper;
  */
 public class JPDABreakpointsHandler extends DebuggerManagerAdapter implements 
PropertyChangeListener {
 
+private static final String SOURCES_FOLDER = "sources"; // NOI18N
+
 private final File niFileSources;
 private final NIDebugger debugger;
 private final Set attachedBreakpoints = new HashSet<>();
@@ -62,7 +64,7 @@ public class JPDABreakpointsHandler extends 
DebuggerManagerAdapter implements Pr
 }
 
 private static File getNativeSources(File niFile) {
-File sources = new File(niFile.getParentFile(), "sources");
+File sources = new File(niFile.getParentFile(), SOURCES_FOLDER);
 if (sources.isDirectory()) {
 return sources;
 } else {
@@ -124,16 +126,12 @@ public class JPDABreakpointsHandler extends 
DebuggerManagerAdapter implements Pr
 return null;
 }
 String filePath = null;
-if (niFileSources != null) {
-FileObject fo;
-fo = URLMapper.findFileObject(url);
-for (FileObject root : 
GlobalPathRegistry.getDefault().getSourceRoots()) {
-if (FileUtil.isParentOf(root, fo)) {
-String path = FileUtil.getRelativePath(root, fo);
-File sourcesFile = new File(niFileSources, path);
-filePath = sourcesFile.getAbsolutePath();
-break;
-}
+FileObject fo = URLMapper.findFileObject(url);
+for (FileObject root : 
GlobalPathRegistry.getDefault().getSourceRoots()) {
+if (FileUtil.isParentOf(root, fo)) {
+String path = FileUtil.getRelativePath(root, fo);
+filePath = SOURCES_FOLDER + File.separator + path;
+break;
 }
 }
 if (filePath == null) {

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: LSP console IO is made more reliable, output is not lost now.

2022-01-07 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new b923d00  LSP console IO is made more reliable, output is not lost now.
b923d00 is described below

commit b923d001be4afe7ebbb6b2bb7ef857aa6793037e
Author: Martin Entlicher 
AuthorDate: Thu Jan 6 15:01:20 2022 +0100

LSP console IO is made more reliable, output is not lost now.
---
 .../server/debugging/launch/NbLaunchDelegate.java  |  2 +-
 .../server/ui/AbstractLspInputOutputProvider.java  | 24 ++
 .../src/org/openide/io/BridgingIOProvider.java |  3 +--
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index 163b39c..6d16f55 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -152,8 +152,8 @@ public abstract class NbLaunchDelegate {
 }
 }
 };
-Project prj = FileOwnerQuery.getOwner(toRun);
 if (nativeImageFile == null) {
+Project prj = FileOwnerQuery.getOwner(toRun);
 class W extends Writer {
 @Override
 public void write(char[] cbuf, int off, int len) throws 
IOException {
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
index e5a54f6..34c3407 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
@@ -58,12 +58,12 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 
 @Override
 public final PrintWriter getOut(LspIO io) {
-return io.out;
+return new PrintWriter(io.out);
 }
 
 @Override
 public final PrintWriter getErr(LspIO io) {
-return io.err;
+return new PrintWriter(io.err);
 }
 
 @Override
@@ -94,7 +94,7 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 
 @Override
 public final boolean isIOClosed(LspIO io) {
-return io.closed;
+return io.isClosed();
 }
 
 @Override
@@ -133,16 +133,15 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 private final IOContext ctx;
 final Lookup lookup;
 final Reader in;
-final PrintWriter out;
-final PrintWriter err;
-volatile boolean closed;
+final LspWriter out;
+final LspWriter err;
 
 LspIO(String name, IOContext ioCtx, Lookup lookup) {
 this.name = name;
 this.ctx = ioCtx;
 this.lookup = lookup;
-this.out = new PrintWriter(new LspWriter(true));
-this.err = new PrintWriter(new LspWriter(false));
+this.out = new LspWriter(true);
+this.err = new LspWriter(false);
 Reader in;
 try {
 InputStream is = ioCtx.getStdIn();
@@ -155,7 +154,9 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 }
 };
 } catch (IOException ex) {
-err.write(ex.getLocalizedMessage());
+try {
+err.write(ex.getLocalizedMessage());
+} catch (IOException ioex) {}
 in = new CharArrayReader(new char[0]) {
 @Override
 public void close() {
@@ -165,8 +166,13 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 this.in = in;
 }
 
+boolean isClosed() {
+return out.closed && err.closed;
+}
+
 private final class LspWriter extends Writer {
 private final boolean stdIO;
+volatile boolean closed;
 
 LspWriter(boolean stdIO) {
 this.stdIO = stdIO;
diff --git a/platform/openide.io/src/org/openide/io/BridgingIOProvider.java 
b/platform/openide.io/src/org/openide/io/BridgingIOProvider.java
index c8d7416..8edd804 100644
--- a/platform/openide.io/src/org/openide/io/BridgingIOProvider.java
+++ b/platform/openide.io/src/org/openide/io/BridgingIOProvider.java
@@ -158,8 +158,7 @@ public class BridgingIOProvider
 @Override
 public OutputWriter getErr() {
 re

[netbeans] branch master updated: Be able to resolve project problems in VSCode extension. (#3400)

2022-01-04 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8b9e822  Be able to resolve project problems in VSCode extension. 
(#3400)
8b9e822 is described below

commit 8b9e822e3aee7ea3d8c47cc0f271d80f86eaad65
Author: Martin Entlicher 
AuthorDate: Tue Jan 4 22:09:38 2022 +0100

Be able to resolve project problems in VSCode extension. (#3400)
---
 .../org/netbeans/modules/gradle/GradleProject.java | 10 ++--
 .../gradle/GradleProjectProblemProvider.java   | 17 --
 .../hints/infrastructure/JavaErrorProvider.java| 11 +++-
 .../modules/java/lsp/server/protocol/Server.java   |  5 ++
 .../server/protocol/TextDocumentServiceImpl.java   |  2 +-
 .../lsp/server/protocol/WorkspaceServiceImpl.java  | 62 ++
 java/java.lsp.server/vscode/package.json   | 18 +++
 7 files changed, 105 insertions(+), 20 deletions(-)

diff --git a/extide/gradle/src/org/netbeans/modules/gradle/GradleProject.java 
b/extide/gradle/src/org/netbeans/modules/gradle/GradleProject.java
index b0c4276..ed731a0 100644
--- a/extide/gradle/src/org/netbeans/modules/gradle/GradleProject.java
+++ b/extide/gradle/src/org/netbeans/modules/gradle/GradleProject.java
@@ -101,11 +101,15 @@ public final class GradleProject implements Serializable, 
Lookup.Provider {
 }
 
 public final GradleProject invalidate(String... reasons) {
+Set problems = reasons.length > 0 ? new 
LinkedHashSet<>(Arrays.asList(reasons)) : Collections.emptySet();
 if (getQuality().worseThan(Quality.EVALUATED)) {
-return this;
+if (!problems.isEmpty()) {
+return new GradleProject(getQuality(), problems, this);
+} else {
+return this;
+}
 } else {
-Set p = new LinkedHashSet<>(Arrays.asList(reasons));
-return new GradleProject(Quality.EVALUATED, p, this);
+return new GradleProject(Quality.EVALUATED, problems, this);
 }
 }
 
diff --git 
a/extide/gradle/src/org/netbeans/modules/gradle/GradleProjectProblemProvider.java
 
b/extide/gradle/src/org/netbeans/modules/gradle/GradleProjectProblemProvider.java
index b6b7b24..2b53729 100644
--- 
a/extide/gradle/src/org/netbeans/modules/gradle/GradleProjectProblemProvider.java
+++ 
b/extide/gradle/src/org/netbeans/modules/gradle/GradleProjectProblemProvider.java
@@ -26,6 +26,7 @@ import java.beans.PropertyChangeSupport;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.Future;
 import org.netbeans.api.project.Project;
 import org.netbeans.spi.project.ProjectServiceProvider;
@@ -81,10 +82,11 @@ public class GradleProjectProblemProvider implements 
ProjectProblemsProvider {
 GradleProject gp = 
project.getLookup().lookup(NbGradleProjectImpl.class).getGradleProject();
 if (gp.getQuality().notBetterThan(EVALUATED)) {
 ret.add(ProjectProblem.createError(Bundle.LBL_PrimingRequired(), 
Bundle.TXT_PrimingRequired(), resolver));
-}
-for (String problem : gp.getProblems()) {
-String[] lines = problem.split("\\n"); //NOI18N
-ret.add(ProjectProblem.createWarning(lines[0], 
problem.replaceAll("\\n", ""), resolver)); //NOI18N
+} else {
+for (String problem : gp.getProblems()) {
+String[] lines = problem.split("\\n"); //NOI18N
+ret.add(ProjectProblem.createWarning(lines[0], 
problem.replaceAll("\\n", ""), resolver)); //NOI18N
+}
 }
 return ret;
 }
@@ -98,7 +100,12 @@ public class GradleProjectProblemProvider implements 
ProjectProblemsProvider {
 Quality q = gradleProject.getQuality();
 Status st = q.worseThan(SIMPLE) ? Status.UNRESOLVED
 : q.worseThan(FULL) ? Status.RESOLVED_WITH_WARNING : 
Status.RESOLVED;
-return Result.create(st);
+Set problems = gradleProject.getProblems();
+if (problems.isEmpty()) {
+return Result.create(st);
+} else {
+return Result.create(st, problems.iterator().next());
+}
 });
}
 }
diff --git 
a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java
 
b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java
index 2b6c246..d882cb4 100644
--- 
a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java
+++ 
b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java
@@ -147,7 +147,13 @@ public class JavaErrorProvider im

[netbeans] branch master updated: Run Configuration UI for the Explorer view (#3378)

2021-12-21 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new a97bb92  Run Configuration UI for the Explorer view (#3378)
a97bb92 is described below

commit a97bb92e9d6bb770a4bf84ef5e6d2006264fdc5a
Author: Jiri Sedlacek 
AuthorDate: Tue Dec 21 12:11:49 2021 +0100

Run Configuration UI for the Explorer view (#3378)

Run Configuration UI for the Explorer view
---
 java/java.lsp.server/vscode/package.json   |  40 
 java/java.lsp.server/vscode/src/extension.ts   |  13 ++
 .../java.lsp.server/vscode/src/runConfiguration.ts | 218 +
 3 files changed, 271 insertions(+)

diff --git a/java/java.lsp.server/vscode/package.json 
b/java/java.lsp.server/vscode/package.json
index 5561d99..c86bfd8 100644
--- a/java/java.lsp.server/vscode/package.json
+++ b/java/java.lsp.server/vscode/package.json
@@ -71,6 +71,12 @@
"id": "database.connections",
"name": "Databases",
"when": "nbJavaLSReady"
+   },
+   {
+   "id": "run-config",
+   "name": "Run Configuration",
+   "contextualTitle": "Run Configuration",
+   "when": "runConfigurationInitialized"
}
]
},
@@ -150,6 +156,26 @@
"description": "Members count to use a 
static star-import",
"default": 999,
"minimum": 1
+   },
+   "java8+.runConfig.arguments": {
+   "type": "string",
+   "default": "",
+   "description": "Arguments"
+   },
+   "java8+.runConfig.vmOptions": {
+   "type": "string",
+   "default": "",
+   "description": "VM options"
+   },
+   "java8+.runConfig.env": {
+   "type": "string",
+   "default": "",
+   "description": "Environment variables"
+   },
+   "java8+.runConfig.cwd": {
+   "type": "string",
+   "default": "",
+   "description": "Working directory"
}
}
},
@@ -463,6 +489,11 @@
{
"command": 
"java.local.db.set.preferred.connection",
"title": "Make Default Connection"
+   },
+   {
+   "command": 
"java.workspace.configureRunSettings",
+   "title": "Edit",
+   "icon": "$(edit)"
}
],
"keybindings": [
@@ -538,6 +569,10 @@
{
"command": 
"java.local.db.set.preferred.connection",
"when": "false"
+   },
+   {
+   "command": 
"java.workspace.configureRunSettings",
+   "when": "false"
}
],
"view/title": [
@@ -614,6 +649,11 @@
{
"command": 
"java.local.db.set.preferred.connection",
  

[netbeans] 02/02: Assure that COMMAND_DEBUG_TEST_SINGLE is called with the context file.

2021-12-15 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 368c5efed2b3da7762a5da821cab7efa5e395a1d
Author: Martin Entlicher 
AuthorDate: Wed Dec 15 09:41:39 2021 +0100

Assure that COMMAND_DEBUG_TEST_SINGLE is called with the context file.
---
 .../lsp/server/debugging/launch/NbLaunchDelegate.java| 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index 58fe932..163b39c 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -186,7 +186,14 @@ public abstract class NbLaunchDelegate {
 
context.setProcessExecutorHandle(e.getProgressHandle());
 }
 });
-Object contextObject = (preferProjActions && prj != null) ? 
prj : toRun;
+boolean singleFile = !(preferProjActions && prj != null);
+if (!singleFile) {
+String command = providerAndCommand.second();
+if 
(ActionProvider.COMMAND_DEBUG_TEST_SINGLE.equals(command)) {
+singleFile = true;
+}
+}
+Object contextObject = (singleFile) ? toRun : prj;
 TestProgressHandler testProgressHandler = 
ctx.getClient().getNbCodeCapabilities().hasTestResultsSupport() ? new 
TestProgressHandler(ctx.getClient(), context.getClient(), Utils.toUri(toRun)) : 
null;
 Lookup launchCtx = new ProxyLookup(
 testProgressHandler != null ? 
Lookups.fixed(contextObject, ioContext, progress, testProgressHandler) : 
Lookups.fixed(contextObject, ioContext, progress),
@@ -550,9 +557,14 @@ public abstract class NbLaunchDelegate {
 } else {
 if (preferProjActions && prj != null) {
 actions = debug ? mainSource ? new String[] 
{ActionProvider.COMMAND_DEBUG}
- : new String[] 
{ActionProvider.COMMAND_DEBUG_TEST_SINGLE, ActionProvider.COMMAND_DEBUG}
+ : new String[] 
{ActionProvider.COMMAND_DEBUG_TEST_SINGLE, ActionProvider.COMMAND_DEBUG} 
//TODO: COMMAND_DEBUG_TEST is missing
 : mainSource ? new String[] 
{ActionProvider.COMMAND_RUN}
  : new String[] 
{ActionProvider.COMMAND_TEST, ActionProvider.COMMAND_RUN};
+if (debug && !mainSource) {
+// We are calling COMMAND_DEBUG_TEST_SINGLE instead of a 
missing COMMAND_DEBUG_TEST
+// This is why we need to add the file to the lookup
+testLookup = (singleMethod != null) ? Lookups.fixed(toRun, 
singleMethod) : Lookups.singleton(toRun);
+}
 } else {
 actions = debug ? mainSource ? new String[] 
{ActionProvider.COMMAND_DEBUG_SINGLE}
  : new String[] 
{ActionProvider.COMMAND_DEBUG_TEST_SINGLE, ActionProvider.COMMAND_DEBUG_SINGLE}

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (84f8a07 -> 368c5ef)

2021-12-15 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 84f8a07  Merge pull request #3370 from 
sdedic/lsp/treeview-item-identity
 new e4f2431  Single file Groovy Run and Debug in VSCode.
 new 368c5ef  Assure that COMMAND_DEBUG_TEST_SINGLE is called with the 
context file.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../breakpoints/GroovyBreakpointFactory.java |  5 +
 .../server/debugging/launch/NbLaunchDelegate.java| 20 
 .../lsp/server/protocol/WorkspaceServiceImpl.java|  2 +-
 3 files changed, 22 insertions(+), 5 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/02: Single file Groovy Run and Debug in VSCode.

2021-12-15 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit e4f2431a70ba4561adbca0c67fe44016c97aaabc
Author: Martin Entlicher 
AuthorDate: Tue Dec 14 02:30:24 2021 +0100

Single file Groovy Run and Debug in VSCode.
---
 .../lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java| 5 +
 .../modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java   | 4 ++--
 .../modules/java/lsp/server/protocol/WorkspaceServiceImpl.java   | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
index b83c3ce..eee3c1b 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
@@ -87,6 +87,11 @@ public class GroovyBreakpointFactory {
 b.setSourcePath(relativePath);
 return relativePath;
 }
+} else {
+// Suppose the current folder
+String relativePath = fo.getNameExt();
+b.setSourcePath(relativePath);
+return relativePath;
 }
 }
 return null;
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index 07f2c73..58fe932 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -542,13 +542,13 @@ public abstract class NbLaunchDelegate {
 ActionProvider provider = null;
 String command = null;
 Collection actionProviders = findActionProviders(prj);
-Lookup testLookup = preferProjActions ? Lookups.singleton(prj) : 
(singleMethod != null) ? Lookups.fixed(toRun, singleMethod) : 
Lookups.singleton(toRun);
+Lookup testLookup = preferProjActions && prj != null ? 
Lookups.singleton(prj) : (singleMethod != null) ? Lookups.fixed(toRun, 
singleMethod) : Lookups.singleton(toRun);
 String[] actions;
 if (!mainSource && singleMethod != null) {
 actions = debug ? new String[] 
{SingleMethod.COMMAND_DEBUG_SINGLE_METHOD}
 : new String[] 
{SingleMethod.COMMAND_RUN_SINGLE_METHOD};
 } else {
-if (preferProjActions) {
+if (preferProjActions && prj != null) {
 actions = debug ? mainSource ? new String[] 
{ActionProvider.COMMAND_DEBUG}
  : new String[] 
{ActionProvider.COMMAND_DEBUG_TEST_SINGLE, ActionProvider.COMMAND_DEBUG}
 : mainSource ? new String[] 
{ActionProvider.COMMAND_RUN}
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
index 3539d71..44b9f9f 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
@@ -507,7 +507,7 @@ public final class WorkspaceServiceImpl implements 
WorkspaceService, LanguageCli
 private CompletableFuture findProjectConfigurations(FileObject 
ownedFile) {
 return server.asyncOpenFileOwner(ownedFile).thenApply(p -> {
 if (p == null) {
-return 
CompletableFuture.completedFuture(Collections.emptyList());
+return Collections.emptyList();
 }
 ProjectConfigurationProvider provider = 
p.getLookup().lookup(ProjectConfigurationProvider.class);
 List configDispNames = new ArrayList<>();

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Merge the code lens actions with the launch config properties and adapt Gradle to apply env.

2021-12-13 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new ae192d1  Merge the code lens actions with the launch config properties 
and adapt Gradle to apply env.
ae192d1 is described below

commit ae192d1309cd2269cf2e95d32ad0ef25224ff1e5
Author: Martin Entlicher 
AuthorDate: Sat Dec 11 01:29:27 2021 +0100

Merge the code lens actions with the launch config properties and adapt 
Gradle to apply env.
---
 .../gradle/tooling/NetBeansRunSinglePlugin.java| 115 ++---
 .../gradle/execute/GradleDaemonExecutor.java   |  62 +--
 java/java.lsp.server/vscode/src/extension.ts   |  22 
 3 files changed, 81 insertions(+), 118 deletions(-)

diff --git 
a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NetBeansRunSinglePlugin.java
 
b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NetBeansRunSinglePlugin.java
index 5663c01..6693f9f 100644
--- 
a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NetBeansRunSinglePlugin.java
+++ 
b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NetBeansRunSinglePlugin.java
@@ -37,7 +37,6 @@ class NetBeansRunSinglePlugin implements Plugin {
 private static final String RUN_SINGLE_ARGS = "runArgs";
 private static final String RUN_SINGLE_JVM_ARGS = "runJvmArgs";
 private static final String RUN_SINGLE_CWD = "runWorkingDir";
-private static final String RUN_SINGLE_ENV = "runEnvironment";
 
 @Override
 public void apply(Project project) {
@@ -47,13 +46,17 @@ class NetBeansRunSinglePlugin implements Plugin {
 && project.hasProperty(RUN_SINGLE_MAIN)){
 addTask(p);
 }
-if(p.hasProperty(RUN_SINGLE_JVM_ARGS)) {
-p.getTasks().withType(JavaExec.class).configureEach(je -> {
+p.getTasks().withType(JavaExec.class).configureEach(je -> {
+if (p.hasProperty(RUN_SINGLE_JVM_ARGS)) {
 je.getJvmArgumentProviders().add(() -> {
 return 
asList(p.property(RUN_SINGLE_JVM_ARGS).toString().split(" "));
 });
-});
-}
+}
+je.setStandardInput(System.in);
+if (project.hasProperty(RUN_SINGLE_CWD)) {
+
je.setWorkingDir(project.property(RUN_SINGLE_CWD).toString());
+}
+});
 });
 }
 
@@ -64,112 +67,10 @@ class NetBeansRunSinglePlugin implements Plugin {
 // Using setMain to keep the backward compatibility
 je.setMain(project.property(RUN_SINGLE_MAIN).toString());
 
je.setClasspath(sourceSets.findByName("main").getRuntimeClasspath());
-je.setStandardInput(System.in);
 if (project.hasProperty(RUN_SINGLE_ARGS)) {
 
je.setArgs(asList(project.property(RUN_SINGLE_ARGS).toString().split(" ")));
 }
-
-if(project.hasProperty(RUN_SINGLE_CWD)) {
-je.setWorkingDir(project.property(RUN_SINGLE_CWD).toString());
-}
-
-if (project.hasProperty(RUN_SINGLE_ENV)) {
-// Quoted space-separated expressions of =
-// to set environment variables, or !
-// to remove environment variables
-for (String env : 
unescapeParameters(project.property(RUN_SINGLE_ENV).toString())) {  
  
-if (env.startsWith("!")) {
-je.getEnvironment().remove(env);
-} else {
-int i = env.indexOf('=');
-if (i > 0) {
-je.getEnvironment().put(env.substring(0, i), 
env.substring(i + 1));
-}
-}
-}
-}
 });
 }
 
-private String[] unescapeParameters(String s) {
-final int NULL = 0x0;
-final int IN_PARAM = 0x1;
-final int IN_DOUBLE_QUOTE = 0x2;
-final int IN_SINGLE_QUOTE = 0x3;
-ArrayList params = new ArrayList<>(5);
-char c;
-
-int state = NULL;
-StringBuilder buff = new StringBuilder(20);
-int slength = s.length();
-
-for (int i = 0; i < slength; i++) {
-c = s.charAt(i);
-switch (state) {
-case NULL:
-switch (c) {
-case '\'':
-state = IN_SINGLE_QUOTE;
-break;
-  

[netbeans] branch master updated (9e27e19 -> adf74ef)

2021-12-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 9e27e19  Implementation of the HTMLViewerSpi for VSNetBeans
 add adf74ef  Run/Debug via project actions.

No new revisions were added by this update.

Summary of changes:
 .../server/debugging/launch/NbLaunchDelegate.java  | 56 +++-
 .../debugging/launch/NbLaunchRequestHandler.java   | 43 +--
 java/java.lsp.server/vscode/package.json   |  9 +---
 java/java.lsp.server/vscode/src/extension.ts   |  5 +-
 .../vscode/src/test/suite/testutils.ts |  1 +
 .../modules/maven/newproject/TemplateUtils.java| 61 +++---
 .../modules/maven/runjar/RunJarPrereqChecker.java  | 32 ++--
 7 files changed, 133 insertions(+), 74 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Check for nativeImagePath property.

2021-11-30 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 4ad8b87  Check for nativeImagePath property.
4ad8b87 is described below

commit 4ad8b8731c74b3290558918474dc640799b5a95f
Author: Martin Entlicher 
AuthorDate: Mon Nov 29 16:38:02 2021 +0100

Check for nativeImagePath property.
---
 .../lsp/server/debugging/attach/NbAttachRequestHandler.java| 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
index 418ddad..f2cb8e0 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
@@ -50,6 +50,7 @@ import 
org.netbeans.modules.java.lsp.server.debugging.utils.ErrorUtilities;
 import org.netbeans.modules.java.lsp.server.protocol.NbCodeLanguageClient;
 import org.netbeans.modules.java.nativeimage.debugger.api.NIDebugRunner;
 import org.netbeans.modules.nativeimage.api.debug.NIDebugger;
+import org.openide.util.NbBundle;
 import org.openide.util.NbBundle.Messages;
 import org.openide.util.RequestProcessor;
 
@@ -82,6 +83,7 @@ public final class NbAttachRequestHandler {
 }
 }
 
+@NbBundle.Messages("MSG_UnknownNIPath=Unknown native image path. Please 
set `nativeImagePath`.")
 private CompletableFuture attachToNative(Map 
attachArguments, DebugAdapterContext context) {
 CompletableFuture resultFuture = new CompletableFuture<>();
 String processAndExe = (String) attachArguments.get("processId");   // 
NOI18N
@@ -92,11 +94,17 @@ public final class NbAttachRequestHandler {
 try {
 if (index > 0) {
 processId = Long.parseLong(processAndExe.substring(0, index));
-if (nativeImagePath.isEmpty()) {
+if (nativeImagePath == null || nativeImagePath.isEmpty()) {
 nativeImagePath = processAndExe.substring(index + 1);
 }
 } else {
 processId = Long.parseLong(processAndExe);
+if (nativeImagePath == null) {
+ErrorUtilities.completeExceptionally(resultFuture,
+Bundle.MSG_UnknownNIPath(),
+ResponseErrorCode.serverErrorStart);
+return resultFuture;
+}
 }
 String executable = nativeImagePath;
 RP.post(() -> attachNativeDebug(new File(executable), processId, 
miDebugger, context, resultFuture));

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Shade whole methods which are not included in the native image.

2021-11-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 7e0f15f  Shade whole methods which are not included in the native 
image.
7e0f15f is described below

commit 7e0f15f5edcbdb7e0c71aa70c5fcf441f0048449
Author: Martin Entlicher 
AuthorDate: Tue Oct 26 09:27:12 2021 +0200

Shade whole methods which are not included in the native image.
---
 .../server/debugging/ni/NILocationVisualizer.java  | 62 +++---
 1 file changed, 55 insertions(+), 7 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/ni/NILocationVisualizer.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/ni/NILocationVisualizer.java
index 13cb437..2f17118 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/ni/NILocationVisualizer.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/ni/NILocationVisualizer.java
@@ -173,8 +173,18 @@ public final class NILocationVisualizer implements 
Consumer {
 while (rangeEnd < end && intervals.contains(rangeEnd)) {
 rangeEnd++;
 }
-int startCol = intervals.getFirstColumn(start);
-int endCol = intervals.getLastColumn(rangeEnd);
+int startCol;
+int endCol;
+int[] extendedRange = intervals.extendRange(start, 
rangeEnd);
+if (extendedRange != null) {
+start = extendedRange[0];
+startCol = extendedRange[1];
+rangeEnd = extendedRange[2];
+endCol = extendedRange[3];
+} else {
+startCol = intervals.getFirstColumn(start);
+endCol = intervals.getLastColumn(rangeEnd);
+}
 int endLine = rangeEnd;
 if (endCol == -1) { // end is the end of line
 endLine++;
@@ -255,13 +265,15 @@ public final class NILocationVisualizer implements 
Consumer {
 List members = ((ClassTree) 
tree).getMembers();
 for (Tree member : members) {
 Tree t = null;
+Tree enclosingTree = null;
 if (member.getKind() == Tree.Kind.METHOD) {
 t = ((MethodTree) member).getBody();
+enclosingTree = member;
 } else if (member.getKind() == 
Tree.Kind.BLOCK) {
 t = member;
 }
 if (t != null) {
-Interval interval = 
createInterval(cc.getCompilationUnit(), sourcePositions, lineMap, t);
+Interval interval = 
createInterval(cc.getCompilationUnit(), sourcePositions, lineMap, t, 
enclosingTree);
 if (interval != null) {
 intervals.add(interval);
 }
@@ -271,7 +283,7 @@ public final class NILocationVisualizer implements 
Consumer {
 if (isStatic) {
 String name = 
variable.getName().toString();
 name = 
cc.getElementUtilities().getElementName(element, true) + "::" + name;
-Interval interval = 
createInterval(cc.getCompilationUnit(), sourcePositions, lineMap, member);
+Interval interval = 
createInterval(cc.getCompilationUnit(), sourcePositions, lineMap, member, 
enclosingTree);
 if (interval != null) {
 intervals.addVariable(name, 
interval);
 }
@@ -287,7 +299,7 @@ public final class NILocationVisualizer implements 
Consumer {
 return intervals;
 }
 
-private static Interval createInterval(CompilationUnitTree cut, 
SourcePositions sourcePositions, LineMap lineMap, Tree tree) {
+private static Interval createInterval(CompilationUnitTree cut, 
SourcePositions sourcePositions, LineMap lineMap, Tree tree, Tree 
enclosingTree) {
 long start = sourcePositions.getStartPosition(cut, tree);
 long end = sourcePositions.getEndPosition(cut, tree);
 if (start != Diagnostic.NOPOS && end != Diagnostic.NOPOS) {
@@ -295,7 +307,11 @@ public final class NILocationVisualizer implements 
Consumer {

[netbeans] branch master updated: Handle any script's URI and provide script content when not readable from file.

2021-11-01 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 4078eeb  Handle any script's URI and provide script content when not 
readable from file.
4078eeb is described below

commit 4078eeb7c3ab73c21ce669f1a81b8477332afac1
Author: Martin Entlicher 
AuthorDate: Wed Oct 27 21:15:31 2021 +0200

Handle any script's URI and provide script content when not readable from 
file.
---
 .../jpda/truffle/frames/models/TruffleDVFrame.java | 20 ++
 .../debugger/jpda/truffle/source/Source.java   | 11 +-
 .../lsp/server/debugging/NbProtocolServer.java | 24 ++
 3 files changed, 42 insertions(+), 13 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
index c1c0395..27f7e7a 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
@@ -21,6 +21,7 @@ package 
org.netbeans.modules.debugger.jpda.truffle.frames.models;
 import java.io.InvalidObjectException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import org.netbeans.api.debugger.jpda.JPDADebugger;
 import org.netbeans.api.debugger.jpda.JPDAThread;
 import org.netbeans.modules.debugger.jpda.truffle.access.CurrentPCInfo;
@@ -77,15 +78,18 @@ public final class TruffleDVFrame implements DVFrame {
 return null;
 }
 Source source = sourcePosition.getSource();
-URI uri = source.getURI();
-if (uri != null && "file".equalsIgnoreCase(uri.getScheme())) {
-return uri;
-}
-try {
-return source.getUrl().toURI();
-} catch (URISyntaxException ex) {
-return null;
+URL url = source.getUrl();
+URI uri;
+if (url != null) {
+try {
+uri = url.toURI();
+} catch (URISyntaxException ex) {
+uri = source.getURI();
+}
+} else {
+uri = source.getURI();
 }
+return uri;
 }
 
 @Override
diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/source/Source.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/source/Source.java
index 1d618d3..ce43ef5 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/source/Source.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/source/Source.java
@@ -20,6 +20,7 @@
 package org.netbeans.modules.debugger.jpda.truffle.source;
 
 import com.sun.jdi.StringReference;
+import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -64,7 +65,7 @@ public final class Source {
 this.codeRef = codeRef;
 URL url = null;
 if (hostMethodName == null) {
-if (uri == null || !"file".equalsIgnoreCase(uri.getScheme())) {
+if (uri == null || !"file".equalsIgnoreCase(uri.getScheme()) || 
!fileIsReadable(uri)) { // NOI18N
 try {
 url = SourceFilesCache.get(jpda).getSourceFile(name, hash, 
uri, getContent());
 } catch (IOException ex) {
@@ -87,6 +88,14 @@ public final class Source {
 this.hash = hash;
 }
 
+private static boolean fileIsReadable(URI uri) {
+try {
+return new File(uri).canRead();
+} catch (IllegalArgumentException | SecurityException ex) {
+return false;
+}
+}
+
 public static Source getExistingSource(JPDADebugger debugger, long id) {
 synchronized (KNOWN_SOURCES) {
 Map dbgSources = KNOWN_SOURCES.get(debugger);
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
index 7807fdb..458f146 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
@@ -23,6 +23,8 @@ import java.io.IOException;
 import java.io.Writer;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.file.FileSystemNotFoundException;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -325,15 +327,29 @@ public final class N

[netbeans] branch master updated: Do not parallelize notifyToBeResumedNoFire(), because it runs under a lock. [NETBEANS-6127]

2021-10-14 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 9e4c64a  Do not parallelize notifyToBeResumedNoFire(), because it runs 
under a lock. [NETBEANS-6127]
9e4c64a is described below

commit 9e4c64a89e4b2acc36f45928259346b83451f456
Author: Martin Entlicher 
AuthorDate: Wed Oct 13 15:15:43 2021 +0200

Do not parallelize notifyToBeResumedNoFire(), because it runs under a lock. 
[NETBEANS-6127]
---
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 24 +-
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
index 3c4921a..5e1f68d 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
@@ -1893,20 +1893,16 @@ public class JPDADebuggerImpl extends JPDADebugger {
 public void notifyToBeResumedAllNoFire(Set 
ignoredThreads) {
 List threads = 
threadsTranslation.getTranslated((o) ->
 (o instanceof JPDAThreadImpl && (ignoredThreads == null || 
!ignoredThreads.contains(o))) ? (JPDAThreadImpl) o : null);
-int n = threads.size();
-if (n > 0) {
-processInParallel(n, (i) -> {
-JPDAThreadImpl thread = threads.get(i);
-int status = thread.getState();
-boolean invalid = (status == JPDAThread.STATE_NOT_STARTED ||
-   status == JPDAThread.STATE_UNKNOWN ||
-   status == JPDAThread.STATE_ZOMBIE);
-if (!invalid) {
-thread.notifyToBeResumedNoFire();
-} else if (status == JPDAThread.STATE_UNKNOWN || status == 
JPDAThread.STATE_ZOMBIE) {
-threadsTranslation.remove(thread.getThreadReference());
-}
-});
+for (JPDAThreadImpl thread : threads) {
+int status = thread.getState();
+boolean invalid = (status == JPDAThread.STATE_NOT_STARTED ||
+   status == JPDAThread.STATE_UNKNOWN ||
+   status == JPDAThread.STATE_ZOMBIE);
+if (!invalid) {
+thread.notifyToBeResumedNoFire();
+} else if (status == JPDAThread.STATE_UNKNOWN || status == 
JPDAThread.STATE_ZOMBIE) {
+threadsTranslation.remove(thread.getThreadReference());
+}
 }
 }
 

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: The set of arguments and launcher arguments is corrected.

2021-10-12 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new a62f3b5  The set of arguments and launcher arguments is corrected.
a62f3b5 is described below

commit a62f3b5d5471202cfdc990a8ee80904477fb30ef
Author: Martin Entlicher 
AuthorDate: Tue Oct 12 19:56:01 2021 +0200

The set of arguments and launcher arguments is corrected.
---
 .../modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index a30c6c2..4c61774 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -352,10 +352,10 @@ public abstract class NbLaunchDelegate {
 Object envObj = launchArguments.get("env");
 Map env = envObj != null ? (Map) 
envObj : Collections.emptyMap();
 ExplicitProcessParameters.Builder bld = 
ExplicitProcessParameters.builder();
-if (!args.isEmpty()) {
+if (!vmArgs.isEmpty()) {
 bld.launcherArgs(vmArgs);
 }
-if (!vmArgs.isEmpty()) {
+if (!args.isEmpty()) {
 bld.args(args);
 }
 bld.replaceArgs(false);

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: The class com.oracle.truffle.polyglot.LanguageCache$Loader is not found in newer GraalVMs, use TruffleJDKServices instead.

2021-10-12 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 9b8fda1  The class com.oracle.truffle.polyglot.LanguageCache$Loader is 
not found in newer GraalVMs, use TruffleJDKServices instead.
9b8fda1 is described below

commit 9b8fda1ef42f5717b619ab44d822f082140cc318
Author: Martin Entlicher 
AuthorDate: Mon Oct 11 19:46:50 2021 +0200

The class com.oracle.truffle.polyglot.LanguageCache$Loader is not found in 
newer GraalVMs, use TruffleJDKServices instead.
---
 .../modules/debugger/jpda/truffle/RemoteServices.java  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
index b566a93..69af7cb 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java
@@ -95,17 +95,17 @@ public final class RemoteServices {
 
 private static final Logger logger = 
Logger.getLogger(RemoteServices.class.getName());
 
-static final String REMOTE_CLASSES_ZIPFILE = 
"/org/netbeans/modules/debugger/jpda/truffle/resources/JPDATruffleBackend.jar";
+static final String REMOTE_CLASSES_ZIPFILE = 
"/org/netbeans/modules/debugger/jpda/truffle/resources/JPDATruffleBackend.jar"; 
   // NOI18N
 
-private static final String TRUFFLE_CLASS = 
"com.oracle.truffle.api.Truffle";
-private static final String EXPORT_TRUFFLE_CLASS = 
"com.oracle.truffle.polyglot.LanguageCache$Loader";
-private static final String EXPORT_TRUFFLE_METHOD = "exportTruffle";
-private static final String EXPORT_TRUFFLE_SIGNAT = 
"(Ljava/lang/ClassLoader;)V";
+private static final String TRUFFLE_CLASS = 
"com.oracle.truffle.api.Truffle";   // NOI18N
+private static final String EXPORT_TRUFFLE_CLASS = 
"com.oracle.truffle.api.impl.TruffleJDKServices";// NOI18N
+private static final String EXPORT_TRUFFLE_METHOD = "exportTo";
 // NOI18N
+private static final String EXPORT_TRUFFLE_SIGNAT = 
"(Ljava/lang/ClassLoader;Ljava/lang/String;)V"; // NOI18N
 
 private static final Map 
remoteServiceClasses = new WeakHashMap<>();
 private static final Map 
remoteServiceAccess = new WeakHashMap<>();
 
-private static final RequestProcessor AUTORESUME_AFTER_SUSPEND_RP = new 
RequestProcessor("Autoresume after suspend", 1);
+private static final RequestProcessor AUTORESUME_AFTER_SUSPEND_RP = new 
RequestProcessor("Autoresume after suspend", 1);// NOI18N
 
 private static final Set serviceListeners = new 
WeakSet<>();
 
@@ -279,7 +279,7 @@ public final class RemoteServices {
 Exceptions.printStackTrace(new 
IllegalStateException("Method " + EXPORT_TRUFFLE_METHOD + " was not found in " 
+ EXPORT_TRUFFLE_CLASS +" in the debuggee."));
 return null;
 }
-ClassTypeWrapper.invokeMethod(languageLoader, tawt, 
exportTruffle, Collections.singletonList(classLoader), 
ObjectReference.INVOKE_SINGLE_THREADED);
+ClassTypeWrapper.invokeMethod(languageLoader, tawt, 
exportTruffle, Arrays.asList(classLoader, null), 
ObjectReference.INVOKE_SINGLE_THREADED);
 } else {
 ObjectReference cl;
 cl = getTruffleClassLoader(tawt, vm);

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Step and Continue after breakpoint suspends at wrong place after eval. [NETBEANS-6123]

2021-10-12 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1b12ab7  Step and Continue after breakpoint suspends at wrong place 
after eval. [NETBEANS-6123]
1b12ab7 is described below

commit 1b12ab7eebf06b7264161e8f19a90b5142103a03
Author: Martin Entlicher 
AuthorDate: Mon Oct 11 20:23:41 2021 +0200

Step and Continue after breakpoint suspends at wrong place after eval. 
[NETBEANS-6123]
---
 .../modules/debugger/jpda/JPDAStepImpl.java|  6 ++
 .../debugger/jpda/actions/StepActionProvider.java  |  3 +
 .../debugger/jpda/actions/StepIntoNextMethod.java  |  2 +
 .../modules/debugger/jpda/impl/StepUtils.java  | 67 
 .../debugger/jpda/models/JPDAThreadImpl.java   | 42 -
 .../org/netbeans/api/debugger/jpda/StepTest.java   | 71 ++
 .../debugger/jpda/testapps/StepAndContinueApp.java | 53 
 7 files changed, 241 insertions(+), 3 deletions(-)

diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java
index e762f6f..2a3706f 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java
@@ -62,6 +62,7 @@ import 
org.netbeans.api.debugger.jpda.event.JPDABreakpointListener;
 import 
org.netbeans.modules.debugger.jpda.actions.CompoundSmartSteppingListener;
 import org.netbeans.modules.debugger.jpda.actions.SmartSteppingFilterImpl;
 import org.netbeans.modules.debugger.jpda.actions.StepIntoActionProvider;
+import org.netbeans.modules.debugger.jpda.impl.StepUtils;
 import org.netbeans.modules.debugger.jpda.jdi.ClassNotPreparedExceptionWrapper;
 import org.netbeans.modules.debugger.jpda.jdi.ClassTypeWrapper;
 import 
org.netbeans.modules.debugger.jpda.jdi.IllegalThreadStateExceptionWrapper;
@@ -225,6 +226,7 @@ public class JPDAStepImpl extends JPDAStep implements 
Executor {
 size,
 getDepth()
 );
+StepUtils.markOriginalStepDepth(stepRequest, 
trImpl.getThreadReference());
 //stepRequest.addCountFilter(1); - works bad with exclusion 
filters!
 String[] exclusionPatterns = 
applyExclusionPatterns(stepRequest);
 debuggerImpl.getOperator().register(stepRequest, this);
@@ -468,6 +470,7 @@ public class JPDAStepImpl extends JPDAStep implements 
Executor {
 StepRequest.STEP_LINE,
 StepRequest.STEP_OVER
 );
+StepUtils.markOriginalStepDepth(boundaryStepRequest, trRef);
 if (isNextOperationFromDifferentExpression) {
 EventRequestWrapper.addCountFilter(boundaryStepRequest, 2);
 } else {
@@ -632,6 +635,7 @@ public class JPDAStepImpl extends JPDAStep implements 
Executor {
 StepRequest.STEP_LINE,
 StepRequest.STEP_OUT
 );
+StepUtils.markOriginalStepDepth(stepRequest, 
tr.getThreadReference());
 EventRequestWrapper.addCountFilter(stepRequest, 1);
 String[] exclusionPatterns = 
getCurrentExclusionPatterns();
 // JDI is inconsistent!!! Step into steps 
*through* filters, but step out does *NOT*
@@ -946,6 +950,7 @@ public class JPDAStepImpl extends JPDAStep implements 
Executor {
 doStepSize,
 doStepDepth
 );
+StepUtils.markOriginalStepDepth(stepRequest, tr);
 //EventRequestWrapper.addCountFilter(stepRequest, 1);
 String[] exclusionPatterns = 
applyExclusionPatterns(stepRequest);
 debuggerImpl.getOperator ().register (stepRequest, 
this);
@@ -1002,6 +1007,7 @@ public class JPDAStepImpl extends JPDAStep implements 
Executor {
 doStepSize,
 depth
 );
+StepUtils.markOriginalStepDepth(stepRequest, tr);
 if (logger.isLoggable(Level.FINE)) {
 try {
 logger.fine("Can not stop at " + 
ThreadReferenceWrapper.frame(tr, 0) + ", smart-stepping. Submitting step = " + 
stepRequest + "; depth = " + depth);
diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StepActionProvider.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StepActionProvider.java
index a770ea5..6cff450 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StepActionProvider.java
+++ 
b/java/debugger

[netbeans] branch master updated: Apply LSP URI translation to debugger as well. URI translation cache is created.

2021-10-11 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 41da357  Apply LSP URI translation to debugger as well. URI 
translation cache is created.
41da357 is described below

commit 41da35720129ef4f4b7c94bd22ef230ead719153
Author: Martin Entlicher 
AuthorDate: Mon Oct 11 07:34:07 2021 +0200

Apply LSP URI translation to debugger as well. URI translation cache is 
created.
---
 .../modules/java/lsp/server/URITranslator.java | 183 +
 .../netbeans/modules/java/lsp/server/Utils.java|  89 +-
 .../lsp/server/debugging/NbProtocolServer.java |   2 +
 .../lsp/server/debugging/NbSourceProvider.java |   2 +
 .../breakpoints/NbBreakpointsRequestHandler.java   |   2 +
 5 files changed, 191 insertions(+), 87 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/URITranslator.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/URITranslator.java
new file mode 100644
index 000..a68f2f2
--- /dev/null
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/URITranslator.java
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.netbeans.modules.java.lsp.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.filesystems.URLMapper;
+import org.openide.modules.Places;
+import org.openide.util.Exceptions;
+
+/**
+ * Translation between NetBeans URIs and LSP URIs. LSP clients might not like
+ * archive URIs. The archive URIs are translated to plain file URIs from a 
cache
+ * directory.
+ */
+public final class URITranslator {
+
+private static final URITranslator INSTANCE = new URITranslator();
+
+private final Map uriFromCacheMap = new LRUCacheMap();
+private final Map uriToCacheMap = new LRUCacheMap();
+
+public static URITranslator getDefault() {
+return INSTANCE;
+}
+
+public synchronized String uriToLSP(String lspUri) {
+return uriFromCacheMap.computeIfAbsent(lspUri, uri -> {
+URI uriUri = URI.create(uri);
+URL url;
+try {
+url = uriUri.toURL();
+} catch (MalformedURLException ex) {
+return uri;
+}
+if (FileUtil.isArchiveArtifact(url)) {
+FileObject file = URLMapper.findFileObject(url);
+if (file == null) {
+return uri;
+}
+File cacheDir = getCacheDir();
+cacheDir.mkdirs();
+File segments = new File(cacheDir, "segments"); // NOI18N
+Properties props = new Properties();
+
+try (InputStream in = new FileInputStream(segments)) {
+props.load(in);
+} catch (IOException ex) {
+//OK, may not exist yet
+}
+FileObject archive = FileUtil.getArchiveFile(file);
+String archiveString = archive.toURL().toString();
+File foundSegment = null;
+for (String segment : props.stringPropertyNames()) {
+if (archiveString.equals(props.getProperty(segment))) {
+foundSegment = new File(cacheDir, segment);
+break;
+}
+}
+if (foundSegment == null) {
+int i = 0;
+while (props.getProperty("s" + i) != null) {// NOI18N
+i++;
+}
+  

[netbeans] branch master updated: Remove check that blows up when the LSP or DAP server is reset.

2021-10-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new aae0fcd  Remove check that blows up when the LSP or DAP server is 
reset.
aae0fcd is described below

commit aae0fcd2997c1921280d8c6709551d8a0de57c64
Author: Martin Entlicher 
AuthorDate: Thu Oct 7 10:37:46 2021 +0200

Remove check that blows up when the LSP or DAP server is reset.
---
 .../src/org/netbeans/modules/java/lsp/server/LspSession.java| 6 --
 1 file changed, 6 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/LspSession.java 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/LspSession.java
index 5ed3a88..4df0d7c 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/LspSession.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/LspSession.java
@@ -53,9 +53,6 @@ public final class LspSession {
  * Set the launched LSP server.
  */
 void setLspServer(NbLspServer lspServer) {
-if (lspServer != null && this.lspServer != null) {
-throw new IllegalStateException("LSP server is set already");
-}
 setServerLookup(lspServer, lspServices);
 this.lspServer = lspServer;
 }
@@ -64,9 +61,6 @@ public final class LspSession {
  * Set the launched DAP server.
  */
 void setDapServer(NbProtocolServer dapServer) {
-if (dapServer != null && this.dapServer != null) {
-throw new IllegalStateException("DAP server is set already");
-}
 setServerLookup(dapServer, dapServices);
 this.dapServer = dapServer;
 }

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Correction of layer location and thread filtering.

2021-10-06 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 3584df036d33007053bdc409c7eada0d89ac26f4
Author: Martin Entlicher 
AuthorDate: Fri Oct 1 09:53:50 2021 +0200

Correction of layer location and thread filtering.
---
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 22 
 java/java.lsp.server/manifest.mf   |  1 -
 .../netbeans/modules/nbcode/integration/layer.xml  |  3 +++
 .../org/netbeans/modules/java/lsp/server/layer.xml | 30 --
 4 files changed, 13 insertions(+), 43 deletions(-)

diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
index 1085334..3c4921a 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
@@ -1989,28 +1989,26 @@ public class JPDADebuggerImpl extends JPDADebugger {
 
 // Create threads in parallel.
 // Constructor of JPDAThreadImpl calls getName() and getStatus(), 
which take time on slow connection during remote debugging.
-List threads = new ArrayList<>(n);
+JPDAThread[] threads = new JPDAThread[n];
 if (n > 0) {
-AtomicBoolean filteredThreads = new AtomicBoolean(false);
 processInParallel(n, (i) -> {
 JPDAThreadImpl thread = getThread(tl.get(i));
 if 
(!thread.getName().contains(ThreadsCache.THREAD_NAME_FILTER_PATTERN)) {
-threads.set(i, thread);
+threads[i] = thread;
 } else {
-threads.set(i, null);
-filteredThreads.set(true);
+threads[i] = null;
 }
 });
-if (filteredThreads.get()) {
-Iterator it = threads.iterator();
-while (it.hasNext()) {
-if (it.next() == null) {
-it.remove();
-}
+List threadsFiltered = new ArrayList<>(n);
+for (JPDAThread t : threads) {
+if (t != null) {
+threadsFiltered.add(t);
 }
 }
+return Collections.unmodifiableList(threadsFiltered);
+} else {
+return Collections.emptyList();
 }
-return Collections.unmodifiableList(threads);
 }
 
 private void processInParallel(int n, Consumer task) {
diff --git a/java/java.lsp.server/manifest.mf b/java/java.lsp.server/manifest.mf
index 78c39b3..32384b0 100644
--- a/java/java.lsp.server/manifest.mf
+++ b/java/java.lsp.server/manifest.mf
@@ -3,5 +3,4 @@ AutoUpdate-Show-In-Client: true
 OpenIDE-Module: org.netbeans.modules.java.lsp.server
 OpenIDE-Module-Implementation-Version: 1
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/java/lsp/server/Bundle.properties
-OpenIDE-Module-Layer: org/netbeans/modules/java/lsp/server/layer.xml
 
diff --git 
a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
 
b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
index 8820b7f..794101d 100644
--- 
a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
+++ 
b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
@@ -21,6 +21,9 @@
 -->
 http://www.netbeans.org/dtds/filesystem-1_2.dtd";>
 
+
+
+
 
 
 
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/layer.xml 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/layer.xml
deleted file mode 100644
index 311b57a..000
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/layer.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-http://www.netbeans.org/dtds/filesystem-1_2.dtd";>
-
-
-
-
-
-
-
-
\ No newline at end of file

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/02: Performance optimizations to speed up remote debugging.

2021-10-06 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit e4211472b858851f100d52522898e05239f98088
Author: Martin Entlicher 
AuthorDate: Tue Sep 7 12:13:34 2021 +0200

Performance optimizations to speed up remote debugging.
---
 .../debugger/jpda/DeadlockDetectorImpl.java|  44 ++--
 .../debugger/jpda/JDIExceptionReporter.java|  16 +-
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 223 -
 .../modules/debugger/jpda/SingleThreadWatcher.java |   5 +-
 .../debugger/jpda/actions/StepActionProvider.java  |   3 +
 .../debugger/jpda/models/JPDAThreadGroupImpl.java  |  11 +-
 .../debugger/jpda/models/JPDAThreadImpl.java   | 122 ++-
 .../debugger/jpda/models/ObjectTranslation.java| 115 +--
 .../modules/debugger/jpda/models/ThreadsCache.java |  17 --
 java/java.lsp.server/manifest.mf   |   1 +
 .../modules/debugger/jpda/Bundle.properties|  18 ++
 .../lsp/server/debugging/NbProtocolServer.java | 154 +++---
 .../variables/NbVariablesRequestHandler.java   | 104 +-
 .../org/netbeans/modules/java/lsp/server/layer.xml |  30 +++
 14 files changed, 529 insertions(+), 334 deletions(-)

diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
index 8018fe8..9f1a938 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
@@ -34,15 +34,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+
 import org.netbeans.api.debugger.jpda.CallStackFrame;
 import org.netbeans.api.debugger.jpda.DeadlockDetector;
 import org.netbeans.api.debugger.jpda.JPDADebugger;
 import org.netbeans.api.debugger.jpda.JPDAThread;
 import org.netbeans.api.debugger.jpda.ObjectVariable;
-import org.netbeans.api.debugger.jpda.This;
 import org.netbeans.modules.debugger.jpda.expr.JDIVariable;
 import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
-import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
 import org.openide.util.RequestProcessor;
 import org.openide.util.RequestProcessor.Task;
 import org.openide.util.WeakListeners;
@@ -52,6 +52,9 @@ import org.openide.util.WeakSet;
  *
  * @author martin
  */
+@NbBundle.Messages({
+"USE_JPDA_DEADLOCK_DETECTOR=true"
+})
 public class DeadlockDetectorImpl extends DeadlockDetector implements 
PropertyChangeListener {
 
 private final Set suspendedThreads = new WeakSet();
@@ -61,6 +64,9 @@ public class DeadlockDetectorImpl extends DeadlockDetector 
implements PropertyCh
 private Map monitorToNode;
 
 DeadlockDetectorImpl(JPDADebugger debugger) {
+if (!Boolean.valueOf(Bundle.USE_JPDA_DEADLOCK_DETECTOR())) {
+return;
+}
 debugger.addPropertyChangeListener(this);
 List threads = 
debugger.getThreadsCollector().getAllThreads();
 for (JPDAThread thread : threads) {
@@ -85,24 +91,26 @@ public class DeadlockDetectorImpl extends DeadlockDetector 
implements PropertyCh
 final Set tempSuspThreads;
 synchronized(suspendedThreads) {
 suspendedThreads.add(thread);
-tempSuspThreads = new 
HashSet(suspendedThreads);
+tempSuspThreads = suspendedThreads.size() > 1 ? new 
HashSet(suspendedThreads) : null;
 }
-final Task[] taskPtr = new Task[] { null };
-synchronized (unfinishedTasks) {
-Task task = rp.post(new Runnable() {
-public void run() {
-Set deadlocks;
-deadlocks = findDeadlockedThreads(tempSuspThreads);
-if (deadlocks != null) {
-setDeadlocks(deadlocks);
-}
-synchronized (unfinishedTasks) {
-unfinishedTasks.remove(taskPtr[0]);
+if (tempSuspThreads != null) {
+final Task[] taskPtr = new Task[] { null };
+synchronized (unfinishedTasks) {
+Task task = rp.post(new Runnable() {
+public void run() {
+Set deadlocks;
+deadlocks = 
findDeadlockedThreads(tempSuspThreads);
+if (deadlocks != null) {
+setDeadlocks(deadlocks);
+}
+synchronized (unfinishedTasks) {
+unfinishe

[netbeans] branch master updated (9a25ef5 -> 3584df0)

2021-10-06 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 9a25ef5  Merge pull request #3184 from sdedic/bugfix/javadoc-resolve
 new e421147  Performance optimizations to speed up remote debugging.
 new 3584df0  Correction of layer location and thread filtering.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../debugger/jpda/DeadlockDetectorImpl.java|  44 ++--
 .../debugger/jpda/JDIExceptionReporter.java|  16 +-
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 223 -
 .../modules/debugger/jpda/SingleThreadWatcher.java |   5 +-
 .../debugger/jpda/actions/StepActionProvider.java  |   3 +
 .../debugger/jpda/models/JPDAThreadGroupImpl.java  |  11 +-
 .../debugger/jpda/models/JPDAThreadImpl.java   | 122 ++-
 .../debugger/jpda/models/ObjectTranslation.java| 115 +--
 .../modules/debugger/jpda/models/ThreadsCache.java |  17 --
 .../modules/debugger/jpda}/Bundle.properties   |   2 +-
 .../netbeans/modules/nbcode/integration/layer.xml  |   3 +
 .../lsp/server/debugging/NbProtocolServer.java | 154 +++---
 .../variables/NbVariablesRequestHandler.java   | 104 +-
 13 files changed, 483 insertions(+), 336 deletions(-)
 copy 
{apisupport/apisupport.ant/test/unit/data/example-external-projects/suite1/support/lib-project/src/org/netbeans/examples/modules/lib
 => 
java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-debugger-jpda.jar/org/netbeans/modules/debugger/jpda}/Bundle.properties
 (95%)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Do not persist breakpoints and watches when debugging through LSP server.

2021-10-05 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0dfe95f  Do not persist breakpoints and watches when debugging through 
LSP server.
0dfe95f is described below

commit 0dfe95f624fa6f054441f324d698a6d499d52544
Author: Martin Entlicher 
AuthorDate: Tue Sep 21 14:25:42 2021 +0200

Do not persist breakpoints and watches when debugging through LSP server.
---
 .../debugger/breakpoints/PersistenceManager.java   | 15 +++
 .../debug/breakpoints/io/PersistenceManager.java   | 15 +++
 ide/spi.debugger.ui/apichanges.xml | 17 +++
 ide/spi.debugger.ui/arch.xml   |  9 
 ide/spi.debugger.ui/manifest.mf|  2 +-
 .../modules/debugger/ui/PersistenceManager.java| 15 +++
 .../jpda/breakpoints/PersistenceManager.java   | 15 +++
 .../nbcode/integration/nbproject/project.xml   |  9 
 .../nbcode/integration/LspDebuggerOptions.java | 52 ++
 .../integration/VerifyDebuggerPersistence.java | 43 ++
 java/java.lsp.server/nbproject/project.xml |  2 +-
 11 files changed, 192 insertions(+), 2 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/PersistenceManager.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/PersistenceManager.java
index d77c8f2..895e08c 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/PersistenceManager.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/PersistenceManager.java
@@ -43,8 +43,17 @@ import org.netbeans.spi.debugger.DebuggerServiceRegistration;
 @DebuggerServiceRegistration(types={LazyDebuggerManagerListener.class})
 public class PersistenceManager implements LazyDebuggerManagerListener {
 
+private boolean areBreakpointsPersisted() {
+Properties p = Properties.getDefault ().getProperties ("debugger");
+p = p.getProperties("persistence");
+return p.getBoolean("breakpoints", true);
+}
+
 @Override
 public Breakpoint[] initBreakpoints () {
+if (!areBreakpointsPersisted()) {
+return new Breakpoint[]{};
+}
 Properties p = Properties.getDefault ().getProperties ("debugger").
 getProperties (DebuggerManager.PROP_BREAKPOINTS);
 Breakpoint[] breakpoints = (Breakpoint[]) p.getArray (
@@ -81,6 +90,9 @@ public class PersistenceManager implements 
LazyDebuggerManagerListener {
 
 @Override
 public void breakpointAdded (Breakpoint breakpoint) {
+if (!areBreakpointsPersisted()) {
+return ;
+}
 if (breakpoint instanceof CPPLiteBreakpoint) {
 Properties p = Properties.getDefault ().getProperties ("debugger").
 getProperties (DebuggerManager.PROP_BREAKPOINTS);
@@ -94,6 +106,9 @@ public class PersistenceManager implements 
LazyDebuggerManagerListener {
 
 @Override
 public void breakpointRemoved (Breakpoint breakpoint) {
+if (!areBreakpointsPersisted()) {
+return ;
+}
 if (breakpoint instanceof CPPLiteBreakpoint) {
 Properties p = Properties.getDefault ().getProperties ("debugger").
 getProperties (DebuggerManager.PROP_BREAKPOINTS);
diff --git 
a/ide/javascript2.debug/src/org/netbeans/modules/javascript2/debug/breakpoints/io/PersistenceManager.java
 
b/ide/javascript2.debug/src/org/netbeans/modules/javascript2/debug/breakpoints/io/PersistenceManager.java
index 828595a..c8034fe 100644
--- 
a/ide/javascript2.debug/src/org/netbeans/modules/javascript2/debug/breakpoints/io/PersistenceManager.java
+++ 
b/ide/javascript2.debug/src/org/netbeans/modules/javascript2/debug/breakpoints/io/PersistenceManager.java
@@ -50,6 +50,12 @@ public class PersistenceManager implements 
LazyDebuggerManagerListener {
 
 private static final String JS_PROPERTY = "JS";
 
+private boolean areBreakpointsPersisted() {
+Properties p = Properties.getDefault ().getProperties ("debugger");
+p = p.getProperties("persistence");
+return p.getBoolean("breakpoints", true);
+}
+
 @Override
 public String[] getProperties() {
 return new String [] {
@@ -60,6 +66,9 @@ public class PersistenceManager implements 
LazyDebuggerManagerListener {
 
 @Override
 public Breakpoint[] initBreakpoints() {
+if (!areBreakpointsPersisted()) {
+return new Breakpoint[]{};
+}
 Properties p = Properties.getDefault ().getProperties ("debugger").
 getProperties (DebuggerManager.PRO

[netbeans] branch master updated: Support of setting the current working directory and environment variables for Java8+ VSCode projects.

2021-09-30 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 03bd150  Support of setting the current working directory and 
environment variables for Java8+ VSCode projects.
03bd150 is described below

commit 03bd150b8b96fde89f653c9f581a24ba1af411e2
Author: Martin Entlicher 
AuthorDate: Tue Sep 21 03:03:14 2021 +0200

Support of setting the current working directory and environment variables 
for Java8+ VSCode projects.
---
 cpplite/cpplite.debugger/nbproject/project.xml |  11 +-
 .../modules/cpplite/debugger/CPPLiteDebugger.java  |  36 +++-
 .../cpplite/debugger/CPPLiteDebuggerConfig.java|  35 +++-
 .../modules/cpplite/debugger/api/Debugger.java |   4 +-
 .../debugger/ni/NIDebuggerProviderImpl.java|  20 ++-
 .../cpplite/debugger/AbstractDebugTest.java|  53 +-
 .../cpplite/debugger/ProcessParametersTest.java| 192 +
 extide/gradle/apichanges.xml   |  17 ++
 extide/gradle/arch.xml |  14 ++
 .../gradle/tooling/NetBeansRunSinglePlugin.groovy  | 104 ++-
 .../base/ExplicitProcessParameters.java| 106 +++-
 .../nativeimage/api/debug/EvaluateException.java   |   7 +-
 .../modules/nativeimage/api/debug/NIDebugger.java  |  56 --
 .../modules/nativeimage/api/debug/NIFrame.java |  16 +-
 .../api/debug/NILineBreakpointDescriptor.java  |  26 +--
 .../modules/nativeimage/api/debug/NIVariable.java  |  20 +--
 .../api/debug/StartDebugParameters.java| 188 
 .../nativeimage/spi/debug/NIDebuggerProvider.java  |  56 --
 java/gradle.java/arch.xml  |  12 ++
 java/gradle.java/nbproject/project.xml |   4 +-
 .../modules/gradle/java/action-mapping.xml |  12 +-
 .../modules/gradle/java/api/ProjectActions.java|  23 ++-
 .../gradle/java/execute/JavaExecTokenProvider.java |  58 ++-
 .../java/execute/JavaExecTokenProviderTest.java|  34 
 java/java.lsp.server/nbproject/project.xml |   4 +-
 .../server/debugging/launch/NbLaunchDelegate.java  |  89 --
 java/java.lsp.server/vscode/package.json   |  15 ++
 .../nbproject/project.xml  |   2 +-
 .../debugger/actions/NIAttachCustomizer.java   |   1 +
 .../nativeimage/debugger/api/NIDebugRunner.java|  25 +++
 java/maven/nbproject/project.xml   |   2 +-
 .../modules/maven/debug/DebuggerChecker.java   |  18 +-
 .../maven/execute/DefaultReplaceTokenProvider.java |   1 +
 .../maven/execute/MavenCommandLineExecutor.java|  14 +-
 .../maven/runjar/LaunchArgPrereqsChecker.java  |  15 ++
 .../modules/maven/runjar/MavenExecuteUtils.java|   7 +
 .../modules/maven/runjar/RunJarStartupArgs.java|  18 +-
 .../maven/execute/MavenExecutionTestBase.java  |   6 +-
 .../maven/runjar/ExecutionEnvHelperTest.java   |  52 ++
 39 files changed, 1242 insertions(+), 131 deletions(-)

diff --git a/cpplite/cpplite.debugger/nbproject/project.xml 
b/cpplite/cpplite.debugger/nbproject/project.xml
index 7574c06..55bb7e8 100644
--- a/cpplite/cpplite.debugger/nbproject/project.xml
+++ b/cpplite/cpplite.debugger/nbproject/project.xml
@@ -61,12 +61,21 @@
 
 
 
+
org.netbeans.modules.extexecution.base
+
+
+
+2
+1.20
+
+
+
 
org.netbeans.modules.nativeimage.api
 
 
 
 0
-0.4
+0.5
 
 
 
diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 946f047..7c30f7c 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -50,6 +50,7 @@ import org.netbeans.api.debugger.DebuggerEngine;
 import org.netbeans.api.debugger.DebuggerInfo;
 import org.netbeans.api.debugger.DebuggerManager;
 import org.netbeans.api.debugger.DebuggerManagerAdapter;
+import org.netbeans.api.extexecution.base.ExplicitProcessParameters;
 import org.netbeans.modules.cnd.debugger.gdb2.mi.MICommand;
 import org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandInjector;
 import org.netbeans.modules.cnd.debugger.gdb2.mi.MIConst;
@@ -75,6 +76,7 @@ import org.openide.filesystems.FileUtil;
 import org.openide.text.Annotatable;
 import

[netbeans] branch master updated: Proper handling of LSP logging breakpoints.

2021-09-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1668b3a  Proper handling of LSP logging breakpoints.
1668b3a is described below

commit 1668b3a2c0bbf61fc3b1a48fd9e9a8954a7a7e31
Author: Martin Entlicher 
AuthorDate: Thu Sep 2 09:28:47 2021 +0200

Proper handling of LSP logging breakpoints.
---
 .../jpda/truffle/access/TruffleAccess.java |  50 +++--
 .../debugger/jpda/truffle/access/TruffleEval.java  |   4 +
 .../truffle/breakpoints/TruffleLineBreakpoint.java |  34 +-
 .../breakpoints/impl/HitBreakpointInfo.java|  65 
 .../breakpoints/impl/TruffleBreakpointOutput.java  | 118 +
 .../impl/TruffleBreakpointsHandler.java|   4 +
 .../impl/TruffleBreakpointsRegistry.java   |  75 +
 .../debugger/jpda/console/DebuggerOutput.java  |   9 +-
 .../jpda/expr/InvocationExceptionTranslated.java   |   7 +-
 .../server/debugging/breakpoints/NbBreakpoint.java |  18 +++-
 10 files changed, 373 insertions(+), 11 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
index eaf94da..7730a71 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
@@ -38,6 +38,7 @@ import java.beans.PropertyVetoException;
 import java.io.InvalidObjectException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -89,6 +90,8 @@ import 
org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager;
 import org.netbeans.modules.debugger.jpda.truffle.Utils;
 import org.netbeans.modules.debugger.jpda.truffle.actions.StepActionProvider;
 import org.netbeans.modules.debugger.jpda.truffle.ast.TruffleNode;
+import 
org.netbeans.modules.debugger.jpda.truffle.breakpoints.impl.HitBreakpointInfo;
+import 
org.netbeans.modules.debugger.jpda.truffle.breakpoints.impl.TruffleBreakpointOutput;
 import org.netbeans.modules.debugger.jpda.truffle.frames.TruffleStackFrame;
 import org.netbeans.modules.debugger.jpda.truffle.frames.TruffleStackInfo;
 import org.netbeans.modules.debugger.jpda.truffle.source.Source;
@@ -366,12 +369,18 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 JPDADebugger debugger = event.getDebugger();
 if (execHaltedBP.get(debugger) == bp) {
 LOG.log(Level.FINE, 
"TruffleAccessBreakpoints.breakpointReached({0}), exec halted.", event);
-StepActionProvider.killJavaStep(debugger);
-setCurrentPosition(debugger, event.getThread());
+if (!setCurrentPosition(debugger, event.getThread())) {
+event.resume();
+} else {
+StepActionProvider.killJavaStep(debugger);
+}
 } else if (execStepIntoBP.get(debugger) == bp) {
 LOG.log(Level.FINE, 
"TruffleAccessBreakpoints.breakpointReached({0}), exec step into.", event);
-StepActionProvider.killJavaStep(debugger);
-setCurrentPosition(debugger, event.getThread());
+if (!setCurrentPosition(debugger, event.getThread())) {
+event.resume();
+} else {
+StepActionProvider.killJavaStep(debugger);
+}
 } else if (dbgAccessBP.get(debugger) == bp) {
 LOG.log(Level.FINE, 
"TruffleAccessBreakpoints.breakpointReached({0}), debugger access.", event);
 try {
@@ -388,8 +397,11 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 }
 }
 
-private void setCurrentPosition(JPDADebugger debugger, JPDAThread thread) {
+private boolean setCurrentPosition(JPDADebugger debugger, JPDAThread 
thread) {
 CurrentPCInfo cpci = getCurrentPosition(debugger, thread);
+if (cpci == null) {
+return false;
+}
 synchronized (currentPCInfos) {
 ThreadInfo info = currentPCInfos.get(thread);
 if (info == null) {
@@ -399,6 +411,7 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 }
 info.cpi = cpci;
 }
+return true;
 }
 
 private static CurrentPCInfo getCurrentPosition(JPDADebugger debugger, 
JPDAThread thread) {
@@ -427,15 +440,40 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 ObjectVariable thisObject = null;// TODO: (ObjectVariable) 
frameInfoVar.getField("thisObject");
 TruffleSta

[netbeans] branch master updated: Performance optimizations to speed up remote debugging.

2021-09-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8a328a3  Performance optimizations to speed up remote debugging.
8a328a3 is described below

commit 8a328a371bed55f5f488bb3d0d89ae8a8c5b84bc
Author: Martin Entlicher 
AuthorDate: Tue Sep 7 12:13:34 2021 +0200

Performance optimizations to speed up remote debugging.
---
 .../debugger/jpda/DeadlockDetectorImpl.java|  44 ++--
 .../debugger/jpda/JDIExceptionReporter.java|  16 +-
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 223 -
 .../modules/debugger/jpda/SingleThreadWatcher.java |   5 +-
 .../debugger/jpda/actions/StepActionProvider.java  |   3 +
 .../debugger/jpda/models/JPDAThreadGroupImpl.java  |  11 +-
 .../debugger/jpda/models/JPDAThreadImpl.java   | 122 ++-
 .../debugger/jpda/models/ObjectTranslation.java| 115 +--
 .../modules/debugger/jpda/models/ThreadsCache.java |  17 --
 java/java.lsp.server/manifest.mf   |   1 +
 .../modules/debugger/jpda/Bundle.properties|  18 ++
 .../lsp/server/debugging/NbProtocolServer.java | 154 +++---
 .../variables/NbVariablesRequestHandler.java   | 104 +-
 .../org/netbeans/modules/java/lsp/server/layer.xml |  30 +++
 14 files changed, 529 insertions(+), 334 deletions(-)

diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
index 8018fe8..9f1a938 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/DeadlockDetectorImpl.java
@@ -34,15 +34,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+
 import org.netbeans.api.debugger.jpda.CallStackFrame;
 import org.netbeans.api.debugger.jpda.DeadlockDetector;
 import org.netbeans.api.debugger.jpda.JPDADebugger;
 import org.netbeans.api.debugger.jpda.JPDAThread;
 import org.netbeans.api.debugger.jpda.ObjectVariable;
-import org.netbeans.api.debugger.jpda.This;
 import org.netbeans.modules.debugger.jpda.expr.JDIVariable;
 import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
-import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
 import org.openide.util.RequestProcessor;
 import org.openide.util.RequestProcessor.Task;
 import org.openide.util.WeakListeners;
@@ -52,6 +52,9 @@ import org.openide.util.WeakSet;
  *
  * @author martin
  */
+@NbBundle.Messages({
+"USE_JPDA_DEADLOCK_DETECTOR=true"
+})
 public class DeadlockDetectorImpl extends DeadlockDetector implements 
PropertyChangeListener {
 
 private final Set suspendedThreads = new WeakSet();
@@ -61,6 +64,9 @@ public class DeadlockDetectorImpl extends DeadlockDetector 
implements PropertyCh
 private Map monitorToNode;
 
 DeadlockDetectorImpl(JPDADebugger debugger) {
+if (!Boolean.valueOf(Bundle.USE_JPDA_DEADLOCK_DETECTOR())) {
+return;
+}
 debugger.addPropertyChangeListener(this);
 List threads = 
debugger.getThreadsCollector().getAllThreads();
 for (JPDAThread thread : threads) {
@@ -85,24 +91,26 @@ public class DeadlockDetectorImpl extends DeadlockDetector 
implements PropertyCh
 final Set tempSuspThreads;
 synchronized(suspendedThreads) {
 suspendedThreads.add(thread);
-tempSuspThreads = new 
HashSet(suspendedThreads);
+tempSuspThreads = suspendedThreads.size() > 1 ? new 
HashSet(suspendedThreads) : null;
 }
-final Task[] taskPtr = new Task[] { null };
-synchronized (unfinishedTasks) {
-Task task = rp.post(new Runnable() {
-public void run() {
-Set deadlocks;
-deadlocks = findDeadlockedThreads(tempSuspThreads);
-if (deadlocks != null) {
-setDeadlocks(deadlocks);
-}
-synchronized (unfinishedTasks) {
-unfinishedTasks.remove(taskPtr[0]);
+if (tempSuspThreads != null) {
+final Task[] taskPtr = new Task[] { null };
+synchronized (unfinishedTasks) {
+Task task = rp.post(new Runnable() {
+public void run() {
+Set deadlocks;
+deadlocks = 
findDeadlockedThreads(tempSuspThreads);
+if (deadlocks != null) {
+   

[netbeans] branch master updated: Restart frame action implemented in the DAP.

2021-08-25 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 65feb02  Restart frame action implemented in the DAP.
65feb02 is described below

commit 65feb026d3e375311a8b724852a54c2315fc7f33
Author: Martin Entlicher 
AuthorDate: Thu Aug 19 18:48:51 2021 +0200

Restart frame action implemented in the DAP.
---
 ide/spi.debugger.ui/manifest.mf|  2 +-
 .../netbeans/spi/debugger/ui/DebuggingView.java| 30 ++
 java/debugger.jpda.truffle/nbproject/project.xml   |  2 +-
 .../jpda/truffle/frames/models/TruffleDVFrame.java | 26 +++
 java/debugger.jpda.ui/nbproject/project.xml|  2 +-
 .../debugger/jpda/ui/debugging/JPDADVFrame.java| 17 +++-
 .../debugger/jpda/models/CallStackFrameImpl.java   |  4 +--
 java/java.lsp.server/nbproject/project.xml |  2 +-
 .../lsp/server/debugging/NbProtocolServer.java | 29 +
 9 files changed, 107 insertions(+), 7 deletions(-)

diff --git a/ide/spi.debugger.ui/manifest.mf b/ide/spi.debugger.ui/manifest.mf
index 51cbb37..92fd524 100644
--- a/ide/spi.debugger.ui/manifest.mf
+++ b/ide/spi.debugger.ui/manifest.mf
@@ -2,6 +2,6 @@ Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.spi.debugger.ui/1
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/debugger/ui/Bundle.properties
 OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
-OpenIDE-Module-Specification-Version: 2.69
+OpenIDE-Module-Specification-Version: 2.70
 OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui
 OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class
diff --git 
a/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java 
b/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
index dd085bf..cbf64c2 100644
--- a/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
+++ b/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
@@ -508,6 +508,36 @@ public final class DebuggingView {
  * @since 2.65
  */
 int getColumn();
+
+/**
+ * Pop all frames up to and including this frame off the stack.
+ *
+ * @throws UnsupportedOperationException thrown when popping of stack 
frames is not supported.
+ * @throws PopException when the pop frame operation fails.
+ * @since 2.70
+ */
+default void popOff() throws UnsupportedOperationException, 
PopException {
+throw new UnsupportedOperationException("The frame pop is not 
supported.");
+}
+}
+
+/**
+ * Thrown when {@link DVFrame#popOff()} operation fails. The message of 
this
+ * exception describes the failure.
+ *
+ * @since 2.70
+ */
+public static final class PopException extends Exception {
+
+/**
+ * Creates a new PopException with a description message.
+ * @param message the description
+ *
+ * @since 2.70
+ */
+public PopException(String message) {
+super(message);
+}
 }
 
 /**
diff --git a/java/debugger.jpda.truffle/nbproject/project.xml 
b/java/debugger.jpda.truffle/nbproject/project.xml
index d06cb2a..f15d913 100644
--- a/java/debugger.jpda.truffle/nbproject/project.xml
+++ b/java/debugger.jpda.truffle/nbproject/project.xml
@@ -130,7 +130,7 @@
 
 
 1
-2.67
+2.70
 
 
 
diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
index da348c2..c1c0395 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/frames/models/TruffleDVFrame.java
@@ -18,8 +18,11 @@
  */
 package org.netbeans.modules.debugger.jpda.truffle.frames.models;
 
+import java.io.InvalidObjectException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import org.netbeans.api.debugger.jpda.JPDADebugger;
+import org.netbeans.api.debugger.jpda.JPDAThread;
 import org.netbeans.modules.debugger.jpda.truffle.access.CurrentPCInfo;
 import org.netbeans.modules.debugger.jpda.truffle.access.TruffleAccess;
 import org.netbeans.modules.debugger.jpda.truffle.frames.TruffleStackFrame;
@@ -27,6 +30,9 @@ import 
org.netbeans.modules.debugger.jpda.truffle.source.Source;
 import org.netbeans.modules.debugger.jpda.truffle.source.SourcePosition;
 import org.netbeans.spi.debugger.ui.DebuggingVi

[netbeans] branch master updated: Prevent from NPE when no NetBeans project is opened.

2021-08-25 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c7f8043  Prevent from NPE when no NetBeans project is opened.
c7f8043 is described below

commit c7f804376471eba9fb3188fd23a246ae8f82ef30
Author: Martin Entlicher 
AuthorDate: Thu Aug 19 19:10:39 2021 +0200

Prevent from NPE when no NetBeans project is opened.
---
 .../java/lsp/server/protocol/ProjectConfigurationCompletion.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ProjectConfigurationCompletion.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ProjectConfigurationCompletion.java
index 5bd77c7..159a2b4 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ProjectConfigurationCompletion.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ProjectConfigurationCompletion.java
@@ -128,7 +128,7 @@ public class ProjectConfigurationCompletion implements 
LaunchConfigurationComple
 }
 
 private static Collection getConfigurations(Project 
p) {
-ProjectConfigurationProvider provider = 
p.getLookup().lookup(ProjectConfigurationProvider.class);
+ProjectConfigurationProvider provider = (p != 
null) ? p.getLookup().lookup(ProjectConfigurationProvider.class) : null;
 if (provider == null) {
 return Collections.emptyList();
 }

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Attach to a running Native Image implemented.

2021-08-19 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new e824e9a  Attach to a running Native Image implemented.
e824e9a is described below

commit e824e9a43ca0617b4909785b0ad7b3a9eec30755
Author: Martin Entlicher 
AuthorDate: Wed Jul 28 12:15:36 2021 +0200

Attach to a running Native Image implemented.
---
 cpplite/cpplite.debugger/nbproject/project.xml |   2 +-
 .../modules/cpplite/debugger/CPPLiteDebugger.java  |  13 +-
 .../cpplite/debugger/CPPLiteDebuggerConfig.java|  34 ++-
 .../modules/cpplite/debugger/api/Debugger.java |  14 +-
 .../debugger/ni/NIDebuggerProviderImpl.java|  99 ++---
 .../cpplite/debugger/AbstractDebugTest.java|   7 +-
 ide/nativeimage.api/manifest.mf|   2 +-
 .../modules/nativeimage/api/debug/NIDebugger.java  |  14 ++
 .../nativeimage/spi/debug/NIDebuggerProvider.java  |  16 ++
 java/java.lsp.server/nbproject/project.xml |   4 +-
 .../debugging/attach/AttachConfigurations.java |   2 +-
 .../attach/AttachNativeConfigurations.java |  80 +++
 .../debugging/attach/NbAttachRequestHandler.java   |  69 ++-
 .../lsp/server/debugging/attach/Processes.java | 230 +
 .../server/debugging/launch/NbDebugSession.java|   3 +-
 .../modules/java/lsp/server/protocol/Server.java   |   7 +-
 .../lsp/server/protocol/WorkspaceServiceImpl.java  |   4 +
 java/java.lsp.server/vscode/package.json   |  32 ++-
 java/java.lsp.server/vscode/src/extension.ts   |   2 +-
 java/java.nativeimage.debugger/manifest.mf |   2 +-
 .../nbproject/project.xml  |   2 +-
 .../nativeimage/debugger/actions/Bundle.properties |  11 +-
 .../debugger/actions/NIAttachCustomizer.form   |  73 ---
 .../debugger/actions/NIAttachCustomizer.java   | 150 +++---
 .../nativeimage/debugger/actions/Processes.java| 230 +
 .../nativeimage/debugger/api/NIDebugRunner.java|  43 +++-
 26 files changed, 1024 insertions(+), 121 deletions(-)

diff --git a/cpplite/cpplite.debugger/nbproject/project.xml 
b/cpplite/cpplite.debugger/nbproject/project.xml
index 380bbb0..7574c06 100644
--- a/cpplite/cpplite.debugger/nbproject/project.xml
+++ b/cpplite/cpplite.debugger/nbproject/project.xml
@@ -66,7 +66,7 @@
 
 
 0
-0.2
+0.4
 
 
 
diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 07c78f1..946f047 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -39,6 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -592,6 +593,7 @@ public final class CPPLiteDebugger {
 //if (record.token() == 0) {
 switch (record.cls()) {
 case "stopped":
+runningLatch.countDown();
 MITList results = record.results();
 String threadId = results.getConstValue("thread-id");
 MIValue stoppedThreads = 
results.valueOf("stopped-threads");
@@ -773,7 +775,7 @@ public final class CPPLiteDebugger {
 
 }
 
-public static @NonNull Pair startDebugging 
(CPPLiteDebuggerConfig configuration, Object... services) throws IOException {
+public static @NonNull Process startDebugging (CPPLiteDebuggerConfig 
configuration, Consumer startedEngine, Object... services) 
throws IOException {
 SessionProvider sessionProvider = new SessionProvider () {
 @Override
 public String getSessionName () {
@@ -804,12 +806,17 @@ public final class CPPLiteDebugger {
 );
 DebuggerEngine[] es = DebuggerManager.getDebuggerManager ().
 startDebugging (di);
+startedEngine.accept(es[0]);
 Pty pty = PtySupport.allocate(ExecutionEnvironmentFactory.getLocal());
 CPPLiteDebugger debugger = es[0].lookupFirst(null, 
CPPLiteDebugger.class);
 List executable = new ArrayList<>();
 executable.add(configuration.getDebugger());
 executable.add("--interpreter=mi");
 executable.add("--tty=" + pty.getSlaveName());
+if (con

[netbeans] branch master updated: Use RequestProcessor to fix SecurityException:setContextClassLoader.

2021-08-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 2ea0985  Use RequestProcessor to fix 
SecurityException:setContextClassLoader.
2ea0985 is described below

commit 2ea0985507fa19e8351722ce9c0c70769e0ef96e
Author: Martin Entlicher 
AuthorDate: Fri Jul 30 18:12:19 2021 +0200

Use RequestProcessor to fix SecurityException:setContextClassLoader.
---
 .../modules/java/lsp/server/debugging/NbProtocolServer.java| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
index 5f14324..5f9581b 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
@@ -28,6 +28,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.Future;
 
@@ -88,6 +89,7 @@ import org.netbeans.modules.nativeimage.api.debug.NIDebugger;
 import org.netbeans.modules.nativeimage.api.debug.NIVariable;
 import org.netbeans.spi.debugger.ui.DebuggingView.DVFrame;
 import org.netbeans.spi.debugger.ui.DebuggingView.DVThread;
+import org.openide.util.RequestProcessor;
 
 /**
  *
@@ -101,6 +103,7 @@ public final class NbProtocolServer implements 
IDebugProtocolServer, LspSession.
 private final NbDisconnectRequestHandler disconnectRequestHandler = new 
NbDisconnectRequestHandler();
 private final NbBreakpointsRequestHandler breakpointsRequestHandler = new 
NbBreakpointsRequestHandler();
 private final NbVariablesRequestHandler variablesRequestHandler = new 
NbVariablesRequestHandler();
+private final RequestProcessor evaluationRP = new 
RequestProcessor(NbProtocolServer.class.getName(), 3);
 private boolean initialized = false;
 private Future runningServer;
 
@@ -458,7 +461,7 @@ public final class NbProtocolServer implements 
IDebugProtocolServer, LspSession.
 evaluateNative(niDebugger, expression, threadId, response);
 }
 return response;
-});
+}, evaluationRP);
 }
 
 private void evaluateJPDA(JPDADebugger debugger, String expression, int 
threadId, EvaluateResponse response) {
@@ -487,7 +490,7 @@ public final class NbProtocolServer implements 
IDebugProtocolServer, LspSession.
 } catch (InvalidExpressionException ex) {
 toString = variable.getValue();
 }
-response.setResult(toString);
+response.setResult(Objects.toString(toString));
 response.setVariablesReference(referenceId);
 response.setType(variable.getType());
 response.setIndexedVariables(Math.max(indexedVariables, 0));

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Visually differentiate lines with DWARF information during native image debugging.

2021-07-14 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 9cd0dee  Visually differentiate lines with DWARF information during 
native image debugging.
9cd0dee is described below

commit 9cd0dee3499cd77c86db6ec6c864d8e7eec0a107
Author: Martin Entlicher 
AuthorDate: Wed Jun 30 09:49:01 2021 +0200

Visually differentiate lines with DWARF information during native image 
debugging.
---
 cpplite/cpplite.debugger/nbproject/project.xml |   2 +-
 .../modules/cpplite/debugger/CPPLiteDebugger.java  | 139 +++
 .../debugger/ni/NIDebuggerProviderImpl.java|  20 +
 ide/nativeimage.api/manifest.mf|   2 +-
 .../netbeans/modules/nativeimage/api/Location.java | 140 +++
 .../modules/nativeimage/api/SourceInfo.java| 138 +++
 .../netbeans/modules/nativeimage/api/Symbol.java   | 131 +++
 .../modules/nativeimage/api/debug/NIDebugger.java  |  48 +++
 .../nativeimage/spi/debug/NIDebuggerProvider.java  |  26 +-
 java/java.lsp.server/nbproject/project.xml |   2 +-
 .../modules/java/lsp/server/LspServerState.java|   6 +
 .../server/debugging/launch/NbLaunchDelegate.java  |   9 +
 .../server/debugging/ni/NILocationVisualizer.java  | 411 +
 .../java/lsp/server/files/OpenedDocuments.java |  98 +
 .../server/protocol/DecorationRenderOptions.java   | 313 
 .../lsp/server/protocol/NbCodeClientWrapper.java   |  15 +
 .../lsp/server/protocol/NbCodeLanguageClient.java  |  25 ++
 .../java/lsp/server/protocol/NbLspServer.java  |   5 +
 .../lsp/server/protocol/OverviewRulerLane.java |  53 +++
 .../modules/java/lsp/server/protocol/Server.java   |  26 ++
 .../protocol/SetTextEditorDecorationParams.java| 139 +++
 .../server/protocol/TextDocumentServiceImpl.java   |  30 +-
 .../ThemableDecorationAttachmentRenderOptions.java | 229 
 .../protocol/ThemableDecorationRenderOptions.java  | 383 +++
 .../java/lsp/server/protocol/ThemeColor.java   |  81 
 .../server/progress/TestProgressHandlerTest.java   |  18 +
 .../lsp/server/protocol/OverviewRulerLaneTest.java |  38 ++
 .../java/lsp/server/protocol/ServerTest.java   | 120 ++
 java/java.lsp.server/vscode/src/extension.ts   |  31 +-
 java/java.lsp.server/vscode/src/protocol.ts|  25 +-
 .../nbproject/project.xml  |   2 +-
 .../debugger/displayer/JavaFrameDisplayer.java |   3 +
 32 files changed, 2683 insertions(+), 25 deletions(-)

diff --git a/cpplite/cpplite.debugger/nbproject/project.xml 
b/cpplite/cpplite.debugger/nbproject/project.xml
index 48ff741..380bbb0 100644
--- a/cpplite/cpplite.debugger/nbproject/project.xml
+++ b/cpplite/cpplite.debugger/nbproject/project.xml
@@ -66,7 +66,7 @@
 
 
 0
-0.1
+0.2
 
 
 
diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 0c41c83..07c78f1 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -29,7 +29,9 @@ import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.EventListener;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -59,6 +61,9 @@ import 
org.netbeans.modules.cpplite.debugger.breakpoints.CPPLiteBreakpoint;
 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
 import org.netbeans.modules.nativeexecution.api.pty.Pty;
 import org.netbeans.modules.nativeexecution.api.pty.PtySupport;
+import org.netbeans.modules.nativeimage.api.Location;
+import org.netbeans.modules.nativeimage.api.SourceInfo;
+import org.netbeans.modules.nativeimage.api.Symbol;
 import org.netbeans.spi.debugger.ContextProvider;
 import org.netbeans.spi.debugger.DebuggerEngineProvider;
 import org.netbeans.spi.debugger.SessionProvider;
@@ -421,6 +426,140 @@ public final class CPPLiteDebugger {
 return versionRecord.command().getConsoleStream();
 }
 
+public List listLocations(String filePath) {
+MIRecord lines;
+try {
+lines = sendAndGet("-symbol-list-lines " + filePath);
+} catch (InterruptedException ex) {
+return null;
+}
+MIValue linesValue = lines.results().valueOf("lines");
+if (linesValue instanceof MITList) {

[netbeans] branch master updated: Completion provider for VS Code's launch.json.

2021-07-02 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 2ae14c0  Completion provider for VS Code's launch.json.
2ae14c0 is described below

commit 2ae14c0fb2e09816cb2fb9c1ef9aa18b98d3f446
Author: Martin Entlicher 
AuthorDate: Tue Jun 29 20:30:45 2021 +0200

Completion provider for VS Code's launch.json.
---
 .../netbeans/modules/java/lsp/server/Utils.java|  55 
 .../attach/AttachConfigurationCompletion.java  | 141 +++
 .../debugging/attach/AttachConfigurations.java | 119 +++-
 .../debugging/attach/ConfigurationAttribute.java   |  50 +++
 .../debugging/attach/ConfigurationAttributes.java  | 141 +++
 .../debugging/attach/NbAttachRequestHandler.java   | 107 +--
 .../protocol/LaunchConfigurationCompletion.java|  68 ++
 .../protocol/ProjectConfigurationCompletion.java   | 137 +++
 .../modules/java/lsp/server/protocol/Server.java   |   5 +
 .../lsp/server/protocol/WorkspaceServiceImpl.java  |  61 +
 .../modules/java/lsp/server/UtilsTest.java |  53 
 java/java.lsp.server/vscode/package-lock.json  |   5 +
 java/java.lsp.server/vscode/package.json   |   1 +
 java/java.lsp.server/vscode/src/extension.ts   |  22 +--
 .../vscode/src/launchConfigurations.ts | 150 +
 15 files changed, 962 insertions(+), 153 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
index 849c26f..248f642 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
@@ -18,6 +18,7 @@
  */
 package org.netbeans.modules.java.lsp.server;
 
+import com.google.gson.stream.JsonWriter;
 import com.sun.source.tree.CompilationUnitTree;
 import com.sun.source.tree.LineMap;
 import com.sun.source.tree.Tree;
@@ -27,6 +28,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.StringWriter;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -223,4 +225,57 @@ public class Utils {
 private static File getCacheDir() {
 return Places.getCacheSubfile("java-server");
 }
+
+private static final char[] SNIPPET_ESCAPE_CHARS = new char[] { '\\', '$', 
'}' };
+/**
+ * Escape special characters in a completion snippet. Characters '$' and 
'}'
+ * are escaped via backslash.
+ */
+public static String escapeCompletionSnippetSpecialChars(String text) {
+if (text.isEmpty()) {
+return text;
+}
+for (char c : SNIPPET_ESCAPE_CHARS) {
+StringBuilder replaced = null;
+int lastPos = 0;
+int i = 0;
+while ((i = text.indexOf(c, i)) >= 0) {
+if (replaced == null) {
+replaced = new StringBuilder(text.length() + 5); // Text 
length + some escapes
+}
+replaced.append(text.substring(lastPos, i));
+replaced.append('\\');
+lastPos = i;
+i += 1;
+}
+if (replaced != null) {
+replaced.append(text.substring(lastPos, text.length()));
+text = replaced.toString();
+}
+replaced = null;
+}
+return text;
+}
+
+/**
+ * Encode a String value to a valid JSON value. Enclose into quotes 
explicitly when needed.
+ */
+public static String encode2JSON(String value) {
+if (value.isEmpty()) {
+return value;
+}
+StringWriter sw = new StringWriter();
+try (JsonWriter w = new JsonWriter(sw)) {
+w.beginArray();
+w.value(value);
+w.endArray();
+w.flush();
+} catch (IOException ex) {
+Exceptions.printStackTrace(ex);
+}
+String encoded = sw.toString();
+// We have ["value"], remove the array and quotes
+return encoded.substring(2, encoded.length() - 2);
+}
+
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
new file mode 100644
index 000..e17c152
--- /dev/null
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
@@ -0,0 +1,141 

[netbeans] branch master updated: Ability to add breakpoints into Groovy sources.

2021-07-01 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 49773b3  Ability to add breakpoints into Groovy sources.
49773b3 is described below

commit 49773b3b4967e1e109a6c45d75616a46fb5fe5b1
Author: Martin Entlicher 
AuthorDate: Thu Jul 1 11:17:01 2021 +0200

Ability to add breakpoints into Groovy sources.
---
 .../breakpoints/GroovyBreakpointFactory.java   | 105 +
 .../server/debugging/breakpoints/NbBreakpoint.java |  12 ++-
 java/java.lsp.server/vscode/package.json   |   6 +-
 3 files changed, 120 insertions(+), 3 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
new file mode 100644
index 000..b83c3ce
--- /dev/null
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/breakpoints/GroovyBreakpointFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.netbeans.modules.java.lsp.server.debugging.breakpoints;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Level;
+import org.netbeans.api.debugger.jpda.LineBreakpoint;
+import org.netbeans.api.java.classpath.ClassPath;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.filesystems.URLMapper;
+import org.openide.util.NbBundle;
+
+/**
+ * Creates Groovy breakpoints.
+ */
+public class GroovyBreakpointFactory {
+
+private GroovyBreakpointFactory() {}
+
+public static LineBreakpoint create(String url, int lineNumber) {
+LineBreakpoint groovyBreakpoint = LineBreakpoint.create(url, 
lineNumber);
+
+groovyBreakpoint.setStratum("Groovy"); // NOI18N
+FileObject fo = findFileObjectFromUrl(url);
+String sourceName = setGroovySourceName(groovyBreakpoint, fo);
+String sourcePath = setGroovySourcePath(groovyBreakpoint, fo);
+setImplClassFilter(groovyBreakpoint, sourcePath);
+setPrintText(groovyBreakpoint, sourceName);
+
+return groovyBreakpoint;
+}
+
+private static FileObject findFileObjectFromUrl(String url) {
+FileObject fo;
+try {
+fo = URLMapper.findFileObject(new URL(url));
+} catch (MalformedURLException e) {
+fo = null;
+}
+return fo;
+}
+
+private static void setImplClassFilter(LineBreakpoint b, String 
relativePath) {
+if (relativePath != null) {
+int dot = relativePath.lastIndexOf('.');
+if (dot > 0) {
+relativePath = relativePath.substring(0, dot);
+String pattern = relativePath.replace('/', '.') + "*";
+b.setPreferredClassName(pattern);
+}
+}
+}
+
+private static String setGroovySourceName(LineBreakpoint b, FileObject fo) 
{
+if (fo != null) {
+String name = fo.getNameExt();
+b.setSourceName(name);
+return name;
+}
+return null;
+}
+private static String setGroovySourcePath(LineBreakpoint b, FileObject fo) 
{
+if (fo != null) {
+ClassPath cp = ClassPath.getClassPath(fo, ClassPath.SOURCE);
+if (cp != null) {
+FileObject root = cp.findOwnerRoot(fo);
+if (root != null) {
+String relativePath = FileUtil.getRelativePath(root, fo);
+b.setSourcePath(relativePath);
+return relativePath;
+}
+}
+}
+return null;
+}
+
+@NbBundle.Messages("CTL_Default_Print_Text=Breakpoint hit at line 
{lineNumber} in {groovyName} by thread {threadName}.")
+private static void setPrintText(LineBreakpoint b, String sourceName) {
+

[netbeans] branch master updated (5f0acca -> 5fb463f)

2021-06-24 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 5f0acca  Add Run with configuration into code lenses.
 new 36ec200  Removing unused findEnabledTarget() method.
 new 5fb463f  Do not proceed with launch with disabled action.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Do not proceed with launch with disabled action.

2021-06-24 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 5fb463fe8f713cfde5f264b961526e93c1f0b807
Author: Svata Dedic 
AuthorDate: Wed Jun 23 17:59:24 2021 +0200

Do not proceed with launch with disabled action.
---
 .../modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index 3113b6e..767ad13 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -260,6 +260,7 @@ public abstract class NbLaunchDelegate {
 } else {
 launchFuture.completeExceptionally(new 
CancellationException());
 }
+return;
 }
 }
 

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/02: Removing unused findEnabledTarget() method.

2021-06-24 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 36ec2009bc4b04a812485ebfcb76c16f79ffe127
Author: Martin Entlicher 
AuthorDate: Wed Jun 23 16:30:40 2021 +0200

Removing unused findEnabledTarget() method.
---
 .../modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java  | 6 --
 1 file changed, 6 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index e9e9de4..3113b6e 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -404,12 +404,6 @@ public abstract class NbLaunchDelegate {
 }
 }
 
-private static CompletableFuture> 
findEnabledTarget(FileObject toRun, SingleMethod singleMethod, boolean debug, 
boolean testRun, NbProcessConsole ioContext) throws IllegalArgumentException {
-return findTargetWithPossibleRebuild(toRun, singleMethod, debug, 
testRun, ioContext).thenApply((Pair actionAndCommand) 
-> {
-return null;
-});
-}
-
 private static CompletableFuture> 
findTargetWithPossibleRebuild(FileObject toRun, SingleMethod singleMethod, 
boolean debug, boolean testRun, NbProcessConsole ioContext) throws 
IllegalArgumentException {
 Pair providerAndCommand = findTarget(toRun, 
singleMethod, debug, testRun);
 if (providerAndCommand != null) {

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Add Run with configuration into code lenses.

2021-06-23 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 5f0acca  Add Run with configuration into code lenses.
5f0acca is described below

commit 5f0acca3f6c8639d886ace996f76df1fb877dcce
Author: Martin Entlicher 
AuthorDate: Wed Jun 16 11:19:30 2021 +0200

Add Run with configuration into code lenses.
---
 .../server/protocol/TextDocumentServiceImpl.java   | 76 +-
 java/java.lsp.server/vscode/src/extension.ts   | 15 +++--
 2 files changed, 82 insertions(+), 9 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
index 1a9d211..f0d1348 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
@@ -37,6 +37,7 @@ import java.net.URI;
 import java.net.URL;
 import java.time.Instant;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.EnumSet;
@@ -51,6 +52,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.BiConsumer;
 import java.util.function.IntFunction;
 import java.util.logging.Level;
@@ -148,6 +150,7 @@ import org.netbeans.api.java.source.ui.ElementOpen;
 import org.netbeans.api.lexer.TokenSequence;
 import org.netbeans.api.lsp.Completion;
 import org.netbeans.api.lsp.HyperlinkLocation;
+import org.netbeans.api.project.FileOwnerQuery;
 import org.netbeans.api.project.Project;
 import org.netbeans.api.project.ProjectUtils;
 import org.netbeans.api.project.SourceGroup;
@@ -189,12 +192,17 @@ import org.netbeans.modules.refactoring.spi.Transaction;
 import org.netbeans.spi.editor.hints.ErrorDescription;
 import org.netbeans.spi.editor.hints.Fix;
 import org.netbeans.spi.lsp.ErrorProvider;
+import org.netbeans.spi.project.ActionProvider;
+import org.netbeans.spi.project.ProjectConfiguration;
+import org.netbeans.spi.project.ProjectConfigurationProvider;
 import org.openide.cookies.EditorCookie;
 import org.openide.filesystems.FileObject;
 import org.openide.text.NbDocument;
 import org.openide.text.PositionBounds;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
 import org.openide.util.RequestProcessor;
 import org.openide.util.Union2;
 import org.openide.util.WeakSet;
@@ -208,6 +216,9 @@ import org.openide.util.lookup.ServiceProvider;
 public class TextDocumentServiceImpl implements TextDocumentService, 
LanguageClientAware {
 private static final Logger LOG = 
Logger.getLogger(TextDocumentServiceImpl.class.getName());
 
+private static final String COMMAND_RUN_SINGLE = "java.run.single";
 // NOI18N
+private static final String COMMAND_DEBUG_SINGLE = "java.debug.single";
 // NOI18N
+
 private static final RequestProcessor BACKGROUND_TASKS = new 
RequestProcessor(TextDocumentServiceImpl.class.getName(), 1, false, false);
 private static final RequestProcessor WORKER = new 
RequestProcessor(TextDocumentServiceImpl.class.getName(), 1, false, false);
 
@@ -884,6 +895,10 @@ public class TextDocumentServiceImpl implements 
TextDocumentService, LanguageCli
 
 private ConcurrentHashMap upToDateTests = new 
ConcurrentHashMap<>();
 
+@NbBundle.Messages({"# {0} - method name", "LBL_Run=Run {0}",
+"# {0} - method name", "LBL_Debug=Debug {0}",
+"# {0} - method name", "# {1} - configuration name", 
"LBL_RunWith=Run {0} with {1}",
+"# {0} - method name", "# {1} - configuration name", 
"LBL_DebugWith=Debug {0} with {1}"})
 @Override
 public CompletableFuture> codeLens(CodeLensParams 
params) {
 // shortcut: if the projects are not yet initialized, return empty:
@@ -932,18 +947,36 @@ public class TextDocumentServiceImpl implements 
TextDocumentService, LanguageCli
 }
 //look for main methods:
 List lens = new ArrayList<>();
+AtomicReference>> 
projectConfigurations = new AtomicReference<>();
 new TreePathScanner() {
 public Void visitMethod(MethodTree tree, Void p) {
 Element el = 
cc.

[netbeans] branch master updated: Debugger attach needs to be initialized.

2021-06-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 7578518  Debugger attach needs to be initialized.
7578518 is described below

commit 757851837d858cd37b33cf7b46c5b07bce2915bd
Author: Martin Entlicher 
AuthorDate: Wed Jun 9 17:51:46 2021 +0200

Debugger attach needs to be initialized.
---
 .../java/lsp/server/debugging/attach/NbAttachRequestHandler.java| 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
index 8b403f8..22e59a9 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/NbAttachRequestHandler.java
@@ -201,6 +201,8 @@ public final class NbAttachRequestHandler {
 if (!finished.getAndSet(true)) {
 notifyTerminated(context);
 }
+} else {
+context.getClient().initialized();
 }
 return ;
 }

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Fixed NPEs in Truffle debugger when SourceSection is null.

2021-06-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0a881f2  Fixed NPEs in Truffle debugger when SourceSection is null.
0a881f2 is described below

commit 0a881f2368d8eecdf6317927e03ca809610c9190
Author: Martin Entlicher 
AuthorDate: Mon Jun 7 15:46:38 2021 +0200

Fixed NPEs in Truffle debugger when SourceSection is null.
---
 .../modules/debugger/jpda/truffle/Utils.java   |  9 ++
 .../jpda/truffle/access/TruffleAccess.java | 32 +++
 .../jpda/truffle/access/TruffleStrataProvider.java |  8 -
 .../jpda/truffle/frames/TruffleStackFrame.java | 36 --
 .../models/DebuggingTruffleActionsProvider.java|  5 ++-
 .../frames/models/DebuggingTruffleTreeModel.java   |  7 -
 .../jpda/truffle/frames/models/TruffleDVFrame.java | 30 +++---
 .../debugger/jpda/truffle/source/Source.java   |  8 -
 .../debugger/jpda/backend/truffle/FrameInfo.java   |  2 +-
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |  3 +-
 .../jpda/backend/truffle/SourcePosition.java   | 32 +++
 11 files changed, 119 insertions(+), 53 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/Utils.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/Utils.java
index 2917a83..506ecda 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/Utils.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/Utils.java
@@ -61,4 +61,13 @@ public final class Utils {
 sb.append ("");
 return sb.toString ();
 }
+
+public static String stringOrNull(String str) {
+if ("null".equals(str)) {
+return null;
+} else {
+return str;
+}
+}
+
 }
diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
index 7392ee2..eaf94da 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
@@ -86,6 +86,7 @@ import 
org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
 import org.netbeans.modules.debugger.jpda.truffle.LanguageName;
 import org.netbeans.modules.debugger.jpda.truffle.RemoteServices;
 import org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager;
+import org.netbeans.modules.debugger.jpda.truffle.Utils;
 import org.netbeans.modules.debugger.jpda.truffle.actions.StepActionProvider;
 import org.netbeans.modules.debugger.jpda.truffle.ast.TruffleNode;
 import org.netbeans.modules.debugger.jpda.truffle.frames.TruffleStackFrame;
@@ -497,7 +498,12 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 return null;
 }
 long id = (Long) varSrcId.createMirrorObject();
-String sourceSection = (String) 
sourcePositionVar.getField(VAR_SRC_SOURCESECTION).createMirrorObject();
+Field varSourceSection = 
sourcePositionVar.getField(VAR_SRC_SOURCESECTION);
+String sourceSection = (String) varSourceSection.createMirrorObject();
+if (sourceSection == null) {
+// No source section information
+return null;
+}
 Source src = Source.getExistingSource(debugger, id);
 if (src == null) {
 String name = (String) 
sourcePositionVar.getField(VAR_SRC_NAME).createMirrorObject();
@@ -582,26 +588,26 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 sourceName = sourceDef.substring(i1, i2);
 i1 = i2 + 1;
 i2 = sourceDef.indexOf('\n', i1);
-hostMethodName = sourceDef.substring(i1, i2);
-if ("null".equals(hostMethodName)) {
-hostMethodName = null;
-}
+hostMethodName = Utils.stringOrNull(sourceDef.substring(i1, i2));
 i1 = i2 + 1;
 i2 = sourceDef.indexOf('\n', i1);
 sourcePath = sourceDef.substring(i1, i2);
 i1 = i2 + 1;
 i2 = sourceDef.indexOf('\n', i1);
-try {
-sourceURI = new URI(sourceDef.substring(i1, i2));
-} catch (URISyntaxException usex) {
-throw new IllegalStateException("Bad URI: 
"+sourceDef.substring(i1, i2), usex);
+String uriStr = Utils.stringOrNull(sourceDef.substring(i1, i2));
+if (uriStr != null) {
+try {
+sourceUR

[netbeans] branch master updated (1ca0470 -> 42e5df3)

2021-06-07 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 1ca0470  Merge pull request #2986 from sdedic/lsp/consoleInputLockup
 add 42e5df3  Debugger attach configurations ask for user input and 
configurations are split between Initial and Dynamic.

No new revisions were added by this update.

Summary of changes:
 .../debugging/attach/AttachConfigurations.java | 31 +-
 .../java/lsp/server/protocol/DebugConnector.java   | 44 --
 java/java.lsp.server/vscode/src/extension.ts   | 68 +++---
 java/java.lsp.server/vscode/src/protocol.ts|  2 +
 4 files changed, 118 insertions(+), 27 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Debugger attach in VSCode extension. (#5346)

2021-05-31 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c47c7f2  Debugger attach in VSCode extension. (#5346)
c47c7f2 is described below

commit c47c7f22bb7adc97af6c428100487ab2f82688e3
Author: Martin Entlicher 
AuthorDate: Thu May 27 18:16:49 2021 +0200

Debugger attach in VSCode extension. (#5346)
---
 .../lsp/server/debugging/NbProtocolServer.java |  14 +-
 .../debugging/attach/AttachConfigurations.java | 222 +
 .../debugging/attach/NbAttachRequestHandler.java   | 222 +
 .../server/debugging/launch/NbDebugSession.java|   2 +-
 .../java/lsp/server/protocol/DebugConnector.java   | 151 ++
 .../modules/java/lsp/server/protocol/Server.java   |  27 ++-
 .../lsp/server/protocol/WorkspaceServiceImpl.java  |  15 +-
 .../java/lsp/server/protocol/ServerTest.java   |  42 
 java/java.lsp.server/vscode/package.json   |  39 +++-
 java/java.lsp.server/vscode/src/extension.ts   |  61 +++---
 java/java.lsp.server/vscode/src/protocol.ts|   7 +
 11 files changed, 758 insertions(+), 44 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
index 56f20df..6ae1497 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java
@@ -19,19 +19,15 @@
 package org.netbeans.modules.java.lsp.server.debugging;
 
 import java.io.File;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.lsp4j.debug.Capabilities;
@@ -41,7 +37,6 @@ import org.eclipse.lsp4j.debug.ContinueResponse;
 import org.eclipse.lsp4j.debug.DisconnectArguments;
 import org.eclipse.lsp4j.debug.EvaluateArguments;
 import org.eclipse.lsp4j.debug.EvaluateResponse;
-import org.eclipse.lsp4j.debug.ExceptionBreakMode;
 import org.eclipse.lsp4j.debug.ExceptionBreakpointsFilter;
 import org.eclipse.lsp4j.debug.ExceptionInfoArguments;
 import org.eclipse.lsp4j.debug.ExceptionInfoResponse;
@@ -79,10 +74,11 @@ import org.netbeans.api.debugger.jpda.ObjectVariable;
 import org.netbeans.api.debugger.jpda.Variable;
 import org.netbeans.modules.debugger.jpda.truffle.vars.TruffleVariable;
 import org.netbeans.modules.java.lsp.server.LspSession;
+import 
org.netbeans.modules.java.lsp.server.debugging.breakpoints.NbBreakpointsRequestHandler;
+import 
org.netbeans.modules.java.lsp.server.debugging.attach.NbAttachRequestHandler;
 import org.netbeans.modules.java.lsp.server.debugging.launch.NbDebugSession;
 import 
org.netbeans.modules.java.lsp.server.debugging.launch.NbDisconnectRequestHandler;
 import 
org.netbeans.modules.java.lsp.server.debugging.launch.NbLaunchRequestHandler;
-import 
org.netbeans.modules.java.lsp.server.debugging.breakpoints.NbBreakpointsRequestHandler;
 import 
org.netbeans.modules.java.lsp.server.debugging.variables.NbVariablesRequestHandler;
 import org.netbeans.modules.java.lsp.server.debugging.utils.ErrorUtilities;
 import org.netbeans.modules.nativeimage.api.debug.EvaluateException;
@@ -99,6 +95,7 @@ public final class NbProtocolServer implements 
IDebugProtocolServer, LspSession.
 
 private final DebugAdapterContext context;
 private final NbLaunchRequestHandler launchRequestHandler = new 
NbLaunchRequestHandler();
+private final NbAttachRequestHandler attachRequestHandler = new 
NbAttachRequestHandler();
 private final NbDisconnectRequestHandler disconnectRequestHandler = new 
NbDisconnectRequestHandler();
 private final NbBreakpointsRequestHandler breakpointsRequestHandler = new 
NbBreakpointsRequestHandler();
 private final NbVariablesRequestHandler variablesRequestHandler = new 
NbVariablesRequestHandler();
@@ -172,6 +169,11 @@ public final class NbProtocolServer implements 
IDebugProtocolServer, LspSession.
 }
 
 @Override
+public CompletableFuture attach(Map args) {
+return attachRequestHandler.attach(args, context);
+}
+
+@Override
 public CompletableFuture disconnect(DisconnectArguments args) {
 return disconnectRequestHandler.disconnect(args, context);
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach

[netbeans] 01/02: Assure that debug process exits when debugging finishes.

2021-05-22 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit fd6921c496c53e51f8c451dee46887545c9d0ca7
Author: Martin Entlicher 
AuthorDate: Fri May 21 10:58:13 2021 +0200

Assure that debug process exits when debugging finishes.
---
 .../modules/cpplite/debugger/CPPLiteDebugger.java  | 72 ++--
 .../cpplite/debugger/AbstractDebugTest.java| 14 +++-
 .../modules/cpplite/debugger/BreakpointsTest.java  |  1 +
 .../debugger/{StepTest.java => ExitTest.java}  | 76 ++
 .../modules/cpplite/debugger/StepTest.java |  3 +-
 5 files changed, 103 insertions(+), 63 deletions(-)

diff --git 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index 8545d3f..0c41c83 100644
--- 
a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ 
b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -36,6 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -93,6 +94,7 @@ public final class CPPLiteDebugger {
 private final ThreadsCollector  threadsCollector = new 
ThreadsCollector(this);
 private volatile CPPThread  currentThread;
 private volatile CPPFrame   currentFrame;
+private AtomicInteger   exitCode = new AtomicInteger();
 
 public CPPLiteDebugger(ContextProvider contextProvider) {
 this.contextProvider = contextProvider;
@@ -359,6 +361,13 @@ public final class CPPLiteDebugger {
 }
 
 void finish (boolean sendExit) {
+finish(sendExit, 0);
+}
+
+private void finish (boolean sendExit, int exitCode) {
+if (exitCode != 0) {
+this.exitCode.set(exitCode);
+}
 LOGGER.fine("CPPLiteDebugger.finish()");
 if (finished) {
 LOGGER.fine("finish(): already finished.");
@@ -462,29 +471,43 @@ public final class CPPLiteDebugger {
 }
 CPPThread thread = threadsCollector.get(threadId);
 String reason = results.getConstValue("reason", "");
-switch (reason) {
-case "exited-normally":
-if ('*' == record.type()) {
-finish(false);
+if (reason.startsWith("exited")) {
+if ('*' == record.type()) {
+int exitCode;
+if ("exited-normally".equals(reason)) {
+exitCode = 0;
 } else {
-threadsCollector.remove(threadId);
-}
-break;
-default:
-MITList topFrameList = (MITList) 
results.valueOf("frame");
-CPPFrame frame = topFrameList != null ? 
CPPFrame.create(thread, topFrameList) : null;
-thread.setTopFrame(frame);
-setSuspended(true, thread, frame);
-if (frame != null) {
-Line currentLine = frame.location();
-if (currentLine != null) {
-Annotatable[] lines = new 
Annotatable[] {currentLine};
-CPPLiteDebugger.this.currentLine = 
lines;
-Utils.markCurrent(lines);
-Utils.showLine(lines);
+String exitCodeStr = 
results.getConstValue("exit-code", null);
+if (exitCodeStr != null) {
+if (exitCodeStr.startsWith("0x")) {
+exitCode = 
Integer.parseInt(exitCodeStr, 16);
+} else if 
(exitCodeStr.startsWith("0")) {
+exitCode = 
Integer.parseInt(exitCodeStr, 8);
+} else {
+exitCode = 
Integer.parseInt(exitCodeStr);
+

[netbeans] 02/02: [NETBEANS-5693] Assure that debugger session finishes when native image application exits.

2021-05-22 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 4e6ce195c7ac9df98b0a066192acae492d72c2cc
Author: Martin Entlicher 
AuthorDate: Wed May 19 15:27:13 2021 +0200

[NETBEANS-5693] Assure that debugger session finishes when native image 
application exits.
---
 .../server/debugging/launch/NbLaunchDelegate.java  | 62 --
 1 file changed, 35 insertions(+), 27 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index 54aab5e..c255f20 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -40,6 +40,7 @@ import org.eclipse.lsp4j.jsonrpc.messages.ResponseErrorCode;
 
 import org.netbeans.api.annotations.common.CheckForNull;
 import org.netbeans.api.annotations.common.NonNull;
+import org.netbeans.api.annotations.common.NullAllowed;
 import org.netbeans.api.debugger.DebuggerManager;
 import org.netbeans.api.debugger.DebuggerManagerAdapter;
 import org.netbeans.api.debugger.Session;
@@ -221,16 +222,26 @@ public abstract class NbLaunchDelegate {
 Lookup.getDefault()
 );
 List args = argsToStringList(launchArguments.get("args"));
+// Add session's lookup, it may override dialog displayer, etc.
+Lookup execLookup = new ProxyLookup(launchCtx, 
context.getLspSession().getLookup());
 if (debug) {
 requestProcessor.post(() -> {
-Lookups.executeWith(launchCtx, () -> {
+ActionProgress debugProgress = 
ActionProgress.start(launchCtx);
+ExecutionDescriptor ed = 
executionDescriptor.postExecution((@NullAllowed Integer exitCode) -> {
+debugProgress.finished(exitCode != null && exitCode == 
0);
+});
+Lookups.executeWith(execLookup, () -> {
 String miDebugger = (String) 
launchArguments.get("miDebugger");
-startNativeDebug(nativeImageFile, args, miDebugger, 
context, executionDescriptor, launchFuture);
+startNativeDebug(nativeImageFile, args, miDebugger, 
context, ed, launchFuture, debugProgress);
 });
 });
 } else {
-Lookups.executeWith(launchCtx, () -> {
-execNative(nativeImageFile, args, context, 
executionDescriptor, launchFuture);//, success);
+ExecutionDescriptor ed = 
executionDescriptor.postExecution((@NullAllowed Integer exitCode) -> {
+ioContext.stop();
+notifyFinished(context, exitCode != null && exitCode == 0);
+});
+Lookups.executeWith(execLookup, () -> {
+execNative(nativeImageFile, args, context, ed, 
launchFuture);
 });
 }
 }
@@ -259,30 +270,27 @@ public abstract class NbLaunchDelegate {
 return joined;
 }
 
-private static void startNativeDebug(File nativeImageFile, List 
args, String miDebugger, DebugAdapterContext context, ExecutionDescriptor 
executionDescriptor, CompletableFuture launchFuture) {
+private static void startNativeDebug(File nativeImageFile, List 
args, String miDebugger, DebugAdapterContext context, ExecutionDescriptor 
executionDescriptor, CompletableFuture launchFuture, ActionProgress 
debugProgress) {
 AtomicReference debugSessionRef = new 
AtomicReference<>();
-Runnable start = () -> {
-NIDebugger niDebugger;
-try {
-niDebugger = NIDebugRunner.start(nativeImageFile, args, 
miDebugger, null, null, executionDescriptor, engine -> {
-Session session = engine.lookupFirst(null, Session.class);
-NbDebugSession debugSession = new NbDebugSession(session);
-debugSessionRef.set(debugSession);
-context.setDebugSession(debugSession);
-launchFuture.complete(null);
-
context.getConfigurationSemaphore().waitForConfigurationDone();
-});
-} catch (IllegalStateException ex) {
-ErrorUtilities.completeExceptionally(launchFuture,
-"Failed to launch debuggee native image. " + 
ex.getLocalizedMessage(),
-ResponseErrorCode.serverErrorStart);
-return ;
-}
-NbDebugSession debugSession = debugSessionRef.get();
- 

[netbeans] branch master updated (7cfbb58 -> 4e6ce19)

2021-05-22 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 7cfbb58  [NETBEANS-5658] Add remaining icons in editor toolbar, and a 
few other icons. Copy the icons to all locations which used the same PNG file 
as well.
 new fd6921c  Assure that debug process exits when debugging finishes.
 new 4e6ce19  [NETBEANS-5693] Assure that debugger session finishes when 
native image application exits.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/cpplite/debugger/CPPLiteDebugger.java  | 72 ++--
 .../cpplite/debugger/AbstractDebugTest.java| 14 +++-
 .../modules/cpplite/debugger/BreakpointsTest.java  |  1 +
 .../debugger/{StepTest.java => ExitTest.java}  | 76 ++
 .../modules/cpplite/debugger/StepTest.java |  3 +-
 .../server/debugging/launch/NbLaunchDelegate.java  | 62 ++
 6 files changed, 138 insertions(+), 90 deletions(-)
 copy 
cpplite/cpplite.debugger/test/unit/src/org/netbeans/modules/cpplite/debugger/{StepTest.java
 => ExitTest.java} (54%)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Provide all scopes with correct receiver information.

2021-04-30 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f75348c  Provide all scopes with correct receiver information.
f75348c is described below

commit f75348c94d2ac869860819188f76c5344809298f
Author: Martin Entlicher 
AuthorDate: Thu Apr 29 10:25:03 2021 +0200

Provide all scopes with correct receiver information.
---
 .../jpda/truffle/access/TruffleAccess.java |  49 ++--
 .../jpda/truffle/vars/TruffleVariable.java |   4 +
 .../jpda/truffle/vars/impl/TruffleScope.java   |  47 +---
 .../truffle/vars/impl/TruffleStackVariable.java|   9 +-
 .../vars/models/TruffleVariablesNodeModel.java |   8 +-
 .../jpda/backend/truffle/JPDATruffleAccessor.java  | 129 -
 6 files changed, 49 insertions(+), 197 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
index bdcd022..976ad7e 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
@@ -510,30 +510,18 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 List scopes = new LinkedList<>();
 int n = varsArr.length;
 int i = 0;
-if (i < n) {
+while (i < n) {
 String scopeName = (String) varsArr[i++].createMirrorObject();
-boolean scopeFunction = (Boolean) 
varsArr[i++].createMirrorObject();
-int numArgs = (Integer) varsArr[i++].createMirrorObject();
+boolean hasReceiver = (Boolean) varsArr[i++].createMirrorObject();
 int numVars = (Integer) varsArr[i++].createMirrorObject();
-TruffleVariable[] arguments = new TruffleVariable[numArgs];
-i = fillVars(debugger, arguments, varsArr, i);
 TruffleVariable[] variables = new TruffleVariable[numVars];
-i = fillVars(debugger, variables, varsArr, i);
-scopes.add(new TruffleScope(scopeName, scopeFunction, arguments, 
variables));
-}
-while (i < n) {
-// There are further scopes, retrieved lazily
-String scopeName = (String) varsArr[i++].createMirrorObject();
-boolean scopeFunction = (Boolean) 
varsArr[i++].createMirrorObject();
-boolean hasArgs = (Boolean) varsArr[i++].createMirrorObject();
-boolean hasVars = (Boolean) varsArr[i++].createMirrorObject();
-ObjectVariable scope = (ObjectVariable) varsArr[i++];
-scopes.add(new TruffleScope(scopeName, scopeFunction, hasArgs, 
hasVars, debugger, scope));
+i = fillVars(debugger, variables, varsArr, hasReceiver, i);
+scopes.add(new TruffleScope(scopeName, variables));
 }
 return scopes.toArray(new TruffleScope[scopes.size()]);
 }
 
-private static int fillVars(JPDADebugger debugger, TruffleVariable[] vars, 
Field[] varsArr, int i) {
+private static int fillVars(JPDADebugger debugger, TruffleVariable[] vars, 
Field[] varsArr, boolean hasReceiver, int i) {
 for (int vi = 0; vi < vars.length; vi++) {
 String name = (String) varsArr[i++].createMirrorObject();
 LanguageName language = LanguageName.parse((String) 
varsArr[i++].createMirrorObject());
@@ -556,35 +544,12 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 valueSourceDef.getUniqueID() 
!= 0L,
 valueSource,
 typeSourceDef.getUniqueID() != 
0L,
-typeSource, value);
+typeSource, hasReceiver, 
value);
+hasReceiver = false;
 }
 return i;
 }
 
-public static TruffleVariable[][] getScopeArgsAndVars(JPDADebugger 
debugger, ObjectVariable debugScope) {
-JPDAClassType debugAccessor = 
TruffleDebugManager.getDebugAccessorJPDAClass(debugger);
-try {
-Variable scopeVars = 
debugAccessor.invokeMethod(METHOD_GET_SCOPE_VARIABLES,
-
METHOD_GET_SCOPE_VARIABLES_SGN,
-new Variable[] { 
debugScope });
-Field[] varsArr = ((ObjectVariable) scopeVars).getFields(0, 
Integer.MAX_VALUE);
-int n = varsArr.length;
-int i = 0;
-if (i < n) {
-int numArgs = (Integer) varsArr[i++].createMirrorObject();

[netbeans] 03/03: The debug test needs to specify configuration, after a second Native Image configuration was added.

2021-04-01 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit f0b395c63b7d40ff18c8655bd2abe596aa04a3a0
Author: Martin Entlicher 
AuthorDate: Thu Apr 1 19:54:21 2021 +0200

The debug test needs to specify configuration, after a second Native Image 
configuration was added.
---
 java/java.lsp.server/vscode/src/test/suite/extension.test.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/java.lsp.server/vscode/src/test/suite/extension.test.ts 
b/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
index 2d8053a..5f4e7ec 100644
--- a/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
+++ b/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
@@ -194,8 +194,9 @@ class Main {
 then(() => waitUserApplication(5, false, () => 
resolve(true)));
 }
 console.log("Test: invoking debug debug.run");
-
vscode.commands.executeCommand("workbench.action.debug.run").then(
-() => waitUserApplication(5, true, onProcessStarted));
+const workspaceFolder = 
(vscode.workspace.workspaceFolders!)[0];
+vscode.debug.startDebugging(workspaceFolder, {type: "java8+", 
name: "Launch Java 8+ App", request: "launch"}, {}).
+then(() => waitUserApplication(5, true, onProcessStarted));
 });
 return r;
 } catch (error) {

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (abd50d8 -> f0b395c)

2021-04-01 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from abd50d8  LSP: Readme, changelog, and version modified for 12.4 Beta. 
(#2852)
 new e4a9fb4  Report closed InputOutputProvider. Not doing so cause 
problems on repeated write.
 new 0344bcf  Native debugging of GraalVM's native images.
 new f0b395c  The debug test needs to specify configuration, after a second 
Native Image configuration was added.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cpplite/cpplite.debugger/nbproject/project.xml |  18 +
 .../modules/cpplite/debugger/CPPFrame.java | 247 +++--
 .../modules/cpplite/debugger/CPPLiteDebugger.java  | 150 --
 .../cpplite/debugger/CPPLiteDebuggerConfig.java|  10 +-
 .../modules/cpplite/debugger/CPPThread.java|  11 +-
 .../modules/cpplite/debugger/CPPVariable.java  |  61 ++-
 .../debugger/DebuggerBreakpointAnnotation.java |  14 +-
 .../modules/cpplite/debugger/ThreadsCollector.java |   2 +-
 .../cpplite/debugger/ToolTipAnnotation.java|  11 +-
 .../modules/cpplite/debugger/api/Debugger.java |   6 +-
 .../breakpoints/BreakpointAnnotationProvider.java  |  13 +-
 .../debugger/breakpoints/BreakpointModel.java  |  15 +-
 .../debugger/breakpoints/BreakpointsReader.java|  89 ++-
 .../debugger/breakpoints/CPPLiteBreakpoint.java| 135 -
 .../CPPLiteBreakpointActionProvider.java   |  33 +-
 .../debugger/breakpoints/PersistenceManager.java   |  13 +-
 .../debugger/debuggingview/DebuggingModel.java |   4 +-
 .../cpplite/debugger/models/CallStackModel.java|  27 +-
 .../cpplite/debugger/models/VariablesModel.java|  52 +-
 .../cpplite/debugger/models/WatchesModel.java  |  27 +-
 .../modules/cpplite/debugger/ni/NIBreakpoints.java |  85 +++
 .../debugger/ni/NIDebuggerProviderImpl.java| 172 ++
 .../NIDebuggerServiceProviderImpl.java}|  25 +-
 .../cpplite/debugger/AbstractDebugTest.java|   3 +-
 .../modules/cpplite/debugger/BreakpointsTest.java  |   8 +-
 .../modules/cpplite/debugger/StepTest.java |   2 +-
 .../cpplite/project/ActionProviderImpl.java|   2 +-
 ide/ide.kit/nbproject/project.xml  |   7 +
 ide/nativeimage.api/build.xml  |  28 +
 ide/nativeimage.api/manifest.mf|   6 +
 .../nativeimage.api}/nbproject/project.properties  |   0
 .../nativeimage.api}/nbproject/project.xml | 100 +---
 .../modules/nativeimage/api/Bundle.properties  |  20 +
 .../nativeimage/api/debug}/EvaluateException.java  |  24 +-
 .../modules/nativeimage/api/debug/NIDebugger.java  | 211 
 .../modules/nativeimage/api/debug/NIFrame.java |  69 +++
 .../api/debug/NILineBreakpointDescriptor.java  | 179 +++
 .../modules/nativeimage/api/debug/NIVariable.java  |  96 
 .../nativeimage/spi/debug/NIDebuggerProvider.java  | 123 +
 .../spi/debug/NIDebuggerServiceProvider.java   |  18 +-
 .../spi/debug/filters/FrameDisplayer.java  | 166 ++
 .../spi/debug/filters/VariableDisplayer.java   |  23 +-
 .../nativeimage/debug/NIDebuggerServiceTest.java   |  67 +++
 .../nativeimage/debug/TestNIDebuggerProvider.java  | 103 
 .../debug/TestNIDebuggerServiceProvider.java   |  25 +-
 java/java.kit/nbproject/project.xml|   7 +
 .../nbcode/nbproject/platform.properties   |   8 +-
 java/java.lsp.server/nbproject/project.xml |  18 +
 java/java.lsp.server/script/etc/nbcode.clusters|   1 +
 .../lsp/server/debugging/NbProtocolServer.java | 115 ++--
 .../java/lsp/server/debugging/NbThreads.java   |  21 +-
 .../server/debugging/launch/NbDebugSession.java|  27 +-
 .../server/debugging/launch/NbLaunchDelegate.java  | 219 +---
 .../debugging/launch/NbLaunchRequestHandler.java   |  64 ++-
 .../variables/NbVariablesRequestHandler.java   |  23 +-
 .../server/ui/AbstractLspInputOutputProvider.java  |   4 +-
 java/java.lsp.server/vscode/package.json   |  55 ++
 java/java.lsp.server/vscode/src/extension.ts   |  26 +
 .../vscode/src/test/suite/extension.test.ts|   5 +-
 java/java.nativeimage.debugger/build.xml   |  28 +
 java/java.nativeimage.debugger/manifest.mf |   7 +
 .../nbproject/project.properties   |   0
 .../nbproject/project.xml  |  88 +--
 .../java/nativeimage/debugger/Bundle.properties|  20 +
 .../nativeimage/debugger/actions/Bundle.properties |  21 +
 .../debugger/actions/NIAttachCustomizer.form   | 125 +
 .../debugger/actions/NIAttachCustomizer.java   | 378 +
 .../nativeimage/debugger/action

[netbeans] 01/03: Report closed InputOutputProvider. Not doing so cause problems on repeated write.

2021-04-01 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit e4a9fb4d51a1b082ee834ba3e3d46a2da543b3eb
Author: Martin Entlicher 
AuthorDate: Mon Mar 22 14:51:37 2021 +0100

Report closed InputOutputProvider. Not doing so cause problems on repeated 
write.
---
 .../modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java| 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
index 593b602..ebc15ee 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java
@@ -92,7 +92,7 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 
 @Override
 public final boolean isIOClosed(LspIO io) {
-return false;
+return io.closed;
 }
 
 @Override
@@ -133,6 +133,7 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 final Reader in;
 final PrintWriter out;
 final PrintWriter err;
+volatile boolean closed;
 
 LspIO(String name, IOContext ioCtx, Lookup lookup) {
 this.name = name;
@@ -170,6 +171,7 @@ public abstract class AbstractLspInputOutputProvider 
implements InputOutputProvi
 
 @Override
 public void close() throws IOException {
+closed = true;
 }
 }
 }

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (eabc0c0 -> ed3dbc0)

2021-03-31 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from eabc0c0  Merge pull request #2843 from 
JaroslavTulach/jtulach/MxProjectsOnJdk15
 add ed3dbc0  Remove items via the iterator.

No new revisions were added by this update.

Summary of changes:
 .../netbeans/modules/autoupdate/services/FeatureUpdateElementImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Completing the merge of delivery to master.

2021-02-18 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 34c41d5  Completing the merge of delivery to master.
 new 40a17f5  Merge pull request #2771 from entlicher/lspMergeComplete
34c41d5 is described below

commit 34c41d5ded527d65ffbf5f207ed99db53ffc666d
Author: Martin Entlicher 
AuthorDate: Thu Feb 18 11:29:15 2021 +0100

Completing the merge of delivery to master.
---
 .../modules/java/lsp/server/protocol/Server.java   |  5 +-
 .../lsp/server/protocol/WorkspaceServiceImpl.java  | 67 --
 2 files changed, 1 insertion(+), 71 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
index 3723e66..d2b0251 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
@@ -323,8 +323,7 @@ public final class Server {
 capabilities.setDocumentHighlightProvider(true);
 capabilities.setReferencesProvider(true);
 List commands = new ArrayList<>(Arrays.asList(
-JAVA_BUILD_WORKSPACE, GRAALVM_PAUSE_SCRIPT, 
JAVA_SUPER_IMPLEMENTATION,
-JAVA_TEST_SINGLE_METHOD, JAVA_RUN_MAIN_METHOD));
+JAVA_BUILD_WORKSPACE, GRAALVM_PAUSE_SCRIPT, 
JAVA_SUPER_IMPLEMENTATION));
 for (CodeGenerator codeGenerator : 
Lookup.getDefault().lookupAll(CodeGenerator.class)) {
 commands.addAll(codeGenerator.getCommands());
 }
@@ -421,8 +420,6 @@ public final class Server {
 
 public static final String JAVA_BUILD_WORKSPACE =  "java.build.workspace";
 public static final String JAVA_SUPER_IMPLEMENTATION =  
"java.super.implementation";
-public static final String JAVA_TEST_SINGLE_METHOD =  
"java.test.single.method";
-public static final String JAVA_RUN_MAIN_METHOD =  "java.run.main.method";
 public static final String GRAALVM_PAUSE_SCRIPT =  "graalvm.pause.script";
 static final String INDEXING_COMPLETED = "Indexing completed.";
 static final String NO_JAVA_SUPPORT = "Cannot initialize Java support on 
JDK ";
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
index 787e2bb..587624f 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
@@ -121,33 +121,6 @@ public final class WorkspaceServiceImpl implements 
WorkspaceService, LanguageCli
 String uri = ((JsonPrimitive) 
params.getArguments().get(0)).getAsString();
 Position pos = 
gson.fromJson(gson.toJson(params.getArguments().get(1)), Position.class);
 return 
(CompletableFuture)((TextDocumentServiceImpl)server.getTextDocumentService()).superImplementation(uri,
 pos);
-case Server.JAVA_TEST_SINGLE_METHOD:
-CommandProgress progressOfCommand = new CommandProgress();
-String uriStr = ((JsonPrimitive) 
params.getArguments().get(0)).getAsString();
-FileObject file;
-try {
-file = URLMapper.findFileObject(new URL(uriStr));
-} catch (MalformedURLException ex) {
-Exceptions.printStackTrace(ex);
-return CompletableFuture.completedFuture(true);
-}
-String methodName = ((JsonPrimitive) 
params.getArguments().get(1)).getAsString();
-SingleMethod method = new SingleMethod(file, methodName);
-runSingleMethodCommand(method, 
SingleMethod.COMMAND_RUN_SINGLE_METHOD, progressOfCommand);
-progressOfCommand.checkStatus();
-return progressOfCommand.getFinishFuture();
-case Server.JAVA_RUN_MAIN_METHOD:
-progressOfCommand = new CommandProgress();
-uriStr = ((JsonPrimitive) 
params.getArguments().get(0)).getAsString();
-try {
-file = URLMapper.findFileObject(new URL(uriStr));
-} catch (MalformedURLException ex) {
-Exceptions.printStackTrace(ex);
-return CompletableFuture.completedFuture(true);
-}
-runSingleFile(file, ActionProvider.COMMAND_RUN_SINGLE, 
progressOfCommand

[netbeans] branch master updated (81bfc6d -> 5ccd21d)

2021-01-22 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 81bfc6d   Adding folding range via LSP support, both client and 
server. (#2682)
 new ed33123  Support for (LSP) code lens for running tests and main 
methods.
 new 38843cd  Run and debug from CodeLens.
 new 5ccd21d  Merge pull request #2705 from entlicher/CodeLensMethodsRun

The 4918 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ide/gsf.testrunner.ui/nbproject/project.xml|  14 +-
 .../testrunner/ui/api/TestMethodController.java|  64 +
 .../ui/api/TestMethodDebuggerProvider.java |   2 +-
 .../ui/api/TestMethodRunnerProvider.java   |  29 -
 .../nbcode/nbproject/platform.properties   |   6 -
 java/java.lsp.server/nbproject/project.xml |  16 +++
 .../server/debugging/launch/NbLaunchDelegate.java  |  45 +--
 .../debugging/launch/NbLaunchRequestHandler.java   |  19 ++-
 .../modules/java/lsp/server/protocol/Server.java   |   8 +-
 .../server/protocol/TextDocumentServiceImpl.java   |  59 -
 .../lsp/server/protocol/WorkspaceServiceImpl.java  | 143 -
 java/java.lsp.server/vscode/src/extension.ts   |  15 +++
 .../nbproject/project.properties   |   2 +-
 java/java.testrunner.ui/nbproject/project.xml  |  19 +++
 .../java/testrunner/ui/ComputeTestMethodsImpl.java | 109 
 .../java/testrunner/ui/spi/ComputeTestMethods.java |  36 ++
 java/junit.ui/nbproject/project.xml|   9 ++
 .../junit/ui/actions/TestClassInfoTask.java| 139 ++--
 .../junit/ui/actions/TestSingleMethodSupport.java  |   4 +-
 java/testng.ui/nbproject/project.xml   |   9 ++
 .../testng/ui/actions/TestClassInfoTask.java   | 114 +---
 21 files changed, 741 insertions(+), 120 deletions(-)
 create mode 100644 
ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java
 create mode 100644 
java/java.testrunner.ui/src/org/netbeans/modules/java/testrunner/ui/ComputeTestMethodsImpl.java
 create mode 100644 
java/java.testrunner.ui/src/org/netbeans/modules/java/testrunner/ui/spi/ComputeTestMethods.java


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Fix of tooltip and evaluations of Truffle languages through LSP.

2021-01-13 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 55af0b6  Fix of tooltip and evaluations of Truffle languages through 
LSP.
 new 136adc0  Merge pull request #2675 from entlicher/LSPTruffleEval
55af0b6 is described below

commit 55af0b660b154a9a2c15a316c1fd41be75b42431
Author: Martin Entlicher 
AuthorDate: Wed Jan 13 14:07:44 2021 +0100

Fix of tooltip and evaluations of Truffle languages through LSP.
---
 .../jpda/truffle/vars/impl/TruffleEvaluator.java   |  6 ++--
 .../modules/debugger/jpda/JPDADebuggerImpl.java| 37 ++
 .../modules/debugger/jpda/JavaEvaluator.java   |  2 +-
 .../lsp/server/debugging/NbProtocolServer.java |  2 +-
 4 files changed, 27 insertions(+), 20 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/vars/impl/TruffleEvaluator.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/vars/impl/TruffleEvaluator.java
index 0775584..de82b42 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/vars/impl/TruffleEvaluator.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/vars/impl/TruffleEvaluator.java
@@ -19,7 +19,6 @@
 
 package org.netbeans.modules.debugger.jpda.truffle.vars.impl;
 
-import org.netbeans.api.debugger.jpda.CallStackFrame;
 import org.netbeans.api.debugger.jpda.InvalidExpressionException;
 import org.netbeans.api.debugger.jpda.JPDADebugger;
 import org.netbeans.api.debugger.jpda.ObjectVariable;
@@ -53,12 +52,11 @@ public class TruffleEvaluator implements 
Evaluator {
 expr = TruffleExpression.parse(expression.getExpression());
 expression.setPreprocessedObject(expr);
 }
-Variable ret = evaluateIn(expr, context.getCallStackFrame(), 
contextVariable);
+Variable ret = evaluateIn(expr);
 return new Result(ret);
 }
 
-private Variable evaluateIn(TruffleExpression expr, CallStackFrame 
callStackFrame, ObjectVariable contextVar) throws InvalidExpressionException {
-//return DebuggerSupport.evaluate(debugger, callStackFrame, 
expr.getExpression(), contextVar);
+private Variable evaluateIn(TruffleExpression expr) throws 
InvalidExpressionException {
 return TruffleEval.evaluate(debugger, expr.getExpression());
 }
 
diff --git 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
index 7dc72e9..c84c44d 100644
--- 
a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
+++ 
b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java
@@ -884,12 +884,16 @@ public class JPDADebuggerImpl extends JPDADebugger {
 }
 }
 }
-if (csf == null) {
+JPDAThread frameThread;
+if (csf != null) {
+frameThread = csf.getThread();
+} else {
+frameThread = getCurrentThread();
+}
+if (frameThread == null) {
 throw new InvalidExpressionException
-(NbBundle.getMessage(JPDADebuggerImpl.class, 
"MSG_NoCurrentContextStackFrame"));
+(NbBundle.getMessage(JPDADebuggerImpl.class, 
"MSG_NoCurrentContext"));
 }
-
-JPDAThread frameThread = csf.getThread();
 JPDAThreadImpl frameThreadImpl = (JPDAThreadImpl) frameThread;
 //Object pendingAction = frameThreadImpl.getPendingAction();
 //if (pendingAction != null) { For the case that evaluation should be 
blocked by pending action
@@ -918,8 +922,8 @@ public class JPDADebuggerImpl extends JPDADebugger {
 Evaluator.Result result;
 final JPDAThreadImpl[] resumedThread = new JPDAThreadImpl[] { null 
};
 try {
-StackFrame sf = csf.getStackFrame();
-int stackDepth = csf.getFrameDepth();
+StackFrame sf = csf != null ? csf.getStackFrame() : null;
+int stackDepth = csf != null ? csf.getFrameDepth() : -1;
 final ThreadReference tr = 
frameThreadImpl.getThreadReference();
 Runnable methodToBeInvokedNotifier = new Runnable() {
 @Override
@@ -940,16 +944,21 @@ public class JPDADebuggerImpl extends JPDADebugger {
 }
 }
 };
-Lookup context;
+List lookupVars = new ArrayList<>();
+lookupVars.add(frameThread);
+lookupVars.add(stackDepth);
+if (csf != null) {
+lookupVars.add(csf);
+   

[netbeans] branch release122 updated (f199e5a -> d305afa)

2021-01-10 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch release122
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from f199e5a  Merge pull request #2662 from jlahoda/backport-release1221
 new fcb6f40  Use the default MIME type, when not set on the Source.
 new cac1545  Display Java + Truffle guest frames correctly.
 new 7ad961a  Refresh hints in VSCode editor.
 new 8c14ff7  First attempt add LSP-based rename refactoring to the Java 
LSP Server and the LSP Client. (#2600)
 new d5f9df0  Make IntroduceElement fixes available as LSP CodeActions. 
(#2647)
 new 4c2c1b7  Support for default Progress action moved to non-UI.
 new 0ac02a4  Upgrade client library to 0.10; support ProgressHandles as 
WorkDoneProgress.
 new c1739d6  Retrofitted some modules to use now-base ProgressHandle.
 new 5cac518  Run action will terminate LSP client exec session on process 
exit.
 new 6b080f3  Added handler for workDone cancel notifications.
 new dbe4526  DAP piggybacks on LSP progress support; disabled cancel for 
debug/run.
 new 9128066  Allow to temporarily substitute different ProgressEnv for 
tests.
 new 642ac2d  Remove redundant scope check.
 new 960f4df  LSP - Go to definition enhanced with possible sources 
download. (#2649)
 new a9b14ad  Be sure to remove breakpoint event interceptor, when it 
wasn't used.
 new 7e4d47f  Various fixes for LSP codeAction and rename requests. (#2655)
 new 5c8e28e  Support executor ProgressHandle cancel over DAP protocol. 
(#2653)
 new 1ed0086  LSP codeAction fixes. (#2660)
 new d305afa  Merge pull request #2651 from 
entlicher/mentlicher/backportTo122

The 4665 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/cpplite/editor/file/CDataObject.java   |   9 +-
 .../modules/cpplite/editor/file/CPPDataObject.java |   9 +-
 .../modules/cpplite/editor/file/HDataObject.java   |   9 +-
 .../modules/cpplite/editor/file/HPPDataObject.java |   9 +-
 extide/gradle/nbproject/project.xml|  10 +-
 .../api/execute/GradleDistributionManager.java |   3 +-
 .../gradle/execute/GradleDaemonExecutor.java   |   3 +-
 ide/extexecution/nbproject/project.xml |  10 +-
 .../api/extexecution/ExecutionService.java |   3 +-
 ide/lsp.client/nbproject/project.xml   |  18 +
 .../client/bindings/refactoring/Bundle.properties  |   8 +-
 .../bindings/refactoring/ModificationResult.java   | 430 ++
 .../client/bindings/refactoring/Refactoring.java   | 519 -
 .../refactoring/RefactoringActionsProvider.java|  82 ++-
 .../client/bindings/refactoring/RenamePanel.form   |  72 +++
 .../client/bindings/refactoring/RenamePanel.java   |  81 +++
 ...ingUIImpl.java => RenameRefactoringUIImpl.java} |  41 +-
 ...UIImpl.java => WhereUsedRefactoringUIImpl.java} |   4 +-
 .../bindings/refactoring/tree/DiffElement.java | 150 +
 .../org/netbeans/modules/lsp/client/TestUtils.java | 202 +++
 ...extDocumentSyncServerCapabilityHandlerTest.java | 129 +
 .../refactoring/RenameRefactoringTest.java | 392 +
 .../org/netbeans/modules/parsing/api/Source.java   |   1 -
 ide/projectui/nbproject/project.xml|  10 +-
 .../modules/project/ui/OpenProjectList.java|   5 +-
 .../netbeans/modules/project/ui/groups/Group.java  |   3 +-
 .../netbeans/modules/project/ui/zip/ExportZIP.java |   4 +-
 .../netbeans/modules/project/ui/zip/ImportZIP.java |   3 +-
 .../modules/refactoring/api/AccessorImpl.java  |  12 +
 .../refactoring/api/RefactoringSession.java|  10 +-
 .../modules/refactoring/api/impl/APIAccessor.java  |   5 +
 .../modules/refactoring/api/impl/SPIAccessor.java  |   3 +
 .../refactoring/plugins/FileRenamePlugin.java  |   2 +-
 .../modules/refactoring/spi/AccessorImpl.java  |   6 +
 java/debugger.jpda.truffle/nbproject/project.xml   |   2 +-
 .../jpda/truffle/FirstSourceURLProvider.java   |  29 +-
 .../jpda/truffle/access/CurrentPCInfo.java |  12 +
 .../jpda/truffle/access/ExecutionHaltedInfo.java   |  13 +-
 .../jpda/truffle/access/TruffleAccess.java | 215 ++-
 .../debugger/jpda/truffle/access/TruffleEval.java  |   7 +-
 .../jpda/truffle/access/TruffleStrataProvider.java |   2 +-
 .../actions/PauseInGraalScriptActionProvider.java  |   2 +-
 .../jpda/truffle/actions/StepActionProvider.java   |   8 +-
 .../jpda/truffle/frames/TruffleStackFrame.java |  27 +-
 .../jpda/truffle/frames/TruffleStackInfo.java  |  23 +-
 .../models/DebuggingTruffleActionsProvider.java| 147 -
 .../frames/models/DebuggingTruffleTreeModel.java   | 157 +-
 .../frames/models/DebuggingViewTruffleSupport.j

[netbeans] branch master updated: Be sure to remove breakpoint event interceptor, when it wasn't used.

2021-01-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0535f96  Be sure to remove breakpoint event interceptor, when it 
wasn't used.
 new 4d92aa6  Merge pull request #2658 from entlicher/EventsInterceptFix
0535f96 is described below

commit 0535f963e33e93411a629b35fd9b2242f00ebbee
Author: Martin Entlicher 
AuthorDate: Sat Jan 9 20:45:52 2021 +0100

Be sure to remove breakpoint event interceptor, when it wasn't used.
---
 .../modules/debugger/jpda/truffle/access/TruffleAccess.java| 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
index 0a08453..6560dd5 100644
--- 
a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
+++ 
b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/access/TruffleAccess.java
@@ -270,17 +270,20 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 ThreadReference tr = threadImpl.getThreadReference();
 try {
 Method suspendHereMethod = 
ClassTypeWrapper.concreteMethodByName(debugAccessorClass, METHOD_SUSPEND_HERE, 
METHOD_SUSPEND_HERE_SGN);
+JPDADebuggerImpl debugger = threadImpl.getDebugger();
 Value haltInfo;
 Lock writeLock = threadImpl.accessLock.writeLock();
+Function breakpointEventInterceptor = null;
 try {
 writeLock.lock();
-
skipSuspendedEventClearLeakingReferences(threadImpl.getDebugger(), thread);
+breakpointEventInterceptor = 
skipSuspendedEventClearLeakingReferences(debugger, thread);
 haltInfo = ClassTypeWrapper.invokeMethod(debugAccessorClass, 
tr, suspendHereMethod, Collections.emptyList(), 
ObjectReference.INVOKE_SINGLE_THREADED);
 } finally {
+((JPDADebuggerImpl) 
debugger).getOperator().removeEventInterceptor(breakpointEventInterceptor);
 writeLock.unlock();
 }
 if (haltInfo instanceof ObjectReference) {
-return (ObjectVariable) 
threadImpl.getDebugger().getVariable(haltInfo);
+return (ObjectVariable) debugger.getVariable(haltInfo);
 }
 } catch (InvocationException ex) {
 Exceptions.printStackTrace(ex);
@@ -290,7 +293,7 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 return null;
 }
 
-private static void skipSuspendedEventClearLeakingReferences(JPDADebugger 
debugger, JPDAThread thread) {
+private static Function 
skipSuspendedEventClearLeakingReferences(JPDADebugger debugger, JPDAThread 
thread) {
 ThreadReference tr = ((JPDAThreadImpl) thread).getThreadReference();
 MethodBreakpoint clearLeakingReferencesBreakpoint = 
MethodBreakpoint.create("com.oracle.truffle.api.debug.SuspendedEvent", 
"clearLeakingReferences");
 
clearLeakingReferencesBreakpoint.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
@@ -340,6 +343,7 @@ public class TruffleAccess implements 
JPDABreakpointListener {
 });
 ((JPDADebuggerImpl) 
debugger).getOperator().addEventInterceptor(breakpointEventInterceptor);
 
DebuggerManager.getDebuggerManager().addBreakpoint(clearLeakingReferencesBreakpoint);
+return breakpointEventInterceptor;
 }
 
 @Override


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Refresh hints in VSCode editor.

2021-01-08 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8e7312e  Refresh hints in VSCode editor.
 new a6c0036  Merge pull request #2648 from 
entlicher/VSCodeEditorHintsRefresh
8e7312e is described below

commit 8e7312e1ed92773a3a38b2920ecd233dc7e139db
Author: Martin Entlicher 
AuthorDate: Thu Jan 7 17:52:34 2021 +0100

Refresh hints in VSCode editor.
---
 .../server/protocol/TextDocumentServiceImpl.java   | 38 --
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
index 1dac3d1..fc685e2 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
@@ -33,6 +33,7 @@ import 
com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter;
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -123,8 +124,6 @@ import org.eclipse.lsp4j.jsonrpc.messages.Either;
 import org.eclipse.lsp4j.services.LanguageClient;
 import org.eclipse.lsp4j.services.LanguageClientAware;
 import org.eclipse.lsp4j.services.TextDocumentService;
-import org.netbeans.api.editor.document.LineDocument;
-import org.netbeans.api.editor.document.LineDocumentUtils;
 import org.netbeans.api.java.lexer.JavaTokenId;
 import org.netbeans.api.java.source.CompilationController;
 import org.netbeans.api.java.source.CompilationInfo;
@@ -169,6 +168,7 @@ import org.netbeans.modules.parsing.api.ParserManager;
 import org.netbeans.modules.parsing.api.ResultIterator;
 import org.netbeans.modules.parsing.api.Source;
 import org.netbeans.modules.parsing.api.UserTask;
+import 
org.netbeans.modules.parsing.impl.indexing.implspi.ActiveDocumentProvider.IndexingAware;
 import org.netbeans.modules.parsing.spi.ParseException;
 import org.netbeans.modules.parsing.spi.SchedulerEvent;
 import org.netbeans.modules.refactoring.api.Problem;
@@ -195,7 +195,9 @@ import org.openide.text.PositionBounds;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 import org.openide.util.RequestProcessor;
+import org.openide.util.WeakSet;
 import org.openide.util.lookup.Lookups;
+import org.openide.util.lookup.ServiceProvider;
 
 /**
  *
@@ -211,6 +213,36 @@ public class TextDocumentServiceImpl implements 
TextDocumentService, LanguageCli
 private NbCodeLanguageClient client;
 
 public TextDocumentServiceImpl() {
+Lookup.getDefault().lookup(RefreshDocument.class).register(this);
+}
+
+private void reRunDiagnostics() {
+Set documents = new HashSet<>(openedDocuments.keySet());
+
+for (String doc : documents) {
+runDiagnoticTasks(doc);
+}
+}
+
+@ServiceProvider(service=IndexingAware.class, position=0)
+public static final class RefreshDocument implements IndexingAware {
+
+private final Set delegates = new WeakSet<>();
+
+public synchronized void register(TextDocumentServiceImpl delegate) {
+delegates.add(delegate);
+}
+
+@Override
+public void indexingComplete(Set indexedRoots) {
+TextDocumentServiceImpl[] delegates;
+synchronized (this) {
+delegates = this.delegates.toArray(new 
TextDocumentServiceImpl[this.delegates.size()]);
+}
+for (TextDocumentServiceImpl delegate : delegates) {
+delegate.reRunDiagnostics();
+}
+}
 }
 
 @Override
@@ -254,8 +286,8 @@ public class TextDocumentServiceImpl implements 
TextDocumentService, LanguageCli
 return 
CompletableFuture.completedFuture(Either., 
CompletionList>forRight(completionList));
 } catch (IOException | ParseException ex) {
 throw new IllegalStateException(ex);
-}
 }
+}
 
 public static final class CompletionData {
 public String uri;


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (e481dad -> 71be248)

2021-01-08 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from e481dad  Merge pull request #2630 from KacerCZ/netbeans-377-psr4-hints
 new 28a7a3f  Display Java + Truffle guest frames correctly.
 new 5b97b86  Removed unused JARs.
 new 71be248  Merge pull request #2643 from 
entlicher/mentlicher/JavaGuestCombinedStack

The 4829 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/debugger.jpda.truffle/build.xml   |   2 +-
 .../nbproject/project.properties   |   3 +-
 java/debugger.jpda.truffle/nbproject/project.xml   |   2 +-
 .../jpda/truffle/FirstSourceURLProvider.java   |  29 +--
 .../jpda/truffle/access/CurrentPCInfo.java |  12 ++
 .../jpda/truffle/access/ExecutionHaltedInfo.java   |  13 +-
 .../jpda/truffle/access/TruffleAccess.java | 211 +++--
 .../debugger/jpda/truffle/access/TruffleEval.java  |   7 +-
 .../jpda/truffle/access/TruffleStrataProvider.java |   2 +-
 .../actions/PauseInGraalScriptActionProvider.java  |   2 +-
 .../jpda/truffle/actions/StepActionProvider.java   |   8 +-
 .../jpda/truffle/frames/TruffleStackFrame.java |  27 ++-
 .../jpda/truffle/frames/TruffleStackInfo.java  |  23 ++-
 .../models/DebuggingTruffleActionsProvider.java| 147 --
 .../frames/models/DebuggingTruffleTreeModel.java   | 157 +--
 .../frames/models/DebuggingViewTruffleSupport.java |  28 ++-
 .../debugger/jpda/truffle/source/Source.java   |  71 ---
 .../truffle/vars/impl/TruffleVariableImpl.java |   6 +-
 .../models/TruffleLocalVariablesTreeModel.java |   4 +-
 .../vars/models/TruffleVariablesTableModel.java|   2 +-
 .../jpda/backend/truffle/DebuggerVisualizer.java   |  25 ++-
 .../debugger/jpda/backend/truffle/FrameInfo.java   |  33 +++-
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |  42 +++-
 .../backend/truffle/JPDATruffleDebugManager.java   |  60 +-
 .../jpda/backend/truffle/SourcePosition.java   |  16 ++
 java/debugger.jpda/nbproject/project.properties|   2 +-
 .../modules/debugger/jpda/JPDADebuggerImpl.java|   6 +-
 .../modules/debugger/jpda/util/Operator.java   |  42 +++-
 28 files changed, 852 insertions(+), 130 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Inform VSCode that application/javascript is also a MIME type of JavaScript.

2020-12-03 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new b9049ee  Inform VSCode that application/javascript is also a MIME type 
of JavaScript.
 new 2b9979d  Merge pull request #2574 from 
entlicher/CorrectJavaScriptMIMEType
b9049ee is described below

commit b9049ee49c69d4a32fce08469234a72d8ea299c9
Author: Martin Entlicher 
AuthorDate: Wed Dec 2 16:28:05 2020 +0100

Inform VSCode that application/javascript is also a MIME type of JavaScript.
---
 java/java.lsp.server/vscode/package.json | 9 +
 1 file changed, 9 insertions(+)

diff --git a/java/java.lsp.server/vscode/package.json 
b/java/java.lsp.server/vscode/package.json
index 0cae9dd..ccc033a 100644
--- a/java/java.lsp.server/vscode/package.json
+++ b/java/java.lsp.server/vscode/package.json
@@ -32,6 +32,15 @@
],
"main": "./out/extension.js",
"contributes": {
+   "languages": [
+   {
+   "id": "javascript",
+   "mimetypes": [
+   "text/javascript",
+   "application/javascript"
+   ]
+   }
+   ],
"configuration": {
"title": "Java",
"properties": {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (0533124 -> d013927)

2020-12-02 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 0533124  First attempt for Java getter/setter generator for the Java 
LSP server.
 new 5870c7e  Display sources loaded from String and find their MIME type.
 new 5a7fcfa  Use the default MIME type, when not set on the Source.
 new d013927  Merge pull request #2572 from 
entlicher/TruffleSourcesFromString

The 4694 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ide/spi.debugger.ui/apichanges.xml | 15 +
 ide/spi.debugger.ui/manifest.mf|  2 +-
 .../netbeans/spi/debugger/ui/DebuggingView.java| 12 ++-
 java/debugger.jpda.truffle/nbproject/project.xml   |  2 +-
 .../jpda/truffle/access/TruffleAccess.java | 10 --
 .../impl/TruffleBreakpointsHandler.java| 24 +-
 .../jpda/truffle/frames/TruffleStackFrame.java |  6 +++-
 .../jpda/truffle/frames/models/TruffleDVFrame.java | 19 ++-
 .../debugger/jpda/truffle/source/Source.java   | 22 +++--
 .../debugger/jpda/backend/truffle/FrameInfo.java   |  4 +--
 .../debugger/jpda/backend/truffle/GuestObject.java |  4 +--
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |  4 ++-
 .../backend/truffle/JPDATruffleDebugManager.java   |  2 +-
 .../jpda/backend/truffle/SourcePosition.java   | 13 +++-
 java/java.lsp.server/nbproject/project.xml |  2 +-
 .../lsp/server/debugging/DebugAdapterContext.java  | 28 
 .../lsp/server/debugging/NbProtocolServer.java | 38 ++
 .../lsp/server/debugging/NbSourceProvider.java | 28 ++--
 .../server/debugging/breakpoints/NbBreakpoint.java | 13 +++-
 java/java.lsp.server/vscode/package.json   |  2 +-
 20 files changed, 214 insertions(+), 36 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Prevent from a deadlock between debugger and debuggee when breakpoint is resolved right during it's submission.

2020-10-23 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 85358b7  Prevent from a deadlock between debugger and debuggee when 
breakpoint is resolved right during it's submission.
 new 2dc5015  Merge pull request #2481 from 
entlicher/TruffleBreakpointResolutionDeadlock_delivery
85358b7 is described below

commit 85358b7b793cac7458e033ad75772b2c2fcb06f4
Author: Martin Entlicher 
AuthorDate: Fri Oct 23 15:15:25 2020 +0200

Prevent from a deadlock between debugger and debuggee when breakpoint is 
resolved right during it's submission.
---
 .../debugger/jpda/backend/truffle/JPDATruffleAccessor.java | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/java/debugger.jpda.truffle/truffle-backend/org/netbeans/modules/debugger/jpda/backend/truffle/JPDATruffleAccessor.java
 
b/java/debugger.jpda.truffle/truffle-backend/org/netbeans/modules/debugger/jpda/backend/truffle/JPDATruffleAccessor.java
index 9eb69fe..2de2dd0 100644
--- 
a/java/debugger.jpda.truffle/truffle-backend/org/netbeans/modules/debugger/jpda/backend/truffle/JPDATruffleAccessor.java
+++ 
b/java/debugger.jpda.truffle/truffle-backend/org/netbeans/modules/debugger/jpda/backend/truffle/JPDATruffleAccessor.java
@@ -39,6 +39,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.WeakHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 import org.graalvm.polyglot.Engine;
 
 /**
@@ -517,13 +518,19 @@ public class JPDATruffleAccessor extends Object {
 if (ignoreCount != 0) {
 bb.ignoreCount(ignoreCount);
 }
+AtomicBoolean canNotifyResolved = new AtomicBoolean(false);
 if (oneShot) {
 bb.oneShot();
 } else {
 bb.resolveListener(new Breakpoint.ResolveListener() {
 @Override
 public void breakpointResolved(Breakpoint breakpoint, 
SourceSection section) {
-breakpointResolvedAccess(breakpoint, 
section.getStartLine(), section.getStartColumn());
+// Notify breakpoint resolution after we actually install 
it.
+// Resolution that is performed synchronously with the 
breakpoint installation
+// would block doSetLineBreakpoint() method invocation on 
breakpointResolvedAccess breakpoint
+if (canNotifyResolved.get()) {
+breakpointResolvedAccess(breakpoint, 
section.getStartLine(), section.getStartColumn());
+}
 }
 });
 }
@@ -532,7 +539,10 @@ public class JPDATruffleAccessor extends Object {
 lb.setCondition(condition);
 }
 trace("JPDATruffleAccessor.setLineBreakpoint({0}, {1}, {2}): lb = 
{3}", debuggerSession, uri, line, lb);
-return debuggerSession.install(lb);
+Breakpoint breakpoint =  debuggerSession.install(lb);
+// We might return a resolved breakpoint already, or notify 
breakpointResolvedAccess later on
+canNotifyResolved.set(true);
+return breakpoint;
 }
 
 static void removeBreakpoint(Object br) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Read mainClass configuration or property.

2020-10-21 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 3b2dabe  Read mainClass configuration or property.
 new 832de2c  Merge pull request #2474 from 
entlicher/MavenMainClass_delivery
3b2dabe is described below

commit 3b2dabe6baf7154533b4183b0b44fd423ab04066
Author: Martin Entlicher 
AuthorDate: Tue Oct 20 15:58:58 2020 +0200

Read mainClass configuration or property.
---
 .../modules/maven/runjar/RunJarPrereqChecker.java  |  60 -
 .../maven/runjar/RunJarPrereqCheckerTest.java  | 134 +
 2 files changed, 193 insertions(+), 1 deletion(-)

diff --git 
a/java/maven/src/org/netbeans/modules/maven/runjar/RunJarPrereqChecker.java 
b/java/maven/src/org/netbeans/modules/maven/runjar/RunJarPrereqChecker.java
index 26b6196..b3f3b2c 100644
--- a/java/maven/src/org/netbeans/modules/maven/runjar/RunJarPrereqChecker.java
+++ b/java/maven/src/org/netbeans/modules/maven/runjar/RunJarPrereqChecker.java
@@ -24,9 +24,13 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import javax.swing.JButton;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Plugin;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.netbeans.api.java.project.JavaProjectConstants;
 import org.netbeans.api.project.Project;
 import org.netbeans.api.project.ProjectUtils;
@@ -57,6 +61,8 @@ import org.openide.util.NbBundle.Messages;
 @ProjectServiceProvider(service=PrerequisitesChecker.class, 
projectType="org-netbeans-modules-maven/" + NbMavenProject.TYPE_JAR)
 public class RunJarPrereqChecker implements PrerequisitesChecker {
 
+private static final String[] MAIN_CLASS_PROPERTIES = {"mainClass", 
"exec.mainClass", "project.mainClass", "project.mainclass"}; // NOI18N
+
 private String mainClass;
 
 @Override public boolean checkRunConfig(RunConfig config) {
@@ -82,7 +88,7 @@ public class RunJarPrereqChecker implements 
PrerequisitesChecker {
 if ((ActionProvider.COMMAND_RUN.equals(actionName) ||
 ActionProvider.COMMAND_DEBUG.equals(actionName) ||
 ActionProvider.COMMAND_PROFILE.equals(actionName))) {
-String mc = null;
+String mc = findMainClass(config);
 for (Map.Entry entry : 
config.getProperties().entrySet()) {
 if (entry.getValue().contains("${packageClassName}")) { 
//NOI18N
 //show dialog to choose main class.
@@ -99,6 +105,58 @@ public class RunJarPrereqChecker implements 
PrerequisitesChecker {
 return true;
 }
 
+private static String findMainClass(RunConfig config) {
+// Read main class from the manifest property:
+String mainClass = getConfiguration(config, "maven-jar-plugin", 
"archive", "manifest", "mainClass"); // NOI18N
+if (mainClass != null) {
+return mainClass;
+}
+// Read main class from exec-maven-plugin configuration:
+mainClass = getConfiguration(config, "exec-maven-plugin", 
"mainClass"); // NOI18N
+if (mainClass != null) {
+return mainClass;
+}
+// Check pom's properties:
+Properties properties = config.getMavenProject().getProperties();
+for (String name : MAIN_CLASS_PROPERTIES) {
+String mc = properties.getProperty(name);
+if (mc != null) {
+return mc;
+}
+}
+return null;
+}
+
+private static Plugin findPlugin(RunConfig config, String name) {
+List plugins = 
config.getMavenProject().getBuild().getPlugins();
+for (Plugin p : plugins) {
+if (name.equals(p.getArtifactId())) {
+return p;
+}
+}
+return null;
+}
+
+private static String getConfiguration(RunConfig config, String pluginId, 
String... configs) {
+Plugin plugin = findPlugin(config, pluginId);
+if (plugin != null) {
+Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
+if (configuration != null) {
+Xpp3Dom child = configuration;
+for (String c : configs) {
+child = child.getChild(c);
+if (child == null) {
+break;
+}
+}
+if (child != null) {
+return child.getValue();
+}
+}
+}
+return null;
+}
+
 @Messages({
 "LBL_ChooseMainClass_Title=Select Main Cla

[netbeans] branch delivery updated: Reload external changes automatically in headless mode.

2020-10-20 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 6900794  Reload external changes automatically in headless mode.
 new 468294c  Merge pull request #2473 from 
entlicher/headlessUQEinDES_delivery
6900794 is described below

commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher 
AuthorDate: Mon Oct 19 17:54:05 2020 +0200

Reload external changes automatically in headless mode.
---
 .../src/org/openide/text/DataEditorSupport.java| 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java 
b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
 
 
 import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
 import org.netbeans.modules.openide.loaders.SimpleES;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends 
CloneableEditorSupport {
 try {
 des.superSaveDoc();
 } catch (UserQuestionException ex) {
-NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
-NotifyDescriptor.YES_NO_OPTION);
-Object res = DialogDisplayer.getDefault().notify(nd);
-
-if (NotifyDescriptor.OK_OPTION.equals(res)) {
+if (GraphicsEnvironment.isHeadless()) {
+// We cn not ask for anything in headless mode.
+// When there are e.g. external changes, we want to 
reload them,
+// otherwise we'd keep an inconsistent state.
 ex.confirmed();
+} else {
+NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+NotifyDescriptor.YES_NO_OPTION);
+Object res = DialogDisplayer.getDefault().notify(nd);
+
+if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ex.confirmed();
+}
 }
 }
 } catch (IOException e) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Reload external changes automatically in headless mode.

2020-10-19 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 6900794  Reload external changes automatically in headless mode.
 new 468294c  Merge pull request #2473 from 
entlicher/headlessUQEinDES_delivery
6900794 is described below

commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher 
AuthorDate: Mon Oct 19 17:54:05 2020 +0200

Reload external changes automatically in headless mode.
---
 .../src/org/openide/text/DataEditorSupport.java| 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java 
b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
 
 
 import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
 import org.netbeans.modules.openide.loaders.SimpleES;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends 
CloneableEditorSupport {
 try {
 des.superSaveDoc();
 } catch (UserQuestionException ex) {
-NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
-NotifyDescriptor.YES_NO_OPTION);
-Object res = DialogDisplayer.getDefault().notify(nd);
-
-if (NotifyDescriptor.OK_OPTION.equals(res)) {
+if (GraphicsEnvironment.isHeadless()) {
+// We cn not ask for anything in headless mode.
+// When there are e.g. external changes, we want to 
reload them,
+// otherwise we'd keep an inconsistent state.
 ex.confirmed();
+} else {
+NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+NotifyDescriptor.YES_NO_OPTION);
+Object res = DialogDisplayer.getDefault().notify(nd);
+
+if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ex.confirmed();
+}
 }
 }
 } catch (IOException e) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Reload external changes automatically in headless mode.

2020-10-19 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 6900794  Reload external changes automatically in headless mode.
 new 468294c  Merge pull request #2473 from 
entlicher/headlessUQEinDES_delivery
6900794 is described below

commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher 
AuthorDate: Mon Oct 19 17:54:05 2020 +0200

Reload external changes automatically in headless mode.
---
 .../src/org/openide/text/DataEditorSupport.java| 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java 
b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
 
 
 import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
 import org.netbeans.modules.openide.loaders.SimpleES;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends 
CloneableEditorSupport {
 try {
 des.superSaveDoc();
 } catch (UserQuestionException ex) {
-NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
-NotifyDescriptor.YES_NO_OPTION);
-Object res = DialogDisplayer.getDefault().notify(nd);
-
-if (NotifyDescriptor.OK_OPTION.equals(res)) {
+if (GraphicsEnvironment.isHeadless()) {
+// We cn not ask for anything in headless mode.
+// When there are e.g. external changes, we want to 
reload them,
+// otherwise we'd keep an inconsistent state.
 ex.confirmed();
+} else {
+NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+NotifyDescriptor.YES_NO_OPTION);
+Object res = DialogDisplayer.getDefault().notify(nd);
+
+if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ex.confirmed();
+}
 }
 }
 } catch (IOException e) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Reload external changes automatically in headless mode.

2020-10-19 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 6900794  Reload external changes automatically in headless mode.
 new 468294c  Merge pull request #2473 from 
entlicher/headlessUQEinDES_delivery
6900794 is described below

commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher 
AuthorDate: Mon Oct 19 17:54:05 2020 +0200

Reload external changes automatically in headless mode.
---
 .../src/org/openide/text/DataEditorSupport.java| 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java 
b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
 
 
 import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
 import org.netbeans.modules.openide.loaders.SimpleES;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends 
CloneableEditorSupport {
 try {
 des.superSaveDoc();
 } catch (UserQuestionException ex) {
-NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
-NotifyDescriptor.YES_NO_OPTION);
-Object res = DialogDisplayer.getDefault().notify(nd);
-
-if (NotifyDescriptor.OK_OPTION.equals(res)) {
+if (GraphicsEnvironment.isHeadless()) {
+// We cn not ask for anything in headless mode.
+// When there are e.g. external changes, we want to 
reload them,
+// otherwise we'd keep an inconsistent state.
 ex.confirmed();
+} else {
+NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+NotifyDescriptor.YES_NO_OPTION);
+Object res = DialogDisplayer.getDefault().notify(nd);
+
+if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ex.confirmed();
+}
 }
 }
 } catch (IOException e) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch delivery updated: Reload external changes automatically in headless mode.

2020-10-19 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
 new 6900794  Reload external changes automatically in headless mode.
 new 468294c  Merge pull request #2473 from 
entlicher/headlessUQEinDES_delivery
6900794 is described below

commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher 
AuthorDate: Mon Oct 19 17:54:05 2020 +0200

Reload external changes automatically in headless mode.
---
 .../src/org/openide/text/DataEditorSupport.java| 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java 
b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
 
 
 import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
 import org.netbeans.modules.openide.loaders.SimpleES;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends 
CloneableEditorSupport {
 try {
 des.superSaveDoc();
 } catch (UserQuestionException ex) {
-NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
-NotifyDescriptor.YES_NO_OPTION);
-Object res = DialogDisplayer.getDefault().notify(nd);
-
-if (NotifyDescriptor.OK_OPTION.equals(res)) {
+if (GraphicsEnvironment.isHeadless()) {
+// We cn not ask for anything in headless mode.
+// When there are e.g. external changes, we want to 
reload them,
+// otherwise we'd keep an inconsistent state.
 ex.confirmed();
+} else {
+NotifyDescriptor nd = new 
NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+NotifyDescriptor.YES_NO_OPTION);
+Object res = DialogDisplayer.getDefault().notify(nd);
+
+if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ex.confirmed();
+}
 }
 }
 } catch (IOException e) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Propagate a launch error to the client.

2020-10-15 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new a9dc33c  Propagate a launch error to the client.
 new 523a8d4  Merge pull request #2459 from entlicher/vscodeext_launchError
a9dc33c is described below

commit a9dc33cba25e476d63770a3adf0fc3b3797b9665
Author: Martin Entlicher 
AuthorDate: Thu Oct 15 18:08:02 2020 +0200

Propagate a launch error to the client.
---
 .../java/lsp/server/debugging/launch/NbLaunchDelegate.java   | 12 +++-
 .../lsp/server/debugging/launch/NbLaunchRequestHandler.java  |  3 +++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
index cb92008..768b02b 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegate.java
@@ -18,18 +18,18 @@
  */
 package org.netbeans.modules.java.lsp.server.debugging.launch;
 
-import com.sun.jdi.VMDisconnectedException;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.concurrent.CancellationException;
 import java.util.concurrent.CompletableFuture;
 import java.util.function.Consumer;
 
+import org.eclipse.lsp4j.jsonrpc.ResponseErrorException;
+import org.eclipse.lsp4j.jsonrpc.messages.ResponseError;
+import org.eclipse.lsp4j.jsonrpc.messages.ResponseErrorCode;
+
 import org.netbeans.api.annotations.common.CheckForNull;
 import org.netbeans.api.debugger.DebuggerManager;
 import org.netbeans.api.debugger.DebuggerManagerAdapter;
@@ -63,7 +63,9 @@ public abstract class NbLaunchDelegate {
 Pair providerAndCommand = findTarget(toRun, 
debug);
 CompletableFuture launchFuture = new CompletableFuture<>();
 if (providerAndCommand == null) {
-launchFuture.completeExceptionally(new 
CancellationException("Cannot find " + (debug ? "debug" : "run") + " action!"));
+launchFuture.completeExceptionally(new ResponseErrorException(new 
ResponseError(
+ResponseErrorCode.MethodNotFound,
+"Cannot find " + (debug ? "debug" : "run") + " action!", 
null)));
 return launchFuture;
 }
 NbProcessConsole ioContext = new NbProcessConsole(consoleMessages);
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 53ad82a..8c0c855 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
@@ -101,6 +101,9 @@ public final class NbLaunchRequestHandler {
 activeLaunchHandler.nbLaunch(file, context, !noDebug, new 
OutputListener(context)).thenRun(() -> {
 activeLaunchHandler.postLaunch(launchArguments, context);
 resultFuture.complete(null);
+}).exceptionally(e -> {
+resultFuture.completeExceptionally(e);
+return null;
 });
 return resultFuture;
 }


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (cdba678 -> 524a8dd)

2020-10-13 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from cdba678  Merge pull request #2447 from 
JaroslavTulach/jtulach/VSCodeDebugging
 new cd6b1de  Validation of breakpoints in VSCode extension.
 new 72daac1  Validation and update of Truffle breakpoints.
 new 524a8dd  Merge pull request #2452 from 
entlicher/vscodeext_UpdateBreakpoints

The 4497 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../impl/TruffleBreakpointsHandler.java| 72 ++
 .../jpda/backend/truffle/JPDATruffleAccessor.java  | 13 
 .../server/debugging/breakpoints/NbBreakpoint.java | 60 +-
 .../breakpoints/NbBreakpointsRequestHandler.java   | 35 +++
 4 files changed, 130 insertions(+), 50 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Improved stability of Truffle debugger and implemented step from scripts to Java.

2020-10-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f282d78  Improved stability of Truffle debugger and implemented step 
from scripts to Java.
 new dfb0edb  Merge pull request #2436 from 
entlicher/TruffleDebugStabilityAndStep2Java
f282d78 is described below

commit f282d78f09c4bf6296cbf062f12808c628287fdb
Author: Martin Entlicher 
AuthorDate: Fri Oct 9 15:09:14 2020 +0200

Improved stability of Truffle debugger and implemented step from scripts to 
Java.
---
 java/api.debugger.jpda/apichanges.xml  |  16 ++
 java/api.debugger.jpda/manifest.mf |   2 +-
 .../netbeans/api/debugger/jpda/JPDADebugger.java   |  15 +-
 .../org/netbeans/api/debugger/jpda/JPDAStep.java   |  60 +++
 .../org/netbeans/api/debugger/jpda/JPDAThread.java |   2 -
 java/debugger.jpda.truffle/nbproject/project.xml   |   9 +-
 .../debugger/jpda/truffle/DebugManagerHandler.java |   2 +-
 .../debugger/jpda/truffle/PersistentValues.java| 129 +++
 .../debugger/jpda/truffle/RemoteServices.java  | 175 +
 .../debugger/jpda/truffle/TruffleDebugManager.java | 121 --
 .../jpda/truffle/access/CurrentPCInfo.java |   2 +-
 .../jpda/truffle/access/TruffleAccess.java |   4 +-
 .../actions/PauseInGraalScriptActionProvider.java  |  85 +-
 .../truffle/actions/RunToCursorActionProvider.java |  15 +-
 .../jpda/truffle/actions/StepActionProvider.java   |  49 +-
 .../truffle/breakpoints/TruffleLineBreakpoint.java |  64 
 .../{ => impl}/TruffleBreakpointReader.java|  16 +-
 .../{ => impl}/TruffleBreakpointsHandler.java  |  57 +--
 .../jpda/truffle/frames/TruffleStackFrame.java |   2 +-
 .../debugger/jpda/truffle/source/Source.java   |   2 +
 .../truffle/source/SourceBinaryTranslator.java | 126 +++
 .../jpda/truffle/vars/TruffleVariable.java |   8 +
 .../truffle/vars/{ => impl}/TruffleEvaluator.java  |   2 +-
 .../truffle/vars/{ => impl}/TruffleExpression.java |   2 +-
 .../jpda/truffle/vars/{ => impl}/TruffleScope.java |   3 +-
 .../vars/{ => impl}/TruffleStackVariable.java  |   8 +-
 .../vars/{ => impl}/TruffleVariableImpl.java   |   3 +-
 .../models/TruffleLocalVariablesTreeModel.java |   2 +-
 .../vars/models/TruffleVariablesNodeModel.java |   2 +-
 .../vars/models/TruffleVariablesTableModel.java|   4 +-
 .../vars/models/TruffleVariablesTreeModel.java |   4 +-
 .../truffle/vars/tooltip/ToolTipAnnotation.java|   2 +-
 .../jpda/backend/truffle/AgentClassLoader.java}|  31 ++--
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |   5 +-
 .../modules/debugger/jpda/JPDAStepImpl.java| 127 +++
 .../jpda/breakpoints/LineBreakpointImpl.java   |  15 +-
 36 files changed, 834 insertions(+), 337 deletions(-)

diff --git a/java/api.debugger.jpda/apichanges.xml 
b/java/api.debugger.jpda/apichanges.xml
index 67a5177..69574ef 100644
--- a/java/api.debugger.jpda/apichanges.xml
+++ b/java/api.debugger.jpda/apichanges.xml
@@ -959,6 +959,22 @@ These are mainly class and thread filters and hit counts.
 
 
 
+
+
+
+JPDAStep enhanced with stepping filters and 
JPDADebugger.getSession() added.
+
+
+
+
+
+JPDAStep enhanced with stepping filters for better 
control.
+JPDADebugger.getSession() added to be able to easily 
retrieve the session
+this JPDA debugger belongs into.
+
+
+
+
 
 
   
diff --git a/java/api.debugger.jpda/manifest.mf 
b/java/api.debugger.jpda/manifest.mf
index e545029..49338d3 100644
--- a/java/api.debugger.jpda/manifest.mf
+++ b/java/api.debugger.jpda/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.api.debugger.jpda/2
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/api/debugger/jpda/Bundle.properties
-OpenIDE-Module-Specification-Version: 3.18
+OpenIDE-Module-Specification-Version: 3.19
 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
 
diff --git 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
index 26d3e6a..d073f22 100644
--- 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
+++ 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
@@ -19,7 +19,6 @@
 
 package org.netbeans.api.debugger.jpda;
 
-import com.sun.jdi.VirtualMachine;
 import com.sun.jdi.connect.Connector.Argument;
 import com.sun.jdi.connect.ListeningConnector;
 import com.sun.jdi.request.EventRequest;
@@ -38,6 +37,7 @@ import java.util.Map;
 import org.netbeans.api.debugger.De

[netbeans] branch master updated: Improved stability of Truffle debugger and implemented step from scripts to Java.

2020-10-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f282d78  Improved stability of Truffle debugger and implemented step 
from scripts to Java.
 new dfb0edb  Merge pull request #2436 from 
entlicher/TruffleDebugStabilityAndStep2Java
f282d78 is described below

commit f282d78f09c4bf6296cbf062f12808c628287fdb
Author: Martin Entlicher 
AuthorDate: Fri Oct 9 15:09:14 2020 +0200

Improved stability of Truffle debugger and implemented step from scripts to 
Java.
---
 java/api.debugger.jpda/apichanges.xml  |  16 ++
 java/api.debugger.jpda/manifest.mf |   2 +-
 .../netbeans/api/debugger/jpda/JPDADebugger.java   |  15 +-
 .../org/netbeans/api/debugger/jpda/JPDAStep.java   |  60 +++
 .../org/netbeans/api/debugger/jpda/JPDAThread.java |   2 -
 java/debugger.jpda.truffle/nbproject/project.xml   |   9 +-
 .../debugger/jpda/truffle/DebugManagerHandler.java |   2 +-
 .../debugger/jpda/truffle/PersistentValues.java| 129 +++
 .../debugger/jpda/truffle/RemoteServices.java  | 175 +
 .../debugger/jpda/truffle/TruffleDebugManager.java | 121 --
 .../jpda/truffle/access/CurrentPCInfo.java |   2 +-
 .../jpda/truffle/access/TruffleAccess.java |   4 +-
 .../actions/PauseInGraalScriptActionProvider.java  |  85 +-
 .../truffle/actions/RunToCursorActionProvider.java |  15 +-
 .../jpda/truffle/actions/StepActionProvider.java   |  49 +-
 .../truffle/breakpoints/TruffleLineBreakpoint.java |  64 
 .../{ => impl}/TruffleBreakpointReader.java|  16 +-
 .../{ => impl}/TruffleBreakpointsHandler.java  |  57 +--
 .../jpda/truffle/frames/TruffleStackFrame.java |   2 +-
 .../debugger/jpda/truffle/source/Source.java   |   2 +
 .../truffle/source/SourceBinaryTranslator.java | 126 +++
 .../jpda/truffle/vars/TruffleVariable.java |   8 +
 .../truffle/vars/{ => impl}/TruffleEvaluator.java  |   2 +-
 .../truffle/vars/{ => impl}/TruffleExpression.java |   2 +-
 .../jpda/truffle/vars/{ => impl}/TruffleScope.java |   3 +-
 .../vars/{ => impl}/TruffleStackVariable.java  |   8 +-
 .../vars/{ => impl}/TruffleVariableImpl.java   |   3 +-
 .../models/TruffleLocalVariablesTreeModel.java |   2 +-
 .../vars/models/TruffleVariablesNodeModel.java |   2 +-
 .../vars/models/TruffleVariablesTableModel.java|   4 +-
 .../vars/models/TruffleVariablesTreeModel.java |   4 +-
 .../truffle/vars/tooltip/ToolTipAnnotation.java|   2 +-
 .../jpda/backend/truffle/AgentClassLoader.java}|  31 ++--
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |   5 +-
 .../modules/debugger/jpda/JPDAStepImpl.java| 127 +++
 .../jpda/breakpoints/LineBreakpointImpl.java   |  15 +-
 36 files changed, 834 insertions(+), 337 deletions(-)

diff --git a/java/api.debugger.jpda/apichanges.xml 
b/java/api.debugger.jpda/apichanges.xml
index 67a5177..69574ef 100644
--- a/java/api.debugger.jpda/apichanges.xml
+++ b/java/api.debugger.jpda/apichanges.xml
@@ -959,6 +959,22 @@ These are mainly class and thread filters and hit counts.
 
 
 
+
+
+
+JPDAStep enhanced with stepping filters and 
JPDADebugger.getSession() added.
+
+
+
+
+
+JPDAStep enhanced with stepping filters for better 
control.
+JPDADebugger.getSession() added to be able to easily 
retrieve the session
+this JPDA debugger belongs into.
+
+
+
+
 
 
   
diff --git a/java/api.debugger.jpda/manifest.mf 
b/java/api.debugger.jpda/manifest.mf
index e545029..49338d3 100644
--- a/java/api.debugger.jpda/manifest.mf
+++ b/java/api.debugger.jpda/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.api.debugger.jpda/2
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/api/debugger/jpda/Bundle.properties
-OpenIDE-Module-Specification-Version: 3.18
+OpenIDE-Module-Specification-Version: 3.19
 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
 
diff --git 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
index 26d3e6a..d073f22 100644
--- 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
+++ 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
@@ -19,7 +19,6 @@
 
 package org.netbeans.api.debugger.jpda;
 
-import com.sun.jdi.VirtualMachine;
 import com.sun.jdi.connect.Connector.Argument;
 import com.sun.jdi.connect.ListeningConnector;
 import com.sun.jdi.request.EventRequest;
@@ -38,6 +37,7 @@ import java.util.Map;
 import org.netbeans.api.debugger.De

[netbeans] branch master updated: Improved stability of Truffle debugger and implemented step from scripts to Java.

2020-10-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f282d78  Improved stability of Truffle debugger and implemented step 
from scripts to Java.
 new dfb0edb  Merge pull request #2436 from 
entlicher/TruffleDebugStabilityAndStep2Java
f282d78 is described below

commit f282d78f09c4bf6296cbf062f12808c628287fdb
Author: Martin Entlicher 
AuthorDate: Fri Oct 9 15:09:14 2020 +0200

Improved stability of Truffle debugger and implemented step from scripts to 
Java.
---
 java/api.debugger.jpda/apichanges.xml  |  16 ++
 java/api.debugger.jpda/manifest.mf |   2 +-
 .../netbeans/api/debugger/jpda/JPDADebugger.java   |  15 +-
 .../org/netbeans/api/debugger/jpda/JPDAStep.java   |  60 +++
 .../org/netbeans/api/debugger/jpda/JPDAThread.java |   2 -
 java/debugger.jpda.truffle/nbproject/project.xml   |   9 +-
 .../debugger/jpda/truffle/DebugManagerHandler.java |   2 +-
 .../debugger/jpda/truffle/PersistentValues.java| 129 +++
 .../debugger/jpda/truffle/RemoteServices.java  | 175 +
 .../debugger/jpda/truffle/TruffleDebugManager.java | 121 --
 .../jpda/truffle/access/CurrentPCInfo.java |   2 +-
 .../jpda/truffle/access/TruffleAccess.java |   4 +-
 .../actions/PauseInGraalScriptActionProvider.java  |  85 +-
 .../truffle/actions/RunToCursorActionProvider.java |  15 +-
 .../jpda/truffle/actions/StepActionProvider.java   |  49 +-
 .../truffle/breakpoints/TruffleLineBreakpoint.java |  64 
 .../{ => impl}/TruffleBreakpointReader.java|  16 +-
 .../{ => impl}/TruffleBreakpointsHandler.java  |  57 +--
 .../jpda/truffle/frames/TruffleStackFrame.java |   2 +-
 .../debugger/jpda/truffle/source/Source.java   |   2 +
 .../truffle/source/SourceBinaryTranslator.java | 126 +++
 .../jpda/truffle/vars/TruffleVariable.java |   8 +
 .../truffle/vars/{ => impl}/TruffleEvaluator.java  |   2 +-
 .../truffle/vars/{ => impl}/TruffleExpression.java |   2 +-
 .../jpda/truffle/vars/{ => impl}/TruffleScope.java |   3 +-
 .../vars/{ => impl}/TruffleStackVariable.java  |   8 +-
 .../vars/{ => impl}/TruffleVariableImpl.java   |   3 +-
 .../models/TruffleLocalVariablesTreeModel.java |   2 +-
 .../vars/models/TruffleVariablesNodeModel.java |   2 +-
 .../vars/models/TruffleVariablesTableModel.java|   4 +-
 .../vars/models/TruffleVariablesTreeModel.java |   4 +-
 .../truffle/vars/tooltip/ToolTipAnnotation.java|   2 +-
 .../jpda/backend/truffle/AgentClassLoader.java}|  31 ++--
 .../jpda/backend/truffle/JPDATruffleAccessor.java  |   5 +-
 .../modules/debugger/jpda/JPDAStepImpl.java| 127 +++
 .../jpda/breakpoints/LineBreakpointImpl.java   |  15 +-
 36 files changed, 834 insertions(+), 337 deletions(-)

diff --git a/java/api.debugger.jpda/apichanges.xml 
b/java/api.debugger.jpda/apichanges.xml
index 67a5177..69574ef 100644
--- a/java/api.debugger.jpda/apichanges.xml
+++ b/java/api.debugger.jpda/apichanges.xml
@@ -959,6 +959,22 @@ These are mainly class and thread filters and hit counts.
 
 
 
+
+
+
+JPDAStep enhanced with stepping filters and 
JPDADebugger.getSession() added.
+
+
+
+
+
+JPDAStep enhanced with stepping filters for better 
control.
+JPDADebugger.getSession() added to be able to easily 
retrieve the session
+this JPDA debugger belongs into.
+
+
+
+
 
 
   
diff --git a/java/api.debugger.jpda/manifest.mf 
b/java/api.debugger.jpda/manifest.mf
index e545029..49338d3 100644
--- a/java/api.debugger.jpda/manifest.mf
+++ b/java/api.debugger.jpda/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.api.debugger.jpda/2
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/api/debugger/jpda/Bundle.properties
-OpenIDE-Module-Specification-Version: 3.18
+OpenIDE-Module-Specification-Version: 3.19
 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
 
diff --git 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
index 26d3e6a..d073f22 100644
--- 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
+++ 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java
@@ -19,7 +19,6 @@
 
 package org.netbeans.api.debugger.jpda;
 
-import com.sun.jdi.VirtualMachine;
 import com.sun.jdi.connect.Connector.Argument;
 import com.sun.jdi.connect.ListeningConnector;
 import com.sun.jdi.request.EventRequest;
@@ -38,6 +37,7 @@ import java.util.Map;
 import org.netbeans.api.debugger.De

[netbeans] branch master updated: Representation of frames in DebuggingView API.

2020-10-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 10cb3ff  Representation of frames in DebuggingView API.
 new 714b6a0  Merge pull request #2429 from entlicher/DebuggingViewFrameAPIs
10cb3ff is described below

commit 10cb3ff7b77c3c82ba67476c1ab25d301d776a4e
Author: Martin Entlicher 
AuthorDate: Thu Oct 8 18:51:44 2020 +0200

Representation of frames in DebuggingView API.
---
 ide/spi.debugger.ui/apichanges.xml |  17 +++
 ide/spi.debugger.ui/manifest.mf|   2 +-
 .../netbeans/spi/debugger/ui/DebuggingView.java|  99 +
 java/debugger.jpda.truffle/nbproject/project.xml   |   2 +-
 .../frames/models/DebuggingTruffleTreeModel.java   |  32 +-
 .../frames/models/DebuggingViewTruffleSupport.java |  80 ++
 .../jpda/truffle/frames/models/TruffleDVFrame.java |  79 ++
 java/debugger.jpda.ui/nbproject/project.xml|   3 +-
 .../ui/debugging/DebuggingViewSupportImpl.java |  28 -
 .../debugger/jpda/ui/debugging/JPDADVFrame.java| 117 +
 .../debugger/jpda/ui/debugging/JPDADVThread.java   |  57 +-
 11 files changed, 504 insertions(+), 12 deletions(-)

diff --git a/ide/spi.debugger.ui/apichanges.xml 
b/ide/spi.debugger.ui/apichanges.xml
index c3e21b4..0703882 100644
--- a/ide/spi.debugger.ui/apichanges.xml
+++ b/ide/spi.debugger.ui/apichanges.xml
@@ -244,6 +244,23 @@
 
 
 
+
+
+Frames added into DebuggingView.
+
+
+
+
+
+
+DebuggingView is enhanced with stack frames.
+DVSupport.DVFrame interface was added together 
with getters on
+DVThread class.
+
+
+
+
+
 
 
   
diff --git a/ide/spi.debugger.ui/manifest.mf b/ide/spi.debugger.ui/manifest.mf
index 57dd36d..c410f70 100644
--- a/ide/spi.debugger.ui/manifest.mf
+++ b/ide/spi.debugger.ui/manifest.mf
@@ -2,6 +2,6 @@ Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.spi.debugger.ui/1
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/debugger/ui/Bundle.properties
 OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
-OpenIDE-Module-Specification-Version: 2.64
+OpenIDE-Module-Specification-Version: 2.65
 OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui
 OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class
diff --git 
a/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java 
b/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
index 63f8c69..263297d 100644
--- a/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
+++ b/ide/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/DebuggingView.java
@@ -29,7 +29,9 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.lang.ref.Reference;
 import java.lang.ref.WeakReference;
+import java.net.URI;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
@@ -172,6 +174,17 @@ public final class DebuggingView {
 public abstract String getDisplayName(DVThread thread);
 
 /**
+ * Get the display name of the frame. It can contain more information
+ * than a frame name, like source location, etc.
+ * @param frame the frame
+ * @return the frame display name
+ * @since 2.65
+ */
+public String getDisplayName(DVFrame frame) {
+return frame.getName();
+}
+
+/**
  * Get the thread icon.
  * @param thread the thread
  * @return the thread icon
@@ -327,6 +340,40 @@ public final class DebuggingView {
 public void makeCurrent();
 
 /**
+ * Get frame count of this thread. The frame count is provided when 
the thread
+ * is suspended only.
+ * @return the frame count, 0 when the thread is running.
+ * @since 2.65
+ */
+public default int getFrameCount() {
+return 0;
+}
+
+/**
+ * Get the stack frames of this thread. Stack frames are provided when 
the thread
+ * is suspended only.
+ *
+ * @return a list of stack frames, it's empty when the thread is 
running.
+ * @since 2.65
+ */
+public default List getFrames() {
+return Collections.emptyList();
+}
+
+/**
+ * Get the stack frames of this thread. Stack frames are provided when 
the thread
+ * is suspended only.
+ *
+ * @param from a from index, inclusive
+ * @param to a to index, exclusive
+ * @return a list of 

[netbeans] branch master updated: Grammatically incorrect constants in ExceptionBreakpoint deprecated and replaced with grammatically correct names.

2020-10-09 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 6861719  Grammatically incorrect constants in ExceptionBreakpoint 
deprecated and replaced with grammatically correct names.
 new 1f6e1ee  Merge pull request #2430 from 
entlicher/ExceptionBreakpointConstantsGrammar
6861719 is described below

commit 68617190ac776a586a326576019cf2328929b468
Author: Martin Entlicher 
AuthorDate: Fri Oct 9 00:34:30 2020 +0200

Grammatically incorrect constants in ExceptionBreakpoint deprecated and 
replaced with grammatically correct names.
---
 java/api.debugger.jpda/apichanges.xml  | 14 
 java/api.debugger.jpda/manifest.mf |  2 +-
 .../api/debugger/jpda/ExceptionBreakpoint.java | 40 +-
 .../modules/debugger/jpda/ant/JPDAStart.java   |  2 +-
 java/debugger.jpda.ui/nbproject/project.xml|  2 +-
 .../ui/breakpoints/ExceptionBreakpointPanel.java   | 14 
 .../jpda/ui/models/BreakpointsNodeModel.java   |  8 ++---
 java/debugger.jpda/nbproject/project.xml   |  2 +-
 .../breakpoints/BreakpointsEngineListener.java |  2 +-
 .../jpda/breakpoints/BreakpointsReader.java|  2 +-
 .../jpda/breakpoints/ExceptionBreakpointImpl.java  |  4 +--
 .../debugger/jpda/BreakpointsClassFilterTest.java  |  4 +--
 .../api/debugger/jpda/ExceptionBreakpointTest.java |  2 +-
 13 files changed, 67 insertions(+), 31 deletions(-)

diff --git a/java/api.debugger.jpda/apichanges.xml 
b/java/api.debugger.jpda/apichanges.xml
index 04027fe..67a5177 100644
--- a/java/api.debugger.jpda/apichanges.xml
+++ b/java/api.debugger.jpda/apichanges.xml
@@ -945,6 +945,20 @@ These are mainly class and thread filters and hit counts.
 
 
 
+
+
+
+Grammatically incorrect constants deprecated.
+
+
+
+
+
+The grammatically incorrect constants in 
ExceptionBreakpoint
+class are deprecated and replaced with grammatically correct names.
+
+
+
 
 
   
diff --git a/java/api.debugger.jpda/manifest.mf 
b/java/api.debugger.jpda/manifest.mf
index 14dbf1c..e545029 100644
--- a/java/api.debugger.jpda/manifest.mf
+++ b/java/api.debugger.jpda/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.api.debugger.jpda/2
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/api/debugger/jpda/Bundle.properties
-OpenIDE-Module-Specification-Version: 3.17
+OpenIDE-Module-Specification-Version: 3.18
 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
 
diff --git 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/ExceptionBreakpoint.java
 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/ExceptionBreakpoint.java
index d53378e..5159004 100644
--- 
a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/ExceptionBreakpoint.java
+++ 
b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/ExceptionBreakpoint.java
@@ -32,14 +32,14 @@ import org.openide.util.NbBundle;
 
 
 /**
- * Notifies about exceptions throw in debugged JVM.
+ * Notifies about exceptions thrown in debugged JVM.
  *
  * 
  * How to use it:
  * 
  *DebuggerManager.addBreakpoint (ExceptionBreakpoint.create (
  *"java.lang.NullPointerException",
- *ExceptionBreakpoint.TYPE_EXCEPTION_UNCATCHED
+ *ExceptionBreakpoint.TYPE_EXCEPTION_UNCAUGHT
  *));
  * This breakpoint stops when NullPointerException is throw and uncatched.
  *
@@ -58,17 +58,39 @@ public class ExceptionBreakpoint extends JPDABreakpoint {
 /** Property name constant. */
 public static final String  PROP_CONDITION = "condition"; // NOI18N
 
-/** Catch type constant. [sic] "caught" */
+/** Catch type constant. [sic] "caught"
+ * @deprecated Use {@link #TYPE_EXCEPTION_CAUGHT} */
+@Deprecated
 public static final int TYPE_EXCEPTION_CATCHED = 1;
-/** Catch type constant. [sic] "uncaught" */
+/** Catch type constant. [sic] "uncaught"
+ * @deprecated Use {@link #TYPE_EXCEPTION_UNCAUGHT} */
+@Deprecated
 public static final int TYPE_EXCEPTION_UNCATCHED = 2;
-/** Catch type constant. [sic] "caught/uncaught" */
+/** Catch type constant. [sic] "caught/uncaught"
+ * @deprecated Use {@link #TYPE_EXCEPTION_CAUGHT_UNCAUGHT} */
+@Deprecated
 public static final int TYPE_EXCEPTION_CATCHED_UNCATCHED = 3;
 
+/**
+ * Catch type constant that matches those exceptions that are caught by 
the user code.
+ * @since 3.18
+ */
+public static final int TYPE_EXCEPTION_CAUGHT = 1;
+/**
+ * Catch type constant that matches those excep

[netbeans] branch master updated: Do not tear down debugger UI in a headless mode.

2020-10-08 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new fa6ca39  Do not tear down debugger UI in a headless mode.
 new 4d8bcca  Merge pull request #2428 from 
entlicher/Debugger_HeadlessFriendly
fa6ca39 is described below

commit fa6ca3959d49584908e062b60a6994448d81e184
Author: Martin Entlicher 
AuthorDate: Thu Oct 8 16:32:07 2020 +0200

Do not tear down debugger UI in a headless mode.
---
 .../src/org/netbeans/modules/debugger/ui/DebuggerManagerListener.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/DebuggerManagerListener.java
 
b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/DebuggerManagerListener.java
index b62c459..8897e96 100644
--- 
a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/DebuggerManagerListener.java
+++ 
b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/DebuggerManagerListener.java
@@ -395,6 +395,9 @@ public class DebuggerManagerListener extends 
DebuggerManagerAdapter {
 
 @Override
 public void engineRemoved (final DebuggerEngine engine) {
+if (GraphicsEnvironment.isHeadless()) {
+return ;
+}
 DebuggerModule dm = DebuggerModule.findObject(DebuggerModule.class);
 if (dm != null && dm.isClosing()) {
 // Do not interfere with closeDebuggerUI()


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists