diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-04-27 22:59:24 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-04-28 06:07:48 +0200 |
commit | ba862b166bd30de8c15593ed3b8dfd457eb39d36 (patch) | |
tree | 8f4f08ccec905f27062a4bb337a6c44185726e9a /app/src/main/java/com/wireguard/android/model/TunnelManager.java | |
parent | 592c5cbbd672a0eae33ce7e51e96215243e50dd8 (diff) |
Quick cleanup across the board
- Clean up imports
- Adjust method visibility
- Drop in NonNull annotations where needed
- Prevent potential NPEs from nulled getActivity calls
- Remove unused methods
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/model/TunnelManager.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/model/TunnelManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/model/TunnelManager.java b/app/src/main/java/com/wireguard/android/model/TunnelManager.java index 61468920..e4667c82 100644 --- a/app/src/main/java/com/wireguard/android/model/TunnelManager.java +++ b/app/src/main/java/com/wireguard/android/model/TunnelManager.java @@ -66,7 +66,7 @@ public final class TunnelManager extends BaseObservable { } public CompletionStage<Tunnel> create(@NonNull final String name, final Config config) { - if (!Tunnel.isNameValid(name)) + if (Tunnel.isNameInvalid(name)) return CompletableFuture.failedFuture(new IllegalArgumentException("Invalid name")); if (tunnels.containsKey(name)) { final String message = "Tunnel " + name + " already exists"; @@ -190,7 +190,7 @@ public final class TunnelManager extends BaseObservable { } CompletionStage<String> setTunnelName(final Tunnel tunnel, final String name) { - if (!Tunnel.isNameValid(name)) + if (Tunnel.isNameInvalid(name)) return CompletableFuture.failedFuture(new IllegalArgumentException("Invalid name")); if (tunnels.containsKey(name)) { final String message = "Tunnel " + name + " already exists"; |