[java-shib-shared] branch main updated: IDP-2069 Null handling task

Rod Widdowson rdw at steadingsoftware.com
Mon May 1 13:13:55 UTC 2023


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=a1c857d131df2d06f623ded48a377f50c9f5580d

The following commit(s) were added to refs/heads/main by this push:
     new a1c857d1 IDP-2069 Null handling task
a1c857d1 is described below

commit a1c857d131df2d06f623ded48a377f50c9f5580d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon May 1 14:13:50 2023 +0100

    IDP-2069 Null handling task
    
    https://shibboleth.atlassian.net/browse/IDP-2069
    
    Revert some overambitious null assumptions.
    
    This is a partial revert of 8770abe9586f5af460779ca3c53f88536e04ad9f
---
 .../java/net/shibboleth/shared/collection/ClassToInstanceMultiMap.java | 2 +-
 .../src/main/java/net/shibboleth/shared/collection/LazyList.java       | 3 ++-
 .../src/main/java/net/shibboleth/shared/collection/LazyMap.java        | 2 +-
 .../src/main/java/net/shibboleth/shared/collection/LazySet.java        | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/shib-support/src/main/java/net/shibboleth/shared/collection/ClassToInstanceMultiMap.java b/shib-support/src/main/java/net/shibboleth/shared/collection/ClassToInstanceMultiMap.java
index 373165f8..2228d3af 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/collection/ClassToInstanceMultiMap.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/collection/ClassToInstanceMultiMap.java
@@ -124,7 +124,7 @@ public class ClassToInstanceMultiMap<B> {
         if (indexedValues == null) {
             return CollectionSupport.emptyList();
         }
-        return CollectionSupport.copyToList(indexedValues);
+        return Collections.unmodifiableList(indexedValues);
     }
 
     /**
diff --git a/shib-support/src/main/java/net/shibboleth/shared/collection/LazyList.java b/shib-support/src/main/java/net/shibboleth/shared/collection/LazyList.java
index 796fb4d8..a5107804 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/collection/LazyList.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/collection/LazyList.java
@@ -20,6 +20,7 @@ package net.shibboleth.shared.collection;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
@@ -45,7 +46,7 @@ public class LazyList<ElementType> implements List<ElementType>, Serializable {
     public boolean add(final ElementType item) {
         if (delegate.isEmpty()) {
             // TODO: allow null?
-            delegate = CollectionSupport.singletonList(item);
+            delegate = Collections.singletonList(item);
             return true;
         }
         
diff --git a/shib-support/src/main/java/net/shibboleth/shared/collection/LazyMap.java b/shib-support/src/main/java/net/shibboleth/shared/collection/LazyMap.java
index 7bfeac39..843fd915 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/collection/LazyMap.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/collection/LazyMap.java
@@ -83,7 +83,7 @@ public class LazyMap<KeyType, ValueType> implements Map<KeyType, ValueType>, Ser
     public ValueType put(final KeyType key, final ValueType value) {
         if (delegate.isEmpty()) {
             // TODO: allow nulls?
-            delegate = CollectionSupport.singletonMap(key, value);
+            delegate = Collections.singletonMap(key, value);
             return null;
         }
         
diff --git a/shib-support/src/main/java/net/shibboleth/shared/collection/LazySet.java b/shib-support/src/main/java/net/shibboleth/shared/collection/LazySet.java
index 1a526bcc..4d25e387 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/collection/LazySet.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/collection/LazySet.java
@@ -45,7 +45,7 @@ public class LazySet<ElementType> implements Set<ElementType>, Serializable {
     public boolean add(final ElementType element) {
         if (delegate.isEmpty()) {
             // TODO: allow null?
-            delegate = CollectionSupport.singleton(element);
+            delegate = Collections.singleton(element);
             return true;
         }
         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list