(netbeans) 01/01: Merge pull request #7338 from thurka/GCN-2809

2024-06-11 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

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

commit 4d0d5a82b55af50c586ef2d6d9c80d7638895ff9
Merge: 675fdd4e81 e15eae47d2
Author: Tomas Hurka 
AuthorDate: Tue Jun 11 16:27:06 2024 +0200

Merge pull request #7338 from thurka/GCN-2809

Do not show Connect dialog when DB connection fails because of missing JDBC 
driver

 .../netbeans/modules/db/explorer/action/ConnectAction.java  | 13 +
 1 file changed, 9 insertions(+), 4 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 (675fdd4e81 -> 4d0d5a82b5)

2024-06-11 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

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


from 675fdd4e81 Merge pull request #7457 from 
dbalek/dbalek/vscode-cve-2024-4068
 add e15eae47d2 do not show Connect dialog when DB connection fails because 
of missing JDBC driver
 new 4d0d5a82b5 Merge pull request #7338 from thurka/GCN-2809

The 1 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:
 .../netbeans/modules/db/explorer/action/ConnectAction.java  | 13 +
 1 file changed, 9 insertions(+), 4 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 (139498df45 -> f69aa60533)

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

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


from 139498df45 Merge pull request #7376 from apache/delivery
 add fc1bdb0a6f GH-7329 do not include 
de-funfried-netbeans-plugins-externalcodeformatter module in default VSNetBeans 
build
 new f69aa60533 Merge pull request #7392 from 
thurka/disable-externalcodeformatter

The 1 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/java.lsp.server/build.xml | 2 +-
 1 file changed, 1 insertion(+), 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) 01/01: Merge pull request #7392 from thurka/disable-externalcodeformatter

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

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

commit f69aa60533cacc1a839bb9abe3a7a05a0ca9253d
Merge: 139498df45 fc1bdb0a6f
Author: Tomas Hurka 
AuthorDate: Wed May 22 10:01:16 2024 +0200

Merge pull request #7392 from thurka/disable-externalcodeformatter

Remove de-funfried-netbeans-plugins-externalcodeformatter from VSNetBeans

 java/java.lsp.server/build.xml | 2 +-
 1 file changed, 1 insertion(+), 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 (55e7742c8f -> 306f174318)

2024-03-22 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

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


from 55e7742c8f Merge pull request #7177 from 
dbalek/dbalek/lsp-gen-test-class-fix
 add 47d052d613 gracefully handle case, when encSimpleName is equal to 
simpleName
 new 306f174318 Merge pull request #7176 from thurka/binary_name_fix

The 1 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:
 .../src/org/netbeans/modules/java/source/usages/BinaryAnalyser.java| 3 +++
 1 file changed, 3 insertions(+)


-
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/01: Merge pull request #7176 from thurka/binary_name_fix

2024-03-22 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

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

commit 306f174318db1e1d5fbe7a63d827d66c7a38978d
Merge: 55e7742c8f 47d052d613
Author: Tomas Hurka 
AuthorDate: Fri Mar 22 08:17:24 2024 +0100

Merge pull request #7176 from thurka/binary_name_fix

gracefully handle case, when encSimpleName is equal to simpleName

 .../src/org/netbeans/modules/java/source/usages/BinaryAnalyser.java| 3 +++
 1 file changed, 3 insertions(+)


-
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: allow to copy OCID to clipboard

2023-12-11 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 9972b4a07e allow to copy OCID to clipboard
 new dbf92bd3ab Merge pull request #6804 from thurka/copy_ocid
9972b4a07e is described below

commit 9972b4a07e48cdd9b7aacffbe143013ea25db5a1
Author: Tomas Hurka 
AuthorDate: Wed Dec 6 17:07:58 2023 +0100

allow to copy OCID to clipboard
---
 .../cloud/oracle/actions/CopyOCIDAction.java   | 73 ++
 1 file changed, 73 insertions(+)

diff --git 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/CopyOCIDAction.java
 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/CopyOCIDAction.java
