summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2018-04-30 16:44:04 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2018-04-30 17:30:25 +0530
commit77c0d4dfa6d46c13632832b8f882e6121e7bef0b (patch)
treed6a509ff4fda93c17e164d4cf8b2467f3d4f02df /app/src/main/java/com/wireguard/android
parent7e415a62c7594e53b3658a54786df5d6173a843f (diff)
TunnelListFragment: Use Collections methods in place of Arrays
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r--app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
index 128ee89b..f8a35d89 100644
--- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
+++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
@@ -45,6 +45,7 @@ import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -133,7 +134,7 @@ public class TunnelListFragment extends BaseFragment {
return CompletableFuture.allOf(futureTunnels.toArray(new CompletableFuture[futureTunnels.size()]));
}).whenComplete((future, exception) -> {
if (exception != null) {
- this.onTunnelImportFinished(Arrays.asList(), Arrays.asList(exception));
+ this.onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(exception));
} else {
future.whenComplete((ignored1, ignored2) -> {
ArrayList<Tunnel> tunnels = new ArrayList<>(futureTunnels.size());
@@ -245,7 +246,7 @@ public class TunnelListFragment extends BaseFragment {
else if (!throwables.isEmpty())
message = getString(R.string.import_partial_success, tunnels.size(), tunnels.size() + throwables.size());
- if (binding != null && message != null) {
+ if (binding != null) {
final CoordinatorLayout container = binding.mainContainer;
Snackbar.make(container, message, Snackbar.LENGTH_LONG).show();
}