diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 4e81a4295..f966f6b22 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -10,7 +10,7 @@ on: required: false env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 jobs: get-version: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 681ba1f94..bf21af27c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: types: [labeled] env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 700322c06..bd353a434 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -19,9 +19,9 @@ on: type: boolean env: - JAVA_VERSION: 19 - OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-x64_bin-jmods.zip' - OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-aarch64_bin-jmods.zip' + JAVA_VERSION: 20 + OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-x64_bin-jmods.zip' + OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-aarch64_bin-jmods.zip' jobs: build: @@ -45,7 +45,7 @@ jobs: run: | sudo add-apt-repository ppa:coffeelibs/openjdk sudo apt-get update - sudo apt-get install debhelper devscripts dput coffeelibs-jdk-19 libgtk2.0-0 + sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.JAVA_VERSION }} libgtk2.0-0 - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 5cffb56fb..d8684dc20 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -22,7 +22,7 @@ on: value: ${{ jobs.determine-version.outputs.type }} env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 JAVA_DIST: 'temurin' JAVA_CACHE: 'maven' diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 27320dba8..bad80138b 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -10,7 +10,7 @@ on: required: false env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 jobs: get-version: diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 48f7bd185..73a21edde 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -4,7 +4,7 @@ on: pull_request: env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 7309cb852..481861540 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -7,7 +7,7 @@ on: - 'hotfix/**' env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 45ce36c2e..df67c1dcb 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -14,11 +14,11 @@ on: env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 JAVA_DIST: 'temurin' JAVA_CACHE: 'maven' - JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_windows-x64_bin-jmods.zip' - JFX_JMODS_HASH: 'B7CF2CAD2468842B3B78D99F6C0555771499A36FA1F1EE3DD1B9A4597F1FAB86' + JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_windows-x64_bin-jmods.zip' + JFX_JMODS_HASH: 'D00767334C43B8832B5CF10267D34CA8F563D187C4655B73EB6020DD79C054B5' defaults: run: @@ -51,7 +51,7 @@ jobs: run: | curl --output jfxjmods.zip -L "${{ env.JFX_JMODS_URL }}" if(!(Get-FileHash -Path jfxjmods.zip -Algorithm SHA256).Hash.equals("${{ env.JFX_JMODS_HASH }}")) { - exit 1; + throw "Wrong checksum of JMOD archive downloaded from ${{ env.JFX_JMODS_URL }}."; } Expand-Archive -Path jfxjmods.zip -DestinationPath jfxjmods Get-ChildItem -Path jfxjmods -Recurse -Filter "*.jmod" | ForEach-Object { Move-Item -Path $_ -Destination $_.Directory.Parent} diff --git a/.idea/misc.xml b/.idea/misc.xml index e5d629592..891096945 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/dist/linux/debian/control b/dist/linux/debian/control index edf9dd3ce..b04812fbb 100644 --- a/dist/linux/debian/control +++ b/dist/linux/debian/control @@ -2,7 +2,7 @@ Source: cryptomator Maintainer: Cryptobot Section: utils Priority: optional -Build-Depends: debhelper (>=10), coffeelibs-jdk-19, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1 +Build-Depends: debhelper (>=10), coffeelibs-jdk-20, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1 Standards-Version: 4.5.0 Homepage: https://cryptomator.org Vcs-Git: https://github.com/cryptomator/cryptomator.git diff --git a/dist/linux/debian/rules b/dist/linux/debian/rules index be1014ea9..e0f077cc9 100755 --- a/dist/linux/debian/rules +++ b/dist/linux/debian/rules @@ -4,7 +4,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -JAVA_HOME = /usr/lib/jvm/java-19-coffeelibs +JAVA_HOME = /usr/lib/jvm/java-20-coffeelibs DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) ifeq ($(DEB_BUILD_ARCH),amd64) JMODS_PATH = jmods/amd64:${JAVA_HOME}/jmods diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 50edd6371..df73b195f 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -70,6 +70,9 @@ + + + @@ -172,11 +175,12 @@ - JP_UPGRADABLE_FOUND + JP_UPGRADABLE_FOUND - JP_DOWNGRADABLE_FOUND + JP_DOWNGRADABLE_FOUND + @@ -188,6 +192,10 @@ NOT Installed OR REINSTALL + + + + diff --git a/pom.xml b/pom.xml index 084ceeb7e..37f45a940 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ UTF-8 - 19 + 20 @@ -38,7 +38,7 @@ 1.2.0 1.2.0 1.2.0 - 2.0.5 + 3.0.0 2.0.0 2.0.2 @@ -48,7 +48,7 @@ 2.2 31.1-jre 2.10.1 - 19.0.2.1 + 20.0.1 4.3.0 9.31 1.4.5 @@ -64,7 +64,7 @@ 23.0.0 8.1.0 - 0.8.8 + 0.8.9 @@ -332,6 +332,9 @@ org.apache.maven.plugins maven-surefire-plugin + + --enable-preview + org.apache.maven.plugins diff --git a/src/main/java/org/cryptomator/ipc/IpcMessage.java b/src/main/java/org/cryptomator/ipc/IpcMessage.java index 9d1c8d3de..7f76da295 100644 --- a/src/main/java/org/cryptomator/ipc/IpcMessage.java +++ b/src/main/java/org/cryptomator/ipc/IpcMessage.java @@ -9,8 +9,8 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.function.Function; -// TODO make sealed, remove enum -interface IpcMessage { +//TODO can the enum be removed? +sealed interface IpcMessage permits HandleLaunchArgsMessage, RevealRunningAppMessage { enum MessageType { REVEAL_RUNNING_APP(RevealRunningAppMessage::decode), diff --git a/src/main/java/org/cryptomator/ipc/IpcMessageListener.java b/src/main/java/org/cryptomator/ipc/IpcMessageListener.java index f49275824..756305cbe 100644 --- a/src/main/java/org/cryptomator/ipc/IpcMessageListener.java +++ b/src/main/java/org/cryptomator/ipc/IpcMessageListener.java @@ -5,10 +5,9 @@ import java.util.List; public interface IpcMessageListener { default void handleMessage(IpcMessage message) { - if (message instanceof RevealRunningAppMessage) { - revealRunningApp(); - } else if (message instanceof HandleLaunchArgsMessage m) { - handleLaunchArgs(m.args()); + switch (message) { + case RevealRunningAppMessage m -> revealRunningApp(); // TODO: rename to _ with JEP 443 + case HandleLaunchArgsMessage m -> handleLaunchArgs(m.args()); } } diff --git a/src/main/java/org/cryptomator/ui/health/StartController.java b/src/main/java/org/cryptomator/ui/health/StartController.java index fa41a7fdc..4e95b6b0f 100644 --- a/src/main/java/org/cryptomator/ui/health/StartController.java +++ b/src/main/java/org/cryptomator/ui/health/StartController.java @@ -102,14 +102,16 @@ public class StartController implements FxController { } private void loadingKeyFailed(Throwable e) { - if (e instanceof UnlockCancelledException) { - // ok - } else if (e instanceof VaultKeyInvalidException) { - LOG.error("Invalid key"); //TODO: specific error screen - appWindows.showErrorWindow(e, window, null); - } else { - LOG.error("Failed to load key.", e); - appWindows.showErrorWindow(e, window, null); + switch (e) { + case UnlockCancelledException uce -> {} //ok + case VaultKeyInvalidException vkie -> { + LOG.error("Invalid key"); //TODO: specific error screen + appWindows.showErrorWindow(e, window, null); + } + default -> { + LOG.error("Failed to load key.", e); + appWindows.showErrorWindow(e, window, null); + } } } diff --git a/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java b/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java index 704ffa9ab..5cb1af7a3 100644 --- a/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java +++ b/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java @@ -84,18 +84,19 @@ public class AwtTrayMenuController implements TrayMenuController { private void addChildren(Menu menu, List items) { for (var item : items) { - // TODO: use Pattern Matching for switch, once available - if (item instanceof ActionItem a) { - var menuItem = new MenuItem(a.title()); - menuItem.addActionListener(evt -> a.action().run()); - menuItem.setEnabled(a.enabled()); - menu.add(menuItem); - } else if (item instanceof SeparatorItem) { - menu.addSeparator(); - } else if (item instanceof SubMenuItem s) { - var submenu = new Menu(s.title()); - addChildren(submenu, s.items()); - menu.add(submenu); + switch (item) { + case ActionItem a -> { + var menuItem = new MenuItem(a.title()); + menuItem.addActionListener(evt -> a.action().run()); + menuItem.setEnabled(a.enabled()); + menu.add(menuItem); + } + case SeparatorItem s -> menu.addSeparator(); // TODO: rename to _ with JEP 443 + case SubMenuItem s -> { + var submenu = new Menu(s.title()); + addChildren(submenu, s.items()); + menu.add(submenu); + } } } } diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java index aeb4a9166..7bc0cbccd 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java @@ -38,12 +38,11 @@ public class UnlockInvalidMountPointController implements FxController { @FXML public void initialize() { var e = unlockException.get(); - String translationKey = "unlock.error.customPath.description.generic"; - if (e instanceof MountPointNotSupportedException) { - translationKey = "unlock.error.customPath.description.notSupported"; - } else if (e instanceof MountPointNotExistsException) { - translationKey = "unlock.error.customPath.description.notExists"; - } + var translationKey = switch (e) { + case MountPointNotSupportedException x -> "unlock.error.customPath.description.notSupported"; + case MountPointNotExistsException x -> "unlock.error.customPath.description.notExists"; + default -> "unlock.error.customPath.description.generic"; + }; dialogDescription.setFormat(resourceBundle.getString(translationKey)); dialogDescription.setArg1(e.getMessage()); }