new file mode 100644
index 00..ad0a507d58
--- /dev/null
+++ 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/CopyOCIDAction.java
@@ -0,0 +1,73 @@
+/*
+ * 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.cloud.oracle.actions;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionReferences;
+import org.openide.awt.ActionRegistration;
+import org.openide.awt.StatusDisplayer;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openide.util.datatransfer.ExClipboard;
+
+/**
+ *
+ * @author Tomas Hurka
+ */
+@ActionID(
+category = "Tools",
+id = "org.netbeans.modules.cloud.oracle.actions.CopyOCIDAction"
+)
+@ActionRegistration(displayName = "#CTL_CopyOCIDAction")
+@ActionReferences(value = {
+@ActionReference(path = "Cloud/Oracle/Common/Actions", position = 300)
+})
+@NbBundle.Messages("CTL_CopyOCIDAction=Copy OCID")
+public class CopyOCIDAction implements ActionListener {
+
+private final OCIItem context;
+
+public CopyOCIDAction(OCIItem context) {
+this.context = context;
+}
+
+@Override
+public void actionPerformed(ActionEvent ev) {
+setClipboardContents(context.getKey().getValue());
+}
+
+@NbBundle.Messages("MSG_OCID_placed_in_clipboard=OCID was placed in 
clipboard")
+private void setClipboardContents(String content) {
+Clipboard clipboard = Lookup.getDefault().lookup(ExClipboard.class);
+if (clipboard == null) {
+clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+}
+if (clipboard != null) {
+clipboard.setContents(new StringSelection(content), null);
+
StatusDisplayer.getDefault().setStatusText(Bundle.MSG_OCID_placed_in_clipboard());
+}
+}
+}


-
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: "Copy OCID" action added

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

thurka 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 264f11ae41 "Copy OCID" action added
 new 3cc6d772eb Merge pull request #6786 from thurka/GCN-3756
264f11ae41 is described below

commit 264f11ae41e866513b2076dfefd5d9cf8b3e5166
Author: Tomas Hurka 
AuthorDate: Mon Dec 4 10:38:13 2023 +0100

"Copy OCID" action added
---
 .../nbcode/integration/nbproject/project.xml   | 24 ---
 .../nbcode/integration/commands/OCIDCommand.java   | 81 ++
 java/java.lsp.server/vscode/package.json   | 27 ++--
 java/java.lsp.server/vscode/src/extension.ts   |  7 ++
 4 files changed, 126 insertions(+), 13 deletions(-)

diff --git a/java/java.lsp.server/nbcode/integration/nbproject/project.xml 
b/java/java.lsp.server/nbcode/integration/nbproject/project.xml
index e176ec66dd..debf5ec044 100644
--- a/java/java.lsp.server/nbcode/integration/nbproject/project.xml
+++ b/java/java.lsp.server/nbcode/integration/nbproject/project.xml
@@ -119,6 +119,14 @@
 9.24.0.8
 
 
+
+
org.netbeans.modules.project.dependency
+
+
+
+
+
+
 
 
org.netbeans.modules.projectapi
 
@@ -191,35 +199,35 @@
 
 
 
-org.openide.util
+org.openide.nodes
 
 
 
-9.18
+7.68
 
 
 
-org.openide.util.lookup
+org.openide.util
 
 
 
-8.44
+9.18
 
 
 
-org.openide.util.ui
+org.openide.util.lookup
 
 
 
-9.24
+8.44
 
 
 
-
org.netbeans.modules.project.dependency
+org.openide.util.ui
 
 
 
-
+9.24
 
 
 
diff --git 
a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java
 
b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java
new file mode 100644
index 00..7cf88de519
--- /dev/null
+++ 
b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java
@@ -0,0 +1,81 @@
+/*
+ * 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.nbcode.integration.commands;
+
+import com.google.gson.JsonPrimitive;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+import org.netbeans.modules.java.lsp.server.explorer.TreeNodeRegistry;
+import org.netbeans.modules.java.lsp.server.explorer.TreeViewProvider;
+import org.netbeans.spi.lsp.CommandProvider;
+import org.openide.nodes.Node;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Tomas Hurka
+ */
+@ServiceProvider(service = CommandProvider.class)
+public class OCIDCommand implements CommandProvider {
+
+private static final Logger LOG = 
Logger.getLogger(OCIDCommand.class.getName());
+
+private static final String COMMAND_CLOUD_OCID_GET = 
"nbls.cloud.o

(netbeans) branch master updated: added option to add the database connection while downloading Database Wallet

2023-11-29 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 ffe7c65bf2 added option to add the database connection while 
downloading Database Wallet
 new 348b0cd295 Merge pull request #6763 from thurka/GCN-3755
ffe7c65bf2 is described below

commit ffe7c65bf2136768d1e04d15dcfb3120d440ff4a
Author: Tomas Hurka 
AuthorDate: Wed Nov 29 10:39:41 2023 +0100

added option to add the database connection while downloading Database 
Wallet
---
 .../modules/cloud/oracle/actions/Bundle.properties |  12 +-
 .../cloud/oracle/actions/DownloadWalletDialog.form |  94 +++--
 .../cloud/oracle/actions/DownloadWalletDialog.java | 152 ++---
 3 files changed, 165 insertions(+), 93 deletions(-)

diff --git 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/Bundle.properties
 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/Bundle.properties
index d15c8ee33c..9a9166bac7 100644
--- 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/Bundle.properties
+++ 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/Bundle.properties
@@ -21,13 +21,15 @@ CreateAutonomousDBDialog.jLabel2.text=Password:
 CreateAutonomousDBDialog.jPasswordField1.text=
 CreateAutonomousDBDialog.jLabel3.text=Confirm Password:
 CreateAutonomousDBDialog.jPasswordField2.text=
-DownloadWalletDialog.jLabel2.text=Confirm Password:
-DownloadWalletDialog.jLabel1.text=Password:
-DownloadWalletDialog.jTextArea1.text=Database connections to your Autonomous 
Database use a secure connection. The wallet file will be required to configure 
your database clients and tools to access Autonomous Database.\n\nPlease create 
a password for this wallet. Some database clients will require that you provide 
both the wallet and password to connect to your database (other clients will 
auto-login using the wallet without a password).
+DownloadWalletDialog.jTextArea1.text=Database connections to your Autonomous 
Database use a secure connection. The wallet file will be required to configure 
your database clients and tools to access Autonomous Database.\n\nA password 
will be created for this wallet. Some database clients will require that you 
provide both the wallet and password to connect to your database (other clients 
will auto-login using the wallet without a password).
 DownloadWalletDialog.jButtonBrowse.text=Browse...
-DownloadWalletDialog.jPasswordField.text=
-DownloadWalletDialog.jPasswordFieldConfirm.text=
 DownloadWalletDialog.jTextFieldLocation.text=
 DownloadWalletDialog.jLabel3.text=Wallet Directory:
 CreateAutonomousDBDialog.jTextArea1.text=Creates a new Autonomous Database.
 CreateAutonomousDBDialog.jLabel4.text=Set the password for your Autonomous 
Database ADMIN user here.
+DownloadWalletDialog.dbUserField.text=
+DownloadWalletDialog.dbPasswordField.text=
+DownloadWalletDialog.dbUserLabel.text=DB Username:
+DownloadWalletDialog.dbPasswordLabel.text=DB Password:
+DownloadWalletDialog.addDBCheckbox.toolltip=In addition to downloading Wallet, 
it also adds this database connection to the database manager.
+DownloadWalletDialog.addDBCheckbox.text=Add As Database Connection
diff --git 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.form
 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.form
index fe0a4f2611..546029ac11 100644
--- 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.form
+++ 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.form
@@ -45,25 +45,29 @@
   
 
   
-  
+  
   
   
   
   
   
-  
   
-  
+  
+  
   
-  
-  
-  
-  
-  
+  
+  
+  
+  
+  
   
   
   
   
+  
+  
+  
+  
   
   
   
@@ -74,23 +78,25

(netbeans) branch master updated: Improve error message for failure to connect to a DB; all connection exception logged

2023-11-14 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 788eec5b56 Improve error message for failure to connect to a DB; all 
connection exception logged
 new e54b87d09e Merge pull request #6655 from thurka/GCN-3485
788eec5b56 is described below

commit 788eec5b56c2b0ad7222fcb60047d2da31e6b841
Author: Tomas Hurka 
AuthorDate: Thu Nov 2 16:19:25 2023 +0100

Improve error message for failure to connect to a DB; all connection 
exception logged
---
 .../java/lsp/server/db/DBAddConnection.java| 24 +++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
index 557edb649c..59de4ff6ea 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
@@ -32,6 +32,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import org.eclipse.lsp4j.CodeAction;
 import org.eclipse.lsp4j.CodeActionParams;
@@ -70,7 +72,7 @@ import org.openide.util.lookup.ServiceProvider;
 "MSG_SelectDriver=Select db driver",
 "MSG_DriverNotFound=Driver not found",
 "MSG_ConnectionAdded=Connection added",
-"MSG_ConnectionFailed=Connection failed",
+"MSG_ConnectionFailed=Could not connect to the database \"{0}\", user 
{1}:\n{2}",
 "MSG_SelectSchema=Select Database Schema"
 })
 @ServiceProvider(service = CodeActionsProvider.class)
@@ -83,6 +85,7 @@ public class DBAddConnection extends CodeActionsProvider {
 public static final String SCHEMA =  "schema"; // NOI18N
 public static final String DISPLAY_NAME =  "displayName"; // NOI18N
 
+private static final Logger LOG = 
Logger.getLogger(DBAddConnection.class.getName());
 private static final Map urlTemplates = new HashMap<> ();
 static {
 urlTemplates.put("org.postgresql.Driver", 
"jdbc:postgresql://:5432/");
@@ -138,6 +141,7 @@ public class DBAddConnection extends CodeActionsProvider {
 
ConnectionManager.getDefault().addConnection(dbconn);
 client.showMessage(new 
MessageParams(MessageType.Info, Bundle.MSG_ConnectionAdded()));
 } catch (DatabaseException ex) {
+LOG.log(Level.INFO, "Add connection", ex);
 client.showMessage(new 
MessageParams(MessageType.Error, ex.getMessage()));
 }
 });
@@ -147,6 +151,7 @@ public class DBAddConnection extends CodeActionsProvider {
 
ConnectionManager.getDefault().addConnection(dbconn);
 client.showMessage(new 
MessageParams(MessageType.Info, Bundle.MSG_ConnectionAdded()));
 } catch (DatabaseException ex) {
+LOG.log(Level.INFO, "Add connection with schema", 
ex);
 client.showMessage(new 
MessageParams(MessageType.Error, ex.getMessage()));
 }
 }
