mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-20 06:54:16 +00:00
replaced some "old" switch statements by switch expressions
This commit is contained in:
@@ -41,16 +41,13 @@ public class VaultStats {
|
||||
}
|
||||
|
||||
private void vaultStateChanged(@SuppressWarnings("unused") Observable observable) {
|
||||
switch (state.get()) {
|
||||
case UNLOCKED:
|
||||
assert fs.get() != null;
|
||||
LOG.debug("start recording stats");
|
||||
updateService.restart();
|
||||
break;
|
||||
default:
|
||||
LOG.debug("stop recording stats");
|
||||
updateService.cancel();
|
||||
break;
|
||||
if (VaultState.UNLOCKED.equals(state.get())) {
|
||||
assert fs.get() != null;
|
||||
LOG.debug("start recording stats");
|
||||
updateService.restart();
|
||||
} else {
|
||||
LOG.debug("stop recording stats");
|
||||
updateService.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,17 +43,10 @@ public interface Volume {
|
||||
}
|
||||
|
||||
static VolumeImpl[] getCurrentSupportedAdapters() {
|
||||
return Stream.of(VolumeImpl.values()).filter(impl -> {
|
||||
switch (impl) {
|
||||
case WEBDAV:
|
||||
return WebDavVolume.isSupportedStatic();
|
||||
case DOKANY:
|
||||
return DokanyVolume.isSupportedStatic();
|
||||
case FUSE:
|
||||
return FuseVolume.isSupportedStatic();
|
||||
default:
|
||||
return false;//throw new IllegalStateException("Adapter not implemented.");
|
||||
}
|
||||
return Stream.of(VolumeImpl.values()).filter(impl -> switch (impl) {
|
||||
case WEBDAV -> WebDavVolume.isSupportedStatic();
|
||||
case DOKANY -> DokanyVolume.isSupportedStatic();
|
||||
case FUSE -> FuseVolume.isSupportedStatic();
|
||||
}).toArray(VolumeImpl[]::new);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user