Armin Schrenk 1 неделя назад
Родитель
Сommit
42ec41b991

+ 2 - 0
src/main/java/org/cryptomator/JavaFXUtil.java

@@ -6,6 +6,8 @@ import java.util.concurrent.TimeUnit;
 
 public class JavaFXUtil {
 
+	private JavaFXUtil() {}
+
 	public static boolean startPlatform() throws InterruptedException {
 		CountDownLatch latch = new CountDownLatch(1);
 		try {

+ 1 - 1
src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingStrategy.java

@@ -113,7 +113,7 @@ public class MasterkeyFileLoadingStrategy implements KeyLoadingStrategy {
 
 	private void savePasswordToSystemkeychain(Passphrase passphrase) {
 		try {
-			if (keychain.isSupported() && !keychain.getPassphraseStoredProperty(vault.getId()).getValue()) {
+			if (keychain.isSupported() && !keychain.getPassphraseStoredProperty(vault.getId()).get()) {
 				keychain.storePassphrase(vault.getId(), vault.getDisplayName(), passphrase);
 			}
 		} catch (KeychainAccessException e) {

+ 1 - 1
src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java

@@ -176,7 +176,7 @@ public class MainWindowController implements FxController {
 		return updateAvailable.get();
 	}
 
-	public BooleanBinding licenseValidProperty(){
+	public BooleanBinding licenseValidProperty() {
 		return licenseHolder.validLicenseProperty();
 	}
 

+ 3 - 1
src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java

@@ -105,7 +105,9 @@ public class GeneralPreferencesController implements FxController {
 		if (SystemUtils.IS_OS_MAC) {
 			var idsAndNames = settings.directories.stream().collect(Collectors.toMap(vs -> vs.id, vs -> vs.displayName.getValue()));
 			if (!idsAndNames.isEmpty()) {
-				LOG.debug("Migrating keychain entries {} from {} to {}", idsAndNames.keySet(), oldProvider.displayName(), newProvider.displayName());
+				if (LOG.isDebugEnabled()) {
+					LOG.debug("Migrating keychain entries {} from {} to {}", idsAndNames.keySet(), oldProvider.displayName(), newProvider.displayName());
+				}
 				keychainMigrations = keychainMigrations.thenRunAsync(() -> {
 					try {
 						KeychainManager.migrate(oldProvider, newProvider, idsAndNames);

+ 2 - 3
src/test/java/org/cryptomator/common/keychain/KeychainManagerTest.java

@@ -14,11 +14,10 @@ import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.beans.property.SimpleObjectProperty;
 import java.time.Duration;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 
-public class KeychainManagerTest {
+class KeychainManagerTest {
 
 	@BeforeAll
 	public static void startup() throws InterruptedException {
@@ -34,7 +33,7 @@ public class KeychainManagerTest {
 	}
 
 	@Nested
-	public class WhenObservingProperties {
+	class WhenObservingProperties {
 
 		@Test
 		public void testPropertyChangesWhenStoringPassword() throws KeychainAccessException, InterruptedException {

+ 0 - 5
src/test/java/org/cryptomator/ui/controls/SecurePasswordFieldTest.java

@@ -1,7 +1,6 @@
 package org.cryptomator.ui.controls;
 
 import org.cryptomator.JavaFXUtil;
-import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.BeforeAll;
@@ -9,10 +8,6 @@ import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
-import javafx.application.Platform;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 public class SecurePasswordFieldTest {
 
 	private SecurePasswordField pwField = new SecurePasswordField();