From c1856de66e77a2653adc1ff76e31295a0d529a77 Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Wed, 4 Sep 2024 18:45:00 +0800 Subject: [PATCH] Throw IllegalStateException when inserting an existing item This commit throws IllegalStateException instead of IllegalArgumentException when inserting an existing item to TestBpfMap to fit the current behavior in the production code. This is safe given that this is only for test and no one is currently check the exception. Test: atest TetheringTests:com.android.networkstack.tethering.BpfCoordinatorTest Bug: 354619988 Change-Id: I1e5c6e99a0d95b44dd556de8805bb16c3d1a4f61 --- .../devicetests/com/android/testutils/TestBpfMap.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java b/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java index 70f20d6e27..58e66221b8 100644 --- a/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java +++ b/staticlibs/testutils/devicetests/com/android/testutils/TestBpfMap.java @@ -65,10 +65,11 @@ public class TestBpfMap implements IBpfMap