[java-opensaml] 02/02: JPAR-85 - Checkstyle, check final variables
Tom Zeller
tzeller at dragonacea.biz
Mon Aug 7 16:37:54 EDT 2017
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=a15d24f2d44ba705fe96ed1e32aad8f0d4ecf8cc
commit a15d24f2d44ba705fe96ed1e32aad8f0d4ecf8cc
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Mon Aug 7 15:36:21 2017 -0500
JPAR-85 - Checkstyle, check final variables
---
.../opensaml/core/config/ConfigurationService.java | 22 ++++-----
.../core/config/InitializationService.java | 8 ++--
...actFilesystemConfigurationPropertiesSource.java | 6 +--
.../ClasspathConfigurationPropertiesSource.java | 2 +-
.../config/provider/MapBasedConfiguration.java | 4 +-
.../opensaml/core/criterion/EntityIdCriterion.java | 2 +-
.../org/opensaml/core/metrics/MetricsSupport.java | 2 +-
...ractElementExtensibleXMLObjectUnmarshaller.java | 2 +-
.../xml/AbstractExtensibleXMLObjectMarshaller.java | 6 +--
.../AbstractExtensibleXMLObjectUnmarshaller.java | 6 +--
.../org/opensaml/core/xml/AbstractXMLObject.java | 8 ++--
.../core/xml/AbstractXMLObjectBuilder.java | 12 ++---
.../main/java/org/opensaml/core/xml/Namespace.java | 2 +-
.../org/opensaml/core/xml/NamespaceManager.java | 45 ++++++++++---------
.../opensaml/core/xml/XMLObjectBuilderFactory.java | 4 +-
.../AbstractXMLObjectProviderInitializer.java | 2 +-
.../xml/config/GlobalParserPoolInitializer.java | 2 +-
.../opensaml/core/xml/config/XMLConfigurator.java | 16 ++++---
.../xml/config/XMLObjectProviderInitializer.java | 2 +-
.../config/XMLObjectProviderRegistrySupport.java | 4 +-
.../core/xml/io/AbstractXMLObjectUnmarshaller.java | 22 ++++-----
.../xml/persist/FilesystemLoadSaveManager.java | 36 +++++++--------
.../core/xml/persist/MapLoadSaveManager.java | 6 +--
.../opensaml/core/xml/schema/XSBooleanValue.java | 4 +-
.../core/xml/schema/impl/XSAnyMarshaller.java | 6 +--
.../core/xml/schema/impl/XSAnyUnmarshaller.java | 8 ++--
.../xml/schema/impl/XSBase64BinaryMarshaller.java | 2 +-
.../schema/impl/XSBase64BinaryUnmarshaller.java | 2 +-
.../core/xml/schema/impl/XSBooleanMarshaller.java | 2 +-
.../xml/schema/impl/XSBooleanUnmarshaller.java | 2 +-
.../core/xml/schema/impl/XSDateTimeMarshaller.java | 2 +-
.../xml/schema/impl/XSDateTimeUnmarshaller.java | 2 +-
.../core/xml/schema/impl/XSIntegerMarshaller.java | 2 +-
.../xml/schema/impl/XSIntegerUnmarshaller.java | 2 +-
.../core/xml/schema/impl/XSQNameMarshaller.java | 2 +-
.../core/xml/schema/impl/XSQNameUnmarshaller.java | 4 +-
.../core/xml/schema/impl/XSStringMarshaller.java | 2 +-
.../core/xml/schema/impl/XSStringUnmarshaller.java | 2 +-
.../core/xml/schema/impl/XSURIMarshaller.java | 2 +-
.../core/xml/schema/impl/XSURIUnmarshaller.java | 2 +-
.../xml/util/AbstractWrappedSingletonFactory.java | 4 +-
.../org/opensaml/core/xml/util/AttributeMap.java | 40 ++++++++---------
.../java/org/opensaml/core/xml/util/IDIndex.java | 2 +-
.../xml/util/IndexedXMLObjectChildrenList.java | 26 +++++------
.../core/xml/util/XMLObjectChildrenList.java | 8 ++--
.../opensaml/core/xml/util/XMLObjectSupport.java | 52 +++++++++++-----------
46 files changed, 202 insertions(+), 199 deletions(-)
diff --git a/opensaml-core/src/main/java/org/opensaml/core/config/ConfigurationService.java b/opensaml-core/src/main/java/org/opensaml/core/config/ConfigurationService.java
index d18df59..7e9fea6 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/config/ConfigurationService.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/config/ConfigurationService.java
@@ -83,7 +83,7 @@ public class ConfigurationService {
* @return the instance of the registered configuration object, or null
*/
public static <T extends Object> T get(@Nonnull final Class<T> configClass) {
- String partitionName = getPartitionName();
+ final String partitionName = getPartitionName();
return getConfiguration().get(configClass, partitionName);
}
@@ -98,7 +98,7 @@ public class ConfigurationService {
*/
public static <T extends Object, I extends T> void register(@Nonnull final Class<T> configClass,
@Nonnull final I configInstance) {
- String partitionName = getPartitionName();
+ final String partitionName = getPartitionName();
getConfiguration().register(configClass, configInstance, partitionName);
}
@@ -112,7 +112,7 @@ public class ConfigurationService {
* @return the configuration object instance which was deregistered, or null
*/
public static <T extends Object> T deregister(@Nonnull final Class<T> configClass) {
- String partitionName = getPartitionName();
+ final String partitionName = getPartitionName();
return getConfiguration().deregister(configClass, partitionName);
}
@@ -136,13 +136,13 @@ public class ConfigurationService {
*/
@Nullable public static Properties getConfigurationProperties() {
//TODO make these immutable?
- Logger log = getLogger();
+ final Logger log = getLogger();
log.trace("Resolving configuration propreties source");
- Iterator<ConfigurationPropertiesSource> iter = configPropertiesLoader.iterator();
+ final Iterator<ConfigurationPropertiesSource> iter = configPropertiesLoader.iterator();
while (iter.hasNext()) {
- ConfigurationPropertiesSource source = iter.next();
+ final ConfigurationPropertiesSource source = iter.next();
log.trace("Evaluating configuration properties implementation: {}", source.getClass().getName());
- Properties props = source.getProperties();
+ final Properties props = source.getProperties();
if (props != null) {
log.trace("Resolved non-null configuration properties using implementation: {}",
source.getClass().getName());
@@ -180,8 +180,8 @@ public class ConfigurationService {
* @return the partition name
*/
@Nonnull @NotEmpty protected static String getPartitionName() {
- Logger log = getLogger();
- Properties configProperties = getConfigurationProperties();
+ final Logger log = getLogger();
+ final Properties configProperties = getConfigurationProperties();
String partitionName = null;
if (configProperties != null) {
partitionName = configProperties.getProperty(PROPERTY_PARTITION_NAME, DEFAULT_PARTITION_NAME);
@@ -206,8 +206,8 @@ public class ConfigurationService {
@Nonnull protected static Configuration getConfiguration() {
if (configuration == null) {
synchronized (ConfigurationService.class) {
- ServiceLoader<Configuration> loader = ServiceLoader.load(Configuration.class);
- Iterator<Configuration> iter = loader.iterator();
+ final ServiceLoader<Configuration> loader = ServiceLoader.load(Configuration.class);
+ final Iterator<Configuration> iter = loader.iterator();
if (iter.hasNext()) {
configuration = iter.next();
} else {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/config/InitializationService.java b/opensaml-core/src/main/java/org/opensaml/core/config/InitializationService.java
index 96fd6c3..a10057a 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/config/InitializationService.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/config/InitializationService.java
@@ -43,14 +43,14 @@ public class InitializationService {
* @throws InitializationException if initialization did not complete successfully
*/
public static synchronized void initialize() throws InitializationException {
- Logger log = getLogger();
+ final Logger log = getLogger();
log.info("Initializing OpenSAML using the Java Services API");
- ServiceLoader<Initializer> serviceLoader = getServiceLoader();
- Iterator<Initializer> iter = serviceLoader.iterator();
+ final ServiceLoader<Initializer> serviceLoader = getServiceLoader();
+ final Iterator<Initializer> iter = serviceLoader.iterator();
while (iter.hasNext()) {
- Initializer initializer = iter.next();
+ final Initializer initializer = iter.next();
log.debug("Initializing module initializer implementation: {}", initializer.getClass().getName());
try {
initializer.init();
diff --git a/opensaml-core/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java b/opensaml-core/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
index f28eb49..c047ebb 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
@@ -48,7 +48,7 @@ public abstract class AbstractFilesystemConfigurationPropertiesSource implements
/** {@inheritDoc} */
public Properties getProperties() {
- String fileName = StringSupport.trimOrNull(getFilename());
+ final String fileName = StringSupport.trimOrNull(getFilename());
if (fileName == null) {
log.warn("No filename was supplied, unable to load properties");
return null;
@@ -58,10 +58,10 @@ public abstract class AbstractFilesystemConfigurationPropertiesSource implements
// NOTE: in this invocation style via class loader, resource should NOT have a leading slash
// because all names are absolute. This is unlike Class.getResourceAsStream
// where a leading slash is required for absolute names.
- File file = new File(fileName);
+ final File file = new File(fileName);
if (file.exists()) {
try (InputStream is = new FileInputStream(fileName)) {
- Properties props = new Properties();
+ final Properties props = new Properties();
props.load(is);
cachedProperties = props;
} catch (final FileNotFoundException e) {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java b/opensaml-core/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
index 2e2352d..71732fd 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
@@ -52,7 +52,7 @@ public class ClasspathConfigurationPropertiesSource implements ConfigurationProp
// because all names are absolute. This is unlike Class.getResourceAsStream
// where a leading slash is required for absolute names.
if (is != null) {
- Properties props = new Properties();
+ final Properties props = new Properties();
props.load(is);
cachedProperties = props;
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/config/provider/MapBasedConfiguration.java b/opensaml-core/src/main/java/org/opensaml/core/config/provider/MapBasedConfiguration.java
index 6c88ded..ad013e7 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/config/provider/MapBasedConfiguration.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/config/provider/MapBasedConfiguration.java
@@ -63,7 +63,7 @@ public class MapBasedConfiguration implements Configuration {
*/
public <T extends Object, I extends T> void register(final Class<T> configClass, final I configuration,
final String partitionName) {
- Map<String, Object> partition = getPartition(partitionName);
+ final Map<String, Object> partition = getPartition(partitionName);
partition.put(configClass.getName(), configuration);
}
@@ -78,7 +78,7 @@ public class MapBasedConfiguration implements Configuration {
* @return the configuration implementation instance which was deregistered, or null
*/
public <T extends Object> T deregister(final Class<T> configClass, final String partitionName) {
- Map<String, Object> partition = getPartition(partitionName);
+ final Map<String, Object> partition = getPartition(partitionName);
synchronized (partition) {
final T old = configClass.cast(partition.get(configClass.getName()));
partition.remove(configClass.getName());
diff --git a/opensaml-core/src/main/java/org/opensaml/core/criterion/EntityIdCriterion.java b/opensaml-core/src/main/java/org/opensaml/core/criterion/EntityIdCriterion.java
index bf15720..fee3a8f 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/criterion/EntityIdCriterion.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/criterion/EntityIdCriterion.java
@@ -51,7 +51,7 @@ public final class EntityIdCriterion implements Criterion {
/** {@inheritDoc} */
@Override
public String toString() {
- StringBuilder builder = new StringBuilder();
+ final StringBuilder builder = new StringBuilder();
builder.append("EntityIdCriterion [id=");
builder.append(id);
builder.append("]");
diff --git a/opensaml-core/src/main/java/org/opensaml/core/metrics/MetricsSupport.java b/opensaml-core/src/main/java/org/opensaml/core/metrics/MetricsSupport.java
index 1c92943..8647d88 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/metrics/MetricsSupport.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/metrics/MetricsSupport.java
@@ -225,7 +225,7 @@ public final class MetricsSupport {
Constraint.isNotNull(name, "Metric name was null");
Constraint.isNotNull(metric, "Metric was null");
- Metric registeredMetric = registry.getMetrics().get(name);
+ final Metric registeredMetric = registry.getMetrics().get(name);
return metric == registeredMetric;
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractElementExtensibleXMLObjectUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractElementExtensibleXMLObjectUnmarshaller.java
index f47d5cb..6613c87 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractElementExtensibleXMLObjectUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractElementExtensibleXMLObjectUnmarshaller.java
@@ -42,7 +42,7 @@ public abstract class AbstractElementExtensibleXMLObjectUnmarshaller extends Abs
@Override
protected void processChildElement(@Nonnull final XMLObject parentXMLObject,
@Nonnull final XMLObject childXMLObject) throws UnmarshallingException {
- ElementExtensibleXMLObject any = (ElementExtensibleXMLObject) parentXMLObject;
+ final ElementExtensibleXMLObject any = (ElementExtensibleXMLObject) parentXMLObject;
any.getUnknownXMLObjects().add(childXMLObject);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectMarshaller.java
index e8372ce..2b99ec3 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectMarshaller.java
@@ -49,10 +49,10 @@ public abstract class AbstractExtensibleXMLObjectMarshaller extends AbstractElem
@Override
protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- AttributeExtensibleXMLObject anyAttribute = (AttributeExtensibleXMLObject) xmlObject;
+ final AttributeExtensibleXMLObject anyAttribute = (AttributeExtensibleXMLObject) xmlObject;
Attr attribute;
- Document document = domElement.getOwnerDocument();
- for (Entry<QName, String> entry : anyAttribute.getUnknownAttributes().entrySet()) {
+ final Document document = domElement.getOwnerDocument();
+ for (final Entry<QName, String> entry : anyAttribute.getUnknownAttributes().entrySet()) {
attribute = AttributeSupport.constructAttribute(document, entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectUnmarshaller.java
index 7f4dbbe..c7b9cd6 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractExtensibleXMLObjectUnmarshaller.java
@@ -44,9 +44,9 @@ public abstract class AbstractExtensibleXMLObjectUnmarshaller extends AbstractEl
@Override
protected void processAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute)
throws UnmarshallingException {
- AttributeExtensibleXMLObject anyAttribute = (AttributeExtensibleXMLObject) xmlObject;
- QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
- .getPrefix());
+ final AttributeExtensibleXMLObject anyAttribute = (AttributeExtensibleXMLObject) xmlObject;
+ final QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(),
+ attribute.getPrefix());
if (attribute.isId()) {
anyAttribute.getUnknownAttributes().registerID(attribQName);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java
index 97dca88..602393d 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java
@@ -151,7 +151,7 @@ public abstract class AbstractXMLObject implements XMLObject {
/** {@inheritDoc} */
public boolean hasChildren() {
- List<? extends XMLObject> children = getOrderedChildren();
+ final List<? extends XMLObject> children = getOrderedChildren();
return children != null && children.size() > 0;
}
@@ -376,7 +376,7 @@ public abstract class AbstractXMLObject implements XMLObject {
* @param newID the new value of the ID-typed attribute
*/
protected void registerOwnID(@Nullable final String oldID, @Nullable final String newID) {
- String newString = StringSupport.trimOrNull(newID);
+ final String newString = StringSupport.trimOrNull(newID);
if (!Objects.equals(oldID, newString)) {
if (oldID != null) {
@@ -394,7 +394,7 @@ public abstract class AbstractXMLObject implements XMLObject {
log.trace("Releasing cached DOM reprsentation for children of {} with propagation set to {}",
getElementQName(), propagateRelease);
if (getOrderedChildren() != null) {
- for (XMLObject child : getOrderedChildren()) {
+ for (final XMLObject child : getOrderedChildren()) {
if (child != null) {
child.releaseDOM();
if (propagateRelease) {
@@ -419,7 +419,7 @@ public abstract class AbstractXMLObject implements XMLObject {
public void releaseParentDOM(final boolean propagateRelease) {
log.trace("Releasing cached DOM reprsentation for parent of {} with propagation set to {}", getElementQName(),
propagateRelease);
- XMLObject parentElement = getParent();
+ final XMLObject parentElement = getParent();
if (parentElement != null) {
parent.releaseDOM();
if (propagateRelease) {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObjectBuilder.java b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObjectBuilder.java
index 85e6ce2..81def60 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObjectBuilder.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObjectBuilder.java
@@ -53,7 +53,7 @@ public abstract class AbstractXMLObjectBuilder<XMLObjectType extends XMLObject>
/** {@inheritDoc} */
@Nonnull public XMLObjectType buildObject(@Nullable final String namespaceURI, @Nonnull final String localName,
@Nullable final String namespacePrefix, @Nullable final QName schemaType) {
- XMLObjectType xmlObject;
+ final XMLObjectType xmlObject;
xmlObject = buildObject(namespaceURI, localName, namespacePrefix);
((AbstractXMLObject) xmlObject).setSchemaType(schemaType);
@@ -63,12 +63,12 @@ public abstract class AbstractXMLObjectBuilder<XMLObjectType extends XMLObject>
/** {@inheritDoc} */
@Nonnull public XMLObjectType buildObject(@Nonnull final Element element) {
- XMLObjectType xmlObject;
+ final XMLObjectType xmlObject;
- String localName = element.getLocalName();
- String nsURI = element.getNamespaceURI();
- String nsPrefix = element.getPrefix();
- QName schemaType = DOMTypeSupport.getXSIType(element);
+ final String localName = element.getLocalName();
+ final String nsURI = element.getNamespaceURI();
+ final String nsPrefix = element.getPrefix();
+ final QName schemaType = DOMTypeSupport.getXSIType(element);
xmlObject = buildObject(nsURI, localName, nsPrefix, schemaType);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java b/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java
index 942240a..2c98505 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java
@@ -116,7 +116,7 @@ public class Namespace {
/** Constructs an XML namespace declaration string representing this namespace. */
protected void constructStringRepresentation() {
- StringBuffer stringRep = new StringBuffer();
+ final StringBuffer stringRep = new StringBuffer();
stringRep.append(XMLConstants.XMLNS_PREFIX);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/NamespaceManager.java b/opensaml-core/src/main/java/org/opensaml/core/xml/NamespaceManager.java
index 70be243..cc6cc95 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/NamespaceManager.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/NamespaceManager.java
@@ -118,7 +118,7 @@ public class NamespaceManager {
* @return the unmodifiable set of namespaces
*/
@Nonnull public Set<Namespace> getNamespaces() {
- Set<Namespace> namespaces = mergeNamespaceCollections(decls, attrNames, attrValues.values());
+ final Set<Namespace> namespaces = mergeNamespaceCollections(decls, attrNames, attrValues.values());
addNamespace(namespaces, getElementNameNamespace());
addNamespace(namespaces, getElementTypeNamespace());
addNamespace(namespaces, contentValue);
@@ -226,7 +226,7 @@ public class NamespaceManager {
* @return the set of non-visibly used namespace prefixes
*/
@Nonnull public Set<String> getNonVisibleNamespacePrefixes() {
- LazySet<String> prefixes = new LazySet<>();
+ final LazySet<String> prefixes = new LazySet<>();
addPrefixes(prefixes, getNonVisibleNamespaces());
return prefixes;
}
@@ -243,14 +243,15 @@ public class NamespaceManager {
* @return the set of non-visibly used namespaces
*/
@Nonnull public Set<Namespace> getNonVisibleNamespaces() {
- LazySet<Namespace> nonVisibleCandidates = new LazySet<>();
+ final LazySet<Namespace> nonVisibleCandidates = new LazySet<>();
// Collect each child's non-visible namespaces
- List<XMLObject> children = getOwner().getOrderedChildren();
+ final List<XMLObject> children = getOwner().getOrderedChildren();
if (children != null) {
- for(XMLObject child : children) {
+ for(final XMLObject child : children) {
if (child != null) {
- Set<Namespace> childNonVisibleNamespaces = child.getNamespaceManager().getNonVisibleNamespaces();
+ final Set<Namespace> childNonVisibleNamespaces =
+ child.getNamespaceManager().getNonVisibleNamespaces();
if (!childNonVisibleNamespaces.isEmpty()) {
nonVisibleCandidates.addAll(childNonVisibleNamespaces);
}
@@ -280,14 +281,14 @@ public class NamespaceManager {
* @return set of all namespaces in scope for the owning object
*/
@Nonnull public Set<Namespace> getAllNamespacesInSubtreeScope() {
- LazySet<Namespace> namespaces = new LazySet<>();
+ final LazySet<Namespace> namespaces = new LazySet<>();
// Collect namespaces for the subtree rooted at each child
- List<XMLObject> children = getOwner().getOrderedChildren();
+ final List<XMLObject> children = getOwner().getOrderedChildren();
if (children != null) {
- for(XMLObject child : children) {
+ for(final XMLObject child : children) {
if (child != null) {
- Set<Namespace> childNamespaces = child.getNamespaceManager().getAllNamespacesInSubtreeScope();
+ final Set<Namespace> childNamespaces = child.getNamespaceManager().getAllNamespacesInSubtreeScope();
if (!childNamespaces.isEmpty()) {
namespaces.addAll(childNamespaces);
}
@@ -296,7 +297,7 @@ public class NamespaceManager {
}
// Collect this node's namespaces.
- for (Namespace myNS : getNamespaces()) {
+ for (final Namespace myNS : getNamespaces()) {
namespaces.add(myNS);
}
@@ -348,7 +349,7 @@ public class NamespaceManager {
*/
@Nullable private Namespace getElementTypeNamespace() {
if (elementType == null) {
- QName type = owner.getSchemaType();
+ final QName type = owner.getSchemaType();
if (type != null && checkQName(type)) {
elementType = buildNamespace(type);
}
@@ -364,9 +365,9 @@ public class NamespaceManager {
*/
@Nonnull private Namespace buildNamespace(@Nonnull final QName name) {
Constraint.isNotNull(name, "QName cannot be null");
- String uri = Constraint.isNotNull(StringSupport.trimOrNull(name.getNamespaceURI()),
+ final String uri = Constraint.isNotNull(StringSupport.trimOrNull(name.getNamespaceURI()),
"Namespace URI of QName cannot be null");
- String prefix = StringSupport.trimOrNull(name.getPrefix());
+ final String prefix = StringSupport.trimOrNull(name.getPrefix());
return new Namespace(uri, prefix);
}
@@ -405,10 +406,10 @@ public class NamespaceManager {
* @return the a new set of merged Namespaces
*/
@Nonnull private Set<Namespace> mergeNamespaceCollections(final Collection<Namespace> ... namespaces) {
- LazySet<Namespace> newNamespaces = new LazySet<>();
+ final LazySet<Namespace> newNamespaces = new LazySet<>();
- for (Collection<Namespace> nsCollection : namespaces) {
- for (Namespace ns : nsCollection) {
+ for (final Collection<Namespace> nsCollection : namespaces) {
+ for (final Namespace ns : nsCollection) {
if (ns != null) {
addNamespace(newNamespaces, ns);
}
@@ -425,7 +426,7 @@ public class NamespaceManager {
* @return the set of visibly-used namespaces
*/
@Nonnull private Set<Namespace> getVisibleNamespaces() {
- LazySet<Namespace> namespaces = new LazySet<>();
+ final LazySet<Namespace> namespaces = new LazySet<>();
// Add namespace from element name.
if (getElementNameNamespace() != null) {
@@ -438,7 +439,7 @@ public class NamespaceManager {
}
// Add namespaces from attribute names
- for (Namespace attribName : attrNames) {
+ for (final Namespace attribName : attrNames) {
if (attribName != null) {
namespaces.add(attribName);
}
@@ -454,7 +455,7 @@ public class NamespaceManager {
* @return the set of non-visibly-used namespaces
*/
@Nonnull private Set<Namespace> getNonVisibleNamespaceCandidates() {
- LazySet<Namespace> namespaces = new LazySet<>();
+ final LazySet<Namespace> namespaces = new LazySet<>();
// Add xsi:type value's prefix, if element carries an xsi:type
if (getElementTypeNamespace() != null) {
@@ -462,7 +463,7 @@ public class NamespaceManager {
}
// Add prefixes from attribute and content values
- for (Namespace attribValue : attrValues.values()) {
+ for (final Namespace attribValue : attrValues.values()) {
if (attribValue != null) {
namespaces.add(attribValue);
}
@@ -483,7 +484,7 @@ public class NamespaceManager {
* @param namespaces the source set of Namespaces
*/
private void addPrefixes(@Nonnull final Set<String> prefixes, @Nonnull final Collection<Namespace> namespaces) {
- for (Namespace ns : namespaces) {
+ for (final Namespace ns : namespaces) {
String prefix = StringSupport.trimOrNull(ns.getNamespacePrefix());
if (prefix == null) {
prefix = DEFAULT_NS_TOKEN;
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/XMLObjectBuilderFactory.java b/opensaml-core/src/main/java/org/opensaml/core/xml/XMLObjectBuilderFactory.java
index bdf732c..8e96a99 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/XMLObjectBuilderFactory.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/XMLObjectBuilderFactory.java
@@ -99,7 +99,7 @@ public class XMLObjectBuilderFactory {
@Nonnull public <XMLObjectType extends XMLObject> XMLObjectBuilder<XMLObjectType> getBuilderOrThrow(
@Nonnull final QName key) {
- XMLObjectBuilder<?> builder = getBuilder(key);
+ final XMLObjectBuilder<?> builder = getBuilder(key);
if (builder == null) {
throw new XMLRuntimeException("Unable to locate a builder for " + key);
}
@@ -121,7 +121,7 @@ public class XMLObjectBuilderFactory {
@Nonnull public <XMLObjectType extends XMLObject> XMLObjectBuilder<XMLObjectType> getBuilderOrThrow(
@Nonnull final Element domElement) {
- XMLObjectBuilder<?> builder = getBuilder(domElement);
+ final XMLObjectBuilder<?> builder = getBuilder(domElement);
if (builder == null) {
throw new XMLRuntimeException("Unable to locate a builder for " + domElement.getLocalName());
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/config/AbstractXMLObjectProviderInitializer.java b/opensaml-core/src/main/java/org/opensaml/core/xml/config/AbstractXMLObjectProviderInitializer.java
index acc4b19..61848d0 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/config/AbstractXMLObjectProviderInitializer.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/config/AbstractXMLObjectProviderInitializer.java
@@ -35,7 +35,7 @@ public abstract class AbstractXMLObjectProviderInitializer implements Initialize
/** {@inheritDoc} */
public void init() throws InitializationException {
try {
- XMLConfigurator configurator = new XMLConfigurator();
+ final XMLConfigurator configurator = new XMLConfigurator();
for (String resource : getConfigResources()) {
// When using ClassLoader.getResourceAsStream() (as below), resource names should *not*
// begin with leading "/". They are always absolute.
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/config/GlobalParserPoolInitializer.java b/opensaml-core/src/main/java/org/opensaml/core/xml/config/GlobalParserPoolInitializer.java
index 040ebb9..c729566 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/config/GlobalParserPoolInitializer.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/config/GlobalParserPoolInitializer.java
@@ -51,7 +51,7 @@ public class GlobalParserPoolInitializer implements Initializer {
/** {@inheritDoc} */
public void init() throws InitializationException {
- BasicParserPool pp = new BasicParserPool();
+ final BasicParserPool pp = new BasicParserPool();
pp.setMaxPoolSize(50);
try {
pp.initialize();
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLConfigurator.java b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLConfigurator.java
index 6eb140a..45be989 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLConfigurator.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLConfigurator.java
@@ -158,7 +158,7 @@ public class XMLConfigurator {
*/
public void load(@Nonnull final InputStream configurationStream) throws XMLConfigurationException {
try {
- Document configuration = parserPool.parse(configurationStream);
+ final Document configuration = parserPool.parse(configurationStream);
load(configuration);
} catch (final XMLParserException e) {
log.error("Invalid configuration file", e);
@@ -197,7 +197,8 @@ public class XMLConfigurator {
*/
protected void load(@Nonnull final Element configurationRoot) throws XMLConfigurationException {
// Initialize object providers
- NodeList objectProviders = configurationRoot.getElementsByTagNameNS(XMLTOOLING_CONFIG_NS, "ObjectProviders");
+ final NodeList objectProviders =
+ configurationRoot.getElementsByTagNameNS(XMLTOOLING_CONFIG_NS, "ObjectProviders");
if (objectProviders.getLength() > 0) {
log.debug("Preparing to load ObjectProviders");
initializeObjectProviders((Element) objectProviders.item(0));
@@ -205,7 +206,8 @@ public class XMLConfigurator {
}
// Initialize ID attributes
- NodeList idAttributesNodes = configurationRoot.getElementsByTagNameNS(XMLTOOLING_CONFIG_NS, "IDAttributes");
+ final NodeList idAttributesNodes =
+ configurationRoot.getElementsByTagNameNS(XMLTOOLING_CONFIG_NS, "IDAttributes");
if (idAttributesNodes.getLength() > 0) {
log.debug("Preparing to load IDAttributes");
initializeIDAttributes((Element) idAttributesNodes.item(0));
@@ -214,7 +216,7 @@ public class XMLConfigurator {
}
/**
- * Intializes the object providers defined in the configuration file.
+ * Initializes the object providers defined in the configuration file.
*
* @param objectProviders the configuration for the various object providers
*
@@ -328,15 +330,15 @@ public class XMLConfigurator {
*/
protected void validateConfiguration(final Document configuration) throws XMLConfigurationException {
try {
- javax.xml.validation.Validator schemaValidator = configurationSchema.newValidator();
+ final javax.xml.validation.Validator schemaValidator = configurationSchema.newValidator();
schemaValidator.validate(new DOMSource(configuration));
} catch (final IOException e) {
// Should never get here as the DOM is already in memory
- String errorMsg = "Unable to read configuration file DOM";
+ final String errorMsg = "Unable to read configuration file DOM";
log.error(errorMsg, e);
throw new XMLConfigurationException(errorMsg, e);
} catch (final SAXException e) {
- String errorMsg = "Configuration file does not validate against schema";
+ final String errorMsg = "Configuration file does not validate against schema";
log.error(errorMsg, e);
throw new XMLConfigurationException(errorMsg, e);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderInitializer.java b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderInitializer.java
index c0dde13..fd8d6eb 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderInitializer.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderInitializer.java
@@ -44,7 +44,7 @@ public class XMLObjectProviderInitializer extends AbstractXMLObjectProviderIniti
public void init() throws InitializationException {
super.init();
- XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
+ final XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
registry.registerIDAttribute(new QName(javax.xml.XMLConstants.XML_NS_URI, "id"));
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderRegistrySupport.java b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderRegistrySupport.java
index 0da08b9..c50a693 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderRegistrySupport.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/config/XMLObjectProviderRegistrySupport.java
@@ -79,7 +79,7 @@ public class XMLObjectProviderRegistrySupport {
public static void registerObjectProvider(@Nonnull final QName providerName,
@Nonnull final XMLObjectBuilder<?> builder, @Nonnull final Marshaller marshaller,
@Nonnull final Unmarshaller unmarshaller) {
- XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
+ final XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
registry.getBuilderFactory().registerBuilder(providerName, builder);
registry.getMarshallerFactory().registerMarshaller(providerName, marshaller);
@@ -92,7 +92,7 @@ public class XMLObjectProviderRegistrySupport {
* @param key the key of the builder, marshaller, and unmarshaller to be removed
*/
public static void deregisterObjectProvider(@Nonnull final QName key) {
- XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
+ final XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
registry.getBuilderFactory().deregisterBuilder(key);
registry.getMarshallerFactory().deregisterMarshaller(key);
registry.getUnmarshallerFactory().deregisterUnmarshaller(key);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
index a66673c..3b5087b 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
@@ -79,12 +79,12 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
@Nonnull public XMLObject unmarshall(@Nonnull final Element domElement) throws UnmarshallingException {
log.trace("Starting to unmarshall DOM element {}", QNameSupport.getNodeQName(domElement));
- XMLObject xmlObject = buildXMLObject(domElement);
+ final XMLObject xmlObject = buildXMLObject(domElement);
if (log.isTraceEnabled()) {
log.trace("Unmarshalling attributes of DOM Element {}", QNameSupport.getNodeQName(domElement));
}
- NamedNodeMap attributes = domElement.getAttributes();
+ final NamedNodeMap attributes = domElement.getAttributes();
Node attribute;
for (int i = 0; i < attributes.getLength(); i++) {
attribute = attributes.item(i);
@@ -141,7 +141,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
xmlObjectBuilder = xmlObjectBuilderFactory.getBuilder(
XMLObjectProviderRegistrySupport.getDefaultProviderQName());
if (xmlObjectBuilder == null) {
- String errorMsg = "Unable to locate builder for " + QNameSupport.getNodeQName(domElement);
+ final String errorMsg = "Unable to locate builder for " + QNameSupport.getNodeQName(domElement);
log.error(errorMsg);
throw new UnmarshallingException(errorMsg);
} else {
@@ -169,9 +169,9 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
*/
protected void unmarshallAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute)
throws UnmarshallingException {
- QName attribName = QNameSupport.getNodeQName(attribute);
+ final QName attribName = QNameSupport.getNodeQName(attribute);
log.trace("Pre-processing attribute {}", attribName);
- String attributeNamespace = StringSupport.trimOrNull(attribute.getNamespaceURI());
+ final String attributeNamespace = StringSupport.trimOrNull(attribute.getNamespaceURI());
if (Objects.equals(attributeNamespace, XMLConstants.XMLNS_NS)) {
unmarshallNamespaceAttribute(xmlObject, attribute);
@@ -182,7 +182,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
log.trace("Attribute {} is neither a schema type nor namespace, calling processAttribute()",
QNameSupport.getNodeQName(attribute));
}
- String attributeNSURI = attribute.getNamespaceURI();
+ final String attributeNSURI = attribute.getNamespaceURI();
String attributeNSPrefix;
if (attributeNSURI != null) {
attributeNSPrefix = attribute.lookupPrefix(attributeNSURI);
@@ -209,7 +209,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject",
QNameSupport.getNodeQName(attribute));
}
- Namespace namespace;
+ final Namespace namespace;
if (Objects.equals(attribute.getLocalName(), XMLConstants.XMLNS_PREFIX)) {
namespace = new Namespace(attribute.getValue(), null);
} else {
@@ -226,7 +226,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
*/
protected void unmarshallSchemaInstanceAttributes(@Nonnull final XMLObject xmlObject,
@Nonnull final Attr attribute) {
- QName attribName = QNameSupport.getNodeQName(attribute);
+ final QName attribName = QNameSupport.getNodeQName(attribute);
if (XMLConstants.XSI_TYPE_ATTRIB_NAME.equals(attribName)) {
if (log.isTraceEnabled()) {
log.trace("Saw XMLObject {} with an xsi:type of: {}", xmlObject.getElementQName(),
@@ -262,7 +262,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
* @param attribute the DOM attribute to be checked
*/
protected void checkIDAttribute(@Nonnull final Attr attribute) {
- QName attribName = QNameSupport.getNodeQName(attribute);
+ final QName attribName = QNameSupport.getNodeQName(attribute);
if (XMLObjectProviderRegistrySupport.isIDAttribute(attribName) && !attribute.isId()) {
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
}
@@ -291,7 +291,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
unmarshaller = unmarshallerFactory.getUnmarshaller(
XMLObjectProviderRegistrySupport.getDefaultProviderQName());
if (unmarshaller == null) {
- String errorMsg =
+ final String errorMsg =
"No unmarshaller available for " + QNameSupport.getNodeQName(childElement) + ", child of "
+ xmlObject.getElementQName();
log.error(errorMsg);
@@ -323,7 +323,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
*/
protected void unmarshallTextContent(@Nonnull final XMLObject xmlObject, @Nonnull final Text content)
throws UnmarshallingException {
- String textContent = StringSupport.trimOrNull(content.getWholeText());
+ final String textContent = StringSupport.trimOrNull(content.getWholeText());
if (textContent != null) {
processElementContent(xmlObject, textContent);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/persist/FilesystemLoadSaveManager.java b/opensaml-core/src/main/java/org/opensaml/core/xml/persist/FilesystemLoadSaveManager.java
index 82f3063..fb32abb 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/persist/FilesystemLoadSaveManager.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/persist/FilesystemLoadSaveManager.java
@@ -141,9 +141,9 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
/** {@inheritDoc} */
public Set<String> listKeys() throws IOException {
- File[] files = baseDirectory.listFiles(fileFilter);
- HashSet<String> keys = new HashSet<>();
- for (File file : files) {
+ final File[] files = baseDirectory.listFiles(fileFilter);
+ final HashSet<String> keys = new HashSet<>();
+ for (final File file : files) {
keys.add(file.getName());
}
return Collections.unmodifiableSet(keys);
@@ -161,13 +161,13 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
/** {@inheritDoc} */
public T load(final String key) throws IOException {
- File file = buildFile(key);
+ final File file = buildFile(key);
if (!file.exists()) {
log.debug("Target file with key '{}' does not exist, path: {}", key, file.getAbsolutePath());
return null;
}
try (final FileInputStream fis = new FileInputStream(file)) {
- byte[] source = ByteStreams.toByteArray(fis);
+ final byte[] source = ByteStreams.toByteArray(fis);
try (final ByteArrayInputStream bais = new ByteArrayInputStream(source)) {
final XMLObject xmlObject = XMLObjectSupport.unmarshallFromInputStream(parserPool, bais);
xmlObject.getObjectMetadata().put(new XMLObjectSource(source));
@@ -192,12 +192,12 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
String.format("Target file already exists for key '%s' and overwrite not indicated", key));
}
- File file = buildFile(key);
+ final File file = buildFile(key);
try (FileOutputStream fos = new FileOutputStream(file)) {
- List<XMLObjectSource> sources = xmlObject.getObjectMetadata().get(XMLObjectSource.class);
+ final List<XMLObjectSource> sources = xmlObject.getObjectMetadata().get(XMLObjectSource.class);
if (sources.size() == 1) {
log.debug("XMLObject contained 1 XMLObjectSource instance, persisting existing byte[]");
- XMLObjectSource source = sources.get(0);
+ final XMLObjectSource source = sources.get(0);
fos.write(source.getObjectSource());
} else {
log.debug("XMLObject contained {} XMLObjectSource instances, persisting marshalled object",
@@ -215,9 +215,9 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
/** {@inheritDoc} */
public boolean remove(final String key) throws IOException {
- File file = buildFile(key);
+ final File file = buildFile(key);
if (file.exists()) {
- boolean success = file.delete();
+ final boolean success = file.delete();
if (success) {
return true;
} else {
@@ -230,12 +230,12 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
/** {@inheritDoc} */
public boolean updateKey(final String currentKey, final String newKey) throws IOException {
- File currentFile = buildFile(currentKey);
+ final File currentFile = buildFile(currentKey);
if (!currentFile.exists()) {
return false;
}
- File newFile = buildFile(newKey);
+ final File newFile = buildFile(newKey);
if (newFile.exists()) {
throw new IOException(String.format("Specified new key already exists: %s", newKey));
} else {
@@ -252,7 +252,7 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
* @throws IOException if there is a fatal error constructing or evaluating the candidate target path
*/
protected File buildFile(final String key) throws IOException {
- File path = new File(baseDirectory,
+ final File path = new File(baseDirectory,
Constraint.isNotNull(StringSupport.trimOrNull(key), "Input key was null or empty"));
if (path.exists() && !path.isFile()) {
throw new IOException(String.format("Path exists based on specified key, but is not a file: %s",
@@ -319,7 +319,7 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
* @param filenames Snapshot of filesystem keys at time of construction
*/
public FileIterator(@Nonnull final Collection<String> filenames) {
- Set<String> keys = new HashSet<>();
+ final Set<String> keys = new HashSet<>();
keys.addAll(Collections2.filter(filenames, Predicates.notNull()));
keysIter = keys.iterator();
}
@@ -338,11 +338,11 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
/** {@inheritDoc} */
public Pair<String, T> next() {
if (current != null) {
- Pair<String, T> temp = current;
+ final Pair<String, T> temp = current;
current = null;
return temp;
} else {
- Pair<String, T> temp = getNext();
+ final Pair<String, T> temp = getNext();
if (temp != null) {
return temp;
} else {
@@ -364,9 +364,9 @@ public class FilesystemLoadSaveManager<T extends XMLObject> implements XMLObject
*/
private Pair<String, T> getNext() {
while (keysIter.hasNext()) {
- String key = keysIter.next();
+ final String key = keysIter.next();
try {
- T xmlObject = load(key);
+ final T xmlObject = load(key);
if (xmlObject != null) {
// This is to defensively guard against files being removed after files/keys are enumerated.
// Don't fail, just skip
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/persist/MapLoadSaveManager.java b/opensaml-core/src/main/java/org/opensaml/core/xml/persist/MapLoadSaveManager.java
index 4bb2e20..81149cc 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/persist/MapLoadSaveManager.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/persist/MapLoadSaveManager.java
@@ -63,8 +63,8 @@ public class MapLoadSaveManager<T extends XMLObject> implements XMLObjectLoadSav
/** {@inheritDoc} */
public Iterable<Pair<String, T>> listAll() throws IOException {
- ArrayList<Pair<String,T>> list = new ArrayList<>();
- for (String key : listKeys()) {
+ final ArrayList<Pair<String,T>> list = new ArrayList<>();
+ for (final String key : listKeys()) {
list.add(new Pair<>(key, load(key)));
}
return list;
@@ -101,7 +101,7 @@ public class MapLoadSaveManager<T extends XMLObject> implements XMLObjectLoadSav
/** {@inheritDoc} */
public boolean updateKey(final String currentKey, final String newKey) throws IOException {
- T value = load(currentKey);
+ final T value = load(currentKey);
if (value != null) {
save(newKey, value, false);
remove(currentKey);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSBooleanValue.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSBooleanValue.java
index 70750e4..b4b60d3 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSBooleanValue.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSBooleanValue.java
@@ -91,7 +91,7 @@ public class XSBooleanValue {
/** {@inheritDoc} */
@Override
public int hashCode(){
- int hash;
+ final int hash;
if(numeric){
if(value == null){
hash = 0;
@@ -170,7 +170,7 @@ public class XSBooleanValue {
* @return the boolean value
*/
public static XSBooleanValue valueOf(@Nullable final String booleanString) {
- String trimmedBooleanString = StringSupport.trimOrNull(booleanString);
+ final String trimmedBooleanString = StringSupport.trimOrNull(booleanString);
if (trimmedBooleanString != null) {
if ("1".equals(trimmedBooleanString)) {
return new XSBooleanValue(Boolean.TRUE, true);
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyMarshaller.java
index ac626ed..9084850 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyMarshaller.java
@@ -42,10 +42,10 @@ public class XSAnyMarshaller extends AbstractXMLObjectMarshaller {
@Override
protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- XSAny xsAny = (XSAny) xmlObject;
+ final XSAny xsAny = (XSAny) xmlObject;
Attr attribute;
- for (Entry<QName, String> entry : xsAny.getUnknownAttributes().entrySet()) {
+ for (final Entry<QName, String> entry : xsAny.getUnknownAttributes().entrySet()) {
attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
@@ -60,7 +60,7 @@ public class XSAnyMarshaller extends AbstractXMLObjectMarshaller {
@Override
protected void marshallElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- XSAny xsAny = (XSAny) xmlObject;
+ final XSAny xsAny = (XSAny) xmlObject;
if (xsAny.getTextContent() != null) {
ElementSupport.appendTextContent(domElement, xsAny.getTextContent());
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyUnmarshaller.java
index b25f03b..f12fcff 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSAnyUnmarshaller.java
@@ -37,7 +37,7 @@ public class XSAnyUnmarshaller extends AbstractXMLObjectUnmarshaller {
@Override
protected void processChildElement(@Nonnull final XMLObject parentXMLObject,
@Nonnull final XMLObject childXMLObject) throws UnmarshallingException {
- XSAny xsAny = (XSAny) parentXMLObject;
+ final XSAny xsAny = (XSAny) parentXMLObject;
xsAny.getUnknownXMLObjects().add(childXMLObject);
}
@@ -46,9 +46,9 @@ public class XSAnyUnmarshaller extends AbstractXMLObjectUnmarshaller {
@Override
protected void processAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute)
throws UnmarshallingException {
- XSAny xsAny = (XSAny) xmlObject;
+ final XSAny xsAny = (XSAny) xmlObject;
- QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(),
+ final QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(),
attribute.getPrefix());
if (attribute.isId()) {
@@ -61,7 +61,7 @@ public class XSAnyUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
@Override
protected void processElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final String elementContent) {
- XSAny xsAny = (XSAny) xmlObject;
+ final XSAny xsAny = (XSAny) xmlObject;
xsAny.setTextContent(elementContent);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryMarshaller.java
index f317d00..d8b7dfe 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryMarshaller.java
@@ -43,7 +43,7 @@ public class XSBase64BinaryMarshaller extends AbstractXMLObjectMarshaller {
@Override
protected void marshallElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- XSBase64Binary xsBase64Binary = (XSBase64Binary) xmlObject;
+ final XSBase64Binary xsBase64Binary = (XSBase64Binary) xmlObject;
ElementSupport.appendTextContent(domElement, xsBase64Binary.getValue());
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryUnmarshaller.java
index 08e51a8..e5c2938 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBase64BinaryUnmarshaller.java
@@ -49,7 +49,7 @@ public class XSBase64BinaryUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
@Override
protected void processElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final String elementContent) {
- XSBase64Binary xsBase64Binary = (XSBase64Binary) xmlObject;
+ final XSBase64Binary xsBase64Binary = (XSBase64Binary) xmlObject;
xsBase64Binary.setValue(StringSupport.trimOrNull(elementContent));
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanMarshaller.java
index c657db2..5b873e8 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanMarshaller.java
@@ -41,7 +41,7 @@ public class XSBooleanMarshaller extends AbstractXMLObjectMarshaller {
@Override
protected void marshallElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- XSBoolean xsiBoolean = (XSBoolean) xmlObject;
+ final XSBoolean xsiBoolean = (XSBoolean) xmlObject;
if (xsiBoolean.getValue() != null && xsiBoolean.getValue().getValue() != null) {
ElementSupport.appendTextContent(domElement, xsiBoolean.getValue().getValue().toString());
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanUnmarshaller.java
index 3e8e0e5..0c4b7b5 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSBooleanUnmarshaller.java
@@ -46,7 +46,7 @@ public class XSBooleanUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
@Override
protected void processElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final String elementContent) {
- XSBoolean xsiBoolean = (XSBoolean) xmlObject;
+ final XSBoolean xsiBoolean = (XSBoolean) xmlObject;
xsiBoolean.setValue(XSBooleanValue.valueOf(elementContent));
}
}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
index 410e6d0..64e44f4 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
@@ -36,7 +36,7 @@ public class XSDateTimeMarshaller extends BaseXMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
throws MarshallingException {
- XSDateTime xsDateTime = (XSDateTime) xmlObject;
+ final XSDateTime xsDateTime = (XSDateTime) xmlObject;
ElementSupport.appendTextContent(domElement, xsDateTime.getDateTimeFormatter().print(xsDateTime.getValue()));
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
index 8199659..159d54e 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
@@ -33,7 +33,7 @@ public class XSDateTimeUnmarshaller extends BaseXMLObjectUnmarshaller{
/** {@inheritDoc} */
protected void processElementContent(final XMLObject xmlObject, final String elementContent) {
- XSDateTime xsDateTime = (XSDateTime) xmlObject;
+ final XSDateTime xsDateTime = (XSDateTime) xmlObject;
xsDateTime.setValue(new DateTime(elementContent).withChronology(ISOChronology.getInstanceUTC()));
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerMarshaller.java
index 7d80d20..93cf09a 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerMarshaller.java
@@ -38,7 +38,7 @@ public class XSIntegerMarshaller extends AbstractXMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
throws MarshallingException {
- XSInteger xsiInteger = (XSInteger) xmlObject;
+ final XSInteger xsiInteger = (XSInteger) xmlObject;
if (xsiInteger.getValue() != null) {
ElementSupport.appendTextContent(domElement, xsiInteger.getValue().toString());
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerUnmarshaller.java
index bbe05ef..d3d1f0e 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSIntegerUnmarshaller.java
@@ -41,7 +41,7 @@ public class XSIntegerUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void processElementContent(final XMLObject xmlObject, final String elementContent) {
- XSInteger xsiInteger = (XSInteger) xmlObject;
+ final XSInteger xsiInteger = (XSInteger) xmlObject;
if (elementContent != null) {
xsiInteger.setValue(Integer.valueOf(elementContent.trim()));
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameMarshaller.java
index ed2f725..f4aadde 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameMarshaller.java
@@ -39,7 +39,7 @@ public class XSQNameMarshaller extends AbstractXMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
throws MarshallingException {
- XSQName qname = (XSQName) xmlObject;
+ final XSQName qname = (XSQName) xmlObject;
ElementSupport.appendTextContent(domElement, QNameSupport.qnameToContentString(qname.getValue()));
}
}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameUnmarshaller.java
index 061fcc4..11b364e 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSQNameUnmarshaller.java
@@ -51,9 +51,9 @@ public class XSQNameUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void unmarshallTextContent(final XMLObject xmlObject, final Text content) throws UnmarshallingException {
- String textContent = StringSupport.trimOrNull(content.getWholeText());
+ final String textContent = StringSupport.trimOrNull(content.getWholeText());
if (textContent != null) {
- XSQName qname = (XSQName) xmlObject;
+ final XSQName qname = (XSQName) xmlObject;
qname.setValue(QNameSupport.constructQName(ElementSupport.getElementAncestor(content), textContent));
}
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringMarshaller.java
index a819db4..d1cafcf 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringMarshaller.java
@@ -38,7 +38,7 @@ public class XSStringMarshaller extends AbstractXMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
throws MarshallingException {
- XSString xsiString = (XSString) xmlObject;
+ final XSString xsiString = (XSString) xmlObject;
ElementSupport.appendTextContent(domElement, xsiString.getValue());
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringUnmarshaller.java
index ed27198..40af87b 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSStringUnmarshaller.java
@@ -41,7 +41,7 @@ public class XSStringUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void processElementContent(final XMLObject xmlObject, final String elementContent) {
- XSString xsiString = (XSString) xmlObject;
+ final XSString xsiString = (XSString) xmlObject;
xsiString.setValue(elementContent);
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIMarshaller.java
index 233f10a..b46ff79 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIMarshaller.java
@@ -38,7 +38,7 @@ public class XSURIMarshaller extends AbstractXMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
throws MarshallingException {
- XSURI uri = (XSURI) xmlObject;
+ final XSURI uri = (XSURI) xmlObject;
ElementSupport.appendTextContent(domElement, uri.getValue());
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIUnmarshaller.java
index 37a99aa..10c62dd 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSURIUnmarshaller.java
@@ -41,7 +41,7 @@ public class XSURIUnmarshaller extends AbstractXMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void processElementContent(final XMLObject xmlObject, final String elementContent) {
- XSURI uri = (XSURI) xmlObject;
+ final XSURI uri = (XSURI) xmlObject;
uri.setValue(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/AbstractWrappedSingletonFactory.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/AbstractWrappedSingletonFactory.java
index ab7a1cb..d42aa8c 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/AbstractWrappedSingletonFactory.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/AbstractWrappedSingletonFactory.java
@@ -115,7 +115,7 @@ public abstract class AbstractWrappedSingletonFactory<Input, Output>
* @return an output class instance
*/
public synchronized Output getInstance(final Input input) {
- Output output = super.getInstance(input);
+ final Output output = super.getInstance(input);
if (explicitRelease && output != null) {
log.trace("Explicit release was indicated, registering output instance to inhibit garbage collection");
@@ -179,7 +179,7 @@ public abstract class AbstractWrappedSingletonFactory<Input, Output>
* </p>
*/
protected synchronized Output get(final Input input) {
- WeakReference<Output> outputRef = map.get(input);
+ final WeakReference<Output> outputRef = map.get(input);
if (outputRef != null) {
log.trace("Input key mapped to a non-null WeakReference");
if (outputRef.get() != null) {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/AttributeMap.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/AttributeMap.java
index db168bd..ebf71fa 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/AttributeMap.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/AttributeMap.java
@@ -86,7 +86,7 @@ public class AttributeMap implements Map<QName, String> {
/** {@inheritDoc} */
public String put(final QName attributeName, final String value) {
Constraint.isNotNull(attributeName, "Attribute name cannot be null");
- String oldValue = get(attributeName);
+ final String oldValue = get(attributeName);
if (!Objects.equals(value, oldValue)) {
releaseDOM();
attributes.put(attributeName, value);
@@ -119,7 +119,7 @@ public class AttributeMap implements Map<QName, String> {
*/
public QName put(final QName attributeName, final QName value) {
Constraint.isNotNull(attributeName, "Attribute name cannot be null");
- String oldValueString = get(attributeName);
+ final String oldValueString = get(attributeName);
QName oldValue = null;
if (!Strings.isNullOrEmpty(oldValueString)) {
@@ -130,7 +130,7 @@ public class AttributeMap implements Map<QName, String> {
releaseDOM();
if (value != null) {
// new value is not null, old value was either null or non-equal
- String newStringValue = constructAttributeValue(value);
+ final String newStringValue = constructAttributeValue(value);
attributes.put(attributeName, newStringValue);
registerQNameValue(attributeName, value);
attributeOwner.getNamespaceManager().registerAttributeName(attributeName);
@@ -146,9 +146,9 @@ public class AttributeMap implements Map<QName, String> {
/** {@inheritDoc} */
public void clear() {
- LazySet<QName> keys = new LazySet<>();
+ final LazySet<QName> keys = new LazySet<>();
keys.addAll(attributes.keySet());
- for (QName attributeName : keys) {
+ for (final QName attributeName : keys) {
remove(attributeName);
}
}
@@ -189,10 +189,10 @@ public class AttributeMap implements Map<QName, String> {
/** {@inheritDoc} */
public String remove(final Object key) {
- String removedValue = attributes.remove(key);
+ final String removedValue = attributes.remove(key);
if (removedValue != null) {
releaseDOM();
- QName attributeName = (QName) key;
+ final QName attributeName = (QName) key;
if (isIDAttribute(attributeName) || XMLObjectProviderRegistrySupport.isIDAttribute(attributeName)) {
attributeOwner.getIDIndex().deregisterIDMapping(removedValue);
}
@@ -206,7 +206,7 @@ public class AttributeMap implements Map<QName, String> {
/** {@inheritDoc} */
public void putAll(final Map<? extends QName, ? extends String> t) {
if (t != null && t.size() > 0) {
- for (Entry<? extends QName, ? extends String> entry : t.entrySet()) {
+ for (final Entry<? extends QName, ? extends String> entry : t.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
@@ -345,7 +345,7 @@ public class AttributeMap implements Map<QName, String> {
return;
}
- QName qnameValue = checkQName(attributeName, attributeValue);
+ final QName qnameValue = checkQName(attributeName, attributeValue);
if (qnameValue != null) {
log.trace("Attribute '{}' with value '{}' was evaluated to be QName type",
attributeName, attributeValue);
@@ -368,7 +368,7 @@ public class AttributeMap implements Map<QName, String> {
return;
}
- String attributeID = NamespaceManager.generateAttributeID(attributeName);
+ final String attributeID = NamespaceManager.generateAttributeID(attributeName);
log.trace("Registering QName attribute value '{}' under attibute ID '{}'",
attributeValue, attributeID);
attributeOwner.getNamespaceManager().registerAttributeValue(attributeID, attributeValue);
@@ -386,7 +386,7 @@ public class AttributeMap implements Map<QName, String> {
return;
}
- QName qnameValue = checkQName(attributeName, attributeValue);
+ final QName qnameValue = checkQName(attributeName, attributeValue);
if (qnameValue != null) {
log.trace("Attribute '{}' with value '{}' was evaluated to be QName type",
attributeName, attributeValue);
@@ -403,7 +403,7 @@ public class AttributeMap implements Map<QName, String> {
* @param attributeName the attribute name whose QName attribute value should be deregistered
*/
private void deregisterQNameValue(final QName attributeName) {
- String attributeID = NamespaceManager.generateAttributeID(attributeName);
+ final String attributeID = NamespaceManager.generateAttributeID(attributeName);
log.trace("Deregistering QName attribute with attibute ID '{}'", attributeID);
attributeOwner.getNamespaceManager().deregisterAttributeValue(attributeID);
}
@@ -427,7 +427,7 @@ public class AttributeMap implements Map<QName, String> {
log.trace("Configuration indicates attribute with name '{}' is a QName type, resolving value QName",
attributeName);
// Do support the default namespace in this scenario, since we know it should be a QName
- QName valueName = resolveQName(attributeValue, true);
+ final QName valueName = resolveQName(attributeValue, true);
if (valueName != null) {
log.trace("Successfully resolved attribute value to QName: {}", valueName);
} else {
@@ -438,7 +438,7 @@ public class AttributeMap implements Map<QName, String> {
log.trace("Attempting to infer whether attribute value is a QName");
// Do not support the default namespace in this scenario, since we're trying to infer.
// Better to fail to resolve than to infer a bogus QName value.
- QName valueName = resolveQName(attributeValue, false);
+ final QName valueName = resolveQName(attributeValue, false);
if (valueName != null) {
log.trace("Resolved attribute as a QName: '{}'", valueName);
} else {
@@ -471,7 +471,7 @@ public class AttributeMap implements Map<QName, String> {
// this candidate prefix into a namespace URI.
String candidatePrefix = null;
String localPart = null;
- int ci = attributeValue.indexOf(':');
+ final int ci = attributeValue.indexOf(':');
if (ci > -1) {
candidatePrefix = attributeValue.substring(0, ci);
log.trace("Evaluating candiate namespace prefix '{}'", candidatePrefix);
@@ -490,10 +490,10 @@ public class AttributeMap implements Map<QName, String> {
log.trace("Evaluated QName local part as '{}'", localPart);
- String nsURI = XMLObjectSupport.lookupNamespaceURI(attributeOwner, candidatePrefix);
+ final String nsURI = XMLObjectSupport.lookupNamespaceURI(attributeOwner, candidatePrefix);
log.trace("Resolved namespace URI '{}'", nsURI);
if (nsURI != null) {
- QName name = QNameSupport.constructQName(nsURI, localPart, candidatePrefix);
+ final QName name = QNameSupport.constructQName(nsURI, localPart, candidatePrefix);
log.trace("Resolved QName '{}'", name);
return name;
} else {
@@ -512,14 +512,14 @@ public class AttributeMap implements Map<QName, String> {
* @return the attribute value string representation of the QName
*/
private String constructAttributeValue(final QName attributeValue) {
- String trimmedLocalName = StringSupport.trimOrNull(attributeValue.getLocalPart());
+ final String trimmedLocalName = StringSupport.trimOrNull(attributeValue.getLocalPart());
if (trimmedLocalName == null) {
throw new IllegalArgumentException("Local name may not be null or empty");
}
- String qualifiedName;
- String trimmedPrefix = StringSupport.trimOrNull(attributeValue.getPrefix());
+ final String qualifiedName;
+ final String trimmedPrefix = StringSupport.trimOrNull(attributeValue.getPrefix());
if (trimmedPrefix != null) {
qualifiedName = trimmedPrefix + ":" + StringSupport.trimOrNull(trimmedLocalName);
} else {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/IDIndex.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/IDIndex.java
index c67f6ac..3822c60 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/IDIndex.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/IDIndex.java
@@ -117,7 +117,7 @@ public class IDIndex {
return;
}
- for (String id : idIndex.getIDs()) {
+ for (final String id : idIndex.getIDs()) {
idMappings.remove(id);
}
if (owner.hasParent()) {
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/IndexedXMLObjectChildrenList.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/IndexedXMLObjectChildrenList.java
index c0b23ac..4e428bd 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/IndexedXMLObjectChildrenList.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/IndexedXMLObjectChildrenList.java
@@ -124,7 +124,7 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
return;
}
- QName type = element.getSchemaType();
+ final QName type = element.getSchemaType();
if (type != null) {
indexElement(type, element);
}
@@ -139,7 +139,7 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
* @param element the element to be indexed
*/
protected void indexElement(@Nonnull final QName index, @Nullable final ElementType element) {
- List<ElementType> objects = get(index);
+ final List<ElementType> objects = get(index);
objects.add(element);
}
@@ -153,7 +153,7 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
@Override
public boolean remove(@Nullable final ElementType element) {
- boolean elementRemoved = super.remove(element);
+ final boolean elementRemoved = super.remove(element);
if (elementRemoved) {
removeElementFromIndex(element);
}
@@ -164,7 +164,7 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
/** {@inheritDoc} */
@Override
@Nonnull public ElementType remove(final int index) {
- ElementType returnValue = super.remove(index);
+ final ElementType returnValue = super.remove(index);
removeElementFromIndex(returnValue);
@@ -182,7 +182,7 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
return;
}
- QName type = element.getSchemaType();
+ final QName type = element.getSchemaType();
if (type != null) {
removeElementFromIndex(type, element);
}
@@ -197,14 +197,14 @@ public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends
* @param element the element to be removed from that index
*/
protected void removeElementFromIndex(@Nonnull final QName index, @Nullable final ElementType element) {
- List<ElementType> objects = get(index);
+ final List<ElementType> objects = get(index);
objects.remove(element);
}
/** {@inheritDoc} */
@Override
@Nullable public ElementType set(final int index, @Nullable final ElementType element) {
- ElementType returnValue = super.set(index, element);
+ final ElementType returnValue = super.set(index, element);
removeElementFromIndex(returnValue);
@@ -261,7 +261,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
/** {@inheritDoc} */
@Override
public boolean add(@Nullable final ElementType o) {
- boolean result = backingList.add(o);
+ final boolean result = backingList.add(o);
indexList = backingList.get(index);
return result;
}
@@ -275,7 +275,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
/** {@inheritDoc} */
@Override
public boolean addAll(@Nonnull final Collection<? extends ElementType> c) {
- boolean result = backingList.addAll(c);
+ final boolean result = backingList.addAll(c);
indexList = backingList.get(index);
return result;
}
@@ -290,7 +290,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
@Override
public void clear() {
// Create a copy of the current list to avoid a potential concurrent modification error.
- LazyList<ElementType> copy = new LazyList<>();
+ final LazyList<ElementType> copy = new LazyList<>();
copy.addAll(indexList);
backingList.removeAll(copy);
indexList = backingList.get(index);
@@ -347,7 +347,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
/** {@inheritDoc} */
@Override
public boolean remove(@Nullable final Object o) {
- boolean result = backingList.remove(o);
+ final boolean result = backingList.remove(o);
indexList = backingList.get(index);
return result;
}
@@ -355,7 +355,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
/** {@inheritDoc} */
@Override
public boolean removeAll(final Collection<?> c) {
- boolean result = backingList.removeAll(c);
+ final boolean result = backingList.removeAll(c);
indexList = backingList.get(index);
return result;
}
@@ -363,7 +363,7 @@ class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
/** {@inheritDoc} */
@Override
public boolean retainAll(final Collection<?> c) {
- boolean result = backingList.retainAll(c);
+ final boolean result = backingList.retainAll(c);
indexList = backingList.get(index);
return result;
}
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectChildrenList.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectChildrenList.java
index bccb11d..f03b880 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectChildrenList.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectChildrenList.java
@@ -123,7 +123,7 @@ public class XMLObjectChildrenList<ElementType extends XMLObject> extends Abstra
setParent(element);
- ElementType removedElement = elements.set(index, element);
+ final ElementType removedElement = elements.set(index, element);
if (removedElement != null) {
removedElement.setParent(null);
parent.getIDIndex().deregisterIDMappings(removedElement.getIDIndex());
@@ -162,7 +162,7 @@ public class XMLObjectChildrenList<ElementType extends XMLObject> extends Abstra
/** {@inheritDoc} */
@Nonnull public ElementType remove(final int index) {
- ElementType element = elements.remove(index);
+ final ElementType element = elements.remove(index);
if (element != null) {
element.releaseParentDOM(true);
@@ -183,7 +183,7 @@ public class XMLObjectChildrenList<ElementType extends XMLObject> extends Abstra
*/
public boolean remove(@Nullable final ElementType element) {
- boolean elementRemoved = elements.remove(element);
+ final boolean elementRemoved = elements.remove(element);
if (elementRemoved) {
if (element != null) {
element.releaseParentDOM(true);
@@ -205,7 +205,7 @@ public class XMLObjectChildrenList<ElementType extends XMLObject> extends Abstra
* @param element the element to set the parent on
*/
protected void setParent(@Nonnull final ElementType element) {
- XMLObject elemParent = element.getParent();
+ final XMLObject elemParent = element.getParent();
if (elemParent != null && elemParent != parent) {
throw new IllegalArgumentException(element.getElementQName()
+ " is already the child of another XMLObject and may not be inserted into this list");
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
index cbb09b1..0938a42 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
@@ -182,7 +182,7 @@ public final class XMLObjectSupport {
switch (cloneOutputOption) {
case RootDOMInNewDocument:
try {
- Document newDocument = XMLObjectProviderRegistrySupport.getParserPool().newDocument();
+ final Document newDocument = XMLObjectProviderRegistrySupport.getParserPool().newDocument();
// Note: importNode copies the node tree and does not modify the source document
clonedElement = (Element) newDocument.importNode(origElement, true);
newDocument.appendChild(clonedElement);
@@ -223,12 +223,12 @@ public final class XMLObjectSupport {
*/
public static XMLObject unmarshallFromInputStream(final ParserPool parserPool, final InputStream inputStream)
throws XMLParserException, UnmarshallingException {
- Logger log = getLogger();
+ final Logger log = getLogger();
log.debug("Parsing InputStream into DOM document");
try {
- Document messageDoc = parserPool.parse(inputStream);
- Element messageElem = messageDoc.getDocumentElement();
+ final Document messageDoc = parserPool.parse(inputStream);
+ final Element messageElem = messageDoc.getDocumentElement();
if (log.isTraceEnabled()) {
log.trace("Resultant DOM message was:");
@@ -236,7 +236,7 @@ public final class XMLObjectSupport {
}
log.debug("Unmarshalling DOM parsed from InputStream");
- Unmarshaller unmarshaller = getUnmarshaller(messageElem);
+ final Unmarshaller unmarshaller = getUnmarshaller(messageElem);
if (unmarshaller == null) {
log.error("Unable to unmarshall InputStream, no unmarshaller registered for element "
+ QNameSupport.getNodeQName(messageElem));
@@ -245,7 +245,7 @@ public final class XMLObjectSupport {
+ QNameSupport.getNodeQName(messageElem));
}
- XMLObject message = unmarshaller.unmarshall(messageElem);
+ final XMLObject message = unmarshaller.unmarshall(messageElem);
log.debug("InputStream succesfully unmarshalled");
return message;
@@ -265,13 +265,13 @@ public final class XMLObjectSupport {
*/
public static XMLObject unmarshallFromReader(final ParserPool parserPool, final Reader reader)
throws XMLParserException, UnmarshallingException {
- Logger log = getLogger();
+ final Logger log = getLogger();
log.debug("Parsing Reader into DOM document");
try {
- Document messageDoc = parserPool.parse(reader);
- Element messageElem = messageDoc.getDocumentElement();
+ final Document messageDoc = parserPool.parse(reader);
+ final Element messageElem = messageDoc.getDocumentElement();
if (log.isTraceEnabled()) {
log.trace("Resultant DOM message was:");
@@ -279,7 +279,7 @@ public final class XMLObjectSupport {
}
log.debug("Unmarshalling DOM parsed from Reader");
- Unmarshaller unmarshaller = getUnmarshaller(messageElem);
+ final Unmarshaller unmarshaller = getUnmarshaller(messageElem);
if (unmarshaller == null) {
log.error("Unable to unmarshall Reader, no unmarshaller registered for element "
+ QNameSupport.getNodeQName(messageElem));
@@ -288,7 +288,7 @@ public final class XMLObjectSupport {
+ QNameSupport.getNodeQName(messageElem));
}
- XMLObject message = unmarshaller.unmarshall(messageElem);
+ final XMLObject message = unmarshaller.unmarshall(messageElem);
log.debug("Reader succesfully unmarshalled");
return message;
@@ -306,7 +306,7 @@ public final class XMLObjectSupport {
* @throws MarshallingException if there is a problem marshalling the XMLObject
*/
@Nonnull public static Element marshall(@Nonnull final XMLObject xmlObject) throws MarshallingException {
- Logger log = getLogger();
+ final Logger log = getLogger();
log.debug("Marshalling XMLObject");
if (xmlObject.getDOM() != null) {
@@ -314,7 +314,7 @@ public final class XMLObjectSupport {
return xmlObject.getDOM();
}
- Marshaller marshaller = getMarshaller(xmlObject);
+ final Marshaller marshaller = getMarshaller(xmlObject);
if (marshaller == null) {
log.error("Unable to marshall XMLObject, no marshaller registered for object: "
+ xmlObject.getElementQName());
@@ -322,7 +322,7 @@ public final class XMLObjectSupport {
+ xmlObject.getElementQName());
}
- Element messageElem = marshaller.marshall(xmlObject);
+ final Element messageElem = marshaller.marshall(xmlObject);
if (log.isTraceEnabled()) {
log.trace("Marshalled XMLObject into DOM:");
@@ -341,7 +341,7 @@ public final class XMLObjectSupport {
*/
public static void marshallToOutputStream(final XMLObject xmlObject, final OutputStream outputStream)
throws MarshallingException {
- Element element = marshall(xmlObject);
+ final Element element = marshall(xmlObject);
SerializeSupport.writeNode(element, outputStream);
}
@@ -357,7 +357,7 @@ public final class XMLObjectSupport {
XMLObject current = xmlObject;
while (current != null) {
- for (Namespace ns : current.getNamespaces()) {
+ for (final Namespace ns : current.getNamespaces()) {
if (Objects.equals(ns.getNamespacePrefix(), prefix)) {
return ns.getNamespaceURI();
}
@@ -380,7 +380,7 @@ public final class XMLObjectSupport {
XMLObject current = xmlObject;
while (current != null) {
- for (Namespace ns : current.getNamespaces()) {
+ for (final Namespace ns : current.getNamespaces()) {
if (Objects.equals(ns.getNamespaceURI(), namespaceURI)) {
return ns.getNamespacePrefix();
}
@@ -428,8 +428,8 @@ public final class XMLObjectSupport {
*/
public static void marshallAttribute(final QName attributeName, final String attributeValue,
final Element domElement, final boolean isIDAttribute) {
- Document document = domElement.getOwnerDocument();
- Attr attribute = AttributeSupport.constructAttribute(document, attributeName);
+ final Document document = domElement.getOwnerDocument();
+ final Attr attribute = AttributeSupport.constructAttribute(document, attributeName);
attribute.setValue(attributeValue);
domElement.setAttributeNodeNS(attribute);
if (isIDAttribute) {
@@ -444,9 +444,9 @@ public final class XMLObjectSupport {
* @param domElement the target Element
*/
public static void marshallAttributeMap(final AttributeMap attributeMap, final Element domElement) {
- Document document = domElement.getOwnerDocument();
+ final Document document = domElement.getOwnerDocument();
Attr attribute = null;
- for (Entry<QName, String> entry : attributeMap.entrySet()) {
+ for (final Entry<QName, String> entry : attributeMap.entrySet()) {
attribute = AttributeSupport.constructAttribute(document, entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
@@ -464,8 +464,8 @@ public final class XMLObjectSupport {
* @param attribute the target DOM Attr
*/
public static void unmarshallToAttributeMap(final AttributeMap attributeMap, final Attr attribute) {
- QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
- .getPrefix());
+ final QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(),
+ attribute.getPrefix());
attributeMap.put(attribQName, attribute.getValue());
if (attribute.isId() || XMLObjectProviderRegistrySupport.isIDAttribute(attribQName)) {
attributeMap.registerID(attribQName);
@@ -480,7 +480,7 @@ public final class XMLObjectSupport {
* @throws XMLRuntimeException if the required builder can not be obtained
*/
public static XMLObject buildXMLObject(final QName elementName) {
- XMLObjectBuilder<?> builder = getProviderRegistry().getBuilderFactory().getBuilderOrThrow(elementName);
+ final XMLObjectBuilder<?> builder = getProviderRegistry().getBuilderFactory().getBuilderOrThrow(elementName);
return builder.buildObject(elementName);
}
@@ -493,7 +493,7 @@ public final class XMLObjectSupport {
* @throws XMLRuntimeException if the required builder can not be obtained
*/
public static XMLObject buildXMLObject(final QName elementName, final QName typeName) {
- XMLObjectBuilder<?> builder = getProviderRegistry().getBuilderFactory().getBuilderOrThrow(elementName);
+ final XMLObjectBuilder<?> builder = getProviderRegistry().getBuilderFactory().getBuilderOrThrow(elementName);
return builder.buildObject(elementName, typeName);
}
@@ -554,7 +554,7 @@ public final class XMLObjectSupport {
* @throws XMLRuntimeException if the registry is not available
*/
private static XMLObjectProviderRegistry getProviderRegistry() {
- XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
+ final XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
if (registry == null) {
throw new XMLRuntimeException("XMLObjectProviderRegistry was not available from the ConfigurationService");
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list