[java-shib-attribute] branch main updated: Fix some warnings.
Scott Cantor
cantor.2 at osu.edu
Thu Jan 23 13:39:22 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-attribute.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=f7d13c528a94f1a7090962eaaf27f57de8a0ab7d
The following commit(s) were added to refs/heads/main by this push:
new f7d13c528 Fix some warnings.
f7d13c528 is described below
commit f7d13c528a94f1a7090962eaaf27f57de8a0ab7d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jan 23 08:39:19 2025 -0500
Fix some warnings.
---
.../dc/scripted/impl/ScriptedDataConnector.java | 14 +++++++-----
.../dc/scripted/impl/ScriptedMappingStrategy.java | 18 ++++++++++++++-
.../resolver/dc/scripted/impl/ScriptedSearch.java | 22 +++++++++++++++---
.../dc/scripted/impl/ScriptedSearchBuilder.java | 26 +++++++++++++++++-----
4 files changed, 65 insertions(+), 15 deletions(-)
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
index ee03c4fa6..2afb90f15 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
@@ -154,13 +154,14 @@ public class ScriptedDataConnector extends AbstractSearchDataConnector<ScriptedS
/** {@inheritDoc} */
@Override
- protected Map<String, IdPAttribute> retrieveAttributes(ScriptedSearch executable) throws ResolutionException {
+ protected Map<String, IdPAttribute> retrieveAttributes(@Nonnull final ScriptedSearch executable)
+ throws ResolutionException {
return Constraint.isNotNull(null, "illegal function called");
}
/** {@inheritDoc} */
@Override
- protected Map<String, IdPAttribute> retrieveAttributes(ScriptedSearch executable,
+ protected Map<String, IdPAttribute> retrieveAttributes(@Nonnull final ScriptedSearch executable,
@Nonnull final AttributeResolverWorkContext workContext) throws ResolutionException {
final AttributeResolutionContext resolutionContext = executable.getResolutionContext();
@@ -305,20 +306,21 @@ public class ScriptedDataConnector extends AbstractSearchDataConnector<ScriptedS
}
/**
- * Because we are a SearchDataConnector we need to have a validator. This plugs the gap.
+ * Because we are a SearchDataConnector we need to have a validator, so this plugs the gap.
*/
- private class NullValidator implements Validator {
+ private final class NullValidator implements Validator {
+ /** Whether to raise an error. */
private boolean throwValidateError;
/** {@inheritDoc} */
@Override
- public void validate(DataConnector dataConnector) throws ValidationException {
+ public void validate(@Nonnull final DataConnector dataConnector) throws ValidationException {
}
/** {@inheritDoc} */
@Override
- public void setThrowValidateError(boolean what) {
+ public void setThrowValidateError(final boolean what) {
throwValidateError = what;
}
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedMappingStrategy.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedMappingStrategy.java
index 07e85f152..20c81b6a7 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedMappingStrategy.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedMappingStrategy.java
@@ -1,7 +1,23 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.shibboleth.idp.attribute.resolver.dc.scripted.impl;
import java.util.Map;
+import javax.annotation.Nonnull;
+
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.resolver.ResolutionException;
import net.shibboleth.idp.attribute.resolver.dc.MappingStrategy;
@@ -13,7 +29,7 @@ public class ScriptedMappingStrategy implements MappingStrategy<Map<String,IdPAt
/** {@inheritDoc} */
@Override
- public Map<String, IdPAttribute> map(Map<String, IdPAttribute> results) throws ResolutionException {
+ public Map<String, IdPAttribute> map(@Nonnull final Map<String, IdPAttribute> results) throws ResolutionException {
return results;
}
}
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearch.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearch.java
index 3776b7037..2d175fcfe 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearch.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearch.java
@@ -1,3 +1,17 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.shibboleth.idp.attribute.resolver.dc.scripted.impl;
import javax.annotation.Nonnull;
@@ -7,8 +21,9 @@ import net.shibboleth.idp.attribute.resolver.dc.ExecutableSearch;
/**
* {@link ExecutableSearch} for the {@link ScriptedDataConnector}.
- * This is not a data searcher per se. This interface is here to
- * provide the cache key (if relevant) and the {@link #AttributeResolutionContext}.
+ *
+ * This is not a data searcher per se, but This interface is here to
+ * provide the cache key (if relevant) and the {@link AttributeResolutionContext}.
*/
public interface ScriptedSearch extends ExecutableSearch{
@@ -16,4 +31,5 @@ public interface ScriptedSearch extends ExecutableSearch{
* @return the context associated with this operation
*/
@Nonnull AttributeResolutionContext getResolutionContext();
-}
+
+}
\ No newline at end of file
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearchBuilder.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearchBuilder.java
index c8a3b39e6..18bba9ba0 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearchBuilder.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedSearchBuilder.java
@@ -1,3 +1,17 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.shibboleth.idp.attribute.resolver.dc.scripted.impl;
import java.util.ArrayList;
@@ -96,11 +110,11 @@ public class ScriptedSearchBuilder extends AbstractInitializableComponent
cacheKeyTemplateText = StringSupport.trimOrNull(text);
}
+ /** {@inheritDoc} */
@Override
- public ScriptedSearch build(@Nonnull AttributeResolutionContext resolutionContext,
- Map<String, List<IdPAttributeValue>> dependencyAttributes) throws ResolutionException {
+ @Nonnull public ScriptedSearch build(@Nonnull final AttributeResolutionContext resolutionContext,
+ @Nonnull final Map<String, List<IdPAttributeValue>> dependencyAttributes) throws ResolutionException {
- /** {@inheritDoc} */
return new ScriptedSearch() {
@Nonnull public AttributeResolutionContext getResolutionContext() {
@@ -114,13 +128,15 @@ public class ScriptedSearchBuilder extends AbstractInitializableComponent
};
}
- /** Allow a user-provided cache key for this resolution
+ /**
+ * Allow a user-provided cache key for this resolution.
+ *
* @param resolutionContext the {@link AttributeResolutionContext}
* @param dependencyAttributes the attributes,
* @return They key or null if the user didn't specify one.
*/
@Nullable @NotEmpty private String getResultCacheKey(@Nonnull final AttributeResolutionContext resolutionContext,
- @Nonnull final Map<String, List<IdPAttributeValue>> dependencyAttributes) {
+ @Nonnull final Map<String, List<IdPAttributeValue>> dependencyAttributes) {
final Template ckt = cacheKeyTemplate;
if (ckt== null) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list