Skip to content

Commit

Permalink
auth.Method drop down is added to the Toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Mar 22, 2024
1 parent 6c43e56 commit 398767a
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 12 deletions.
1 change: 1 addition & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Adding auth.method control to the toolbar
* Any IO errors are added as Error tab (pop-up error message is used for internal bugs)
* KX errors from servers are now display with ' (not as symbol)
* Parent folder can be specified in the server form (in add and edit server)
Expand Down
19 changes: 13 additions & 6 deletions src/studio/core/AuthenticationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

Expand All @@ -22,14 +19,14 @@ public class AuthenticationManager {

private static AuthenticationManager instance;
private Map classMap = new HashMap();
private String[] authMechanisms;

public Class lookup(String authenticationMethod) {
return (Class) classMap.get(authenticationMethod);
}

public String[] getAuthenticationMechanisms() {
Set s = classMap.keySet();
return (String[]) s.toArray(new String[0]);
return authMechanisms;
}

public synchronized static AuthenticationManager getInstance() {
Expand All @@ -38,6 +35,14 @@ public synchronized static AuthenticationManager getInstance() {
return instance;
}

private void init() {
List<String> auths = new ArrayList<>(classMap.keySet());
auths.remove(DefaultAuthenticationMechanism.NAME);
Collections.sort(auths);
auths.add(0, DefaultAuthenticationMechanism.NAME);
authMechanisms = auths.toArray(new String[0]);
}

private AuthenticationManager() {
DefaultAuthenticationMechanism dam = new DefaultAuthenticationMechanism();
classMap.put(dam.getMechanismName(),dam.getClass());
Expand Down Expand Up @@ -88,5 +93,7 @@ private AuthenticationManager() {
log.error("Error loading plugin {}", filename, e);
}
}

init();
}
}
2 changes: 1 addition & 1 deletion src/studio/core/DefaultAuthenticationMechanism.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class DefaultAuthenticationMechanism implements IAuthenticationMechanism
private static final String[] PROP_NAMES = new String[]{USERNAME,PASSWORD};
private Properties props;

public final static String NAME = "Username and password";
public final static String NAME = "Plain";

