Browse Source

replace JSR-305 Nullable annotation

Sebastian Stenzel 3 years ago
parent
commit
4f3cd2f47c

+ 0 - 1
src/main/java/module-info.java

@@ -25,7 +25,6 @@ module org.cryptomator.desktop {
 	/* TODO: filename-based modules: */
 	requires dagger;
 	requires static javax.inject; /* ugly dagger/guava crap */
-	requires static jsr305; /* ugly dagger/guava crap */
 	requires java.jwt;
 	requires com.fasterxml.jackson.databind; // TODO: tmp fix, waiting for https://github.com/auth0/java-jwt/pull/484
 	requires zxcvbn;

+ 8 - 0
src/main/java/org/cryptomator/common/Nullable.java

@@ -0,0 +1,8 @@
+package org.cryptomator.common;
+
+/**
+ * Replacement for JSR-305 to avoid runtime dependencies. Used in Dagger components.
+ */
+public @interface Nullable {
+
+}

+ 1 - 1
src/main/java/org/cryptomator/common/settings/VaultSettings.java

@@ -43,7 +43,7 @@ public class VaultSettings {
 	private static final Random RNG = new Random();
 
 	private final String id;
-	private final ObjectProperty<Path> path = new SimpleObjectProperty();
+	private final ObjectProperty<Path> path = new SimpleObjectProperty<>();
 	private final StringProperty displayName = new SimpleStringProperty();
 	private final StringProperty winDriveLetter = new SimpleStringProperty();
 	private final BooleanProperty unlockAfterStartup = new SimpleBooleanProperty(DEFAULT_UNLOCK_AFTER_STARTUP);

+ 1 - 1
src/main/java/org/cryptomator/common/vaults/VaultComponent.java

@@ -7,10 +7,10 @@ package org.cryptomator.common.vaults;
 
 import dagger.BindsInstance;
 import dagger.Subcomponent;
+import org.cryptomator.common.Nullable;
 import org.cryptomator.common.mountpoint.MountPointChooserModule;
 import org.cryptomator.common.settings.VaultSettings;
 
-import javax.annotation.Nullable;
 import javax.inject.Named;
 
 @PerVault

+ 1 - 1
src/main/java/org/cryptomator/common/vaults/VaultModule.java

@@ -8,6 +8,7 @@ package org.cryptomator.common.vaults;
 import dagger.Module;
 import dagger.Provides;
 import org.apache.commons.lang3.SystemUtils;
+import org.cryptomator.common.Nullable;
 import org.cryptomator.common.settings.Settings;
 import org.cryptomator.common.settings.VaultSettings;
 import org.cryptomator.common.settings.VolumeImpl;
@@ -15,7 +16,6 @@ import org.cryptomator.cryptofs.CryptoFileSystem;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.Nullable;
 import javax.inject.Named;
 import javafx.beans.binding.Bindings;
 import javafx.beans.binding.StringBinding;

+ 1 - 1
src/main/java/org/cryptomator/ui/common/ErrorComponent.java

@@ -2,8 +2,8 @@ package org.cryptomator.ui.common;
 
 import dagger.BindsInstance;
 import dagger.Subcomponent;
+import org.cryptomator.common.Nullable;
 
-import javax.annotation.Nullable;
 import javafx.application.Platform;
 import javafx.scene.Scene;
 import javafx.stage.Stage;

+ 2 - 1
src/main/java/org/cryptomator/ui/common/ErrorController.java

@@ -1,6 +1,7 @@
 package org.cryptomator.ui.common;
 
-import javax.annotation.Nullable;
+import org.cryptomator.common.Nullable;
+
 import javax.inject.Inject;
 import javax.inject.Named;
 import javafx.fxml.FXML;