[java-opensaml] branch main updated: JSSH-27 - Implement an ensureId method to help with nullability annotation

Rod Widdowson rdw at steadingsoftware.com
Tue Apr 25 14:46:07 UTC 2023


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

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

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

The following commit(s) were added to refs/heads/main by this push:
     new b85c16938 JSSH-27 - Implement an ensureId method to help with nullability annotation
b85c16938 is described below

commit b85c16938d4f108b119150e74e21ab497e8ddce3
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Apr 25 15:40:57 2023 +0100

    JSSH-27 - Implement an ensureId method to help with nullability annotation
    
    https://shibboleth.atlassian.net/browse/JSSH-27
    
    Use the new method appropriately
---
 .../java/org/opensaml/saml/common/binding/BindingDescriptor.java    | 6 +++---
 .../opensaml/storage/impl/client/JSONClientStorageServiceStore.java | 2 +-
 .../storage/impl/client/PopulateClientStorageLoadContext.java       | 2 +-
 .../storage/impl/client/SaveCookieBackedClientStorageServices.java  | 2 +-
 .../opensaml/storage/impl/client/XMLClientStorageServiceStore.java  | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/BindingDescriptor.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/BindingDescriptor.java
index 92226a493..a7ecb6e47 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/BindingDescriptor.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/BindingDescriptor.java
@@ -173,7 +173,7 @@ public class BindingDescriptor extends AbstractIdentifiableInitializableComponen
     /** {@inheritDoc} */
     @Override
     public int hashCode() {
-        return getId().hashCode();
+        return ensureId().hashCode();
     }
 
     /** {@inheritDoc} */
@@ -188,7 +188,7 @@ public class BindingDescriptor extends AbstractIdentifiableInitializableComponen
         }
 
         if (obj instanceof BindingDescriptor) {
-            return getId().equals(((BindingDescriptor) obj).getId());
+            return ensureId().equals(((BindingDescriptor) obj).getId());
         }
 
         return false;
@@ -197,7 +197,7 @@ public class BindingDescriptor extends AbstractIdentifiableInitializableComponen
     /** {@inheritDoc} */
     @Override
     public String toString() {
-        return MoreObjects.toStringHelper(this).add("bindingId", getId())
+        return MoreObjects.toStringHelper(this).add("bindingId", ensureId())
                 .add("shortName", shortName)
                 .add("synchronous", synchronous)
                 .add("artifact", artifact)
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/JSONClientStorageServiceStore.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/JSONClientStorageServiceStore.java
index 3fde289a7..3f2f62e31 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/JSONClientStorageServiceStore.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/JSONClientStorageServiceStore.java
@@ -109,7 +109,7 @@ public class JSONClientStorageServiceStore extends AbstractClientStorageServiceS
         
         if (getContextMap().isEmpty()) {
             log.trace("{} Data is empty", storageService.getLogPrefix());
-            return new ClientStorageServiceOperation(storageService.getId(), storageService.getStorageName(), null,
+            return new ClientStorageServiceOperation(storageService.ensureId(), storageService.getStorageName(), null,
                     source);
         }
 
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContext.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContext.java
index 5c7e28ac5..3532f5c1d 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContext.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContext.java
@@ -101,7 +101,7 @@ public class PopulateClientStorageLoadContext extends AbstractProfileAction {
             try {
                 if (!service.isLoaded()) {
                     loadCtx.getStorageKeys().add(service.getStorageName());
-                    ids.add(service.getId());
+                    ids.add(service.ensureId());
                 }
             } catch (final IOException e) {
                 log.warn("{} Error checking load status of {}, assuming unloaded", getLogPrefix(), service.getId());
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServices.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServices.java
index d7154830f..ac99e2839 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServices.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServices.java
@@ -82,7 +82,7 @@ public class SaveCookieBackedClientStorageServices
         storageServices = new HashMap<>(services.size());
         for (final ClientStorageService ss : services) {
             if (ss != null) {
-                storageServices.put(ss.getId(), ss);
+                storageServices.put(ss.ensureId(), ss);
             }
         }
     }
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/XMLClientStorageServiceStore.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/XMLClientStorageServiceStore.java
index ac6f78412..49d59707b 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/XMLClientStorageServiceStore.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/XMLClientStorageServiceStore.java
@@ -133,7 +133,7 @@ public class XMLClientStorageServiceStore extends AbstractClientStorageServiceSt
         
         if (getContextMap().isEmpty()) {
             log.trace("{} Data is empty", storageService.getLogPrefix());
-            return new ClientStorageServiceOperation(storageService.getId(), storageService.getStorageName(), null,
+            return new ClientStorageServiceOperation(storageService.ensureId(), storageService.getStorageName(), null,
                     source);
         }
 

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


More information about the commits mailing list