@@ -245,8 +250,20 @@ public class DBAddConnection extends CodeActionsProvider {
 
ConnectionManager.getDefault().addConnection(dbconn);
 schemas.addAll(getSchemas(dbconn));
 failed = false;
-} catch(DatabaseException | SQLException ex) {
+} catch(SQLException ex) {
+LOG.log(Level.INFO, "vaildate", ex);
 return 
CompletableFuture.completedFuture(ex.getMessage());
+} catch (DatabaseException ex) {
+String message;
+Throwable cause = ex.getCause();
+if (cause == null) cause = ex;
+if (cause.getCause() != null) {
+message = 
Bundle.MSG_ConnectionFailed(urlData.getRight(), userData.getRight(), 
cause.getCause().getMessage());
+} else {
+message = cause.getMessage();
+}
+ 

[netbeans] branch master updated: make sure that there is database connection - getDialect() needs it

2023-10-24 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 29b88adab0 make sure that there is database connection - getDialect() 
needs it
 new 2fde2b4fd6 Merge pull request #6609 from thurka/GCN-3613
29b88adab0 is described below

commit 29b88adab0979f8c194276bfd0c51779a02baccb
Author: Tomas Hurka 
AuthorDate: Mon Oct 23 14:13:59 2023 +0200

make sure that there is database connection - getDialect() needs it
---
 .../src/org/netbeans/modules/micronaut/db/MicronautRepository.java   | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
index 1bb29e08ec..4bea0889a0 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
@@ -117,6 +117,11 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoDdSupport(folder.getPath()), 
NotifyDescriptor.ERROR_MESSAGE));
 return Collections.emptyList();
 }
+DatabaseConnection connection = 
ConnectionManager.getDefault().getPreferredConnection(true);
+if (connection == null) {
+DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoDbConn(), 
NotifyDescriptor.ERROR_MESSAGE));
+return Collections.emptyList();
+}
 final boolean jpaSupported = 
Utils.isJPASupported(sourceGroup);
 final Map entity2idTypes = 
getEntityClasses(sourceGroup, jpaSupported);
 final List entities = 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: Micronaut Template for Data repository - add support for Pageable

2023-10-24 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 0c437f1411 Micronaut Template for Data repository - add support for 
Pageable
 new 4c6ab9ac54 Merge pull request #6591 from thurka/GCN-3261
0c437f1411 is described below

commit 0c437f1411d64c94eb5953b1fe01da9c09d5c75a
Author: Tomas Hurka 
AuthorDate: Thu Oct 19 17:36:00 2023 +0200

Micronaut Template for Data repository - add support for Pageable
---
 .../modules/micronaut/db/MicronautRepository.java  | 33 --
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
index 1bb29e08ec..8adcdf7288 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
@@ -71,6 +71,8 @@ import 
org.netbeans.spi.project.ui.templates.support.Templates;
 import org.openide.DialogDescriptor;
 import org.openide.DialogDisplayer;
 import org.openide.NotifyDescriptor;
+import org.openide.NotifyDescriptor.QuickPick;
+import org.openide.NotifyDescriptor.QuickPick.Item;
 import org.openide.WizardDescriptor;
 import org.openide.filesystems.FileObject;
 import org.openide.loaders.DataObject;
@@ -90,7 +92,12 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 
 @NbBundle.Messages({
 "MSG_SelectEntities=Select Entity Classes",
-"MSG_NoEntities=No entity class found in {0}"
+"MSG_NoEntities=No entity class found in {0}",
+"MSG_Repository_Type=Select Repository Type",
+"MSG_CrudRepository=CRUD Repository",
+"DESC_CrudRepository=CrudRepository enables automatic generation of 
CRUD operations.",
+"MSG_PageableRepository=Pageable Repository",
+"DESC_PageableRepository=PageableRepository extends CrudRepository and 
adds methods for pagination."
 })
 public static CreateFromTemplateHandler handler() {
 return new CreateFromTemplateHandler() {
@@ -132,6 +139,14 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoEntities(sourceGroup.getRootFolder().getPath()),
 NotifyDescriptor.ERROR_MESSAGE));
 return Collections.emptyList();
 }
+List repoType = new ArrayList<>();
+Item pageableItem = new 
Item(Bundle.MSG_PageableRepository(), null 
/*Bundle.DESC_PageableRepository()*/);
+repoType.add(new Item(Bundle.MSG_CrudRepository(), null 
/*Bundle.DESC_CrudRepository()*/));
+repoType.add(pageableItem);
+QuickPick qpt = new 
QuickPick(Bundle.MSG_Repository_Type(), Bundle.MSG_Repository_Type(), repoType, 
false);
+if (DialogDescriptor.OK_OPTION != 
DialogDisplayer.getDefault().notify(qpt)) {
+return Collections.emptyList();
+}
 NotifyDescriptor.QuickPick qp = new 
NotifyDescriptor.QuickPick(Bundle.MSG_SelectEntities(), 
Bundle.MSG_SelectEntities(), entities, true);
 if (DialogDescriptor.OK_OPTION == 
DialogDisplayer.getDefault().notify(qp)) {
 String dialect = getDialect(jpaSupported);
@@ -140,7 +155,7 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 if (item.isSelected()) {
 String fqn = item.getDescription() != null ? 
item.getDescription() + '.' + item.getLabel() : item.getLabel();
 String entityIdType = entity2idTypes.get(fqn);
-FileObject fo = generate(folder, 
item.getLabel(), fqn, entityIdType, dialect);
+FileObject fo = generate(folder, 
item.getLabel(), fqn, entityIdType, dialect, pageableItem.isSelected());
 if (fo != null) {
 generated.add(fo);
 }
@@ -172,7 +187,7 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 String fqn = entry.getKey();
 int idx = fqn.lastIndexOf('.');
 String label = idx < 0 ? fqn : fqn.substring(idx + 1);
-FileObject fo = generate(targetFolder, label, fqn, 
entry.getValue(), dialect);
+FileObject fo = generate(targetFolder, label, fqn, 
entry.getValue(), dialect, false);
 if (fo 

[netbeans] branch master updated: do not create repository and entity classes from template if project was not configured with databse support

2023-10-16 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 fc9e5178f8 do not create repository and entity classes from template 
if project was not configured with databse support
 new 9b91eba3ef Merge pull request #6529 from thurka/GCN-3474
fc9e5178f8 is described below

commit fc9e5178f822f61cc194ed259505ecf7d37efc00
Author: Tomas Hurka 
AuthorDate: Wed Oct 4 14:04:59 2023 +0200

do not create repository and entity classes from template if project was 
not configured with databse support
---
 .../org/netbeans/modules/micronaut/db/MicronautEntity.java|  5 +
 .../netbeans/modules/micronaut/db/MicronautRepository.java|  4 
 .../src/org/netbeans/modules/micronaut/db/Utils.java  | 11 +--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautEntity.java
 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautEntity.java
index 7e83726708..76d072c548 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautEntity.java
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautEntity.java
@@ -105,6 +105,7 @@ public class MicronautEntity extends RelatedCMPWizard {
 
 @NbBundle.Messages({
 "MSG_NoDbConn=No database connection found",
+"MSG_NoDdSupport=No database support libraries found for {0}",
 "MSG_NoProject=No project found for {0}",
 "MSG_NoSourceGroup=No source group found for {0}",
 "MSG_SelectTables=Select Database Tables",
@@ -137,6 +138,10 @@ public class MicronautEntity extends RelatedCMPWizard {
 DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoSourceGroup(folder.getPath()), 
NotifyDescriptor.ERROR_MESSAGE));
 return Collections.emptyList();
 }
+if (!Utils.isDBSupported(sourceGroup) && 
!Utils.isJPASupported(sourceGroup)) {
+DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoDdSupport(folder.getPath()), 
NotifyDescriptor.ERROR_MESSAGE));
+return Collections.emptyList();
+}
 DatabaseConnection connection = 
ConnectionManager.getDefault().getPreferredConnection(true);
 if (connection == null) {
 DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoDbConn(), 
NotifyDescriptor.ERROR_MESSAGE));
diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
index 4f3c6b6797..1bb29e08ec 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautRepository.java
@@ -113,6 +113,10 @@ public class MicronautRepository implements 
TemplateWizard.Iterator {
 DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoSourceGroup(folder.getPath()), 
NotifyDescriptor.ERROR_MESSAGE));
 return Collections.emptyList();
 }
