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>
This commit is contained in:
Harsh Shandilya
2018-04-28 06:07:48 +02:00
committed by Jason A. Donenfeld
parent 592c5cbbd6
commit ba862b166b
8 changed files with 16 additions and 19 deletions
@@ -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";