[java-metadata-aggregator] 03/05: JPAR-85 - check 'final' keyword with Checkstyle
Ian Young
ian at iay.org.uk
Thu Nov 23 10:32:29 EST 2017
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch maint-0.9
in repository java-metadata-aggregator.
View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=be738fb7ed6e9e6a6b12b550c9e492d8a2985c7d
commit be738fb7ed6e9e6a6b12b550c9e492d8a2985c7d
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Wed Oct 5 16:34:45 2016 +0100
JPAR-85 - check 'final' keyword with Checkstyle
---
.../shibboleth/metadata/cli/SimpleCommandLine.java | 12 ++---
.../metadata/cli/SimpleCommandLineArguments.java | 6 +--
.../resources/checkstyle/checkstyle.xml | 7 +++
.../metadata/DeduplicatingItemIdMergeStrategy.java | 8 ++--
.../main/java/net/shibboleth/metadata/ItemId.java | 6 +--
.../metadata/SimpleCollectionMergeStrategy.java | 2 +-
.../main/java/net/shibboleth/metadata/Version.java | 6 +--
.../metadata/dom/AbstractDOMTraversalStage.java | 10 ++---
.../metadata/dom/AbstractDOMValidationStage.java | 2 +-
.../dom/AbstractNamespacesStrippingStage.java | 4 +-
.../metadata/dom/AbstractXSLProcessingStage.java | 22 ++++-----
.../metadata/dom/DOMElementSerializer.java | 6 +--
.../metadata/dom/DOMFilesystemSourceStage.java | 12 ++---
.../metadata/dom/DOMResourceSourceStage.java | 6 +--
.../metadata/dom/ElementStrippingStage.java | 6 +--
.../metadata/dom/EmptyContainerStrippingStage.java | 4 +-
.../dom/MultiOutputXSLTransformationStage.java | 8 ++--
.../metadata/dom/XMLSchemaValidationStage.java | 10 ++---
.../metadata/dom/XMLSignatureSigningStage.java | 52 +++++++++++-----------
.../metadata/dom/XMLSignatureValidationStage.java | 8 ++--
.../metadata/dom/XMLSignatureValidator.java | 26 +++++------
.../metadata/dom/XPathFilteringStage.java | 12 ++---
.../metadata/dom/XPathItemSelectionStrategy.java | 8 ++--
.../metadata/dom/XSLTransformationStage.java | 4 +-
.../metadata/dom/XSLValidationStage.java | 4 +-
.../metadata/dom/ds/X509ValidationStage.java | 4 +-
.../dom/saml/ContactPersonFilterStage.java | 10 ++---
.../dom/saml/EntitiesDescriptorAssemblerStage.java | 4 +-
.../saml/EntitiesDescriptorDisassemblerStage.java | 4 +-
.../EntityDescriptorItemIdPopulationStage.java | 4 +-
.../metadata/dom/saml/EntityRoleFilterStage.java | 2 +-
.../metadata/dom/saml/GenerateIdStage.java | 2 +-
.../dom/saml/PullUpCacheDurationStage.java | 14 +++---
.../metadata/dom/saml/PullUpValidUntilStage.java | 20 ++++-----
.../metadata/dom/saml/RemoveOrganizationStage.java | 6 +--
.../metadata/dom/saml/SAMLMetadataSupport.java | 10 ++---
.../metadata/dom/saml/SetValidUntilStage.java | 2 +-
.../EntityRegistrationAuthorityFilterStage.java | 4 +-
.../RegistrationAuthorityPopulationStage.java | 2 +-
.../AbstractItemMetadataSelectionStage.java | 4 +-
.../pipeline/AtLeastCollectionPredicate.java | 2 +-
.../metadata/pipeline/BaseIteratingStage.java | 2 +-
.../metadata/pipeline/CompositeStage.java | 6 +--
.../metadata/pipeline/FutureSupport.java | 10 ++---
.../metadata/pipeline/ItemIdTransformStage.java | 4 +-
.../metadata/pipeline/ItemMetadataFilterStage.java | 4 +-
.../pipeline/ItemMetadataTerminationStage.java | 4 +-
.../pipeline/MultiOutputSerializationStage.java | 4 +-
.../pipeline/PipelineDemultiplexerStage.java | 12 ++---
.../metadata/pipeline/PipelineMergeStage.java | 6 +--
.../metadata/pipeline/ScriptletStage.java | 4 +-
.../metadata/pipeline/SerializationStage.java | 8 ++--
.../metadata/pipeline/SimplePipeline.java | 4 +-
.../metadata/pipeline/SplitMergeStage.java | 4 +-
.../metadata/pipeline/StaticItemSourceStage.java | 2 +-
.../pipeline/StatusMetadataLoggingStage.java | 12 ++---
.../metadata/util/ItemCollectionWithMetadata.java | 4 +-
.../metadata/util/ItemMetadataSupport.java | 10 ++---
.../x509/X509RSAOpenSSLBlacklistValidator.java | 12 ++---
59 files changed, 232 insertions(+), 225 deletions(-)
diff --git a/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java b/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java
index f7f0bea..35aa195 100644
--- a/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java
+++ b/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java
@@ -72,7 +72,7 @@ public final class SimpleCommandLine {
*
* @param args command line arguments
*/
- public static void main(String[] args) {
+ public static void main(final String[] args) {
final SimpleCommandLineArguments cli = new SimpleCommandLineArguments();
cli.parseCommandLineArguments(args);
@@ -85,14 +85,14 @@ public final class SimpleCommandLine {
FileSystemXmlApplicationContext appCtx = null;
try {
- String fileUri = new File(cli.getInputFile()).toURI().toString();
+ final String fileUri = new File(cli.getInputFile()).toURI().toString();
log.debug("Initializing Spring context with configuration file {}", fileUri);
appCtx = new FileSystemXmlApplicationContext(fileUri);
// Register a shutdown hook for the context, so that beans will be
// correctly destroyed before the CLI exits.
appCtx.registerShutdownHook();
- } catch (BeansException e) {
+ } catch (final BeansException e) {
log.error("Unable to initialize Spring context", e);
System.exit(RC_INIT);
}
@@ -127,7 +127,7 @@ public final class SimpleCommandLine {
System.exit(RC_OK);
- } catch (TerminationException e) {
+ } catch (final TerminationException e) {
if (cli.doVerboseOutput()) {
log.error("TerminationException during processing", e);
} else {
@@ -135,7 +135,7 @@ public final class SimpleCommandLine {
}
System.exit(RC_INIT);
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error processing information", e);
System.exit(RC_INIT);
}
@@ -146,7 +146,7 @@ public final class SimpleCommandLine {
*
* @param cli command line arguments
*/
- protected static void initLogging(SimpleCommandLineArguments cli) {
+ protected static void initLogging(final SimpleCommandLineArguments cli) {
if (cli.getLoggingConfiguration() != null) {
System.setProperty("logback.configurationFile", cli.getLoggingConfiguration());
} else if (cli.doVerboseOutput()) {
diff --git a/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLineArguments.java b/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLineArguments.java
index 67ec08e..4bba20d 100644
--- a/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLineArguments.java
+++ b/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLineArguments.java
@@ -94,7 +94,7 @@ public class SimpleCommandLineArguments {
pipelineName = otherArgs.get(1);
validateCommandLineArguments();
- } catch (ParameterException e) {
+ } catch (final ParameterException e) {
errorAndExit(e.getMessage());
}
}
@@ -173,7 +173,7 @@ public class SimpleCommandLineArguments {
*
* @param out location where to print the output
*/
- public void printHelp(PrintStream out) {
+ public void printHelp(final PrintStream out) {
out.println("SimpleCommandLine");
out.println("Provides a command line interface for the metadata aggregator.");
out.println();
@@ -202,7 +202,7 @@ public class SimpleCommandLineArguments {
*
* @param error the error message
*/
- private void errorAndExit(String error) {
+ private void errorAndExit(final String error) {
System.err.println(error);
System.err.flush();
System.out.println();
diff --git a/aggregator-parent/resources/checkstyle/checkstyle.xml b/aggregator-parent/resources/checkstyle/checkstyle.xml
index 5565264..e08350c 100644
--- a/aggregator-parent/resources/checkstyle/checkstyle.xml
+++ b/aggregator-parent/resources/checkstyle/checkstyle.xml
@@ -92,6 +92,13 @@
<module name="TrailingComment"/>
<module name="EqualsAvoidNull"/>
<module name="ModifiedControlVariable"/>
+ <module name="FinalParameters">
+ <property name="tokens" value="METHOD_DEF,CTOR_DEF,LITERAL_CATCH"/>
+ </module>
+ <module name="FinalLocalVariable">
+ <property name="tokens" value="PARAMETER_DEF,VARIABLE_DEF"/>
+ <property name="validateEnhancedForLoopVariable" value="true"/>
+ </module>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="\bCheck[Ss]tyle:\s*([\w|]+)\s+OFF\b"/>
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/DeduplicatingItemIdMergeStrategy.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/DeduplicatingItemIdMergeStrategy.java
index c00aee8..afb4888 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/DeduplicatingItemIdMergeStrategy.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/DeduplicatingItemIdMergeStrategy.java
@@ -42,14 +42,14 @@ public class DeduplicatingItemIdMergeStrategy implements CollectionMergeStrategy
List<ItemId> itemIds;
final HashSet<ItemId> presentItemIds = new HashSet<>();
- for (Item<T> item : target) {
+ for (final Item<T> item : target) {
itemIds = item.getItemMetadata().get(ItemId.class);
if (itemIds != null) {
presentItemIds.addAll(itemIds);
}
}
- for (Collection<Item<T>> source : sources) {
+ for (final Collection<Item<T>> source : sources) {
merge(presentItemIds, target, source);
}
}
@@ -69,7 +69,7 @@ public class DeduplicatingItemIdMergeStrategy implements CollectionMergeStrategy
@Nonnull @NonnullElements final Collection<Item<T>> sourceItems) {
boolean itemAlreadyPresent;
List<ItemId> itemIds;
- for (Item<T> sourceItem : sourceItems) {
+ for (final Item<T> sourceItem : sourceItems) {
itemIds = sourceItem.getItemMetadata().get(ItemId.class);
if (itemIds == null || itemIds.isEmpty()) {
target.add(sourceItem);
@@ -77,7 +77,7 @@ public class DeduplicatingItemIdMergeStrategy implements CollectionMergeStrategy
}
itemAlreadyPresent = false;
- for (ItemId itemId : itemIds) {
+ for (final ItemId itemId : itemIds) {
if (presentItemIds.contains(itemId)) {
itemAlreadyPresent = true;
break;
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemId.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemId.java
index d10f234..d460c37 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemId.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemId.java
@@ -66,7 +66,7 @@ public class ItemId implements ItemMetadata, Comparable<ItemId> {
}
/** {@inheritDoc} */
- @Override public boolean equals(Object obj) {
+ @Override public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
@@ -77,12 +77,12 @@ public class ItemId implements ItemMetadata, Comparable<ItemId> {
return false;
}
- ItemId other = (ItemId) obj;
+ final ItemId other = (ItemId) obj;
return Objects.equals(id, other.id);
}
/** {@inheritDoc} */
- @Override public int compareTo(ItemId o) {
+ @Override public int compareTo(final ItemId o) {
return id.compareTo(o.id);
}
}
\ No newline at end of file
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/SimpleCollectionMergeStrategy.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/SimpleCollectionMergeStrategy.java
index 5eeb5db..2807849 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/SimpleCollectionMergeStrategy.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/SimpleCollectionMergeStrategy.java
@@ -37,7 +37,7 @@ public class SimpleCollectionMergeStrategy implements CollectionMergeStrategy {
Constraint.isNotNull(target, "Target collection can not be null");
Constraint.isNotNull(sources, "Source collections can not be null or empty");
- for (Collection<Item<T>> source : sources) {
+ for (final Collection<Item<T>> source : sources) {
target.addAll(source);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Version.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Version.java
index f4f6973..665ce69 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Version.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Version.java
@@ -43,8 +43,8 @@ public final class Version {
*
* @param args command line arguments
*/
- public static void main(String[] args) {
- Package pkg = Version.class.getPackage();
+ public static void main(final String[] args) {
+ final Package pkg = Version.class.getPackage();
System.out.println(pkg.getImplementationTitle() + " version " + VERSION);
}
@@ -86,7 +86,7 @@ public final class Version {
static {
VERSION = Version.class.getPackage().getImplementationVersion();
- String[] versionParts = VERSION.split(".");
+ final String[] versionParts = VERSION.split(".");
MAJOR_VERSION = Integer.parseInt(versionParts[0]);
MINOR_VERSION = Integer.parseInt(versionParts[1]);
MICRO_VERSION = Integer.parseInt(versionParts[2]);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMTraversalStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMTraversalStage.java
index c29951a..9df75e2 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMTraversalStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMTraversalStage.java
@@ -55,7 +55,7 @@ public abstract class AbstractDOMTraversalStage extends BaseStage<Element> {
*
* @param contextItem the {@link Item} this traversal is being performed on.
*/
- public TraversalContext(@Nonnull Item<Element> contextItem) {
+ public TraversalContext(@Nonnull final Item<Element> contextItem) {
item = contextItem;
}
@@ -111,7 +111,7 @@ public abstract class AbstractDOMTraversalStage extends BaseStage<Element> {
private void traverse(@Nonnull final Element element, @Nonnull final TraversalContext context)
throws StageProcessingException {
final List<Element> children = ElementSupport.getChildElements(element);
- for (Element child : children) {
+ for (final Element child : children) {
traverse(child, context);
}
if (applicable(element)) {
@@ -120,8 +120,8 @@ public abstract class AbstractDOMTraversalStage extends BaseStage<Element> {
}
@Override
- protected void doExecute(Collection<Item<Element>> itemCollection) throws StageProcessingException {
- for (Item<Element> item : itemCollection) {
+ protected void doExecute(final Collection<Item<Element>> itemCollection) throws StageProcessingException {
+ for (final Item<Element> item : itemCollection) {
final Element docElement = item.unwrap();
final TraversalContext context = new TraversalContext(item);
traverse(docElement, context);
@@ -167,7 +167,7 @@ public abstract class AbstractDOMTraversalStage extends BaseStage<Element> {
if (id != null) {
prefix = id.getTextContent() + ": ";
} else {
- Attr entityID = entity.getAttributeNode("entityID");
+ final Attr entityID = entity.getAttributeNode("entityID");
if (entityID != null) {
prefix = entityID.getTextContent() + ": ";
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMValidationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMValidationStage.java
index fec083d..6c87f2a 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMValidationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractDOMValidationStage.java
@@ -91,7 +91,7 @@ public abstract class AbstractDOMValidationStage<V> extends AbstractDOMTraversal
protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
- for (Validator<V> validator : validators) {
+ for (final Validator<V> validator : validators) {
if (!validator.isInitialized()) {
validator.initialize();
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
index 0b85276..cce894e 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
@@ -78,7 +78,7 @@ public abstract class AbstractNamespacesStrippingStage extends BaseStage<Element
* so fail quickly if the document element is in the target namespace.
*/
if (removingNamespace(element.getNamespaceURI())) {
- ClassToInstanceMultiMap<ItemMetadata> metadata = item.getItemMetadata();
+ final ClassToInstanceMultiMap<ItemMetadata> metadata = item.getItemMetadata();
metadata.put(new ErrorStatus(getId(), "can't strip namespace from document element"));
return;
}
@@ -181,7 +181,7 @@ public abstract class AbstractNamespacesStrippingStage extends BaseStage<Element
@Override
protected void doExecute(@Nonnull @NonnullElements final Collection<Item<Element>> items)
throws StageProcessingException {
- for (Item<Element> item : items) {
+ for (final Item<Element> item : items) {
processItem(item);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java
index ec31124..01107e1 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java
@@ -136,7 +136,7 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
}
final HashMap<String, Object> newAttributes = new HashMap<>();
- for (String attributeName : attributes.keySet()) {
+ for (final String attributeName : attributes.keySet()) {
if (attributeName != null) {
newAttributes.put(attributeName, attributes.get(attributeName));
}
@@ -168,7 +168,7 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
}
final HashMap<String, Boolean> newFeatures = new HashMap<>();
- for (String featuresName : features.keySet()) {
+ for (final String featuresName : features.keySet()) {
if (featuresName != null) {
newFeatures.put(featuresName, features.get(featuresName));
}
@@ -201,7 +201,7 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
}
final HashMap<String, Object> newParams = new HashMap<>();
- for (String paramName : parameters.keySet()) {
+ for (final String paramName : parameters.keySet()) {
if (paramName != null) {
newParams.put(paramName, parameters.get(paramName));
}
@@ -236,12 +236,12 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
throws StageProcessingException {
try {
final Transformer transformer = xslTemplate.newTransformer();
- for (Map.Entry<String, Object> entry : transformParameters.entrySet()) {
+ for (final Map.Entry<String, Object> entry : transformParameters.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
executeTransformer(transformer, itemCollection);
- } catch (TransformerConfigurationException e) {
+ } catch (final TransformerConfigurationException e) {
throw new RuntimeException("XSL transformation engine misconfigured", e);
}
}
@@ -289,11 +289,11 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
final TransformerFactory tfactory = TransformerFactory.newInstance();
- for (Entry<String, Object> attribute : transformAttributes.entrySet()) {
+ for (final Entry<String, Object> attribute : transformAttributes.entrySet()) {
tfactory.setAttribute(attribute.getKey(), attribute.getValue());
}
- for (Entry<String, Boolean> features : transformFeatures.entrySet()) {
+ for (final Entry<String, Boolean> features : transformFeatures.entrySet()) {
tfactory.setFeature(features.getKey(), features.getValue());
}
@@ -304,9 +304,9 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
log.debug("{} pipeline stage compiling XSL file {}", getId(), xslResource);
xslTemplate = tfactory.newTemplates(new StreamSource(xslResource.getInputStream(),
xslResource.getURL().toExternalForm()));
- } catch (TransformerConfigurationException e) {
+ } catch (final TransformerConfigurationException e) {
throw new ComponentInitializationException("XSL transformation engine misconfigured", e);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new ComponentInitializationException("Unable to initialize " + getId()
+ ", error reading XslResource " + xslResource.getDescription() + " information", e);
}
@@ -369,12 +369,12 @@ public abstract class AbstractXSLProcessingStage extends BaseStage<Element> {
* @throws TransformerException thrown if the error does not contain the appropriate message prefix
*/
private void parseAndAppendStatusInfo(@Nonnull final TransformerException e) throws TransformerException {
- String errorMessage = StringSupport.trimOrNull(e.getMessage());
+ final String errorMessage = StringSupport.trimOrNull(e.getMessage());
if (errorMessage == null) {
throw e;
}
- String statusMessage;
+ final String statusMessage;
if (errorMessage.startsWith(ERROR_PREFIX)) {
statusMessage = StringSupport.trim(errorMessage.substring(ERROR_PREFIX.length()));
item.getItemMetadata().put(new ErrorStatus(getId(), statusMessage));
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java
index eee450c..b055184 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java
@@ -60,11 +60,11 @@ public class DOMElementSerializer implements ItemSerializer<Element>, ItemCollec
final Element documentRoot = item.unwrap();
try {
- TransformerFactory tfac = TransformerFactory.newInstance();
- Transformer serializer = tfac.newTransformer();
+ final TransformerFactory tfac = TransformerFactory.newInstance();
+ final Transformer serializer = tfac.newTransformer();
serializer.setOutputProperty("encoding", "UTF-8");
serializer.transform(new DOMSource(documentRoot.getOwnerDocument()), new StreamResult(output));
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
log.error("Unable to write out XML", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMFilesystemSourceStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMFilesystemSourceStage.java
index 584ea23..769488b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMFilesystemSourceStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMFilesystemSourceStage.java
@@ -142,7 +142,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
*
* @param filter filter used to determine if a file, in a directory, should be treated as a source file, may be null
*/
- public synchronized void setSourceFileFilter(@Nonnull FileFilter filter) {
+ public synchronized void setSourceFileFilter(@Nonnull final FileFilter filter) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -184,7 +184,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
*
* @param isError whether the lack of source files is considered an error
*/
- public synchronized void setNoSourceFilesAnError(boolean isError) {
+ public synchronized void setNoSourceFilesAnError(final boolean isError) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -232,7 +232,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
}
DOMElementItem dme;
- for (File source : sourceFiles) {
+ for (final File source : sourceFiles) {
dme = processSourceFile(source);
if (dme != null) {
itemCollection.add(dme);
@@ -260,7 +260,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
// file must be a directory
final File[] files = input.listFiles();
if (files != null) {
- for (File file : files) {
+ for (final File file : files) {
if (file.isFile() || (file.isDirectory() && recurseDirectories)) {
getSourceFiles(file, collector);
}
@@ -287,7 +287,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
xmlIn = new FileInputStream(source);
final Document doc = parserPool.parse(xmlIn);
return new DOMElementItem(doc);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (errorCausesSourceFailure) {
throw new StageProcessingException(getId() + " pipeline source unable to parse XML input file "
+ source.getPath(), e);
@@ -299,7 +299,7 @@ public class DOMFilesystemSourceStage extends BaseStage<Element> {
} finally {
try {
xmlIn.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new StageProcessingException("Exception closing input stream", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMResourceSourceStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMResourceSourceStage.java
index ce9cd10..f4735df 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMResourceSourceStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMResourceSourceStage.java
@@ -139,7 +139,7 @@ public class DOMResourceSourceStage extends BaseStage<Element> {
try (InputStream ins = domResource.getInputStream()) {
populateItemCollection(itemCollection, ins);
- } catch (IOException e) {
+ } catch (final IOException e) {
if (errorCausesSourceFailure) {
throw new StageProcessingException("Error retrieving XML document from " +
domResource.getDescription(), e);
@@ -159,12 +159,12 @@ public class DOMResourceSourceStage extends BaseStage<Element> {
*
* @throws StageProcessingException thrown if there is a problem reading and parsing the response
*/
- protected void populateItemCollection(@Nonnull @NonnullElements Collection<Item<Element>> itemCollection,
+ protected void populateItemCollection(@Nonnull @NonnullElements final Collection<Item<Element>> itemCollection,
final InputStream data) throws StageProcessingException {
try {
log.debug("Parsing XML document retrieved from '{}'", domResource.getDescription());
itemCollection.add(new DOMElementItem(parserPool.parse(data)));
- } catch (XMLParserException e) {
+ } catch (final XMLParserException e) {
if (errorCausesSourceFailure) {
throw new StageProcessingException(getId() + " unable to parse returned XML document " +
domResource.getDescription(), e);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ElementStrippingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ElementStrippingStage.java
index 1b793cc..92c390b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ElementStrippingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ElementStrippingStage.java
@@ -97,12 +97,12 @@ public class ElementStrippingStage extends BaseStage<Element> {
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<Element>> items)
throws StageProcessingException {
- for (Item<Element> item : items) {
+ for (final Item<Element> item : items) {
final Element docElement = item.unwrap();
// List all the matching descendant elements in this document in document order
// Note that this list will never include the document element itself
- NodeList nodeList = docElement.getElementsByTagNameNS(elementNamespace, elementName);
+ final NodeList nodeList = docElement.getElementsByTagNameNS(elementNamespace, elementName);
// Copy these into a list, because a NodeList can change length at any time
final int nNodes = nodeList.getLength();
@@ -112,7 +112,7 @@ public class ElementStrippingStage extends BaseStage<Element> {
}
// Remove the elements from the document
- for (Element element : elements) {
+ for (final Element element : elements) {
element.getParentNode().removeChild(element);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/EmptyContainerStrippingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/EmptyContainerStrippingStage.java
index 96cb075..9c6bedc 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/EmptyContainerStrippingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/EmptyContainerStrippingStage.java
@@ -101,14 +101,14 @@ public class EmptyContainerStrippingStage extends BaseStage<Element> {
* @return true if and only if the Element has child elements.
*/
private boolean hasChildElements(@Nonnull final Element element) {
- Node firstChild = ElementSupport.getFirstChildElement(Constraint.isNotNull(element, "Element can not be null"));
+ final Node firstChild = ElementSupport.getFirstChildElement(Constraint.isNotNull(element, "Element can not be null"));
return firstChild != null;
}
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<Element>> items)
throws StageProcessingException {
- for (Item<Element> item : items) {
+ for (final Item<Element> item : items) {
final Element element = item.unwrap();
// List all the relevant elements in this document in document order
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/MultiOutputXSLTransformationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/MultiOutputXSLTransformationStage.java
index 5332b85..c236091 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/MultiOutputXSLTransformationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/MultiOutputXSLTransformationStage.java
@@ -54,7 +54,7 @@ public class MultiOutputXSLTransformationStage extends AbstractXSLProcessingStag
try {
final ArrayList<Item<Element>> newItems = new ArrayList<>();
- for (Item<Element> domItem : itemCollection) {
+ for (final Item<Element> domItem : itemCollection) {
transformer.setErrorListener(new StatusInfoAppendingErrorListener(domItem));
final Element element = domItem.unwrap();
@@ -66,15 +66,15 @@ public class MultiOutputXSLTransformationStage extends AbstractXSLProcessingStag
// becomes a new DomElementItem in the output collection carrying the same
// ItemMetadata objects as the input.
final List<Element> transformedElements = ElementSupport.getChildElements(result.getNode());
- for (Element transformedElement : transformedElements) {
- DOMElementItem newItem = new DOMElementItem(transformedElement);
+ for (final Element transformedElement : transformedElements) {
+ final DOMElementItem newItem = new DOMElementItem(transformedElement);
ItemMetadataSupport.addAll(newItem, domItem.getItemMetadata().values());
newItems.add(newItem);
}
}
itemCollection.clear();
itemCollection.addAll(newItems);
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
throw new StageProcessingException("Unable to transform DOM Element", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSchemaValidationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSchemaValidationStage.java
index 5ed8545..8eccbaf 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSchemaValidationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSchemaValidationStage.java
@@ -115,7 +115,7 @@ public class XMLSchemaValidationStage extends BaseIteratingStage<Element> {
*
* @param isRequired whether Elements are required to be schema valid
*/
- public synchronized void setElementRequiredToBeSchemaValid(boolean isRequired) {
+ public synchronized void setElementRequiredToBeSchemaValid(final boolean isRequired) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -129,7 +129,7 @@ public class XMLSchemaValidationStage extends BaseIteratingStage<Element> {
final Validator validator = validationSchema.newValidator();
try {
validator.validate(new DOMSource(item.unwrap()));
- } catch (Exception e) {
+ } catch (final Exception e) {
if (log.isDebugEnabled()) {
log.debug("DOM Element was not valid:\n{}", SerializeSupport.prettyPrintXML(item.unwrap()), e);
}
@@ -163,17 +163,17 @@ public class XMLSchemaValidationStage extends BaseIteratingStage<Element> {
try {
log.debug("{} pipeline stage building validation schema resources", getId());
final SchemaBuilder builder = new SchemaBuilder();
- for (Resource schemaResource : schemaResources) {
+ for (final Resource schemaResource : schemaResources) {
try {
builder.addSchema(new StreamSource(schemaResource.getInputStream(),
schemaResource.getDescription()));
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new ComponentInitializationException("Unable to read schema resource " +
schemaResource.getDescription(), e);
}
}
validationSchema = builder.buildSchema();
- } catch (SAXException e) {
+ } catch (final SAXException e) {
throw new ComponentInitializationException("Unable to generate schema", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
index 04ec475..6b60009 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
@@ -641,10 +641,10 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element element = item.unwrap();
- XMLSignature signature = xmlSigFactory.newXMLSignature(buildSignedInfo(element), buildKeyInfo());
+ final Element element = item.unwrap();
+ final XMLSignature signature = xmlSigFactory.newXMLSignature(buildSignedInfo(element), buildKeyInfo());
try {
- XMLSignContext context = new DOMSignContext(privKey, element, element.getFirstChild());
+ final XMLSignContext context = new DOMSignContext(privKey, element, element.getFirstChild());
// Enable caching reference values if required for debugging.
if (isDebugPreDigest() && log.isDebugEnabled()) {
@@ -656,11 +656,11 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
// Log the pre-digest data for debugging
if (isDebugPreDigest() && log.isDebugEnabled()) {
- Reference ref = (Reference) signature.getSignedInfo().getReferences().get(0);
- String preDigest = CharStreams.toString(new InputStreamReader(ref.getDigestInputStream(), "UTF-8"));
+ final Reference ref = (Reference) signature.getSignedInfo().getReferences().get(0);
+ final String preDigest = CharStreams.toString(new InputStreamReader(ref.getDigestInputStream(), "UTF-8"));
log.debug("pre digest: {}", preDigest);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Unable to create signature for element", e);
throw new StageProcessingException("Unable to create signature for element", e);
}
@@ -684,20 +684,20 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
c14nMethodSpec = new ExcC14NParameterSpec(inclusivePrefixList);
}
- CanonicalizationMethod c14nMethod;
+ final CanonicalizationMethod c14nMethod;
try {
c14nMethod = xmlSigFactory.newCanonicalizationMethod(c14nAlgo, c14nMethodSpec);
- } catch (Exception e) {
- String errMsg = "Unable to create transform " + c14nAlgo;
+ } catch (final Exception e) {
+ final String errMsg = "Unable to create transform " + c14nAlgo;
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
- SignatureMethod sigMethod;
+ final SignatureMethod sigMethod;
try {
sigMethod = xmlSigFactory.newSignatureMethod(sigAlgo, null);
- } catch (Exception e) {
- String errMsg = "Unable to create signature method " + sigAlgo;
+ } catch (final Exception e) {
+ final String errMsg = "Unable to create signature method " + sigAlgo;
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
@@ -728,10 +728,10 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
DigestMethod digestMethod = null;
try {
- DigestMethodParameterSpec digestMethodSpec = null;
+ final DigestMethodParameterSpec digestMethodSpec = null;
digestMethod = xmlSigFactory.newDigestMethod(digestAlgo, digestMethodSpec);
- } catch (Exception e) {
- String errMsg = "Unable to create digest method " + digestAlgo;
+ } catch (final Exception e) {
+ final String errMsg = "Unable to create digest method " + digestAlgo;
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
@@ -742,8 +742,8 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
try {
transformSpec = null;
transforms.add(xmlSigFactory.newTransform(TRANSFORM_ENVELOPED_SIGNATURE, transformSpec));
- } catch (Exception e) {
- String errMsg = "Unable to create transform " + TRANSFORM_ENVELOPED_SIGNATURE;
+ } catch (final Exception e) {
+ final String errMsg = "Unable to create transform " + TRANSFORM_ENVELOPED_SIGNATURE;
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
@@ -754,8 +754,8 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
transformSpec = new ExcC14NParameterSpec(inclusivePrefixList);
}
transforms.add(xmlSigFactory.newTransform(c14nAlgo, transformSpec));
- } catch (Exception e) {
- String errMsg = "Unable to create transform " + c14nAlgo;
+ } catch (final Exception e) {
+ final String errMsg = "Unable to create transform " + c14nAlgo;
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
@@ -841,7 +841,7 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
}
if (keyNames != null && !keyNames.isEmpty()) {
- for (String name : keyNames) {
+ for (final String name : keyNames) {
keyInfoItems.add(keyInfoFactory.newKeyName(name));
}
}
@@ -862,7 +862,7 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
PublicKey key = pubKey;
if (key == null && certificates != null) {
- X509Certificate cert = certificates.get(0);
+ final X509Certificate cert = certificates.get(0);
if (cert != null) {
key = cert.getPublicKey();
}
@@ -870,7 +870,7 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
if (key != null) {
try {
keyInfoItems.add(keyInfoFactory.newKeyValue(key));
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Unable to create KeyValue", e);
throw new StageProcessingException("Unable to create KeyValue", e);
}
@@ -889,10 +889,10 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
final ArrayList<Object> x509Data = new ArrayList<>();
if (certificates != null && !certificates.isEmpty()) {
- X509Certificate endEntityCert = certificates.get(0);
+ final X509Certificate endEntityCert = certificates.get(0);
if (includeX509SubjectName) {
- X500Principal subjectDn = endEntityCert.getSubjectX500Principal();
+ final X500Principal subjectDn = endEntityCert.getSubjectX500Principal();
keyInfoItems.add(subjectDn.getName(X500Principal.RFC2253));
}
@@ -901,8 +901,8 @@ public class XMLSignatureSigningStage extends BaseIteratingStage<Element> {
}
if (includeX509IssuerSerial) {
- X500Principal issuerDn = endEntityCert.getIssuerX500Principal();
- BigInteger serialNumber = endEntityCert.getSerialNumber();
+ final X500Principal issuerDn = endEntityCert.getIssuerX500Principal();
+ final BigInteger serialNumber = endEntityCert.getSerialNumber();
x509Data.add(keyInfoFactory.newX509IssuerSerial(issuerDn.getName(X500Principal.RFC2253), serialNumber));
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidationStage.java
index 042c134..f28c71a 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidationStage.java
@@ -127,7 +127,7 @@ public class XMLSignatureValidationStage extends BaseIteratingStage<Element> {
*
* @param isRequired whether the signature on a Element element is required to be valid
*/
- public synchronized void setValidSignatureRequired(boolean isRequired) {
+ public synchronized void setValidSignatureRequired(final boolean isRequired) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -248,7 +248,7 @@ public class XMLSignatureValidationStage extends BaseIteratingStage<Element> {
final Element docElement = item.unwrap();
// Step 1: locate the signature element within the document.
- Element signatureElement;
+ final Element signatureElement;
try {
signatureElement = validator.getSignatureElement(docElement);
if (signatureElement == null) {
@@ -261,7 +261,7 @@ public class XMLSignatureValidationStage extends BaseIteratingStage<Element> {
}
return true;
}
- } catch (ValidationException e) {
+ } catch (final ValidationException e) {
// pass on an error from signature location (e.g., multiple signatures)
log.debug("setting status: ", e.getMessage());
item.getItemMetadata().put(new ErrorStatus(getId(), e.getMessage()));
@@ -274,7 +274,7 @@ public class XMLSignatureValidationStage extends BaseIteratingStage<Element> {
try {
validator.verifySignature(docElement, signatureElement);
- } catch (ValidationException e) {
+ } catch (final ValidationException e) {
final String message = "element signature is invalid: " + e.getMessage();
log.debug("setting status: ", message);
if (validSignatureRequired) {
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
index 9181e09..d9a0d3d 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
@@ -195,9 +195,9 @@ final class XMLSignatureValidator {
/*
* Now look for the attribute which holds the ID value, and mark it as the ID attribute.
*/
- NamedNodeMap attributes = docElement.getAttributes();
+ final NamedNodeMap attributes = docElement.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
- Attr attribute = (Attr) attributes.item(i);
+ final Attr attribute = (Attr) attributes.item(i);
if (id.equals(attribute.getValue())) {
log.debug("marking ID attribute {}", attribute.getName());
docElement.setIdAttributeNode(attribute, true);
@@ -230,7 +230,7 @@ final class XMLSignatureValidator {
XMLSignature signature = null;
try {
signature = new XMLSignature(signatureElement, "");
- } catch (XMLSecurityException e) {
+ } catch (final XMLSecurityException e) {
throw new ValidationException("Unable to read XML signature", e);
}
@@ -243,18 +243,18 @@ final class XMLSignatureValidator {
// check reference digest algorithm against blacklist
try {
- String alg = ref.getMessageDigestAlgorithm().getAlgorithmURI();
+ final String alg = ref.getMessageDigestAlgorithm().getAlgorithmURI();
log.debug("blacklist checking digest {}", alg);
if (blacklistedDigests.contains(alg)) {
log.error("Digest algorithm {} is blacklisted", alg);
throw new ValidationException("Digest algorithm " + alg + " is blacklisted");
}
- } catch (XMLSignatureException e) {
+ } catch (final XMLSignatureException e) {
throw new ValidationException("unable to retrieve signature digest algorithm");
}
// check signature algorithm against blacklist
- String alg = signature.getSignedInfo().getSignatureMethodURI();
+ final String alg = signature.getSignedInfo().getSignatureMethodURI();
log.debug("blacklist checking signature method {}", alg);
if (blacklistedSignatureMethods.contains(alg)) {
throw new ValidationException("Signature algorithm " + alg + " is blacklisted");
@@ -279,7 +279,7 @@ final class XMLSignatureValidator {
} else {
throw new ValidationException("XML document signature verification failed");
}
- } catch (XMLSignatureException e) {
+ } catch (final XMLSignatureException e) {
if (log.isDebugEnabled()) {
log.debug("Unable to validate signature", e);
}
@@ -297,7 +297,7 @@ final class XMLSignatureValidator {
* @throws ValidationException if a reference could not be extracted
*/
private Reference extractReference(@Nonnull final XMLSignature signature) throws ValidationException {
- int numReferences = signature.getSignedInfo().getLength();
+ final int numReferences = signature.getSignedInfo().getLength();
if (numReferences != 1) {
throw new ValidationException("Signature SignedInfo had invalid number of References: " + numReferences);
}
@@ -313,7 +313,7 @@ final class XMLSignatureValidator {
}
}
return ref;
- } catch (XMLSecurityException e) {
+ } catch (final XMLSecurityException e) {
throw new ValidationException("Apache XML Security exception obtaining Reference: " + e.getMessage());
}
}
@@ -377,7 +377,7 @@ final class XMLSignatureValidator {
Transforms transforms = null;
try {
transforms = reference.getTransforms();
- } catch (XMLSecurityException e) {
+ } catch (final XMLSecurityException e) {
throw new ValidationException("Apache XML Security error obtaining Transforms instance: " + e.getMessage());
}
@@ -385,7 +385,7 @@ final class XMLSignatureValidator {
throw new ValidationException("Error obtaining Transforms instance, null was returned");
}
- int numTransforms = transforms.getLength();
+ final int numTransforms = transforms.getLength();
if (numTransforms > 2) {
throw new ValidationException("Invalid number of Transforms was present: " + numTransforms);
}
@@ -395,10 +395,10 @@ final class XMLSignatureValidator {
Transform transform = null;
try {
transform = transforms.item(i);
- } catch (TransformationException e) {
+ } catch (final TransformationException e) {
throw new ValidationException("Error obtaining transform instance: " + e.getMessage());
}
- String uri = transform.getURI();
+ final String uri = transform.getURI();
if (Transforms.TRANSFORM_ENVELOPED_SIGNATURE.equals(uri)) {
log.debug("Saw Enveloped signature transform");
sawEnveloped = true;
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathFilteringStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathFilteringStage.java
index 29e6fdc..1d5c237 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathFilteringStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathFilteringStage.java
@@ -116,16 +116,16 @@ public class XPathFilteringStage extends BaseStage<Element> {
/** {@inheritDoc} */
@Override public void doExecute(@Nonnull @NonnullElements final Collection<Item<Element>> metadataCollection) {
- XPathFactory factory = XPathFactory.newInstance();
- XPath xpath = factory.newXPath();
+ final XPathFactory factory = XPathFactory.newInstance();
+ final XPath xpath = factory.newXPath();
if (namespaceContext != null) {
xpath.setNamespaceContext(namespaceContext);
}
- XPathExpression compiledExpression;
+ final XPathExpression compiledExpression;
try {
compiledExpression = xpath.compile(xpathExpression);
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
log.error("error compiling XPath expression; no filtering performed", e);
return;
}
@@ -134,12 +134,12 @@ public class XPathFilteringStage extends BaseStage<Element> {
while (iterator.hasNext()) {
final Item<Element> item = iterator.next();
try {
- Boolean filterThis = (Boolean) compiledExpression.evaluate(item.unwrap(), XPathConstants.BOOLEAN);
+ final Boolean filterThis = (Boolean) compiledExpression.evaluate(item.unwrap(), XPathConstants.BOOLEAN);
if (filterThis) {
log.debug("removing item matching XPath condition");
iterator.remove();
}
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
log.error("removing item due to XPath expression error", e);
iterator.remove();
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathItemSelectionStrategy.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathItemSelectionStrategy.java
index 3f792a0..aa34084 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathItemSelectionStrategy.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathItemSelectionStrategy.java
@@ -71,8 +71,8 @@ public class XPathItemSelectionStrategy implements Predicate<Item<Element>> {
namespaceContext = context;
}
- XPathFactory factory = XPathFactory.newInstance();
- XPath xpath = factory.newXPath();
+ final XPathFactory factory = XPathFactory.newInstance();
+ final XPath xpath = factory.newXPath();
if (namespaceContext != null) {
xpath.setNamespaceContext(namespaceContext);
}
@@ -80,10 +80,10 @@ public class XPathItemSelectionStrategy implements Predicate<Item<Element>> {
}
/** {@inheritDoc} */
- @Override public synchronized boolean apply(@Nonnull Item<Element> item) {
+ @Override public synchronized boolean apply(@Nonnull final Item<Element> item) {
try {
return (Boolean) compiledExpression.evaluate(item.unwrap(), XPathConstants.BOOLEAN);
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
log.warn("Exception thrown during XPath evaluation: " + e);
return false;
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLTransformationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLTransformationStage.java
index 587a7e9..f3f969a 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLTransformationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLTransformationStage.java
@@ -54,7 +54,7 @@ public class XSLTransformationStage extends AbstractXSLProcessingStage {
try {
final ArrayList<Item<Element>> newItems = new ArrayList<>();
- for (Item<Element> domItem : itemCollection) {
+ for (final Item<Element> domItem : itemCollection) {
transformer.setErrorListener(new StatusInfoAppendingErrorListener(domItem));
final Element element = domItem.unwrap();
@@ -72,7 +72,7 @@ public class XSLTransformationStage extends AbstractXSLProcessingStage {
}
itemCollection.clear();
itemCollection.addAll(newItems);
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
throw new StageProcessingException("Unable to transform DOM Element", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLValidationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLValidationStage.java
index 367308f..792686e 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLValidationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLValidationStage.java
@@ -48,11 +48,11 @@ public class XSLValidationStage extends AbstractXSLProcessingStage {
TransformerConfigurationException {
try {
- for (Item<Element> domItem : itemCollection) {
+ for (final Item<Element> domItem : itemCollection) {
transformer.setErrorListener(new StatusInfoAppendingErrorListener(domItem));
transformer.transform(new DOMSource(domItem.unwrap().getOwnerDocument()), new DOMResult());
}
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
throw new StageProcessingException("Unable to validate DOM Element", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ds/X509ValidationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ds/X509ValidationStage.java
index b4a7621..63544b8 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ds/X509ValidationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/ds/X509ValidationStage.java
@@ -61,7 +61,7 @@ public class X509ValidationStage extends AbstractDOMValidationStage<X509Certific
context.getStash().put(cert);
applyValidators(cert, context);
}
- } catch (CertificateException e) {
+ } catch (final CertificateException e) {
context.getItem().getItemMetadata().put(new ErrorStatus(getId(), "could not convert X509Certificate data"));
}
}
@@ -71,7 +71,7 @@ public class X509ValidationStage extends AbstractDOMValidationStage<X509Certific
super.doInitialize();
try {
factory = CertificateFactory.getInstance("X.509");
- } catch (CertificateException e) {
+ } catch (final CertificateException e) {
throw new ComponentInitializationException("can't create X.509 certificate factory", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/ContactPersonFilterStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/ContactPersonFilterStage.java
index 9b6ccce..1bf0c10 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/ContactPersonFilterStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/ContactPersonFilterStage.java
@@ -113,9 +113,9 @@ public class ContactPersonFilterStage extends BaseIteratingStage<Element> {
return;
}
- HashSet<String> checkedTypes = new HashSet<>();
+ final HashSet<String> checkedTypes = new HashSet<>();
String checkedType;
- for (String type : types) {
+ for (final String type : types) {
checkedType = StringSupport.trimOrNull(type);
if (checkedType == null) {
continue;
@@ -172,7 +172,7 @@ public class ContactPersonFilterStage extends BaseIteratingStage<Element> {
*/
protected void processEntitiesDescriptor(@Nonnull final Element entitiesDescriptor) {
final List<Element> children = ElementSupport.getChildElements(entitiesDescriptor);
- for (Element child : children) {
+ for (final Element child : children) {
if (SAMLMetadataSupport.isEntitiesDescriptor(child)) {
processEntitiesDescriptor(child);
} else if (SAMLMetadataSupport.isEntityDescriptor(child)) {
@@ -194,7 +194,7 @@ public class ContactPersonFilterStage extends BaseIteratingStage<Element> {
.getChildElementsByTagNameNS(entityDescriptor, SAMLMetadataSupport.MD_NS, "ContactPerson");
if (!contactPersons.isEmpty()) {
log.debug("{} pipeline stage filtering ContactPerson from EntityDescriptor {}", getId(), entityId);
- for (Element contactPerson : contactPersons) {
+ for (final Element contactPerson : contactPersons) {
if (!isRetainedContactPersonType(contactPerson)) {
entityDescriptor.removeChild(contactPerson);
}
@@ -212,7 +212,7 @@ public class ContactPersonFilterStage extends BaseIteratingStage<Element> {
protected boolean isRetainedContactPersonType(@Nonnull final Element contactPerson) {
Constraint.isNotNull(contactPerson, "Contact person element can not be null");
- String type = StringSupport.trimOrNull(AttributeSupport.getAttributeValue(contactPerson, null, "contactType"));
+ final String type = StringSupport.trimOrNull(AttributeSupport.getAttributeValue(contactPerson, null, "contactType"));
if (type == null) {
log.debug(
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorAssemblerStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorAssemblerStage.java
index 154dafd..ac8483a 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorAssemblerStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorAssemblerStage.java
@@ -86,7 +86,7 @@ public class EntitiesDescriptorAssemblerStage extends BaseStage<Element> {
*
* @param isError whether attempting to turn an empty item collection should be treated as processing error
*/
- public synchronized void setNoChildrenAProcessingError(boolean isError) {
+ public synchronized void setNoChildrenAProcessingError(final boolean isError) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -164,7 +164,7 @@ public class EntitiesDescriptorAssemblerStage extends BaseStage<Element> {
final List<Item<Element>> orderedItems = orderingStrategy.order(itemCollection);
Element descriptor;
- for (Item<Element> item : orderedItems) {
+ for (final Item<Element> item : orderedItems) {
descriptor = item.unwrap();
if (SAMLMetadataSupport.isEntityOrEntitiesDescriptor(descriptor)) {
descriptor = (Element) entitiesDescriptorDocument.importNode(descriptor, true);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
index 8cb5d8f..e62c409 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
@@ -53,7 +53,7 @@ public class EntitiesDescriptorDisassemblerStage extends BaseStage<Element> {
itemCollection.clear();
Element element;
- for (Item<Element> item : items) {
+ for (final Item<Element> item : items) {
element = item.unwrap();
if (SAMLMetadataSupport.isEntitiesDescriptor(element)) {
processEntitiesDescriptor(itemCollection, element);
@@ -77,7 +77,7 @@ public class EntitiesDescriptorDisassemblerStage extends BaseStage<Element> {
@Nonnull final Element entitiesDescriptor) {
final List<Element> children = ElementSupport.getChildElements(entitiesDescriptor);
- for (Element child : children) {
+ for (final Element child : children) {
if (SAMLMetadataSupport.isEntitiesDescriptor(child)) {
processEntitiesDescriptor(itemCollection, child);
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityDescriptorItemIdPopulationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityDescriptorItemIdPopulationStage.java
index 381db2e..63dfd06 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityDescriptorItemIdPopulationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityDescriptorItemIdPopulationStage.java
@@ -37,10 +37,10 @@ public class EntityDescriptorItemIdPopulationStage extends BaseIteratingStage<El
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element metadataElement = item.unwrap();
+ final Element metadataElement = item.unwrap();
if (SAMLMetadataSupport.isEntityDescriptor(metadataElement)) {
- String entityId = AttributeSupport.getAttributeValue(metadataElement, null, "entityID");
+ final String entityId = AttributeSupport.getAttributeValue(metadataElement, null, "entityID");
item.getItemMetadata().put(new ItemId(entityId));
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityRoleFilterStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityRoleFilterStage.java
index 1f32284..08ffb4b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityRoleFilterStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/EntityRoleFilterStage.java
@@ -313,7 +313,7 @@ public class EntityRoleFilterStage extends BaseIteratingStage<Element> {
continue;
}
- boolean isDesignatedRole = designatedRoles.contains(roleIdentifier);
+ final boolean isDesignatedRole = designatedRoles.contains(roleIdentifier);
if (roleIdentifier != null) {
if ((isWhitelistingRoles() && !isDesignatedRole) || (!isWhitelistingRoles() && isDesignatedRole)) {
log.debug("{} pipeline stage removing role {} from EntityDescriptor {}", new Object[] {getId(),
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/GenerateIdStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/GenerateIdStage.java
index 81ee44a..33cf6c0 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/GenerateIdStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/GenerateIdStage.java
@@ -56,7 +56,7 @@ public class GenerateIdStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element element = item.unwrap();
+ final Element element = item.unwrap();
if (!SAMLMetadataSupport.isEntityOrEntitiesDescriptor(element)) {
return true;
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpCacheDurationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpCacheDurationStage.java
index 677da0f..ced0b1b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpCacheDurationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpCacheDurationStage.java
@@ -97,8 +97,8 @@ public class PullUpCacheDurationStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element descriptor = item.unwrap();
- Long cacheDuration = getShortestCacheDuration(descriptor);
+ final Element descriptor = item.unwrap();
+ final Long cacheDuration = getShortestCacheDuration(descriptor);
setCacheDuration(descriptor, cacheDuration);
return true;
}
@@ -118,25 +118,25 @@ public class PullUpCacheDurationStage extends BaseIteratingStage<Element> {
}
Long cacheDuration = null;
- List<Element> entitiesDescriptors =
+ final List<Element> entitiesDescriptors =
ElementSupport.getChildElements(descriptor, SAMLMetadataSupport.ENTITIES_DESCRIPTOR_NAME);
- for (Element entitiesDescriptor : entitiesDescriptors) {
+ for (final Element entitiesDescriptor : entitiesDescriptors) {
cacheDuration = getShortestCacheDuration(entitiesDescriptor);
if (cacheDuration != null && (shortestCacheDuration == null || (cacheDuration < shortestCacheDuration))) {
shortestCacheDuration = cacheDuration;
}
}
- List<Element> entityDescriptors =
+ final List<Element> entityDescriptors =
ElementSupport.getChildElements(descriptor, SAMLMetadataSupport.ENTITY_DESCRIPTOR_NAME);
- for (Element entityDescriptor : entityDescriptors) {
+ for (final Element entityDescriptor : entityDescriptors) {
cacheDuration = getShortestCacheDuration(entityDescriptor);
if (cacheDuration != null && (shortestCacheDuration == null || (cacheDuration < shortestCacheDuration))) {
shortestCacheDuration = cacheDuration;
}
}
- Attr cacheDurationAttr =
+ final Attr cacheDurationAttr =
AttributeSupport.getAttribute(descriptor, SAMLMetadataSupport.CACHE_DURATION_ATTRIB_NAME);
if (cacheDurationAttr != null) {
cacheDuration = AttributeSupport.getDurationAttributeValueAsLong(cacheDurationAttr);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpValidUntilStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpValidUntilStage.java
index 397cd4b..c3dd633 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpValidUntilStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/PullUpValidUntilStage.java
@@ -100,8 +100,8 @@ public class PullUpValidUntilStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element descriptor = item.unwrap();
- Long nearestValidUntil = getNearestValidUntil(descriptor);
+ final Element descriptor = item.unwrap();
+ final Long nearestValidUntil = getNearestValidUntil(descriptor);
setValidUntil(descriptor, nearestValidUntil);
return true;
}
@@ -121,25 +121,25 @@ public class PullUpValidUntilStage extends BaseIteratingStage<Element> {
}
Long validUntil;
- List<Element> entitiesDescriptors =
+ final List<Element> entitiesDescriptors =
ElementSupport.getChildElements(descriptor, SAMLMetadataSupport.ENTITIES_DESCRIPTOR_NAME);
- for (Element entitiesDescriptor : entitiesDescriptors) {
+ for (final Element entitiesDescriptor : entitiesDescriptors) {
validUntil = getNearestValidUntil(entitiesDescriptor);
if (validUntil != null && (nearestValidUntil == null || (validUntil < nearestValidUntil))) {
nearestValidUntil = validUntil;
}
}
- List<Element> entityDescriptors =
+ final List<Element> entityDescriptors =
ElementSupport.getChildElements(descriptor, SAMLMetadataSupport.ENTITY_DESCRIPTOR_NAME);
- for (Element entityDescriptor : entityDescriptors) {
+ for (final Element entityDescriptor : entityDescriptors) {
validUntil = getNearestValidUntil(entityDescriptor);
if (validUntil != null && (nearestValidUntil == null || (validUntil < nearestValidUntil))) {
nearestValidUntil = validUntil;
}
}
- Attr validUntilAttr =
+ final Attr validUntilAttr =
descriptor.getAttributeNodeNS(null, SAMLMetadataSupport.VALID_UNTIL_ATTRIB_NAME.getLocalPart());
if (validUntilAttr != null) {
validUntil = AttributeSupport.getDateTimeAttributeAsLong(validUntilAttr);
@@ -167,14 +167,14 @@ public class PullUpValidUntilStage extends BaseIteratingStage<Element> {
return;
}
- long now = System.currentTimeMillis();
- long minValidUntil = now + minValidityDuration;
+ final long now = System.currentTimeMillis();
+ final long minValidUntil = now + minValidityDuration;
long maxValidUntil = now + maxValidityDuration;
if (maxValidUntil < 0) {
maxValidUntil = Long.MAX_VALUE;
}
- long boundedValidUntil;
+ final long boundedValidUntil;
if (validUntil < minValidUntil) {
boundedValidUntil = minValidUntil;
} else if (validUntil > maxValidUntil) {
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/RemoveOrganizationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/RemoveOrganizationStage.java
index db49ef7..0089aa2 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/RemoveOrganizationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/RemoveOrganizationStage.java
@@ -40,7 +40,7 @@ public class RemoveOrganizationStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element descriptor = item.unwrap();
+ final Element descriptor = item.unwrap();
if (SAMLMetadataSupport.isEntitiesDescriptor(descriptor)) {
processEntitiesDescriptor(descriptor);
} else if (SAMLMetadataSupport.isEntityDescriptor(descriptor)) {
@@ -57,7 +57,7 @@ public class RemoveOrganizationStage extends BaseIteratingStage<Element> {
*/
protected void processEntitiesDescriptor(@Nonnull final Element entitiesDescriptor) {
final List<Element> children = ElementSupport.getChildElements(entitiesDescriptor);
- for (Element child : children) {
+ for (final Element child : children) {
if (SAMLMetadataSupport.isEntitiesDescriptor(child)) {
processEntitiesDescriptor(child);
} else if (SAMLMetadataSupport.isEntityDescriptor(child)) {
@@ -78,7 +78,7 @@ public class RemoveOrganizationStage extends BaseIteratingStage<Element> {
ElementSupport.getChildElementsByTagNameNS(entityDescriptor, SAMLMetadataSupport.MD_NS, "Organization");
if (!organizations.isEmpty()) {
log.debug("{} pipeline stage filtering Organization from EntityDescriptor {}", getId(), entityId);
- for (Element organization : organizations) {
+ for (final Element organization : organizations) {
entityDescriptor.removeChild(organization);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
index ddfc327..90b5cce 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
@@ -159,17 +159,17 @@ public final class SAMLMetadataSupport {
return;
}
- Element extensionsElement;
+ final Element extensionsElement;
- Map<QName, List<Element>> descriptorChildren = ElementSupport.getIndexedChildElements(descriptor);
- List<Element> extensionsElements = descriptorChildren.get(EXTENSIONS_NAME);
+ final Map<QName, List<Element>> descriptorChildren = ElementSupport.getIndexedChildElements(descriptor);
+ final List<Element> extensionsElements = descriptorChildren.get(EXTENSIONS_NAME);
if (extensionsElements.isEmpty()) {
extensionsElement = ElementSupport.constructElement(descriptor.getOwnerDocument(), EXTENSIONS_NAME);
Element insertExtensionsElementBefore = null;
- List<Element> signatureElements = descriptorChildren.get(XMLSignatureSigningStage.SIGNATURE_NAME);
+ final List<Element> signatureElements = descriptorChildren.get(XMLSignatureSigningStage.SIGNATURE_NAME);
if (!signatureElements.isEmpty()) {
- Element lastSignatureElement = signatureElements.get(signatureElements.size() - 1);
+ final Element lastSignatureElement = signatureElements.get(signatureElements.size() - 1);
insertExtensionsElementBefore = ElementSupport.getNextSiblingElement(lastSignatureElement);
} else {
insertExtensionsElementBefore = ElementSupport.getFirstChildElement(descriptor);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SetValidUntilStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SetValidUntilStage.java
index c2c1ef9..45fa067 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SetValidUntilStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/SetValidUntilStage.java
@@ -71,7 +71,7 @@ public class SetValidUntilStage extends BaseIteratingStage<Element> {
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) throws StageProcessingException {
- Element descriptor = item.unwrap();
+ final Element descriptor = item.unwrap();
if (SAMLMetadataSupport.isEntityOrEntitiesDescriptor(descriptor)) {
AttributeSupport.removeAttribute(descriptor, SAMLMetadataSupport.VALID_UNTIL_ATTRIB_NAME);
AttributeSupport.appendDateTimeAttribute(descriptor, SAMLMetadataSupport.VALID_UNTIL_ATTRIB_NAME,
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/EntityRegistrationAuthorityFilterStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/EntityRegistrationAuthorityFilterStage.java
index 9b1335b..15709b9 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/EntityRegistrationAuthorityFilterStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/EntityRegistrationAuthorityFilterStage.java
@@ -162,7 +162,7 @@ public class EntityRegistrationAuthorityFilterStage extends BaseIteratingStage<E
/** {@inheritDoc} */
@Override protected boolean doExecute(@Nonnull final Item<Element> item) {
- Element descriptor;
+ final Element descriptor;
descriptor = item.unwrap();
if (SAMLMetadataSupport.isEntitiesDescriptor(descriptor)) {
if (processEntitiesDescriptor(descriptor)) {
@@ -237,7 +237,7 @@ public class EntityRegistrationAuthorityFilterStage extends BaseIteratingStage<E
* @return true if the descriptor should be filtered out
*/
protected boolean filterOutDescriptor(@Nonnull final Element descriptor) {
- Element registrationInfoElement =
+ final Element registrationInfoElement =
SAMLMetadataSupport.getDescriptorExtensions(descriptor, MDRPIMetadataSupport.MDRPI_REGISTRATION_INFO);
if (registrationInfoElement == null) {
if (requiringRegistrationInformation) {
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/RegistrationAuthorityPopulationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/RegistrationAuthorityPopulationStage.java
index e79aa99..28f0862 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/RegistrationAuthorityPopulationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdrpi/RegistrationAuthorityPopulationStage.java
@@ -47,7 +47,7 @@ public class RegistrationAuthorityPopulationStage extends BaseStage<Element> {
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<Element>> items)
throws StageProcessingException {
- for (Item<Element> item : items) {
+ for (final Item<Element> item : items) {
final Element entity = item.unwrap();
final ClassToInstanceMultiMap<ItemMetadata> metadata = item.getItemMetadata();
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AbstractItemMetadataSelectionStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AbstractItemMetadataSelectionStage.java
index 27d3346..a7411b7 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AbstractItemMetadataSelectionStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AbstractItemMetadataSelectionStage.java
@@ -115,11 +115,11 @@ public abstract class AbstractItemMetadataSelectionStage<T> extends BaseStage<T>
// to the itemCollection and thus would cause issues if we were iterating over it directly
final ArrayList<Item<T>> collectionCopy = new ArrayList<>(itemCollection);
- for (Item<T> item : collectionCopy) {
+ for (final Item<T> item : collectionCopy) {
final HashMap<Class<? extends ItemMetadata>, List<? extends ItemMetadata>> matchingMetadata =
new HashMap<>();
- for (Class<? extends ItemMetadata> infoClass : selectionRequirements) {
+ for (final Class<? extends ItemMetadata> infoClass : selectionRequirements) {
if (item.getItemMetadata().containsKey(infoClass)) {
matchingMetadata.put(infoClass, item.getItemMetadata().get(infoClass));
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AtLeastCollectionPredicate.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AtLeastCollectionPredicate.java
index 1ee4fa9..17a69e1 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AtLeastCollectionPredicate.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/AtLeastCollectionPredicate.java
@@ -52,7 +52,7 @@ public class AtLeastCollectionPredicate<T> implements Predicate<Collection<T>> {
* @param min minimum number of elements which will result in a <code>true</code>
* result.
*/
- public void setMinimum(int min) {
+ public void setMinimum(final int min) {
minimum = min;
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseIteratingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseIteratingStage.java
index 0f05526..92b154b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseIteratingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseIteratingStage.java
@@ -42,7 +42,7 @@ public abstract class BaseIteratingStage<T> extends BaseStage<T> {
*/
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection)
throws StageProcessingException {
- Iterator<Item<T>> itemIterator = itemCollection.iterator();
+ final Iterator<Item<T>> itemIterator = itemCollection.iterator();
Item<T> item;
while (itemIterator.hasNext()) {
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/CompositeStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/CompositeStage.java
index e0e21de..98b731f 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/CompositeStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/CompositeStage.java
@@ -63,9 +63,9 @@ public class CompositeStage<T> extends BaseStage<T> {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- ArrayList<Stage<T>> newStages = new ArrayList<>();
+ final ArrayList<Stage<T>> newStages = new ArrayList<>();
if (stages != null) {
- for (Stage<T> stage : stages) {
+ for (final Stage<T> stage : stages) {
if (stage != null) {
newStages.add(stage);
}
@@ -79,7 +79,7 @@ public class CompositeStage<T> extends BaseStage<T> {
@Override
protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection)
throws StageProcessingException {
- for (Stage<T> stage : composedStages) {
+ for (final Stage<T> stage : composedStages) {
stage.execute(itemCollection);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java
index 511f6e7..bcb7382 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java
@@ -60,7 +60,7 @@ public final class FutureSupport {
}
@Override
- public boolean cancel(boolean mayInterruptIfRunning) {
+ public boolean cancel(final boolean mayInterruptIfRunning) {
return false;
}
@@ -80,7 +80,7 @@ public final class FutureSupport {
}
@Override
- public T get(long timeout, TimeUnit unit) throws InterruptedException,
+ public T get(final long timeout, final TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException {
return value;
}
@@ -117,7 +117,7 @@ public final class FutureSupport {
* @throws StageProcessingException unless resolution is successful
*/
@Nonnull public static <T> Collection<Item<T>> futureItems(
- @Nonnull Future<Collection<Item<T>>> future) throws StageProcessingException {
+ @Nonnull final Future<Collection<Item<T>>> future) throws StageProcessingException {
assert future != null;
try {
final Collection<Item<T>> value = future.get();
@@ -125,7 +125,7 @@ public final class FutureSupport {
throw new StageProcessingException("null returned from future value");
}
return value;
- } catch (ExecutionException e) {
+ } catch (final ExecutionException e) {
LOG.debug("Pipeline threw an unexpected exception", e);
if (e.getCause() instanceof StageProcessingException) {
// UN-wrap our own exceptions so as to propagate them
@@ -134,7 +134,7 @@ public final class FutureSupport {
// Wrap other exceptions
throw new StageProcessingException("ExecutionException during processing", e);
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
LOG.debug("Execution service was interrupted", e);
throw new StageProcessingException("Execution service was interrupted", e);
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemIdTransformStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemIdTransformStage.java
index 3895bde..9a06095 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemIdTransformStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemIdTransformStage.java
@@ -74,8 +74,8 @@ public class ItemIdTransformStage<T> extends BaseIteratingStage<T> {
final List<ItemId> ids = item.getItemMetadata().get(ItemId.class);
final List<ItemId> transformedIds = new ArrayList<>();
- for (ItemId id : ids) {
- for (Converter<String, String> idTransform : idTransformers) {
+ for (final ItemId id : ids) {
+ for (final Converter<String, String> idTransform : idTransformers) {
final String transformedId = idTransform.convert(id.getId());
transformedIds.add(new ItemId(transformedId));
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataFilterStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataFilterStage.java
index 3a8a13a..538519b 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataFilterStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataFilterStage.java
@@ -47,8 +47,8 @@ public class ItemMetadataFilterStage<T> extends AbstractItemMetadataSelectionSta
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection,
- Item<T> matchingItem,
- Map<Class<? extends ItemMetadata>, List<? extends ItemMetadata>> matchingMetadata)
+ final Item<T> matchingItem,
+ final Map<Class<? extends ItemMetadata>, List<? extends ItemMetadata>> matchingMetadata)
throws StageProcessingException {
final String itemId = getItemIdentificationStrategy().getItemIdentifier(matchingItem);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataTerminationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataTerminationStage.java
index bfd5b6d..58349e9 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataTerminationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ItemMetadataTerminationStage.java
@@ -45,8 +45,8 @@ public class ItemMetadataTerminationStage<T> extends AbstractItemMetadataSelecti
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection,
- Item<T> matchingItem,
- Map<Class<? extends ItemMetadata>, List<? extends ItemMetadata>> matchingMetadata)
+ final Item<T> matchingItem,
+ final Map<Class<? extends ItemMetadata>, List<? extends ItemMetadata>> matchingMetadata)
throws TerminationException {
final String itemId = getItemIdentificationStrategy().getItemIdentifier(matchingItem);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/MultiOutputSerializationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/MultiOutputSerializationStage.java
index c854822..0dc74c5 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/MultiOutputSerializationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/MultiOutputSerializationStage.java
@@ -141,13 +141,13 @@ public class MultiOutputSerializationStage<T> extends BaseStage<T> {
}
@Override
- protected void doExecute(@Nonnull @NonnullElements Collection<Item<T>> itemCollection)
+ protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection)
throws StageProcessingException {
for (final Item<T> item : itemCollection) {
try (final Destination destination = outputStrategy.getDestination(item);
final OutputStream stream = destination.getOutputStream()) {
serializer.serialize(item, stream);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new StageProcessingException("Error writing to output location", e);
}
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineDemultiplexerStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineDemultiplexerStage.java
index d430e0b..f1cd898 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineDemultiplexerStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineDemultiplexerStage.java
@@ -111,7 +111,7 @@ public class PipelineDemultiplexerStage<T> extends BaseStage<T> {
*
* @param isWaiting whether this child waits for all the invoked pipelines to complete before proceeding
*/
- public synchronized void setWaitingForPipelines(boolean isWaiting) {
+ public synchronized void setWaitingForPipelines(final boolean isWaiting) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -165,7 +165,7 @@ public class PipelineDemultiplexerStage<T> extends BaseStage<T> {
}
final Builder<Pair<Pipeline<T>, Predicate<Item<T>>>> checkedPasses = new Builder<>();
- for (Pair<Pipeline<T>, Predicate<Item<T>>> pass : passes) {
+ for (final Pair<Pipeline<T>, Predicate<Item<T>>> pass : passes) {
Constraint.isNotNull(pass.getFirst(), "Pipeline can not be null");
Constraint.isNotNull(pass.getSecond(), "Predicate can not be null");
@@ -181,12 +181,12 @@ public class PipelineDemultiplexerStage<T> extends BaseStage<T> {
Collection<Item<T>> selectedItems;
final ArrayList<Future<Collection<Item<T>>>> pipelineFutures = new ArrayList<>();
- for (Pair<Pipeline<T>, Predicate<Item<T>>> pipelineAndStrategy : pipelineAndStrategies) {
+ for (final Pair<Pipeline<T>, Predicate<Item<T>>> pipelineAndStrategy : pipelineAndStrategies) {
final Pipeline<T> pipeline = pipelineAndStrategy.getFirst();
final Predicate<Item<T>> selectionStrategy = pipelineAndStrategy.getSecond();
selectedItems = collectionFactory.get();
- for (Item<T> item : itemCollection) {
+ for (final Item<T> item : itemCollection) {
if (selectionStrategy.apply(item)) {
// @SuppressWarnings("unchecked") final ItemType copied = (ItemType) item.copy();
// selectedItems.add(copied);
@@ -198,7 +198,7 @@ public class PipelineDemultiplexerStage<T> extends BaseStage<T> {
}
if (isWaitingForPipelines()) {
- for (Future<Collection<Item<T>>> pipelineFuture : pipelineFutures) {
+ for (final Future<Collection<Item<T>>> pipelineFuture : pipelineFutures) {
FutureSupport.futureItems(pipelineFuture);
}
}
@@ -223,7 +223,7 @@ public class PipelineDemultiplexerStage<T> extends BaseStage<T> {
}
Pipeline<T> pipeline;
- for (Pair<Pipeline<T>, Predicate<Item<T>>> pipelineAndStrategy : pipelineAndStrategies) {
+ for (final Pair<Pipeline<T>, Predicate<Item<T>>> pipelineAndStrategy : pipelineAndStrategies) {
pipeline = pipelineAndStrategy.getFirst();
if (!pipeline.isInitialized()) {
pipeline.initialize();
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineMergeStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineMergeStage.java
index b862d41..da05ccb 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineMergeStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/PipelineMergeStage.java
@@ -170,13 +170,13 @@ public class PipelineMergeStage<T> extends BaseStage<T> {
throws StageProcessingException {
final ArrayList<Future<Collection<Item<T>>>> pipelineResultFutures = new ArrayList<>();
- for (Pipeline<T> pipeline : mergedPipelines) {
+ for (final Pipeline<T> pipeline : mergedPipelines) {
pipelineResultFutures.add(executorService.submit(
new PipelineCallable<>(pipeline, collectionFactory.get())));
}
final ArrayList<Collection<Item<T>>> pipelineResults = new ArrayList<>();
- for (Future<Collection<Item<T>>> future : pipelineResultFutures) {
+ for (final Future<Collection<Item<T>>> future : pipelineResultFutures) {
pipelineResults.add(FutureSupport.futureItems(future));
}
@@ -197,7 +197,7 @@ public class PipelineMergeStage<T> extends BaseStage<T> {
@Override protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
- for (Pipeline<T> pipeline : mergedPipelines) {
+ for (final Pipeline<T> pipeline : mergedPipelines) {
if (!pipeline.isInitialized()) {
pipeline.initialize();
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ScriptletStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ScriptletStage.java
index 6432a04..b3c1491 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ScriptletStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/ScriptletStage.java
@@ -92,8 +92,8 @@ public class ScriptletStage<T> extends BaseStage<T> {
try {
script.eval(context);
- } catch (ScriptException e) {
- String errMsg = getId() + " pipeline stage unable to execute script";
+ } catch (final ScriptException e) {
+ final String errMsg = getId() + " pipeline stage unable to execute script";
log.error(errMsg, e);
throw new StageProcessingException(errMsg, e);
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SerializationStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SerializationStage.java
index bde6715..06b2dcf 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SerializationStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SerializationStage.java
@@ -100,7 +100,7 @@ public class SerializationStage<T> extends BaseStage<T> {
*
* @param isOverwriting whether an existing output file should be overwritten
*/
- public synchronized void setOverwritingExistingOutputFile(boolean isOverwriting) {
+ public synchronized void setOverwritingExistingOutputFile(final boolean isOverwriting) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -129,11 +129,11 @@ public class SerializationStage<T> extends BaseStage<T> {
}
/** {@inheritDoc} */
- @Override protected void doExecute(@Nonnull @NonnullElements Collection<Item<T>> itemCollection)
+ @Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection)
throws StageProcessingException {
try (OutputStream stream = new FileOutputStream(outputFile)) {
serializer.serializeCollection(itemCollection, stream);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new StageProcessingException("Error write to output file " + outputFile.getAbsolutePath(), e);
}
}
@@ -167,7 +167,7 @@ public class SerializationStage<T> extends BaseStage<T> {
}
} else {
- File parentDirectory = outputFile.getParentFile();
+ final File parentDirectory = outputFile.getParentFile();
if (parentDirectory != null) {
if (!parentDirectory.canWrite()) {
throw new ComponentInitializationException("Can not write to parent directory of output file '"
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SimplePipeline.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SimplePipeline.java
index b56cc39..414dd1c 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SimplePipeline.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SimplePipeline.java
@@ -74,7 +74,7 @@ public class SimplePipeline<T> extends AbstractIdentifiableInitializableComponen
throws PipelineProcessingException {
final ComponentInfo compInfo = new ComponentInfo(this);
- for (Stage<T> stage : pipelineStages) {
+ for (final Stage<T> stage : pipelineStages) {
stage.execute(itemCollection);
}
@@ -93,7 +93,7 @@ public class SimplePipeline<T> extends AbstractIdentifiableInitializableComponen
@Override protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
- for (Stage<T> stage : pipelineStages) {
+ for (final Stage<T> stage : pipelineStages) {
if (!stage.isInitialized()) {
stage.initialize();
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java
index 06537f1..c921b2f 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java
@@ -222,7 +222,7 @@ public class SplitMergeStage<T> extends BaseStage<T> {
final Collection<Item<T>> selectedItems = collectionFactory.get();
final Collection<Item<T>> nonselectedItems = collectionFactory.get();
- for (Item<T> item : itemCollection) {
+ for (final Item<T> item : itemCollection) {
if (item == null) {
continue;
}
@@ -256,7 +256,7 @@ public class SplitMergeStage<T> extends BaseStage<T> {
*
* @return the token representing the background execution of the pipeline
*/
- @Nonnull protected Future<Collection<Item<T>>> executePipeline(Pipeline<T> pipeline,
+ @Nonnull protected Future<Collection<Item<T>>> executePipeline(final Pipeline<T> pipeline,
final Collection<Item<T>> items) {
/*
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StaticItemSourceStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StaticItemSourceStage.java
index a1169d9..b13f436 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StaticItemSourceStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StaticItemSourceStage.java
@@ -73,7 +73,7 @@ public class StaticItemSourceStage<T> extends BaseStage<T> {
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection)
throws StageProcessingException {
- for (Item<T> item : getSourceItems()) {
+ for (final Item<T> item : getSourceItems()) {
if (item != null) {
itemCollection.add(item.copy());
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StatusMetadataLoggingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StatusMetadataLoggingStage.java
index 8dd9bd1..ddf1a42 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StatusMetadataLoggingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/StatusMetadataLoggingStage.java
@@ -68,10 +68,10 @@ public class StatusMetadataLoggingStage<T> extends AbstractItemMetadataSelection
* @param statuses status messages to log
*/
private void logInfos(@Nonnull final String itemId,
- @Nonnull @NonnullElements List<? extends ItemMetadata> statuses) {
+ @Nonnull @NonnullElements final List<? extends ItemMetadata> statuses) {
if (statuses != null && !statuses.isEmpty() && log.isInfoEnabled()) {
log.info("Item {} was marked with the following Info status messages", itemId);
- for (ItemMetadata info : statuses) {
+ for (final ItemMetadata info : statuses) {
final StatusMetadata status = (StatusMetadata) info;
log.info(" {}: {}", status.getComponentId(), status.getStatusMessage());
}
@@ -85,10 +85,10 @@ public class StatusMetadataLoggingStage<T> extends AbstractItemMetadataSelection
* @param statuses status messages to log
*/
private void logWarnings(@Nonnull final String itemId,
- @Nonnull @NonnullElements List<? extends ItemMetadata> statuses) {
+ @Nonnull @NonnullElements final List<? extends ItemMetadata> statuses) {
if (statuses != null && !statuses.isEmpty() && log.isWarnEnabled()) {
log.warn("Item {} was marked with the following Warning status messages", itemId);
- for (ItemMetadata info : statuses) {
+ for (final ItemMetadata info : statuses) {
final StatusMetadata status = (StatusMetadata) info;
log.warn(" {}: {}", status.getComponentId(), status.getStatusMessage());
}
@@ -102,10 +102,10 @@ public class StatusMetadataLoggingStage<T> extends AbstractItemMetadataSelection
* @param statuses status messages to log
*/
private void logErrors(@Nonnull final String itemId,
- @Nonnull @NonnullElements List<? extends ItemMetadata> statuses) {
+ @Nonnull @NonnullElements final List<? extends ItemMetadata> statuses) {
if (statuses != null && !statuses.isEmpty() && log.isErrorEnabled()) {
log.error("Item {} was marked with the following Error status messages", itemId);
- for (ItemMetadata info : statuses) {
+ for (final ItemMetadata info : statuses) {
final StatusMetadata status = (StatusMetadata) info;
log.error(" {}: {}", status.getComponentId(), status.getStatusMessage());
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemCollectionWithMetadata.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemCollectionWithMetadata.java
index de3f3d2..165565c 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemCollectionWithMetadata.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemCollectionWithMetadata.java
@@ -81,7 +81,7 @@ public class ItemCollectionWithMetadata<T> implements Collection<Item<T>> {
}
/** {@inheritDoc} */
- @Override public boolean contains(Object o) {
+ @Override public boolean contains(final Object o) {
return delegate.contains(o);
}
@@ -145,7 +145,7 @@ public class ItemCollectionWithMetadata<T> implements Collection<Item<T>> {
}
/** {@inheritDoc} */
- @Override public boolean retainAll(@Nonnull Collection<?> c) {
+ @Override public boolean retainAll(@Nonnull final Collection<?> c) {
Constraint.isNotNull(c, "Collection can not be null");
return delegate.retainAll(c);
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemMetadataSupport.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemMetadataSupport.java
index d1c15dc..b23d9e8 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemMetadataSupport.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/util/ItemMetadataSupport.java
@@ -41,12 +41,12 @@ public final class ItemMetadataSupport {
* collection
*/
public static void addToAll(@Nullable final Collection<? extends Item<?>> itemCollection,
- @Nullable @NullableElements Iterable<? extends ItemMetadata> metadatas) {
+ @Nullable @NullableElements final Iterable<? extends ItemMetadata> metadatas) {
if (itemCollection == null || metadatas == null) {
return;
}
- for (Item<?> item : itemCollection) {
+ for (final Item<?> item : itemCollection) {
addAll(item, metadatas);
}
}
@@ -63,7 +63,7 @@ public final class ItemMetadataSupport {
return;
}
- for (ItemMetadata metadata : metadatas) {
+ for (final ItemMetadata metadata : metadatas) {
if (metadata != null) {
item.getItemMetadata().put(metadata);
}
@@ -87,8 +87,8 @@ public final class ItemMetadataSupport {
return;
}
- ItemCollectionWithMetadata<T> collection = (ItemCollectionWithMetadata<T>) itemCollection;
- for (ItemMetadata metadata : itemMetadatas) {
+ final ItemCollectionWithMetadata<T> collection = (ItemCollectionWithMetadata<T>) itemCollection;
+ for (final ItemMetadata metadata : itemMetadatas) {
if (metadata != null) {
collection.getCollectionMetadata().put(metadata);
}
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidator.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidator.java
index 5398f24..059e160 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidator.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidator.java
@@ -135,14 +135,14 @@ public class X509RSAOpenSSLBlacklistValidator extends AbstractX509Validator {
final char[] encodedModulus = Hex.encodeHex(modulusBytes, false);
// Now construct the thing we want to hash
- ByteArrayOutputStream bb = new ByteArrayOutputStream();
+ final ByteArrayOutputStream bb = new ByteArrayOutputStream();
try {
bb.write(openSSLprefix);
- for (char c : encodedModulus) {
+ for (final char c : encodedModulus) {
bb.write((byte) c);
}
bb.write('\n');
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new StageProcessingException("internal error writing to ByteArrayStream", e);
}
//System.out.println("To be digested: " + bb.toString());
@@ -153,12 +153,12 @@ public class X509RSAOpenSSLBlacklistValidator extends AbstractX509Validator {
final byte[] bytes = digest.digest();
// Convert the digest to a lower-case hex string
- char [] encodedDigest = Hex.encodeHex(bytes, true);
+ final char [] encodedDigest = Hex.encodeHex(bytes, true);
final String strValue = String.valueOf(encodedDigest);
final String trimmed = strValue.substring(20);
//System.out.println("Digest: " + strValue + " trimmed " + trimmed);
return trimmed;
- } catch (NoSuchAlgorithmException e) {
+ } catch (final NoSuchAlgorithmException e) {
throw new StageProcessingException("could not create message digester", e);
}
}
@@ -224,7 +224,7 @@ public class X509RSAOpenSSLBlacklistValidator extends AbstractX509Validator {
blacklistedValues.add(line);
}
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new ComponentInitializationException("Unable to initialize " + getId()
+ ", error reading blacklistResource " + blacklistResource.getDescription() + " information", e);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list