+if (!Utils.isDBSupported(sourceGroup) && 
!Utils.isJPASupported(sourceGroup)) {
+DialogDisplayer.getDefault().notifyLater(new 
NotifyDescriptor.Message(Bundle.MSG_NoDdSupport(folder.getPath()), 
NotifyDescriptor.ERROR_MESSAGE));
+return Collections.emptyList();
+}
 final boolean jpaSupported = 
Utils.isJPASupported(sourceGroup);
 final Map entity2idTypes = 
getEntityClasses(sourceGroup, jpaSupported);
 final List entities = new 
ArrayList<>();
diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java
index 4e3e08fbd7..c0e5897dea 100644
--- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java
+++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java
@@ -28,6 +28,14 @@ import org.netbeans.api.project.SourceGroup;
 public class Utils {
 
 public static boolean isJPASupported(SourceGroup sg) {
+return resolveClassName(sg, 
"io.micronaut.data.jpa.repository.JpaRepository"); //NOI18N
+}
+
+public static boolean isDBSupported(SourceGroup sg) {
+return resolveClassName(sg, "io.micronaut.data.annotation.Id"); 
//NOI18N
+}
+
+private static boolean resolve

[netbeans] branch master updated: update npm module debug (moderate severity vulnerability)

2023-10-03 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 2841f235fe update npm module debug (moderate severity vulnerability)
 new 7747055cb7 Merge pull request #6518 from thurka/npm_debug
2841f235fe is described below

commit 2841f235feea986c236a0ff04f5ec410a0f26868
Author: Tomas Hurka 
AuthorDate: Tue Oct 3 10:48:17 2023 +0200

update npm module debug (moderate severity vulnerability)
---
 java/java.lsp.server/vscode/package-lock.json | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/java/java.lsp.server/vscode/package-lock.json 
b/java/java.lsp.server/vscode/package-lock.json
index 790f1a0306..7bd0d7017f 100644
--- a/java/java.lsp.server/vscode/package-lock.json
+++ b/java/java.lsp.server/vscode/package-lock.json
@@ -959,9 +959,10 @@
}
},
"node_modules/https-proxy-agent/node_modules/debug": {
-   "version": "3.2.6",
+   "version": "3.2.7",
+   "resolved": 
"https://registry.npmjs.org/debug/-/debug-3.2.7.tgz;,
+   "integrity": 
"sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
-   "license": "MIT",
"dependencies": {
"ms": "^2.1.1"
}
@@ -2166,7 +2167,9 @@
},
"dependencies": {
"debug": {
-   "version": "3.2.6",
+   "version": "3.2.7",
+   "resolved": 
"https://registry.npmjs.org/debug/-/debug-3.2.7.tgz;,
+   "integrity": 
"sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"requires": {
"ms": "^2.1.1"


-
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 (e71774364f -> 60a9c163ca)

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

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


from e71774364f Merge pull request #6476 from 
dbalek/dbalek/lsp-signature-help
 new ed854913fa quickpick title for database fixed
 new 6927021db9 estimated number of inputs fixed in AddADBAction
 new 60a9c163ca Merge pull request #6420 from thurka/GCN-3221

The 9059 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/cloud/oracle/actions/AddADBAction.java   | 16 +++-
 1 file changed, 11 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] branch master updated: 'allmodules' should include all clusters not just 'java' and its dependencies

2023-09-07 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 69c795ccde 'allmodules' should include all clusters not just 'java' 
and its dependencies
 new 8cfa6e0b6f Merge pull request #6417 from thurka/GCN-3248
69c795ccde is described below

commit 69c795ccdeeb7a49bf92e18349fa17b015935fc0
Author: Tomas Hurka 
AuthorDate: Thu Sep 7 12:53:06 2023 +0200

'allmodules' should include all clusters not just 'java' and its 
dependencies
---
 java/java.lsp.server/build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/java.lsp.server/build.xml b/java/java.lsp.server/build.xml
index 51051fb631..7db974a132 100644
--- a/java/java.lsp.server/build.xml
+++ b/java/java.lsp.server/build.xml
@@ -128,7 +128,7 @@
 
 
 
-
+
 
 https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Pass DB connection details using file instead of env. variables

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

thurka 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 6b29456cfa Pass DB connection details using file instead of env. 
variables
 new fef90a1cd6 Merge pull request #6353 from thurka/GCN-3053
6b29456cfa is described below

commit 6b29456cfa9dcdee822b352d5217b255b26f7567
Author: Tomas Hurka 
AuthorDate: Thu Aug 17 13:30:44 2023 +0200

Pass DB connection details using file instead of env. variables
---
 .../java/lsp/server/db/DBConnectionProvider.java   | 173 +++--
 .../vscode/src/dbConfigurationProvider.ts  |  10 ++
 java/java.lsp.server/vscode/src/extension.ts   |   3 +-
 3 files changed, 172 insertions(+), 14 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
index d761d2044a..8c01aedfb3 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
@@ -18,12 +18,35 @@
  */
 package org.netbeans.modules.java.lsp.server.db;
 
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.charset.Charset;
+import java.nio.file.DirectoryStream;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.attribute.AclEntry;
+import java.nio.file.attribute.AclEntryPermission;
+import static java.nio.file.attribute.AclEntryPermission.*;
+import java.nio.file.attribute.AclFileAttributeView;
+import java.nio.file.attribute.DosFileAttributeView;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.PosixFileAttributeView;
+import java.nio.file.attribute.PosixFilePermission;
+import static java.nio.file.attribute.PosixFilePermission.*;
+import java.nio.file.attribute.PosixFilePermissions;
 import java.util.Collections;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.eclipse.lsp4j.CodeAction;
 import org.eclipse.lsp4j.CodeActionParams;
 import org.netbeans.api.db.explorer.ConnectionManager;
@@ -34,39 +57,163 @@ import org.netbeans.modules.parsing.api.ResultIterator;
 import org.openide.util.lookup.ServiceProvider;
 
 /**
- * 
+ *
  * @author Jan Horvath
  */
 @ServiceProvider(service = CodeActionsProvider.class)
 public class DBConnectionProvider extends CodeActionsProvider{
-private static final String  GET_DB_CONNECTION = "java.db.connection"; 
//NOI18N
+   private static final Logger LOG = 
Logger.getLogger(DBConnectionProvider.class.getName());
+   private static final String  GET_DB_CONNECTION = "java.db.connection"; 
//NOI18N
+
+private static final boolean POSIX = 
FileSystems.getDefault().supportedFileAttributeViews().contains("posix");  // 
NOI18N
+private static final EnumSet readWritePosix = 
EnumSet.of(OWNER_READ, OWNER_WRITE);
+private static final EnumSet readOnlyAcl = 
EnumSet.of(READ_ACL, READ_ATTRIBUTES, WRITE_ATTRIBUTES, READ_DATA, 
READ_NAMED_ATTRS, DELETE, SYNCHRONIZE);
+
+// temporary directory location
+private static final Path tmpdir = 
Path.of(System.getProperty("java.io.tmpdir"));   // NOI18N
+
+public DBConnectionProvider() {
+try {
+deleteOldFiles(generateDirPath());
+} catch (IOException ex) {
+LOG.log(Level.SEVERE, "deleteOldFiles", ex);
+}
+}
 
 @Override
 public List getCodeActions(ResultIterator resultIterator, 
CodeActionParams params) throws Exception {
 return Collections.emptyList();
 }
-
+
 @Override
 public CompletableFuture processCommand(NbCodeLanguageClient 
client, String command, List arguments) {
 Map result = new HashMap<> ();
+CompletableFuture ret = new CompletableFuture();
+Properties dbProps = new Properties();
 DatabaseConnection conn = 
ConnectionManager.getDefault().getPreferredConnection(true);
 
 if (conn != null) {
-result.put("DATASOURCES_DEFAULT_URL", conn.getDatabaseURL()); 
//NOI18N
-result.put("DATASOURCES_DEFAULT_USERNAME", conn.getUser()); 
//NOI18N
-result.put("DATASOURCES_DEFAULT_PASSWORD", conn.getPassword()); 
//NOI18N
-result.put("DATASOURCES_DEFAULT_DRIVER_CLASS_NAME", 
conn.getDriverClass()); //NOI18N
-String ocid = (String) conn

[netbeans] branch master updated: cleanup of CodeActionsProvider.getCommands()

2023-08-16 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 05c4591402 cleanup of CodeActionsProvider.getCommands()
 new eaf1858c81 Merge pull request #6345 from thurka/GH-6113_1
05c4591402 is described below

commit 05c45914024f0389fab859cbf79c34e9aa66e069
Author: Tomas Hurka 
AuthorDate: Tue Aug 15 18:30:58 2023 +0200

cleanup of CodeActionsProvider.getCommands()
---
 .../netbeans/modules/java/lsp/server/db/DBCommandProvider.java   | 9 +
 .../modules/java/lsp/server/db/DBConnectionProvider.java | 9 +
 .../modules/java/lsp/server/protocol/TestClassGenerator.java | 4 +---
 .../server/refactoring/ChangeMethodParametersRefactoring.java| 4 +---
 .../modules/java/lsp/server/refactoring/MoveRefactoring.java | 3 +--
 .../modules/java/lsp/server/refactoring/PullUpRefactoring.java   | 3 +--
 .../modules/java/lsp/server/refactoring/PushDownRefactoring.java | 3 +--
 7 files changed, 7 insertions(+), 28 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
index 845b8af04e..79850e77fb 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
@@ -18,9 +18,7 @@
  */
 package org.netbeans.modules.java.lsp.server.db;
 
-import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
@@ -29,7 +27,6 @@ import org.eclipse.lsp4j.CodeAction;
 import org.eclipse.lsp4j.CodeActionParams;
 import org.netbeans.api.db.explorer.ConnectionManager;
 import org.netbeans.api.db.explorer.DatabaseConnection;
-import org.netbeans.modules.java.lsp.server.explorer.TreeItem;
 import org.netbeans.modules.java.lsp.server.explorer.TreeNodeRegistry;
 import org.netbeans.modules.java.lsp.server.protocol.CodeActionsProvider;
 import org.netbeans.modules.java.lsp.server.protocol.NbCodeLanguageClient;
@@ -46,10 +43,6 @@ import org.openide.util.lookup.ServiceProvider;
 public class DBCommandProvider extends CodeActionsProvider {
 private static final String  COMMAND_GET_PREFERRED_CONNECTION = 
"java.db.preferred.connection";
 
-private static final Set COMMANDS = new HashSet<>(Arrays.asList(
-COMMAND_GET_PREFERRED_CONNECTION
-));
-
 @Override
 public List getCodeActions(ResultIterator resultIterator, 
CodeActionParams params) throws Exception {
 return Collections.emptyList();
@@ -76,6 +69,6 @@ public class DBCommandProvider extends CodeActionsProvider {
 
 @Override
 public Set getCommands() {
-return COMMANDS;
+return Collections.singleton(COMMAND_GET_PREFERRED_CONNECTION);
 }
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
index 09e2176663..d761d2044a 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
@@ -18,10 +18,8 @@
  */
 package org.netbeans.modules.java.lsp.server.db;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -42,11 +40,6 @@ import org.openide.util.lookup.ServiceProvider;
 @ServiceProvider(service = CodeActionsProvider.class)
 public class DBConnectionProvider extends CodeActionsProvider{
 private static final String  GET_DB_CONNECTION = "java.db.connection"; 
//NOI18N
-
-private static final Set COMMANDS = new HashSet<>(Arrays.asList(
-GET_DB_CONNECTION
-));
-
 
 @Override
 public List getCodeActions(ResultIterator resultIterator, 
CodeActionParams params) throws Exception {
@@ -74,6 +67,6 @@ public class DBConnectionProvider extends CodeActionsProvider{
 
 @Override
 public Set getCommands() {
-return COMMANDS;
+return Collections.singleton(GET_DB_CONNECTION);
 }
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TestClassGenerator.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TestClassGenerator.java
index 7a352e0787..cc1d3a0032 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TestClassGenerator.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TestCl

[netbeans] branch master updated: update npm module semver (moderate severity vulnerability)

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

thurka 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 fc06b786d1 update npm module semver (moderate severity vulnerability)
 new a6b69a5db1 Merge pull request #6319 from thurka/npm_semver
fc06b786d1 is described below

commit fc06b786d142ca69cc2337c8bee0d77fcb37109b
Author: Tomas Hurka 
AuthorDate: Tue Aug 8 15:29:29 2023 +0200

update npm module semver (moderate severity vulnerability)
---
 java/java.lsp.server/vscode/package-lock.json | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/java/java.lsp.server/vscode/package-lock.json 
b/java/java.lsp.server/vscode/package-lock.json
index 81118c27ff..790f1a0306 100644
--- a/java/java.lsp.server/vscode/package-lock.json
+++ b/java/java.lsp.server/vscode/package-lock.json
@@ -1359,8 +1359,9 @@
"license": "MIT"
},
"node_modules/semver": {
-   "version": "7.3.5",
-   "license": "ISC",
+   "version": "7.5.4",
+   "resolved": 
"https://registry.npmjs.org/semver/-/semver-7.5.4.tgz;,
+   "integrity": 
"sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
@@ -2417,7 +2418,9 @@
"dev": true
},
"semver": {
-   "version": "7.3.5",
+   "version": "7.5.4",
+   "resolved": 
"https://registry.npmjs.org/semver/-/semver-7.5.4.tgz;,
+   "integrity": 
"sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"requires": {
"lru-cache": "^6.0.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: use 'parameters' to find out if createProcedureInfo() was already invoked - 'returnValue' can be null

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

thurka 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 bb345ad72c use 'parameters' to find out if createProcedureInfo() was 
already invoked - 'returnValue' can be null
 new 7ef3c70f64 Merge pull request #6298 from thurka/GCN-3043
bb345ad72c is described below

commit bb345ad72cd34a3f94dd85fa91cd08d3b37bfb3a
Author: Tomas Hurka 
AuthorDate: Fri Aug 4 09:32:32 2023 +0200

use 'parameters' to find out if createProcedureInfo() was already invoked - 
'returnValue' can be null
---
 .../src/org/netbeans/modules/db/metadata/model/jdbc/JDBCProcedure.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ide/db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCProcedure.java
 
b/ide/db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCProcedure.java
index cb9f54b6d9..cd350a90f4 100644
--- 
a/ide/db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCProcedure.java
+++ 
b/ide/db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCProcedure.java
@@ -201,7 +201,7 @@ public class JDBCProcedure extends ProcedureImplementation {
 }
 
 private Value initReturnValue() {
-if (returnValue != null) {
+if (parameters != null) {
 return returnValue;
 }
 createProcedureInfo();


-
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: Allow to select 'Add Database Connection' or 'Add Oracle Autonomous DB' from database view toolbar

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

thurka 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 3d9b2ee0b3 Allow to select 'Add Database Connection' or 'Add Oracle 
Autonomous DB' from database view toolbar
 new 5fc6c7ab48 Merge pull request #6281 from thurka/GCN-1397
3d9b2ee0b3 is described below

commit 3d9b2ee0b3d4dfce6d8bcf3c87d3fc9f2f25aa4f
Author: Tomas Hurka 
AuthorDate: Tue Aug 1 12:33:12 2023 +0200

Allow to select 'Add Database Connection' or 'Add Oracle Autonomous DB' 
from database view toolbar
---
 java/java.lsp.server/vscode/package.json | 12 ++--
 java/java.lsp.server/vscode/src/extension.ts | 10 ++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/java/java.lsp.server/vscode/package.json 
b/java/java.lsp.server/vscode/package.json
index 16c9d24b61..80841e6d6c 100644
--- a/java/java.lsp.server/vscode/package.json
+++ b/java/java.lsp.server/vscode/package.json
@@ -491,11 +491,15 @@
"title": "Delete"
},
{
-   "command": "db.add.connection",
+   "command": "db.add.all.connection",
"title": "Add Database Connection",
"category": "Database",
"icon": "$(add)"
},
+   {
+   "command": "db.add.connection",
+   "title": "Add JDBC Database Connection"
+   },
{
"command": 
"nbls:Database:netbeans.db.explorer.action.Connect",
"title": "Connect to Database"
@@ -725,6 +729,10 @@
"command": 
"java.workspace.configureRunSettings",
"when": "false"
},
+   {
+   "command": "db.add.all.connection",
+   "when": "false"
+   },
{
"command": "nbls.addEventListener",
"when": "false"
@@ -757,7 +765,7 @@
"when": "nbJavaLSReady && view == 
foundProjects && config.netbeans.javaSupport.enabled"
},
{
-   "command": "db.add.connection",
+   "command": "db.add.all.connection",
"when": "view == database.connections",
"group": "navigation@3"
}
diff --git a/java/java.lsp.server/vscode/src/extension.ts 
b/java/java.lsp.server/vscode/src/extension.ts
index 8ce5fe55b4..0601f31ed5 100644
--- a/java/java.lsp.server/vscode/src/extension.ts
+++ b/java/java.lsp.server/vscode/src/extension.ts
@@ -538,6 +538,16 @@ export function activate(context: ExtensionContext): 
VSNetBeansAPI {
 await commands.executeCommand(selected.userData.command.command, 
...(selected.userData.command.arguments || []));
 }
 }));
+
context.subscriptions.push(commands.registerCommand('db.add.all.connection', 
async () => {
+const ADD_JDBC = 'Add Database Connection';
+const ADD_ADB = 'Add Oracle Autonomous DB';
+const selected: any = await window.showQuickPick([ADD_JDBC, ADD_ADB], 
{ placeHolder: 'Select type...' });
+if (selected == ADD_JDBC) {
+await commands.executeCommand('db.add.connection');
+} else if (selected == ADD_ADB) {
+await 
commands.executeCommand('nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddADBAction');
+}
+}));
 const mergeWithLaunchConfig = (dconfig : vscode.DebugConfiguration) => {
 const folder = vscode.workspace.workspaceFolders?.[0];
 const uri = folder?.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: redundant check for supported 'command' removed

2023-08-08 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 a2a20e24e7 redundant check for supported 'command' removed
 new d6afe996e9 Merge pull request #6285 from thurka/GH-6113
a2a20e24e7 is described below

commit a2a20e24e7c068bd9236a33bae9d9968ab9a1f65
Author: Tomas Hurka 
AuthorDate: Wed Aug 2 11:43:00 2023 +0200

redundant check for supported 'command' removed
---
 .../netbeans/modules/java/lsp/server/db/DBAddConnection.java  |  3 ---
 .../modules/java/lsp/server/db/DBCommandProvider.java |  3 ---
 .../modules/java/lsp/server/db/DBConnectionProvider.java  |  3 ---
 .../modules/java/lsp/server/explorer/NodeActionsProvider.java |  3 ---
 .../java/lsp/server/explorer/NodePropertiesProvider.java  |  3 ---
 .../org/netbeans/modules/java/lsp/server/htmlui/WebView.java  |  2 +-
 .../netbeans/modules/java/lsp/server/protocol/ServerTest.java | 11 ++-
 7 files changed, 3 insertions(+), 25 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
index 79fb38b24f..5b00a58bec 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
@@ -96,9 +96,6 @@ public class DBAddConnection extends CodeActionsProvider {
 
 @Override
 public CompletableFuture processCommand(NbCodeLanguageClient 
client, String command, List arguments) {
-if (!DB_ADD_CONNECTION.equals(command)) {
-return null;
-}
 InputService.Registry inputServiceRegistry = 
Lookup.getDefault().lookup(InputService.Registry.class);
 if (inputServiceRegistry == null) {
 return null;
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
index 9a75a82143..845b8af04e 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBCommandProvider.java
@@ -57,9 +57,6 @@ public class DBCommandProvider extends CodeActionsProvider {
 
 @Override
 public CompletableFuture processCommand(NbCodeLanguageClient 
client, String command, List arguments) {
-if (!COMMAND_GET_PREFERRED_CONNECTION.equals(command)) {
-return null;
-}
 TreeNodeRegistry r = 
Lookup.getDefault().lookup(TreeNodeRegistry.class);
 DatabaseConnection conn = 
ConnectionManager.getDefault().getPreferredConnection(true);
 if (conn == null || r == null) {
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
index 4f8d6e338e..09e2176663 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
@@ -55,9 +55,6 @@ public class DBConnectionProvider extends CodeActionsProvider{
 
 @Override
 public CompletableFuture processCommand(NbCodeLanguageClient 
client, String command, List arguments) {
-if (!GET_DB_CONNECTION.equals(command)) {
-return null;
-}
 Map result = new HashMap<> ();
 DatabaseConnection conn = 
ConnectionManager.getDefault().getPreferredConnection(true);
 
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodeActionsProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodeActionsProvider.java
index b583025c98..a786638561 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodeActionsProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodeActionsProvider.java
@@ -96,9 +96,6 @@ public class NodeActionsProvider extends CodeActionsProvider {
 
 @Override
 public CompletableFuture processCommand(NbCodeLanguageClient 
client, String command, List arguments) {
-if (!command.startsWith(NBLS_ACTION_PREFIX)) {
-return CompletableFuture.completedFuture(false);
-}
 JsonElement el = null;
 if (arguments.size() > 0) {
 JsonObject item = gson.fromJson(gson.toJson(arguments.get(0)), 
JsonObject.class);
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodePropertiesProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server

[netbeans] branch master updated: InputBoxStep does not accept null for 'value'; prompt for password InputBoxStep fixed

2023-06-28 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 92b4bda087 InputBoxStep does not accept null for 'value'; prompt for 
password InputBoxStep fixed
 new 0a84604d51 Merge pull request #6132 from thurka/GCN-2792
92b4bda087 is described below

commit 92b4bda087d0f799fa3145964994ce8cf7f134e0
Author: Tomas Hurka 
AuthorDate: Tue Jun 27 17:39:42 2023 +0200

InputBoxStep does not accept null for 'value'; prompt for password 
InputBoxStep fixed
---
 .../org/netbeans/modules/java/lsp/server/db/DBAddConnection.java  | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
index 4a2d69e2af..79fb38b24f 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
@@ -112,19 +112,21 @@ public class DBAddConnection extends CodeActionsProvider {
 String driverClass = m != null ? (String) m.get(DRIVER) : null;
 if (dbUrl != null && driverClass != null) {
 
-JDBCDriver[] driver = 
JDBCDriverManager.getDefault().getDrivers(driverClass); //NOI18N
+JDBCDriver[] driver = 
JDBCDriverManager.getDefault().getDrivers(driverClass);
 if (driver != null && driver.length > 0) {
 if (userId == null || password == null) {
 String inputId = 
inputServiceRegistry.registerInput(param -> {
 int totalSteps = 2;
 switch (param.getStep()) {
 case 1:
-return 
CompletableFuture.completedFuture(Either.forRight(new InputBoxStep(totalSteps, 
USER_ID, Bundle.MSG_EnterUsername(), userId)));
+String userIdVal = userId != null ? userId 
: "";
+return 
CompletableFuture.completedFuture(Either.forRight(new InputBoxStep(totalSteps, 
USER_ID, Bundle.MSG_EnterUsername(), userIdVal)));
 case 2:
 Map, 
String>> data = param.getData();
 Either, String> 
userData = data.get(USER_ID);
 if (userData != null) {
-return 
CompletableFuture.completedFuture(Either.forRight(new InputBoxStep(totalSteps, 
PASSWORD, null, Bundle.MSG_EnterUsername(), password, true)));
+String passwordVal = password != null 
? password : "";
+return 
CompletableFuture.completedFuture(Either.forRight(new InputBoxStep(totalSteps, 
PASSWORD, null, Bundle.MSG_EnterPassword(), passwordVal, true)));
 }
 return 
CompletableFuture.completedFuture(null);
 default:


-
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: display a flat list of all compartments using fully qualified names in the Select Compartment quick pick

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

thurka 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 fa6bbe8ce9 display a flat list of all compartments using fully 
qualified names in the Select Compartment quick pick
 new 4b15b95479 Merge pull request #6103 from thurka/GCN-1395
fa6bbe8ce9 is described below

commit fa6bbe8ce9d70c9705271808f5f43c9c0eee32be
Author: Tomas Hurka 
AuthorDate: Tue Jun 20 16:37:28 2023 +0200

display a flat list of all compartments using fully qualified names in the 
Select Compartment quick pick
---
 .../modules/cloud/oracle/actions/AddADBAction.java | 102 +++--
 1 file changed, 93 insertions(+), 9 deletions(-)

diff --git 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
index 9321b41388..c7d28350e8 100644
--- 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
+++ 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
@@ -18,7 +18,12 @@
  */
 package org.netbeans.modules.cloud.oracle.actions;
 
+import com.oracle.bmc.identity.Identity;
+import com.oracle.bmc.identity.IdentityClient;
+import com.oracle.bmc.identity.model.Compartment;
 import com.oracle.bmc.identity.model.Tenancy;
+import com.oracle.bmc.identity.requests.ListCompartmentsRequest;
+import com.oracle.bmc.identity.responses.ListCompartmentsResponse;
 import com.oracle.bmc.model.BmcException;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -28,17 +33,19 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.modules.cloud.oracle.OCIManager;
 import org.netbeans.modules.cloud.oracle.OCIProfile;
+import org.netbeans.modules.cloud.oracle.OCISessionInitiator;
 import 
org.netbeans.modules.cloud.oracle.actions.DownloadWalletDialog.WalletInfo;
 import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem;
-import org.netbeans.modules.cloud.oracle.compartment.CompartmentNode;
 import org.netbeans.modules.cloud.oracle.database.DatabaseItem;
 import org.netbeans.modules.cloud.oracle.database.DatabaseNode;
+import org.netbeans.modules.cloud.oracle.items.OCID;
 import org.netbeans.modules.cloud.oracle.items.OCIItem;
 import org.netbeans.modules.cloud.oracle.items.TenancyItem;
 import org.openide.DialogDescriptor;
@@ -119,9 +126,16 @@ public class AddADBAction implements ActionListener {
 }
 String title;
 if (profiles.size() == 1) {
-values.put(1, 
getCompartmentsAndDbs(profiles.keySet().iterator().next().getTenancy().get()));
-title = Bundle.SelectCompartment();
-return createQuickPick(values.get(1), title);
+h = 
ProgressHandle.createHandle(Bundle.MSG_CollectingItems());
+h.start();
+h.progress(Bundle.MSG_CollectingItems_Text());
+try {
+values.put(1, 
getFlatCompartment(profiles.keySet().iterator().next().getTenancy().get()));
+title = Bundle.SelectCompartment();
+return createQuickPick(values.get(1), title);
+} finally {
+h.finish();
+}
 } else {
 title = Bundle.SelectProfile();
 List items = new ArrayList<>(profiles.size());
@@ -153,7 +167,11 @@ public class AddADBAction implements ActionListener {
 h.start();
 h.progress(Bundle.MSG_CollectingItems_Text());
 try {
-values.put(number, 
getCompartmentsAndDbs(prevItem));
+if (prevItem instanceof TenancyItem) {
+values.put(number, 
getFlatCompartment((TenancyItem) prevItem));
+} else {
+values.put(number, getDbs(prevItem));
+}
 
input.setEstimatedNumberOfInputs(input.getEstimatedNumberOfInputs() + 1);
 return createQuickPick(values.get(number), 
Bundle.SelectDatabase());
 } finally {
@@ -194,13 +212,80 @@ public class AddADBAction implements ActionListener {
 
 private  NotifyDescriptor.QuickPick 
createQuickPick(Map ociItems, 

[netbeans] branch master updated: shell env. variable cannot contain '.'

2023-06-22 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 776081037c shell env. variable cannot contain '.'
 new bbef9ab52e Merge pull request #6102 from thurka/GCN-2763
776081037c is described below

commit 776081037c6532976bed5cd2c898b9d5c8082168
Author: Tomas Hurka 
AuthorDate: Tue Jun 20 15:02:32 2023 +0200

shell env. variable cannot contain '.'
---
 java/java.lsp.server/vscode/src/nbcode.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/java.lsp.server/vscode/src/nbcode.ts 
b/java/java.lsp.server/vscode/src/nbcode.ts
index 6df035717f..744f9c85c7 100644
--- a/java/java.lsp.server/vscode/src/nbcode.ts
+++ b/java/java.lsp.server/vscode/src/nbcode.ts
@@ -75,7 +75,7 @@ export function launch(
 }
 ideArgs.push(...extraArgs);
 
-if (env['netbeans.debug'] && extraArgs && extraArgs.find(s => 
s.includes("--list"))) {
+if (env['netbeans_debug'] && extraArgs && extraArgs.find(s => 
s.includes("--list"))) {
 ideArgs.push(...['-J-Xdebug', '-J-Dnetbeans.logger.console=true', 
'-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000']);
 }
 


-
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: Attempting to avoid a crash when running a project/file when there's no DB connection.

2023-06-20 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 43bd91a438 Attempting to avoid a crash when running a project/file 
when there's no DB connection.
 new d824c6e84d Merge pull request #6085 from lahodaj/fix-run-actions
43bd91a438 is described below

commit 43bd91a4386e6ddb3aac5c0cc6f9d0f22f167bb7
Author: Jan Lahoda 
AuthorDate: Fri Jun 16 19:51:10 2023 +0200

Attempting to avoid a crash when running a project/file when there's no DB 
connection.
---
 .../java/lsp/server/db/DBConnectionProvider.java   | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
index 254404f0be..4f8d6e338e 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBConnectionProvider.java
@@ -60,14 +60,16 @@ public class DBConnectionProvider extends 
CodeActionsProvider{
 }
 Map result = new HashMap<> ();
 DatabaseConnection conn = 
ConnectionManager.getDefault().getPreferredConnection(true);
-
-result.put("DATASOURCES_DEFAULT_URL", conn.getDatabaseURL()); //NOI18N
-result.put("DATASOURCES_DEFAULT_USERNAME", conn.getUser()); //NOI18N
-result.put("DATASOURCES_DEFAULT_PASSWORD", conn.getPassword()); 
//NOI18N
-result.put("DATASOURCES_DEFAULT_DRIVER_CLASS_NAME", 
conn.getDriverClass()); //NOI18N
-String ocid = (String) conn.getConnectionProperties().get("OCID"); 
//NOI18N
-if (ocid != null && !ocid.isEmpty()) {
-result.put("DATASOURCES_DEFAULT_OCID", ocid); //NOI18N
+
+if (conn != null) {
+result.put("DATASOURCES_DEFAULT_URL", conn.getDatabaseURL()); 
//NOI18N
+result.put("DATASOURCES_DEFAULT_USERNAME", conn.getUser()); 
//NOI18N
+result.put("DATASOURCES_DEFAULT_PASSWORD", conn.getPassword()); 
//NOI18N
+result.put("DATASOURCES_DEFAULT_DRIVER_CLASS_NAME", 
conn.getDriverClass()); //NOI18N
+String ocid = (String) conn.getConnectionProperties().get("OCID"); 
//NOI18N
+if (ocid != null && !ocid.isEmpty()) {
+result.put("DATASOURCES_DEFAULT_OCID", ocid); //NOI18N
+}
 }
 
 return CompletableFuture.completedFuture(result);


-
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: validate() - do not remove connection if 'schemas' is empty

2023-06-15 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 5af5f30e97 validate() - do not remove connection if 'schemas' is empty
5af5f30e97 is described below

commit 5af5f30e97c08222539b0c9ce79afc19e1a52b68
Author: Tomas Hurka 
AuthorDate: Thu Jun 15 14:11:43 2023 +0200

validate() - do not remove connection if 'schemas' is empty
---
 .../org/netbeans/modules/java/lsp/server/db/DBAddConnection.java   | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
index c24ddae16a..4a2d69e2af 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/db/DBAddConnection.java
@@ -238,16 +238,21 @@ public class DBAddConnection extends CodeActionsProvider {
 Either,String> userData = 
data.get(USER_ID);
 int i = ((Double) 
driverData.getLeft().get(0).getUserData()).intValue();
 JDBCDriver driver = drivers[i];
+boolean failed = true;
+
 schemas.clear();
 DatabaseConnection dbconn = 
DatabaseConnection.create(driver, urlData.getRight(), userData.getRight(), 
null, passwordData.getRight(), true);
 try {
 
ConnectionManager.getDefault().addConnection(dbconn);
 schemas.addAll(getSchemas(dbconn));
+failed = false;
 } catch(DatabaseException | SQLException ex) {
 return 
CompletableFuture.completedFuture(ex.getMessage());
 } finally {
 try {
-
ConnectionManager.getDefault().removeConnection(dbconn);
+if (failed || !schemas.isEmpty()) {
+
ConnectionManager.getDefault().removeConnection(dbconn);
+}
 } catch (DatabaseException ex) {}
 }
 }


-
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: headless mode - allow to re-enter username and password if connecting to database fails

2023-06-13 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 b650da6f3a headless mode - allow to re-enter username and password if 
connecting to database fails
 new 850af2af6c Merge pull request #6057 from thurka/GCN-2644
b650da6f3a is described below

commit b650da6f3a3523623270acfba5f482b7f3d7c627
Author: Tomas Hurka 
AuthorDate: Fri Jun 9 07:25:20 2023 +0200

headless mode - allow to re-enter username and password if connecting to 
database fails
---
 .../modules/db/explorer/action/ConnectAction.java  | 260 +++--
 1 file changed, 191 insertions(+), 69 deletions(-)

diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java 
b/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
index 7418c3756e..bbe0f41327 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
+++ b/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
@@ -35,7 +35,6 @@ import java.sql.SQLException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.CountDownLatch;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.AbstractAction;
@@ -68,6 +67,7 @@ import org.openide.util.HelpCtx;
 import org.openide.util.Lookup;
 import org.openide.util.Mutex;
 import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
 import org.openide.util.WeakListeners;
 
 @ActionRegistration(
@@ -163,7 +163,6 @@ public class ConnectAction extends AbstractAction 
implements ContextAwareAction,
 @NbBundle.Messages({
 "# {0} - connection name",
 "Progress_ConnectingDB=Connecting to {0}",
-"CannotConnectHeadless=Required connection properties missing or 
incorrect, cannot connect."
 })
 public void showDialog(final DatabaseConnection dbcon, boolean 
showDialog) {
 String user = dbcon.getUser();
@@ -182,12 +181,13 @@ public class ConnectAction extends AbstractAction 
implements ContextAwareAction,
 if (((!supportsConnectWithoutUsername(dbcon))
 && (user == null || !remember)) || showDialog) {
 
+final Credentials input;
 if (headless) {
-DialogDisplayer.getDefault().notifyLater(
-new 
NotifyDescriptor.Message(Bundle.CannotConnectHeadless(), 
NotifyDescriptor.ERROR_MESSAGE));
-return;
+input = new CredetialsLine(dbcon);
+} else {
+ConnectPanel basePanel = new ConnectPanel(this, dbcon);
+input = new CredetialsUI(basePanel);
 }
-final ConnectPanel basePanel = new ConnectPanel(this, dbcon);
 
 final PropertyChangeListener connectionListener = new 
PropertyChangeListener() {
 @Override
@@ -207,13 +207,15 @@ public class ConnectAction extends AbstractAction 
implements ContextAwareAction,
 
realDbcon.setRememberPassword(dbcon.rememberPassword());
 }
 
-
dbcon.setRememberPassword(basePanel.rememberPassword());
+
dbcon.setRememberPassword(input.rememberPassword());
 
-SwingUtilities.invokeLater(() -> {
-if (dlg != null) {
-dlg.close();
-}
-});
+if (!headless) {
+SwingUtilities.invokeLater(() -> {
+if (dlg != null) {
+dlg.close();
+}
+});
+}
 }
 }
 }
@@ -221,43 +223,29 @@ public class ConnectAction extends AbstractAction 
implements ContextAwareAction,
 
 dbcon.addPropertyChangeListener(connectionListener);
 
-ActionListener actionListener = new ActionListener() {
-@Override
-public void actionPerformed(ActionEvent event) {
-if (event.getSource() == DialogDescriptor.OK_OPTION) {
-dbcon.setUser(basePanel.getUser());
-dbcon.setPassword(basePanel.getPassword());
-dbcon.setUser(basePanel.getUser());
-dbcon.setPassword(basePanel.getPassword());
-  

[netbeans] branch master updated: upgrade vsce to @vscode/vsce version 2.19

2023-06-02 Thread thurka
This is an automated email from the ASF dual-hosted git repository.

thurka 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 6a7053ecf5 upgrade vsce to @vscode/vsce version 2.19
 new 4447e51670 Merge pull request #6009 from thurka/GCN-2645
6a7053ecf5 is described below

commit 6a7053ecf518e2e388ac7e6fc4d67e56ee851672
Author: Tomas Hurka 
AuthorDate: Thu Jun 1 16:54:08 2023 +0200

upgrade vsce to @vscode/vsce version 2.19
---
 java/java.lsp.server/build.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/java.lsp.server/build.xml b/java/java.lsp.server/build.xml
index a2908d77ee..51051fb631 100644
--- a/java/java.lsp.server/build.xml
+++ b/java/java.lsp.server/build.xml
@@ -108,9 +108,9 @@
 
 
 
-
+
 
-
+
 
 
 https://github.com/apache/netbeans/raw/${metabuild.hash}/java/java.lsp.server/vscode;
 />


-
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