Browse Source

code cleanup

Jan-Peter Klein 1 year ago
parent
commit
c85823fe04

+ 4 - 5
src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java

@@ -60,12 +60,11 @@ public class VolumePreferencesController implements FxController {
 		this.mountToDriveLetterSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER));
 		this.mountFlagsSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_FLAGS));
 		this.readonlySupported = selectedMountService.map(s -> s.hasCapability(MountCapability.READ_ONLY));
-		this.fuseRestartRequired = selectedMountService.map(s -> {//
-			return firstUsedProblematicFuseMountService.get() != null //
+		this.fuseRestartRequired = selectedMountService.map(s -> //
+				firstUsedProblematicFuseMountService.get() != null //
 					&& VaultModule.isProblematicFuseService(s) //
-					&& !firstUsedProblematicFuseMountService.get().equals(s);
-		});
-
+					&& !firstUsedProblematicFuseMountService.get().equals(s)
+		);
 	}
 
 	public void initialize() {

+ 7 - 2
src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java

@@ -84,7 +84,8 @@ public class MountOptionsController implements FxController {
 						   @VaultOptionsWindow Vault vault, //
 						   WindowsDriveLetters windowsDriveLetters, //
 						   ResourceBundle resourceBundle, //
-						   Lazy<Application> application, List<MountService> mountProviders, //
+						   Lazy<Application> application, //
+						   List<MountService> mountProviders, //
 						   @Named("FUPFMS") AtomicReference<MountService> firstUsedProblematicFuseMountService) {
 		this.window = window;
 		this.vaultSettings = vault.getVaultSettings();
@@ -95,7 +96,11 @@ public class MountOptionsController implements FxController {
 		this.mountProviders = mountProviders;
 		var fallbackProvider = mountProviders.stream().findFirst().orElse(null);
 		this.selectedMountService = ObservableUtil.mapWithDefault(vaultSettings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider);
-		this.fuseRestartRequired = selectedMountService.map(s -> firstUsedProblematicFuseMountService.get() != null && VaultModule.isProblematicFuseService(s) && !firstUsedProblematicFuseMountService.get().equals(s));
+		this.fuseRestartRequired = selectedMountService.map(s -> //
+				firstUsedProblematicFuseMountService.get() != null //
+						&& VaultModule.isProblematicFuseService(s) //
+						&& !firstUsedProblematicFuseMountService.get().equals(s)
+		);
 		this.loopbackPortSupported = BooleanExpression.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT)));
 
 		this.defaultMountFlags = selectedMountService.map(s -> {