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 <[email protected]>
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, Either<List<QuickPickItem>,
String>> data = param.getData();
Either<List<QuickPickItem>, 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: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists