[java-shib-profile] branch main updated: JSPROF-5 - InstallableComponentVersion serialized with extra null field
Scott Cantor
cantor.2 at osu.edu
Wed May 15 14:23:16 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-profile.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=13603df3bdd0156685dede5ceca16a5fd5fc42ec
The following commit(s) were added to refs/heads/main by this push:
new 13603df JSPROF-5 - InstallableComponentVersion serialized with extra null field
13603df is described below
commit 13603df3bdd0156685dede5ceca16a5fd5fc42ec
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed May 15 10:23:13 2024 -0400
JSPROF-5 - InstallableComponentVersion serialized with extra null field
https://shibboleth.atlassian.net/browse/JSPROF-5
---
shib-profile-api/pom.xml | 7 ++++++-
.../installablecomponent/InstallableComponentSupport.java | 8 +++++---
.../installablecomponent/InstallableComponentVersion.java | 12 ++++++++++--
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/shib-profile-api/pom.xml b/shib-profile-api/pom.xml
index d71b78f..f04fe8f 100644
--- a/shib-profile-api/pom.xml
+++ b/shib-profile-api/pom.xml
@@ -88,7 +88,12 @@
<artifactId>metrics-core</artifactId>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>${httpclient.groupId}</groupId>
<artifactId>${httpclient.artifactId}</artifactId>
</dependency>
diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentSupport.java b/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentSupport.java
index 0c3896c..2d2c732 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentSupport.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentSupport.java
@@ -94,11 +94,12 @@ public final class InstallableComponentSupport {
* @param instaleeInfo all about the instalee
* @return the best version (or null)
*/
- @Nullable static public InstallableComponentVersion getBestVersion(
+ @Nullable public static InstallableComponentVersion getBestVersion(
@Nonnull final InstallableComponentVersion installIntoVersion,
@Nonnull final InstallableComponentVersion instaleeVersion,
@Nonnull final InstallableComponentInfo instaleeInfo) {
- final List<InstallableComponentVersion> availableVersions = new ArrayList<>(instaleeInfo.getAvailableVersions().keySet());
+ final List<InstallableComponentVersion> availableVersions =
+ new ArrayList<>(instaleeInfo.getAvailableVersions().keySet());
availableVersions.sort(null);
log.debug("Considering available versions: {}", availableVersions);
@@ -115,7 +116,8 @@ public final class InstallableComponentSupport {
continue;
}
if (!instaleeInfo.isSupportedWithIdPVersion(version, installIntoVersion)) {
- log.debug("Available version {} is not supported with Application Version {}", version, installIntoVersion);
+ log.debug("Available version {} is not supported with Application Version {}", version,
+ installIntoVersion);
continue;
}
log.debug("Plugin version {} is supported with Application Version {}", version, installIntoVersion);
diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentVersion.java b/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentVersion.java
index 8a58f05..572ff5a 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentVersion.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/installablecomponent/InstallableComponentVersion.java
@@ -16,6 +16,8 @@ package net.shibboleth.profile.installablecomponent;
import javax.annotation.Nonnull;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
import net.shibboleth.profile.plugin.Plugin;
import net.shibboleth.profile.module.Module;
import net.shibboleth.shared.primitive.StringSupport;
@@ -117,8 +119,14 @@ public class InstallableComponentVersion implements Comparable<InstallableCompon
return patch;
}
- /** Is this version all zeros (usually as a result of a parsing issue.
- * @return if all nulls */
+ /**
+ * Is this version all zeros (usually as a result of a parsing issue.
+ *
+ * <p>The Jackson annotation is used to exclude this getter from serialization for metrics.</p>
+ *
+ * @return if all nulls
+ */
+ @JsonIgnore
public boolean isNull() {
return major == 0 && minor ==0 && patch == 0;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list