]> WPIA git - gigi.git/commitdiff
Merge changes Ie9951caa,I9a57ce72
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Wed, 22 Mar 2017 21:38:50 +0000 (22:38 +0100)
committerGerrit Code Review <gigi-system@dogcraft.de>
Wed, 22 Mar 2017 21:38:50 +0000 (22:38 +0100)
* changes:
  fix: Typo pointed out while reviewing change 492
  chg: Make synchronization on the Database layer explicit

src/club/wpia/gigi/util/PasswordHash.java
tests/club/wpia/gigi/testUtils/ConfiguredTest.java

index 7d2cb3342e92b0d4f6921c54b2191ce783c6083e..40700d32765f941062c0627d92e8597e40956a36 100644 (file)
@@ -15,7 +15,7 @@ public class PasswordHash {
      *            The hash to verify the password against.
      * @return
      *         <ul>
-     *         <li><code>null</code>, if the password was valid</li>
+     *         <li><code>null</code>, if the password was invalid</li>
      *         <li><code>hash</code>, if the password is valid and the hash
      *         doesn't need to be updated</li>
      *         <li>a new hash, if the password is valid but the hash in the
index cdacf6922f0f4af08d51e5484f210211fa96b654..711007a047eafe94703507f2ddac532650e8a8eb 100644 (file)
@@ -93,7 +93,9 @@ public abstract class ConfiguredTest {
         if ( !DatabaseConnection.isInited()) {
             DatabaseConnection.init(testProps);
             try {
-                l = DatabaseConnection.newLink(false);
+                synchronized (ConfiguredTest.class) {
+                    l = DatabaseConnection.newLink(false);
+                }
             } catch (InterruptedException e) {
                 throw new Error(e);
             }
@@ -104,9 +106,11 @@ public abstract class ConfiguredTest {
 
     @AfterClass
     public static void closeDBLink() {
-        if (l != null) {
-            l.close();
-            l = null;
+        synchronized (ConfiguredTest.class) {
+            if (l != null) {
+                l.close();
+                l = null;
+            }
         }
     }