commit | 055b0c9057242ee1b0a9460001878229936f3067 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Fri Sep 06 04:05:58 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Sep 06 04:05:58 2024 +0000 |
tree | e6c9daeb312eab17562674e2aa0cee4ad7567d1b | |
parent | 1633a7fe2a7664e4897a5e53509b54bda7ad367f [diff] | |
parent | 7bf26f7404f6ff169a052eb397babb7acbf03d1a [diff] |
Merge "Throw IllegalStateException when inserting an existing item" into main am: e7d67662a9 am: 7bf26f7404 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3254276 Change-Id: Ie77bd00daf7ee14e339d9246947c9092b8ff70be Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java b/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java index 70f20d6..58e6622 100644 --- a/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java +++ b/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java
@@ -65,10 +65,11 @@ @Override public void insertEntry(K key, V value) throws ErrnoException, - IllegalArgumentException { - // The entry is created if and only if it doesn't exist. See BpfMap#insertEntry. + IllegalStateException { + // The entry is created if and only if it doesn't exist. + // And throws exception if it exists. See BpfMap#insertEntry. if (mMap.get(key) != null) { - throw new IllegalArgumentException(key + " already exist"); + throw new IllegalStateException(key + " already exist"); } mMap.put(key, value); }