jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1352993 - /jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java
Date Fri, 22 Jun 2012 18:46:59 GMT
Author: sebb
Date: Fri Jun 22 18:46:59 2012
New Revision: 1352993

URL: http://svn.apache.org/viewvc?rev=1352993&view=rev
Log:
Tidy up code - defaultpw has already been set from the system property, no point doing it
again.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java?rev=1352993&r1=1352992&r2=1352993&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/SSLManager.java Fri Jun 22 18:46:59 2012
@@ -152,26 +152,20 @@ public abstract class SSLManager {
     private String getPassword() {
         String password = this.defaultpw;
         if (null == password) {
-            this.defaultpw = System.getProperty(KEY_STORE_PASSWORD);
-
-            if (null == defaultpw) {
-                final GuiPackage guiInstance = GuiPackage.getInstance();
-                if (guiInstance != null) {
-                    synchronized (this) {
-                        this.defaultpw = JOptionPane.showInputDialog(
-                                guiInstance.getMainFrame(),
-                                JMeterUtils.getResString("ssl_pass_prompt"),  // $NON-NLS-1$
-                                JMeterUtils.getResString("ssl_pass_title"),  // $NON-NLS-1$
-                                JOptionPane.QUESTION_MESSAGE);
-                        System.setProperty(KEY_STORE_PASSWORD, this.defaultpw);
-                    }
+            final GuiPackage guiInstance = GuiPackage.getInstance();
+            if (guiInstance != null) {
+                synchronized (this) { // TODO is sync really needed?
+                    this.defaultpw = JOptionPane.showInputDialog(
+                            guiInstance.getMainFrame(),
+                            JMeterUtils.getResString("ssl_pass_prompt"),  // $NON-NLS-1$
+                            JMeterUtils.getResString("ssl_pass_title"),  // $NON-NLS-1$
+                            JOptionPane.QUESTION_MESSAGE);
+                    System.setProperty(KEY_STORE_PASSWORD, this.defaultpw);
                     password = this.defaultpw;
-                    System.setProperty(KEY_STORE_PASSWORD, password);
-                } else {
-                    log.warn("No password provided, and no GUI present so cannot prompt");
                 }
+            } else {
+                log.warn("No password provided, and no GUI present so cannot prompt");
             }
-
         }
         return password;
     }



Mime
View raw message