This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 65ce14b75 Fix test: compute if present is a put.
65ce14b75 is described below

commit 65ce14b7572d79d85f51843889d9e82b7c3568ef
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Oct 3 09:17:58 2024 -0400

    Fix test: compute if present is a put.
---
 .../java/org/apache/commons/collections4/map/AbstractMapTest.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java 
b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
index 55e16c188..d3398ecba 100644
--- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
@@ -1622,13 +1622,9 @@ public abstract class AbstractMapTest<M extends Map<K, 
V>, K, V> extends Abstrac
                 }
             }
         } else if (isPutChangeSupported()) {
+            // compute if present is a put.
             resetEmpty();
-            try {
-                getMap().computeIfPresent(keys[0], (k, v) -> values[0]);
-                fail("Expected UnsupportedOperationException or 
IllegalArgumentException on putIfAbsent (add) when fixed size");
-            } catch (final IllegalArgumentException | 
UnsupportedOperationException ex) {
-                // ignore
-            }
+            getMap().computeIfPresent(keys[0], (k, v) -> values[0]);
             resetFull();
             int i = 0;
             for (final Iterator<K> it = getMap().keySet().iterator(); 
it.hasNext() && i < newValues.length; i++) {

Reply via email to