public String getMechanismName() {
return NAME;
Expand Down
44 changes: 41 additions & 3 deletions src/studio/kdb/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.nio.file.Paths;
import java.util.List;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -98,11 +99,13 @@ public class Config extends AbstractConfig {
private static final String CONFIG_FILENAME = "studio.properties";
private static final String WORKSPACE_FILENAME = "workspace.properties";

private static final String OLD_DEF_AUTHMETHOD = "Username and password";
private static final String VERSION14 = "1.4";
private static final String VERSION13 = "1.3";
private static final String VERSION12 = "1.2";
private static final String OLD_VERSION = "1.1";

private static final String VERSION = VERSION13;
private static final String VERSION = VERSION14;


private PropertiesConfig workspaceConfig;
Expand Down Expand Up @@ -310,6 +313,32 @@ private void init() {
initTableConnExtractor();
}

private void upgradeTo14() {
log.info("Upgrading config to version 1.4");
String defAuth = DefaultAuthenticationMechanism.NAME;
if (getDefaultAuthMechanism().equals(OLD_DEF_AUTHMETHOD) ) {
setDefaultAuthMechanism(defAuth);
}

setDefaultCredentials(defAuth, getDefaultCredentials(OLD_DEF_AUTHMETHOD));
config.remove("auth." + OLD_DEF_AUTHMETHOD + ".user");
config.remove("auth." + OLD_DEF_AUTHMETHOD + ".password");

//server.1.authenticationMechanism
Pattern pattern = Pattern.compile("server\\.[0-9]+\\.authenticationMechanism");
for (String key: config.keySet().toArray(new String[0]) ) {
if (pattern.matcher(key).matches() ) {
String value = config.getProperty(key);
if (value.equals(OLD_DEF_AUTHMETHOD)) {
config.setProperty(key, defAuth);
}
}
}

config.setProperty("version", VERSION);
save();
}

private void upgradeTo12() {
try {
log.info("Found old config. Converting...");
Expand Down Expand Up @@ -387,6 +416,11 @@ private void checkForUpgrade() {
config.setProperty("version", VERSION12);
}


if (config.getProperty("version", VERSION).equals(VERSION13)) {
upgradeTo14();
}

initServers();
if (config.getProperty("version").equals(VERSION12)) {
initServerHistory();
Expand Down Expand Up @@ -469,8 +503,11 @@ public void setLookAndFeel(String lf) {
// host:port
// If user and password are not found, defaults form default AuthenticationMechanism are used
public Server getServerByConnectionString(String connectionString) {
String defaultAuth = getDefaultAuthMechanism();
return QConnection.getByConnection(connectionString, defaultAuth, getDefaultCredentials(defaultAuth), servers.values());
return getServerByConnectionString(connectionString, getDefaultAuthMechanism());
}

public Server getServerByConnectionString(String connectionString, String authMethod) {
return QConnection.getByConnection(connectionString, authMethod, getDefaultCredentials(authMethod), servers.values());
}

public Credentials getDefaultCredentials(String authenticationMechanism) {
Expand Down Expand Up @@ -655,6 +692,7 @@ public void replaceServer(Server oldServer, Server newServer) {
log.error("Failed to add server", e);
addServer(oldServer);
}
saveAllServers();
}

private void purgeAll() {
Expand Down
3 changes: 2 additions & 1 deletion src/studio/kdb/Server.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package studio.kdb;

import studio.core.Credentials;
import studio.core.DefaultAuthenticationMechanism;

import java.awt.*;
import java.util.Collections;
Expand All @@ -10,7 +11,7 @@
import java.util.stream.Collectors;

public class Server {
private String authenticationMechanism;
private String authenticationMechanism = DefaultAuthenticationMechanism.NAME;
private Color backgroundColor = Color.white;
private String name = "";
private String host = "";
Expand Down
18 changes: 18 additions & 0 deletions src/studio/ui/StudioWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.apache.logging.log4j.Logger;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit;
import studio.core.AuthenticationManager;
import studio.core.Studio;
import studio.kdb.*;
import studio.kdb.config.ActionOnExit;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class StudioWindow extends JFrame implements WindowListener {
private boolean loading = true;

private JComboBox<String> comboServer;
private JComboBox<String> comboAuthMethod;
private JTextField txtServer;
private String lastQuery = null;
private JToolBar toolbar;
Expand Down Expand Up @@ -1074,6 +1076,17 @@ private void showServerList(boolean selectHistory) {
}


private void selectAuthMethod() {
Object selectedItem = comboAuthMethod.getSelectedItem();
String newAuthMethod = selectedItem == null ? "" : selectedItem.toString();
if (editor.getServer().getAuthenticationMechanism().equals(newAuthMethod)) return;

Server server = CONFIG.getServerByConnectionString(txtServer.getText().trim(), newAuthMethod);
setServer(server);
refreshServer();

}

private void selectServerName() {
String selection = comboServer.getSelectedItem().toString();
if(! CONFIG.getServerNames().contains(selection)) return;
Expand Down Expand Up @@ -1125,6 +1138,7 @@ private void refreshServer() {
Server server = editor.getServer();
String name = server == Server.NO_SERVER ? "" : server.getFullName();
comboServer.setSelectedItem(name);
comboAuthMethod.getModel().setSelectedItem(server.getAuthenticationMechanism());

refreshConnectionText();
refreshActionState();
Expand All @@ -1140,6 +1154,9 @@ private void initToolbar() {
// Cut the width if it is too wide.
comboServer.setMinimumSize(new Dimension(0, 0));

comboAuthMethod = new JComboBox<>(AuthenticationManager.getInstance().getAuthenticationMechanisms());

Check failure on line 1157 in src/studio/ui/StudioWindow.java

View workflow job for this annotation

GitHub Actions / JUnit Tests

studio.ui.EditorTest ► testCancelOnFrameClosure

Failed test found in: build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.RSTAEditorTest.xml build/test-results/integrationTest/TEST-studio.ui.RSTAEditorTest.xml build/test-results/integrationTest/TEST-studio.ui.RSTAEditorTest.xml build/test-results/integrationTest/TEST-studio.ui.ServerTest.xml build/test-results/integrationTest/TEST-studio.ui.ServerTest.xml build/test-results/integrationTest/TEST-studio.ui.StopQueryTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml build/test-results/integrationTest/TEST-studio.ui.TabsTest.xml Error: java.lang.NullPointerException
Raw output
java.lang.NullPointerException
	at javax.swing.DefaultComboBoxModel.<init>(DefaultComboBoxModel.java:58)
	at javax.swing.JComboBox.<init>(JComboBox.java:196)
	at studio.ui.StudioWindow.initToolbar(StudioWindow.java:1157)
	at studio.ui.StudioWindow.<init>(StudioWindow.java:1337)
	at studio.ui.StudioWindow.<init>(StudioWindow.java:1312)
	at studio.ui.StudioTest.lambda$onSetUp$0(StudioTest.java:96)
	at org.assertj.swing.edt.GuiActionRunner$1.executeInEDT(GuiActionRunner.java:75)
	at org.assertj.swing.edt.GuiQuery.run(GuiQuery.java:42)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
	at org.assertj.swing.edt.GuiActionRunner.execute(GuiActionRunner.java:98)
	at org.assertj.swing.edt.GuiActionRunner.execute(GuiActionRunner.java:72)
	at studio.ui.StudioTest.onSetUp(StudioTest.java:96)
	at org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase.setUp(AssertJSwingJUnitTestCase.java:49)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

Check failure on line 1157 in src/studio/ui/StudioWindow.java

View workflow job for this annotation

GitHub Actions / JUnit Tests

studio.ui.EditorTest ► testMac9LE

Failed test found in: build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.EditorTest.xml build/test-results/integrationTest/TEST-studio.ui.GenericTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml build/test-results/integrationTest/TEST-studio.ui.SaveFileTest.xml build/test-results/integrationTest/TEST-studio.ui.SearchTest.xml build/test-results/integrationTest/TEST-studio.ui.SearchTest.xml build/test-results/integrationTest/TEST-studio.ui.SearchTest.xml build/test-results/integrationTest/TEST-studio.ui.SearchTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml build/test-results/integrationTest/TEST-studio.ui.SplitTest.xml Error: java.lang.NullPointerException
Raw output
java.lang.NullPointerException
	at javax.swing.DefaultComboBoxModel.<init>(DefaultComboBoxModel.java:58)
	at javax.swing.JComboBox.<init>(JComboBox.java:196)
	at studio.ui.StudioWindow.initToolbar(StudioWindow.java:1157)
	at studio.ui.StudioWindow.<init>(StudioWindow.java:1337)
	at studio.ui.StudioWindow.<init>(StudioWindow.java:1312)
	at studio.ui.StudioTest.lambda$onSetUp$0(StudioTest.java:96)
	at org.assertj.swing.edt.GuiActionRunner$1.executeInEDT(GuiActionRunner.java:75)
	at org.assertj.swing.edt.GuiQuery.run(GuiQuery.java:42)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
	at org.assertj.swing.edt.GuiActionRunner.execute(GuiActionRunner.java:98)
	at org.assertj.swing.edt.GuiActionRunner.execute(GuiActionRunner.java:72)
	at studio.ui.StudioTest.onSetUp(StudioTest.java:96)
	at org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase.setUp(AssertJSwingJUnitTestCase.java:49)
	at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
comboAuthMethod.addActionListener(e->selectAuthMethod());

txtServer = new JTextField(32);
txtServer.setName("serverEntryTextField");
txtServer.addActionListener(e -> {
Expand All @@ -1159,6 +1176,7 @@ public void focusLost(FocusEvent e) {
toolbar.add(Box.createRigidArea(new Dimension(3,0)));
toolbar.add(new JLabel(I18n.getString("Server")));
toolbar.add(comboServer);
toolbar.add(comboAuthMethod);
toolbar.add(txtServer);

Action[] actions = new Action[] {
Expand Down
3 changes: 2 additions & 1 deletion src/studio/utils/QConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public static Server getByConnection(String connection ,String defaultAuth,
Color bgColor = Config.getInstance().getColor(Config.COLOR_BACKGROUND);

for (Server s: servers) {
if (s.getHost().equals(host) && s.getPort() == port && s.getUsername().equals(user) && s.getPassword().equals(password)) {
if (s.getHost().equals(host) && s.getPort() == port && s.getUsername().equals(user) && s.getPassword().equals(password)
&& s.getAuthenticationMechanism().equals(auth) ) {
return s;
}
}
Expand Down

0 comments on commit 398767a

Please sign in to comment.