diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-05-05 16:26:52 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-09 18:16:14 +0200 |
commit | 0b9bcf0f9e25122f9ee351aa9c889ebb01a238f5 (patch) | |
tree | e7e66720eca79145348adb82b763a0ee10685b3a /app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java | |
parent | MainActivity: Nip out as early as possible when moving to same fragment (diff) | |
download | wireguard-android-0b9bcf0f9e25122f9ee351aa9c889ebb01a238f5.tar.xz wireguard-android-0b9bcf0f9e25122f9ee351aa9c889ebb01a238f5.zip |
global: Cleanup line lengths and misc lint warnings
I know we decided to ditch the idea of shutting up "Exception
thrown with empty param" warnings but this pesters me too
much and we can instead just treat this as a weird future proofing
thing if and when we end up needing the exception messages.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java index 7e41a696..0612deb5 100644 --- a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java +++ b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java @@ -95,7 +95,9 @@ public class ObservableSortedKeyedArrayList<K, E extends Keyed<? extends K>> @Override public K firstKey() { if (isEmpty()) - throw new NoSuchElementException(); + // The parameter in the exception is only to shut + // lint up, we never care for the exception message. + throw new NoSuchElementException("Empty set"); return get(0).getKey(); } @@ -137,7 +139,9 @@ public class ObservableSortedKeyedArrayList<K, E extends Keyed<? extends K>> @Override public K lastKey() { if (isEmpty()) - throw new NoSuchElementException(); + // The parameter in the exception is only to shut + // lint up, we never care for the exception message. + throw new NoSuchElementException("Empty set"); return get(size() - 1).getKey(); } |