You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/09/27 22:24:26 UTC
svn commit: r1842194 [14/34] - in /commons/proper/configuration/trunk/src:
main/java/org/apache/commons/configuration2/
main/java/org/apache/commons/configuration2/beanutils/
main/java/org/apache/commons/configuration2/builder/
main/java/org/apache/com...
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTracker.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTracker.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTracker.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTracker.java Thu Sep 27 22:24:23 2018
@@ -82,7 +82,7 @@ class NodeTracker
*
* @param map the map with tracked nodes
*/
- private NodeTracker(Map<NodeSelector, TrackedNodeData> map)
+ private NodeTracker(final Map<NodeSelector, TrackedNodeData> map)
{
trackedNodes = map;
}
@@ -100,13 +100,13 @@ class NodeTracker
* @throws ConfigurationRuntimeException if the selector does not select a
* single node
*/
- public NodeTracker trackNode(ImmutableNode root, NodeSelector selector,
- NodeKeyResolver<ImmutableNode> resolver,
- NodeHandler<ImmutableNode> handler)
+ public NodeTracker trackNode(final ImmutableNode root, final NodeSelector selector,
+ final NodeKeyResolver<ImmutableNode> resolver,
+ final NodeHandler<ImmutableNode> handler)
{
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>(trackedNodes);
- TrackedNodeData trackData = newState.get(selector);
+ final TrackedNodeData trackData = newState.get(selector);
newState.put(
selector,
trackDataForAddedObserver(root, selector, resolver, handler,
@@ -122,15 +122,15 @@ class NodeTracker
* @param nodes a collection with the nodes to be tracked
* @return the updated instance
*/
- public NodeTracker trackNodes(Collection<NodeSelector> selectors,
- Collection<ImmutableNode> nodes)
+ public NodeTracker trackNodes(final Collection<NodeSelector> selectors,
+ final Collection<ImmutableNode> nodes)
{
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>(trackedNodes);
- Iterator<ImmutableNode> itNodes = nodes.iterator();
- for (NodeSelector selector : selectors)
+ final Iterator<ImmutableNode> itNodes = nodes.iterator();
+ for (final NodeSelector selector : selectors)
{
- ImmutableNode node = itNodes.next();
+ final ImmutableNode node = itNodes.next();
TrackedNodeData trackData = newState.get(selector);
if (trackData == null)
{
@@ -156,13 +156,13 @@ class NodeTracker
* @throws ConfigurationRuntimeException if no information about this node
* is available
*/
- public NodeTracker untrackNode(NodeSelector selector)
+ public NodeTracker untrackNode(final NodeSelector selector)
{
- TrackedNodeData trackData = getTrackedNodeData(selector);
+ final TrackedNodeData trackData = getTrackedNodeData(selector);
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>(trackedNodes);
- TrackedNodeData newTrackData = trackData.observerRemoved();
+ final TrackedNodeData newTrackData = trackData.observerRemoved();
if (newTrackData == null)
{
newState.remove(selector);
@@ -183,7 +183,7 @@ class NodeTracker
* @throws ConfigurationRuntimeException if no data for this selector is
* available
*/
- public ImmutableNode getTrackedNode(NodeSelector selector)
+ public ImmutableNode getTrackedNode(final NodeSelector selector)
{
return getTrackedNodeData(selector).getNode();
}
@@ -196,7 +196,7 @@ class NodeTracker
* @throws ConfigurationRuntimeException if no data for this selector is
* available
*/
- public boolean isTrackedNodeDetached(NodeSelector selector)
+ public boolean isTrackedNodeDetached(final NodeSelector selector)
{
return getTrackedNodeData(selector).isDetached();
}
@@ -213,7 +213,7 @@ class NodeTracker
* @throws ConfigurationRuntimeException if no data for this selector is
* available
*/
- public InMemoryNodeModel getDetachedNodeModel(NodeSelector selector)
+ public InMemoryNodeModel getDetachedNodeModel(final NodeSelector selector)
{
return getTrackedNodeData(selector).getDetachedModel();
}
@@ -238,9 +238,9 @@ class NodeTracker
* @param handler the {@code NodeHandler}
* @return the updated instance
*/
- public NodeTracker update(ImmutableNode root, NodeSelector txTarget,
- NodeKeyResolver<ImmutableNode> resolver,
- NodeHandler<ImmutableNode> handler)
+ public NodeTracker update(final ImmutableNode root, final NodeSelector txTarget,
+ final NodeKeyResolver<ImmutableNode> resolver,
+ final NodeHandler<ImmutableNode> handler)
{
if (trackedNodes.isEmpty())
{
@@ -248,9 +248,9 @@ class NodeTracker
return this;
}
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>();
- for (Map.Entry<NodeSelector, TrackedNodeData> e : trackedNodes
+ for (final Map.Entry<NodeSelector, TrackedNodeData> e : trackedNodes
.entrySet())
{
newState.put(
@@ -277,12 +277,12 @@ class NodeTracker
return this;
}
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>();
- for (Map.Entry<NodeSelector, TrackedNodeData> e : trackedNodes
+ for (final Map.Entry<NodeSelector, TrackedNodeData> e : trackedNodes
.entrySet())
{
- TrackedNodeData newData =
+ final TrackedNodeData newData =
e.getValue().isDetached() ? e.getValue() : e.getValue()
.detach(null);
newState.put(e.getKey(), newData);
@@ -300,10 +300,10 @@ class NodeTracker
* @return the updated instance
* @throws ConfigurationRuntimeException if the selector cannot be resolved
*/
- public NodeTracker replaceAndDetachTrackedNode(NodeSelector selector,
- ImmutableNode newNode)
+ public NodeTracker replaceAndDetachTrackedNode(final NodeSelector selector,
+ final ImmutableNode newNode)
{
- Map<NodeSelector, TrackedNodeData> newState =
+ final Map<NodeSelector, TrackedNodeData> newState =
new HashMap<>(trackedNodes);
newState.put(selector, getTrackedNodeData(selector).detach(newNode));
return new NodeTracker(newState);
@@ -317,9 +317,9 @@ class NodeTracker
* @return the {@code TrackedNodeData} object for this selector
* @throws ConfigurationRuntimeException if the selector cannot be resolved
*/
- private TrackedNodeData getTrackedNodeData(NodeSelector selector)
+ private TrackedNodeData getTrackedNodeData(final NodeSelector selector)
{
- TrackedNodeData trackData = trackedNodes.get(selector);
+ final TrackedNodeData trackData = trackedNodes.get(selector);
if (trackData == null)
{
throw new ConfigurationRuntimeException("No tracked node found: "
@@ -342,10 +342,10 @@ class NodeTracker
* @return the updated {@code TrackedNodeData}
*/
private static TrackedNodeData determineUpdatedTrackedNodeData(
- ImmutableNode root, NodeSelector txTarget,
- NodeKeyResolver<ImmutableNode> resolver,
- NodeHandler<ImmutableNode> handler,
- Map.Entry<NodeSelector, TrackedNodeData> e)
+ final ImmutableNode root, final NodeSelector txTarget,
+ final NodeKeyResolver<ImmutableNode> resolver,
+ final NodeHandler<ImmutableNode> handler,
+ final Map.Entry<NodeSelector, TrackedNodeData> e)
{
if (e.getValue().isDetached())
{
@@ -357,7 +357,7 @@ class NodeTracker
{
newTarget = e.getKey().select(root, resolver, handler);
}
- catch (Exception ex)
+ catch (final Exception ex)
{
/*
Evaluation of the key caused an exception. This can happen for
@@ -386,9 +386,9 @@ class NodeTracker
* tracked node
*/
private static TrackedNodeData detachedTrackedNodeData(
- NodeSelector txTarget, Map.Entry<NodeSelector, TrackedNodeData> e)
+ final NodeSelector txTarget, final Map.Entry<NodeSelector, TrackedNodeData> e)
{
- ImmutableNode newNode =
+ final ImmutableNode newNode =
e.getKey().equals(txTarget) ? createEmptyTrackedNode(e
.getValue()) : null;
return e.getValue().detach(newNode);
@@ -402,7 +402,7 @@ class NodeTracker
* @param data the {@code TrackedNodeData}
* @return the new node instance for this tracked node
*/
- private static ImmutableNode createEmptyTrackedNode(TrackedNodeData data)
+ private static ImmutableNode createEmptyTrackedNode(final TrackedNodeData data)
{
return new ImmutableNode.Builder().name(data.getNode().getNodeName())
.create();
@@ -422,15 +422,15 @@ class NodeTracker
* single node
*/
private static TrackedNodeData trackDataForAddedObserver(
- ImmutableNode root, NodeSelector selector,
- NodeKeyResolver<ImmutableNode> resolver,
- NodeHandler<ImmutableNode> handler, TrackedNodeData trackData)
+ final ImmutableNode root, final NodeSelector selector,
+ final NodeKeyResolver<ImmutableNode> resolver,
+ final NodeHandler<ImmutableNode> handler, final TrackedNodeData trackData)
{
if (trackData != null)
{
return trackData.observerAdded();
}
- ImmutableNode target = selector.select(root, resolver, handler);
+ final ImmutableNode target = selector.select(root, resolver, handler);
if (target == null)
{
throw new ConfigurationRuntimeException(
@@ -459,7 +459,7 @@ class NodeTracker
*
* @param nd the tracked node
*/
- public TrackedNodeData(ImmutableNode nd)
+ public TrackedNodeData(final ImmutableNode nd)
{
this(nd, 1, null);
}
@@ -472,8 +472,8 @@ class NodeTracker
* @param obsCount the observer count
* @param detachedNodeModel a model to be used in detached mode
*/
- private TrackedNodeData(ImmutableNode nd, int obsCount,
- InMemoryNodeModel detachedNodeModel)
+ private TrackedNodeData(final ImmutableNode nd, final int obsCount,
+ final InMemoryNodeModel detachedNodeModel)
{
node = nd;
observerCount = obsCount;
@@ -545,7 +545,7 @@ class NodeTracker
* @param newNode the new tracked node instance
* @return the updated instance
*/
- public TrackedNodeData updateNode(ImmutableNode newNode)
+ public TrackedNodeData updateNode(final ImmutableNode newNode)
{
return new TrackedNodeData(newNode, observerCount, getDetachedModel());
}
@@ -560,9 +560,9 @@ class NodeTracker
* @param newNode the new tracked node instance (may be <b>null</b>)
* @return the updated instance
*/
- public TrackedNodeData detach(ImmutableNode newNode)
+ public TrackedNodeData detach(final ImmutableNode newNode)
{
- ImmutableNode newTrackedNode =
+ final ImmutableNode newTrackedNode =
(newNode != null) ? newNode : getNode();
return new TrackedNodeData(newTrackedNode, observerCount,
new InMemoryNodeModel(newTrackedNode));
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java Thu Sep 27 22:24:23 2018
@@ -63,8 +63,8 @@ public class NodeTreeWalker
* @param <T> the type of the nodes involved
* @throws IllegalArgumentException if a required parameter is <b>null</b>
*/
- public <T> void walkDFS(T root, ConfigurationNodeVisitor<T> visitor,
- NodeHandler<T> handler)
+ public <T> void walkDFS(final T root, final ConfigurationNodeVisitor<T> visitor,
+ final NodeHandler<T> handler)
{
if (checkParameters(root, visitor, handler))
{
@@ -91,8 +91,8 @@ public class NodeTreeWalker
* @param <T> the type of the nodes involved
* @throws IllegalArgumentException if a required parameter is <b>null</b>
*/
- public <T> void walkBFS(T root, ConfigurationNodeVisitor<T> visitor,
- NodeHandler<T> handler)
+ public <T> void walkBFS(final T root, final ConfigurationNodeVisitor<T> visitor,
+ final NodeHandler<T> handler)
{
if (checkParameters(root, visitor, handler))
{
@@ -108,13 +108,13 @@ public class NodeTreeWalker
* @param handler the handler
* @param <T> the type of the nodes involved
*/
- private static <T> void dfs(T node, ConfigurationNodeVisitor<T> visitor,
- NodeHandler<T> handler)
+ private static <T> void dfs(final T node, final ConfigurationNodeVisitor<T> visitor,
+ final NodeHandler<T> handler)
{
if (!visitor.terminate())
{
visitor.visitBeforeChildren(node, handler);
- for (T c : handler.getChildren(node))
+ for (final T c : handler.getChildren(node))
{
dfs(c, visitor, handler);
}
@@ -137,19 +137,19 @@ public class NodeTreeWalker
* @param handler the handler
* @param <T> the type of the nodes involved
*/
- private static <T> void bfs(T root, ConfigurationNodeVisitor<T> visitor,
- NodeHandler<T> handler)
+ private static <T> void bfs(final T root, final ConfigurationNodeVisitor<T> visitor,
+ final NodeHandler<T> handler)
{
- List<T> pendingNodes = new LinkedList<>();
+ final List<T> pendingNodes = new LinkedList<>();
pendingNodes.add(root);
boolean cancel = false;
while (!pendingNodes.isEmpty() && !cancel)
{
- T node = pendingNodes.remove(0);
+ final T node = pendingNodes.remove(0);
visitor.visitBeforeChildren(node, handler);
cancel = visitor.terminate();
- for (T c : handler.getChildren(node))
+ for (final T c : handler.getChildren(node))
{
pendingNodes.add(c);
}
@@ -169,8 +169,8 @@ public class NodeTreeWalker
* otherwise
* @throws IllegalArgumentException if a required parameter is missing
*/
- private static <T> boolean checkParameters(T root,
- ConfigurationNodeVisitor<T> visitor, NodeHandler<T> handler)
+ private static <T> boolean checkParameters(final T root,
+ final ConfigurationNodeVisitor<T> visitor, final NodeHandler<T> handler)
{
if (visitor == null)
{
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeUpdateData.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeUpdateData.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeUpdateData.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/NodeUpdateData.java Thu Sep 27 22:24:23 2018
@@ -68,9 +68,9 @@ public class NodeUpdateData<T>
* @param removedNodes the collection with the nodes to be removed
* @param key the key of the update operation
*/
- public NodeUpdateData(Map<QueryResult<T>, Object> changedValues,
- Collection<Object> newValues,
- Collection<QueryResult<T>> removedNodes, String key)
+ public NodeUpdateData(final Map<QueryResult<T>, Object> changedValues,
+ final Collection<Object> newValues,
+ final Collection<QueryResult<T>> removedNodes, final String key)
{
this.changedValues = copyMap(changedValues);
this.newValues = copyCollection(newValues);
@@ -133,7 +133,7 @@ public class NodeUpdateData<T>
* @param <V> the type of the values involved
* @return the unmodifiable copy
*/
- private static <K, V> Map<K, V> copyMap(Map<? extends K, ? extends V> map)
+ private static <K, V> Map<K, V> copyMap(final Map<? extends K, ? extends V> map)
{
if (map == null)
{
@@ -150,7 +150,7 @@ public class NodeUpdateData<T>
* @param <T> the element type of the collection
* @return the unmodifiable copy
*/
- private static <T> Collection<T> copyCollection(Collection<? extends T> col)
+ private static <T> Collection<T> copyCollection(final Collection<? extends T> col)
{
if (col == null)
{
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java Thu Sep 27 22:24:23 2018
@@ -60,16 +60,16 @@ public class OverrideCombiner extends No
* @return the resulting combined node structure
*/
@Override
- public ImmutableNode combine(ImmutableNode node1,
- ImmutableNode node2)
+ public ImmutableNode combine(final ImmutableNode node1,
+ final ImmutableNode node2)
{
- ImmutableNode.Builder result = new ImmutableNode.Builder();
+ final ImmutableNode.Builder result = new ImmutableNode.Builder();
result.name(node1.getNodeName());
// Process nodes from the first structure, which override the second
- for (ImmutableNode child : node1.getChildren())
+ for (final ImmutableNode child : node1.getChildren())
{
- ImmutableNode child2 = canCombine(node1, node2, child);
+ final ImmutableNode child2 = canCombine(node1, node2, child);
if (child2 != null)
{
result.addChild(combine(child, child2));
@@ -82,7 +82,7 @@ public class OverrideCombiner extends No
// Process nodes from the second structure, which are not contained
// in the first structure
- for (ImmutableNode child : node2.getChildren())
+ for (final ImmutableNode child : node2.getChildren())
{
if (HANDLER.getChildrenCount(node1, child.getNodeName()) < 1)
{
@@ -107,11 +107,11 @@ public class OverrideCombiner extends No
* @param node1 the first node
* @param node2 the second node
*/
- protected void addAttributes(ImmutableNode.Builder result,
- ImmutableNode node1, ImmutableNode node2)
+ protected void addAttributes(final ImmutableNode.Builder result,
+ final ImmutableNode node1, final ImmutableNode node2)
{
result.addAttributes(node1.getAttributes());
- for (String attr : node2.getAttributes().keySet())
+ for (final String attr : node2.getAttributes().keySet())
{
if (!node1.getAttributes().containsKey(attr))
{
@@ -133,8 +133,8 @@ public class OverrideCombiner extends No
* @param child the child node (of the first node)
* @return a child of the second node, with which a combination is possible
*/
- protected ImmutableNode canCombine(ImmutableNode node1,
- ImmutableNode node2, ImmutableNode child)
+ protected ImmutableNode canCombine(final ImmutableNode node1,
+ final ImmutableNode node2, final ImmutableNode child)
{
if (HANDLER.getChildrenCount(node2, child.getNodeName()) == 1
&& HANDLER.getChildrenCount(node1, child.getNodeName()) == 1
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/QueryResult.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/QueryResult.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/QueryResult.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/QueryResult.java Thu Sep 27 22:24:23 2018
@@ -56,7 +56,7 @@ public final class QueryResult<T>
* @param nd the node
* @param attr the attribute name
*/
- private QueryResult(T nd, String attr)
+ private QueryResult(final T nd, final String attr)
{
node = nd;
attributeName = attr;
@@ -70,7 +70,7 @@ public final class QueryResult<T>
* @param resultNode the result node
* @return the newly created instance
*/
- public static <T> QueryResult<T> createNodeResult(T resultNode)
+ public static <T> QueryResult<T> createNodeResult(final T resultNode)
{
return new QueryResult<>(resultNode, null);
}
@@ -85,8 +85,8 @@ public final class QueryResult<T>
* @param <T> the type of the parent node
* @return the newly created instance
*/
- public static <T> QueryResult<T> createAttributeResult(T parentNode,
- String attrName)
+ public static <T> QueryResult<T> createAttributeResult(final T parentNode,
+ final String attrName)
{
return new QueryResult<>(parentNode, attrName);
}
@@ -134,7 +134,7 @@ public final class QueryResult<T>
* @return the attribute value
* @throws IllegalStateException if this is not an attribute result
*/
- public Object getAttributeValue(NodeHandler<T> handler)
+ public Object getAttributeValue(final NodeHandler<T> handler)
{
if (!isAttributeResult())
{
@@ -160,7 +160,7 @@ public final class QueryResult<T>
* @return a flag whether these objects are equal
*/
@Override
- public boolean equals(Object obj)
+ public boolean equals(final Object obj)
{
if (this == obj)
{
@@ -171,7 +171,7 @@ public final class QueryResult<T>
return false;
}
- QueryResult<?> c = (QueryResult<?>) obj;
+ final QueryResult<?> c = (QueryResult<?>) obj;
return new EqualsBuilder().append(getNode(), c.getNode())
.append(getAttributeName(), c.getAttributeName()).isEquals();
}
@@ -186,7 +186,7 @@ public final class QueryResult<T>
@Override
public String toString()
{
- ToStringBuilder sb = new ToStringBuilder(this);
+ final ToStringBuilder sb = new ToStringBuilder(this);
if (isAttributeResult())
{
sb.append("parentNode", getNode()).append("attribute",
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/ReferenceTracker.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/ReferenceTracker.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/ReferenceTracker.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/ReferenceTracker.java Thu Sep 27 22:24:23 2018
@@ -69,8 +69,8 @@ class ReferenceTracker
* @param refs the references
* @param removedRefs the removed references
*/
- private ReferenceTracker(Map<ImmutableNode, Object> refs,
- List<Object> removedRefs)
+ private ReferenceTracker(final Map<ImmutableNode, Object> refs,
+ final List<Object> removedRefs)
{
references = refs;
removedReferences = removedRefs;
@@ -94,9 +94,9 @@ class ReferenceTracker
* @param refs the references to be added
* @return the new instance
*/
- public ReferenceTracker addReferences(Map<ImmutableNode, ?> refs)
+ public ReferenceTracker addReferences(final Map<ImmutableNode, ?> refs)
{
- Map<ImmutableNode, Object> newRefs =
+ final Map<ImmutableNode, Object> newRefs =
new HashMap<>(references);
newRefs.putAll(refs);
return new ReferenceTracker(newRefs, removedReferences);
@@ -113,16 +113,16 @@ class ReferenceTracker
* @return the new instance
*/
public ReferenceTracker updateReferences(
- Map<ImmutableNode, ImmutableNode> replacedNodes,
- Collection<ImmutableNode> removedNodes)
+ final Map<ImmutableNode, ImmutableNode> replacedNodes,
+ final Collection<ImmutableNode> removedNodes)
{
if (!references.isEmpty())
{
Map<ImmutableNode, Object> newRefs = null;
- for (Map.Entry<ImmutableNode, ImmutableNode> e : replacedNodes
+ for (final Map.Entry<ImmutableNode, ImmutableNode> e : replacedNodes
.entrySet())
{
- Object ref = references.get(e.getKey());
+ final Object ref = references.get(e.getKey());
if (ref != null)
{
if (newRefs == null)
@@ -138,9 +138,9 @@ class ReferenceTracker
List<Object> newRemovedRefs =
(newRefs != null) ? new LinkedList<>(
removedReferences) : null;
- for (ImmutableNode node : removedNodes)
+ for (final ImmutableNode node : removedNodes)
{
- Object ref = references.get(node);
+ final Object ref = references.get(node);
if (ref != null)
{
if (newRefs == null)
@@ -173,7 +173,7 @@ class ReferenceTracker
* @param node the node
* @return the reference object for this node or <b>null</b>
*/
- public Object getReference(ImmutableNode node)
+ public Object getReference(final ImmutableNode node)
{
return references.get(node);
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeHandler.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeHandler.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeHandler.java Thu Sep 27 22:24:23 2018
@@ -54,8 +54,8 @@ class TrackedNodeHandler extends Abstrac
* @param root the root node of the represented hierarchy
* @param handler an underlying handler for delegation
*/
- public TrackedNodeHandler(ImmutableNode root,
- NodeHandler<ImmutableNode> handler)
+ public TrackedNodeHandler(final ImmutableNode root,
+ final NodeHandler<ImmutableNode> handler)
{
rootNode = root;
parentHandler = handler;
@@ -77,7 +77,7 @@ class TrackedNodeHandler extends Abstrac
* parent mapping.
*/
@Override
- public ImmutableNode getParent(ImmutableNode node)
+ public ImmutableNode getParent(final ImmutableNode node)
{
return getParentHandler().getParent(node);
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeModel.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeModel.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeModel.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TrackedNodeModel.java Thu Sep 27 22:24:23 2018
@@ -96,8 +96,8 @@ public class TrackedNodeModel implements
* released on finalization
* @throws IllegalArgumentException if a required parameter is missing
*/
- public TrackedNodeModel(InMemoryNodeModelSupport modelSupport, NodeSelector sel,
- boolean untrackOnFinalize)
+ public TrackedNodeModel(final InMemoryNodeModelSupport modelSupport, final NodeSelector sel,
+ final boolean untrackOnFinalize)
{
if (modelSupport == null)
{
@@ -165,7 +165,7 @@ public class TrackedNodeModel implements
}
@Override
- public void setRootNode(ImmutableNode newRoot)
+ public void setRootNode(final ImmutableNode newRoot)
{
getParentModel().replaceTrackedNode(getSelector(), newRoot);
}
@@ -177,36 +177,36 @@ public class TrackedNodeModel implements
}
@Override
- public void addProperty(String key, Iterable<?> values,
- NodeKeyResolver<ImmutableNode> resolver)
+ public void addProperty(final String key, final Iterable<?> values,
+ final NodeKeyResolver<ImmutableNode> resolver)
{
getParentModel().addProperty(key, getSelector(), values, resolver);
}
@Override
- public void addNodes(String key, Collection<? extends ImmutableNode> nodes,
- NodeKeyResolver<ImmutableNode> resolver)
+ public void addNodes(final String key, final Collection<? extends ImmutableNode> nodes,
+ final NodeKeyResolver<ImmutableNode> resolver)
{
getParentModel().addNodes(key, getSelector(), nodes, resolver);
}
@Override
- public void setProperty(String key, Object value,
- NodeKeyResolver<ImmutableNode> resolver)
+ public void setProperty(final String key, final Object value,
+ final NodeKeyResolver<ImmutableNode> resolver)
{
getParentModel().setProperty(key, getSelector(), value, resolver);
}
@Override
- public List<QueryResult<ImmutableNode>> clearTree(String key,
- NodeKeyResolver<ImmutableNode> resolver)
+ public List<QueryResult<ImmutableNode>> clearTree(final String key,
+ final NodeKeyResolver<ImmutableNode> resolver)
{
return getParentModel().clearTree(key, getSelector(), resolver);
}
@Override
- public void clearProperty(String key,
- NodeKeyResolver<ImmutableNode> resolver)
+ public void clearProperty(final String key,
+ final NodeKeyResolver<ImmutableNode> resolver)
{
getParentModel().clearProperty(key, getSelector(), resolver);
}
@@ -219,7 +219,7 @@ public class TrackedNodeModel implements
* @param resolver
*/
@Override
- public void clear(NodeKeyResolver<ImmutableNode> resolver)
+ public void clear(final NodeKeyResolver<ImmutableNode> resolver)
{
getParentModel().clearTree(null, getSelector(), resolver);
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeData.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeData.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeData.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeData.java Thu Sep 27 22:24:23 2018
@@ -63,10 +63,10 @@ class TreeData extends AbstractImmutable
* @param tracker the {@code NodeTracker}
* @param refTracker the {@code ReferenceTracker}
*/
- public TreeData(ImmutableNode root,
- Map<ImmutableNode, ImmutableNode> parentMapping,
- Map<ImmutableNode, ImmutableNode> replacements,
- NodeTracker tracker, ReferenceTracker refTracker)
+ public TreeData(final ImmutableNode root,
+ final Map<ImmutableNode, ImmutableNode> parentMapping,
+ final Map<ImmutableNode, ImmutableNode> replacements,
+ final NodeTracker tracker, final ReferenceTracker refTracker)
{
this.root = root;
this.parentMapping = parentMapping;
@@ -112,15 +112,15 @@ class TreeData extends AbstractImmutable
* @throws IllegalArgumentException if the node cannot be resolved
*/
@Override
- public ImmutableNode getParent(ImmutableNode node)
+ public ImmutableNode getParent(final ImmutableNode node)
{
if (node == getRootNode())
{
return null;
}
- ImmutableNode org = handleReplacements(node, inverseReplacementMapping);
+ final ImmutableNode org = handleReplacements(node, inverseReplacementMapping);
- ImmutableNode parent = parentMapping.get(org);
+ final ImmutableNode parent = parentMapping.get(org);
if (parent == null)
{
throw new IllegalArgumentException("Cannot determine parent! "
@@ -157,7 +157,7 @@ class TreeData extends AbstractImmutable
* @param newTracker the new {@code NodeTracker}
* @return the updated instance
*/
- public TreeData updateNodeTracker(NodeTracker newTracker)
+ public TreeData updateNodeTracker(final NodeTracker newTracker)
{
return new TreeData(root, parentMapping, replacementMapping,
newTracker, referenceTracker);
@@ -171,7 +171,7 @@ class TreeData extends AbstractImmutable
* @param newTracker the new {@code ReferenceTracker}
* @return the updated instance
*/
- public TreeData updateReferenceTracker(ReferenceTracker newTracker)
+ public TreeData updateReferenceTracker(final ReferenceTracker newTracker)
{
return new TreeData(root, parentMapping, replacementMapping,
nodeTracker, newTracker);
@@ -181,7 +181,7 @@ class TreeData extends AbstractImmutable
* {@inheritDoc} This implementation delegates to the reference tracker.
*/
@Override
- public Object getReference(ImmutableNode node)
+ public Object getReference(final ImmutableNode node)
{
return getReferenceTracker().getReference(node);
}
@@ -208,8 +208,8 @@ class TreeData extends AbstractImmutable
* @param mapping the replacement mapping
* @return the corresponding node according to the mapping
*/
- private static ImmutableNode handleReplacements(ImmutableNode replace,
- Map<ImmutableNode, ImmutableNode> mapping)
+ private static ImmutableNode handleReplacements(final ImmutableNode replace,
+ final Map<ImmutableNode, ImmutableNode> mapping)
{
ImmutableNode node = replace;
ImmutableNode org;
@@ -231,11 +231,11 @@ class TreeData extends AbstractImmutable
* @return the inverse replacement mapping
*/
private Map<ImmutableNode, ImmutableNode> createInverseMapping(
- Map<ImmutableNode, ImmutableNode> replacements)
+ final Map<ImmutableNode, ImmutableNode> replacements)
{
- Map<ImmutableNode, ImmutableNode> inverseMapping =
+ final Map<ImmutableNode, ImmutableNode> inverseMapping =
new HashMap<>();
- for (Map.Entry<ImmutableNode, ImmutableNode> e : replacements
+ for (final Map.Entry<ImmutableNode, ImmutableNode> e : replacements
.entrySet())
{
inverseMapping.put(e.getValue(), e.getKey());
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeUtils.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeUtils.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/TreeUtils.java Thu Sep 27 22:24:23 2018
@@ -37,7 +37,7 @@ public final class TreeUtils
* @param stream The OutputStream.
* @param result The root node of the tree.
*/
- public static void printTree(PrintStream stream, ImmutableNode result)
+ public static void printTree(final PrintStream stream, final ImmutableNode result)
{
if (stream != null)
{
@@ -45,10 +45,10 @@ public final class TreeUtils
}
}
- private static void printTree(PrintStream stream, String indent, ImmutableNode result)
+ private static void printTree(final PrintStream stream, final String indent, final ImmutableNode result)
{
- StringBuilder buffer = new StringBuilder(indent).append("<").append(result.getNodeName());
- for (Map.Entry<String, Object> e : result.getAttributes().entrySet())
+ final StringBuilder buffer = new StringBuilder(indent).append("<").append(result.getNodeName());
+ for (final Map.Entry<String, Object> e : result.getAttributes().entrySet())
{
buffer.append(' ').append(e.getKey()).append("='").append(e.getValue()).append("'");
}
@@ -62,7 +62,7 @@ public final class TreeUtils
if (!result.getChildren().isEmpty())
{
stream.print("\n");
- for (ImmutableNode child : result.getChildren())
+ for (final ImmutableNode child : result.getChildren())
{
printTree(stream, indent + " ", child);
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/UnionCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/UnionCombiner.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/UnionCombiner.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/UnionCombiner.java Thu Sep 27 22:24:23 2018
@@ -123,10 +123,10 @@ public class UnionCombiner extends NodeC
* @return the union node
*/
@Override
- public ImmutableNode combine(ImmutableNode node1,
- ImmutableNode node2)
+ public ImmutableNode combine(final ImmutableNode node1,
+ final ImmutableNode node2)
{
- ImmutableNode.Builder result = new ImmutableNode.Builder();
+ final ImmutableNode.Builder result = new ImmutableNode.Builder();
result.name(node1.getNodeName());
// attributes of the first node take precedence
@@ -134,10 +134,10 @@ public class UnionCombiner extends NodeC
result.addAttributes(node1.getAttributes());
// Check if nodes can be combined
- List<ImmutableNode> children2 = new LinkedList<>(node2.getChildren());
- for (ImmutableNode child1 : node1.getChildren())
+ final List<ImmutableNode> children2 = new LinkedList<>(node2.getChildren());
+ for (final ImmutableNode child1 : node1.getChildren())
{
- ImmutableNode child2 = findCombineNode(node1, node2, child1
+ final ImmutableNode child2 = findCombineNode(node1, node2, child1
);
if (child2 != null)
{
@@ -151,7 +151,7 @@ public class UnionCombiner extends NodeC
}
// Add remaining children of node 2
- for (ImmutableNode c : children2)
+ for (final ImmutableNode c : children2)
{
result.addChild(c);
}
@@ -189,14 +189,14 @@ public class UnionCombiner extends NodeC
* @return the matching child node of the second source node or <b>null</b>
* if there is none
*/
- protected ImmutableNode findCombineNode(ImmutableNode node1,
- ImmutableNode node2, ImmutableNode child)
+ protected ImmutableNode findCombineNode(final ImmutableNode node1,
+ final ImmutableNode node2, final ImmutableNode child)
{
if (child.getValue() == null && !isListNode(child)
&& HANDLER.getChildrenCount(node1, child.getNodeName()) == 1
&& HANDLER.getChildrenCount(node2, child.getNodeName()) == 1)
{
- ImmutableNode child2 =
+ final ImmutableNode child2 =
HANDLER.getChildren(node2, child.getNodeName()).get(0);
if (child2.getValue() == null)
{
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationAttributePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationAttributePointer.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationAttributePointer.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationAttributePointer.java Thu Sep 27 22:24:23 2018
@@ -50,8 +50,8 @@ class ConfigurationAttributePointer<T> e
* @param parent the parent node pointer
* @param attrName the name of the managed attribute
*/
- public ConfigurationAttributePointer(ConfigurationNodePointer<T> parent,
- String attrName)
+ public ConfigurationAttributePointer(final ConfigurationNodePointer<T> parent,
+ final String attrName)
{
super(parent);
attributeResult =
@@ -69,6 +69,7 @@ class ConfigurationAttributePointer<T> e
// safe to cast because the constructor only expects pointers of this
// type
@SuppressWarnings("unchecked")
+ final
ConfigurationNodePointer<T> configurationNodePointer =
(ConfigurationNodePointer<T>) getParent();
return configurationNodePointer;
@@ -83,7 +84,7 @@ class ConfigurationAttributePointer<T> e
* @return the order of these pointers
*/
@Override
- public int compareChildNodePointers(NodePointer p1, NodePointer p2)
+ public int compareChildNodePointers(final NodePointer p1, final NodePointer p2)
{
return 0;
}
@@ -188,7 +189,7 @@ class ConfigurationAttributePointer<T> e
* @param value the new value
*/
@Override
- public void setValue(Object value)
+ public void setValue(final Object value)
{
throw new UnsupportedOperationException(
"Updating the value is not supported!");
@@ -202,7 +203,7 @@ class ConfigurationAttributePointer<T> e
* @return a flag if this node corresponds to the test
*/
@Override
- public boolean testNode(NodeTest test)
+ public boolean testNode(final NodeTest test)
{
if (test instanceof NodeTypeTest
&& ((NodeTypeTest) test).getNodeType() == Compiler.NODE_TYPE_TEXT)
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorAttribute.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorAttribute.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorAttribute.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorAttribute.java Thu Sep 27 22:24:23 2018
@@ -49,7 +49,7 @@ class ConfigurationNodeIteratorAttribute
* @param name the name of the selected attribute
*/
public ConfigurationNodeIteratorAttribute(
- ConfigurationNodePointer<T> parent, QName name)
+ final ConfigurationNodePointer<T> parent, final QName name)
{
super(parent, false);
parentPointer = parent;
@@ -63,7 +63,7 @@ class ConfigurationNodeIteratorAttribute
* @return a pointer for the attribute at this position
*/
@Override
- protected NodePointer createNodePointer(int position)
+ protected NodePointer createNodePointer(final int position)
{
return new ConfigurationAttributePointer<>(parentPointer,
attributeNames.get(position));
@@ -89,22 +89,22 @@ class ConfigurationNodeIteratorAttribute
* @return a list with the selected attributes
*/
private List<String> createAttributeDataList(
- ConfigurationNodePointer<T> parent, QName name)
+ final ConfigurationNodePointer<T> parent, final QName name)
{
- List<String> result = new ArrayList<>();
+ final List<String> result = new ArrayList<>();
if (!WILDCARD.equals(name.getName()))
{
addAttributeData(parent, result, qualifiedName(name));
}
else
{
- Set<String> names =
+ final Set<String> names =
new LinkedHashSet<>(parent.getNodeHandler()
.getAttributes(parent.getConfigurationNode()));
- String prefix =
+ final String prefix =
(name.getPrefix() != null) ? prefixName(name.getPrefix(),
null) : null;
- for (String n : names)
+ for (final String n : names)
{
if (prefix == null || StringUtils.startsWith(n, prefix))
{
@@ -124,8 +124,8 @@ class ConfigurationNodeIteratorAttribute
* @param result the result list
* @param name the name of the current attribute
*/
- private void addAttributeData(ConfigurationNodePointer<T> parent,
- List<String> result, String name)
+ private void addAttributeData(final ConfigurationNodePointer<T> parent,
+ final List<String> result, final String name)
{
if (parent.getNodeHandler().getAttributeValue(
parent.getConfigurationNode(), name) != null)
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorBase.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorBase.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorBase.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorBase.java Thu Sep 27 22:24:23 2018
@@ -63,8 +63,8 @@ abstract class ConfigurationNodeIterator
* @param parent the parent pointer
* @param reverse the reverse flag
*/
- protected ConfigurationNodeIteratorBase(ConfigurationNodePointer<T> parent,
- boolean reverse)
+ protected ConfigurationNodeIteratorBase(final ConfigurationNodePointer<T> parent,
+ final boolean reverse)
{
this.parent = parent;
this.reverse = reverse;
@@ -88,7 +88,7 @@ abstract class ConfigurationNodeIterator
* @return a flag if this is a valid position
*/
@Override
- public boolean setPosition(int pos)
+ public boolean setPosition(final int pos)
{
position = pos;
return pos >= 1 && pos <= getMaxPosition();
@@ -147,7 +147,7 @@ abstract class ConfigurationNodeIterator
*
* @param startOffset the start offset
*/
- protected void setStartOffset(int startOffset)
+ protected void setStartOffset(final int startOffset)
{
this.startOffset = startOffset;
if (reverse)
@@ -177,7 +177,7 @@ abstract class ConfigurationNodeIterator
* @param pos the position (1-based)
* @return the corresponding list index
*/
- protected int positionToIndex(int pos)
+ protected int positionToIndex(final int pos)
{
return (reverse ? 1 - pos : pos - 1) + getStartOffset();
}
@@ -206,7 +206,7 @@ abstract class ConfigurationNodeIterator
* @param name the name (may be <b>null</b>)
* @return the qualified name
*/
- protected static String prefixName(String prefix, String name)
+ protected static String prefixName(final String prefix, final String name)
{
return String.format(FMT_NAMESPACE, prefix,
StringUtils.defaultString(name));
@@ -220,7 +220,7 @@ abstract class ConfigurationNodeIterator
* @param name the {@code QName}
* @return the qualified name
*/
- protected static String qualifiedName(QName name)
+ protected static String qualifiedName(final QName name)
{
return (name.getPrefix() == null) ? name.getName() : prefixName(
name.getPrefix(), name.getName());
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorChildren.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorChildren.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorChildren.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodeIteratorChildren.java Thu Sep 27 22:24:23 2018
@@ -53,11 +53,11 @@ class ConfigurationNodeIteratorChildren<
* @param startsWith the first element of the iteration
*/
public ConfigurationNodeIteratorChildren(
- ConfigurationNodePointer<T> parent, NodeTest nodeTest,
- boolean reverse, ConfigurationNodePointer<T> startsWith)
+ final ConfigurationNodePointer<T> parent, final NodeTest nodeTest,
+ final boolean reverse, final ConfigurationNodePointer<T> startsWith)
{
super(parent, reverse);
- T root = parent.getConfigurationNode();
+ final T root = parent.getConfigurationNode();
subNodes = createSubNodeList(root, nodeTest);
if (startsWith != null)
@@ -81,7 +81,7 @@ class ConfigurationNodeIteratorChildren<
* @return the node pointer
*/
@Override
- protected NodePointer createNodePointer(int position)
+ protected NodePointer createNodePointer(final int position)
{
return new ConfigurationNodePointer<>(getParent(), subNodes
.get(position), getNodeHandler());
@@ -108,7 +108,7 @@ class ConfigurationNodeIteratorChildren<
* @param test the test object
* @return a list with the matching nodes
*/
- private List<T> createSubNodeList(T node, NodeTest test)
+ private List<T> createSubNodeList(final T node, final NodeTest test)
{
if (test == null)
{
@@ -116,15 +116,15 @@ class ConfigurationNodeIteratorChildren<
}
if (test instanceof NodeNameTest)
{
- NodeNameTest nameTest = (NodeNameTest) test;
- QName name = nameTest.getNodeName();
+ final NodeNameTest nameTest = (NodeNameTest) test;
+ final QName name = nameTest.getNodeName();
return nameTest.isWildcard() ? createSubNodeListForWildcardName(
node, name) : createSubNodeListForName(node, name);
}
else if (test instanceof NodeTypeTest)
{
- NodeTypeTest typeTest = (NodeTypeTest) test;
+ final NodeTypeTest typeTest = (NodeTypeTest) test;
if (typeTest.getNodeType() == Compiler.NODE_TYPE_NODE
|| typeTest.getNodeType() == Compiler.NODE_TYPE_TEXT)
{
@@ -143,11 +143,11 @@ class ConfigurationNodeIteratorChildren<
* @param name the name to be selected
* @return the list with selected sub nodes
*/
- private List<T> createSubNodeListForName(T node, QName name)
+ private List<T> createSubNodeListForName(final T node, final QName name)
{
- String compareName = qualifiedName(name);
- List<T> result = new ArrayList<>();
- for (T child : getNodeHandler().getChildren(node))
+ final String compareName = qualifiedName(name);
+ final List<T> result = new ArrayList<>();
+ for (final T child : getNodeHandler().getChildren(node))
{
if (StringUtils.equals(compareName, getNodeHandler()
.nodeName(child)))
@@ -166,16 +166,16 @@ class ConfigurationNodeIteratorChildren<
* @param name the name to be selected
* @return the list with selected sub nodes
*/
- private List<T> createSubNodeListForWildcardName(T node, QName name)
+ private List<T> createSubNodeListForWildcardName(final T node, final QName name)
{
- List<T> children = getNodeHandler().getChildren(node);
+ final List<T> children = getNodeHandler().getChildren(node);
if (name.getPrefix() == null)
{
return children;
}
- List<T> prefixChildren = new ArrayList<>(children.size());
- String prefix = prefixName(name.getPrefix(), null);
- for (T child : children)
+ final List<T> prefixChildren = new ArrayList<>(children.size());
+ final String prefix = prefixName(name.getPrefix(), null);
+ for (final T child : children)
{
if (StringUtils.startsWith(getNodeHandler().nodeName(child),
prefix))
@@ -194,10 +194,10 @@ class ConfigurationNodeIteratorChildren<
* @param startNode the start node
* @return the start node's index
*/
- private int findStartIndex(List<T> children, T startNode)
+ private int findStartIndex(final List<T> children, final T startNode)
{
int index = 0;
- for (T child : children)
+ for (final T child : children)
{
if (child == startNode)
{
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointer.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointer.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointer.java Thu Sep 27 22:24:23 2018
@@ -59,8 +59,8 @@ class ConfigurationNodePointer<T> extend
* @param locale the locale
* @param handler the {@code NodeHandler}
*/
- public ConfigurationNodePointer(T node, Locale locale,
- NodeHandler<T> handler)
+ public ConfigurationNodePointer(final T node, final Locale locale,
+ final NodeHandler<T> handler)
{
super(null, locale);
this.node = node;
@@ -75,8 +75,8 @@ class ConfigurationNodePointer<T> extend
* @param node the associated node
* @param handler the {@code NodeHandler}
*/
- public ConfigurationNodePointer(ConfigurationNodePointer<T> parent, T node,
- NodeHandler<T> handler)
+ public ConfigurationNodePointer(final ConfigurationNodePointer<T> parent, final T node,
+ final NodeHandler<T> handler)
{
super(parent);
this.node = node;
@@ -181,7 +181,7 @@ class ConfigurationNodePointer<T> extend
* @param value the new value
*/
@Override
- public void setValue(Object value)
+ public void setValue(final Object value)
{
throw new UnsupportedOperationException("Node value cannot be set!");
}
@@ -194,14 +194,14 @@ class ConfigurationNodePointer<T> extend
* @return a flag, which pointer should be sorted first
*/
@Override
- public int compareChildNodePointers(NodePointer pointer1,
- NodePointer pointer2)
+ public int compareChildNodePointers(final NodePointer pointer1,
+ final NodePointer pointer2)
{
- Object node1 = pointer1.getBaseValue();
- Object node2 = pointer2.getBaseValue();
+ final Object node1 = pointer1.getBaseValue();
+ final Object node2 = pointer2.getBaseValue();
// sort based on the occurrence in the sub node list
- for (T child : getNodeHandler().getChildren(node))
+ for (final T child : getNodeHandler().getChildren(node))
{
if (child == node1)
{
@@ -222,7 +222,7 @@ class ConfigurationNodePointer<T> extend
* @return the iterator for the attributes
*/
@Override
- public NodeIterator attributeIterator(QName name)
+ public NodeIterator attributeIterator(final QName name)
{
return new ConfigurationNodeIteratorAttribute<>(this, name);
}
@@ -236,8 +236,8 @@ class ConfigurationNodePointer<T> extend
* @param startWith the start value of the iteration
*/
@Override
- public NodeIterator childIterator(NodeTest test, boolean reverse,
- NodePointer startWith)
+ public NodeIterator childIterator(final NodeTest test, final boolean reverse,
+ final NodePointer startWith)
{
return new ConfigurationNodeIteratorChildren<>(this, test, reverse,
castPointer(startWith));
@@ -251,7 +251,7 @@ class ConfigurationNodePointer<T> extend
* @return a flag if this node corresponds to the test
*/
@Override
- public boolean testNode(NodeTest test)
+ public boolean testNode(final NodeTest test)
{
if (test instanceof NodeTypeTest
&& ((NodeTypeTest) test).getNodeType() == Compiler.NODE_TYPE_TEXT)
@@ -290,9 +290,10 @@ class ConfigurationNodePointer<T> extend
* @param p the {@code NodePointer} to cast
* @return the resulting {@code ConfigurationNodePointer}
*/
- private ConfigurationNodePointer<T> castPointer(NodePointer p)
+ private ConfigurationNodePointer<T> castPointer(final NodePointer p)
{
@SuppressWarnings("unchecked") // see method comment
+ final
ConfigurationNodePointer<T> result = (ConfigurationNodePointer<T>) p;
return result;
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointerFactory.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointerFactory.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/ConfigurationNodePointerFactory.java Thu Sep 27 22:24:23 2018
@@ -74,11 +74,11 @@ public class ConfigurationNodePointerFac
/* Type casts are safe here; because of the way the NodeWrapper was
constructed the node handler must be compatible with the node.
*/
- public NodePointer createNodePointer(QName name, Object bean, Locale locale)
+ public NodePointer createNodePointer(final QName name, final Object bean, final Locale locale)
{
if (bean instanceof NodeWrapper)
{
- NodeWrapper<?> wrapper = (NodeWrapper<?>) bean;
+ final NodeWrapper<?> wrapper = (NodeWrapper<?>) bean;
return new ConfigurationNodePointer(wrapper.getNode(),
locale, wrapper.getNodeHandler());
}
@@ -99,12 +99,12 @@ public class ConfigurationNodePointerFac
/* Type casts are safe here, see above. Also, the hierarchy of node
pointers is consistent, so a parent is compatible to a child.
*/
- public NodePointer createNodePointer(NodePointer parent, QName name,
- Object bean)
+ public NodePointer createNodePointer(final NodePointer parent, final QName name,
+ final Object bean)
{
if (bean instanceof NodeWrapper)
{
- NodeWrapper<?> wrapper = (NodeWrapper<?>) bean;
+ final NodeWrapper<?> wrapper = (NodeWrapper<?>) bean;
return new ConfigurationNodePointer((ConfigurationNodePointer) parent,
wrapper.getNode(), wrapper.getNodeHandler());
}
@@ -121,7 +121,7 @@ public class ConfigurationNodePointerFac
* @param handler the corresponding node handler
* @return a wrapper for this node
*/
- public static <T> Object wrapNode(T node, NodeHandler<T> handler)
+ public static <T> Object wrapNode(final T node, final NodeHandler<T> handler)
{
return new NodeWrapper<>(node, handler);
}
@@ -146,7 +146,7 @@ public class ConfigurationNodePointerFac
* @param nd the node
* @param handler the node handler
*/
- public NodeWrapper(T nd, NodeHandler<T> handler)
+ public NodeWrapper(final T nd, final NodeHandler<T> handler)
{
node = nd;
nodeHandler = handler;
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathContextFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathContextFactory.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathContextFactory.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathContextFactory.java Thu Sep 27 22:24:23 2018
@@ -39,9 +39,9 @@ class XPathContextFactory
* @param <T> the type of the nodes to be handled
* @return the newly created context
*/
- public <T> JXPathContext createContext(T root, NodeHandler<T> handler)
+ public <T> JXPathContext createContext(final T root, final NodeHandler<T> handler)
{
- JXPathContext context =
+ final JXPathContext context =
JXPathContext.newContext(ConfigurationNodePointerFactory
.wrapNode(root, handler));
context.setLenient(true);
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathExpressionEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathExpressionEngine.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathExpressionEngine.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/tree/xpath/XPathExpressionEngine.java Thu Sep 27 22:24:23 2018
@@ -182,7 +182,7 @@ public class XPathExpressionEngine imple
*
* @param factory the {@code XPathContextFactory}
*/
- XPathExpressionEngine(XPathContextFactory factory)
+ XPathExpressionEngine(final XPathContextFactory factory)
{
contextFactory = factory;
}
@@ -192,15 +192,15 @@ public class XPathExpressionEngine imple
* expression.
*/
@Override
- public <T> List<QueryResult<T>> query(T root, String key,
- NodeHandler<T> handler)
+ public <T> List<QueryResult<T>> query(final T root, final String key,
+ final NodeHandler<T> handler)
{
if (StringUtils.isEmpty(key))
{
- QueryResult<T> result = createResult(root);
+ final QueryResult<T> result = createResult(root);
return Collections.singletonList(result);
}
- JXPathContext context = createContext(root, handler);
+ final JXPathContext context = createContext(root, handler);
List<?> results = context.selectNodes(key);
if (results == null)
{
@@ -219,7 +219,7 @@ public class XPathExpressionEngine imple
* key.
*/
@Override
- public <T> String nodeKey(T node, String parentKey, NodeHandler<T> handler)
+ public <T> String nodeKey(final T node, final String parentKey, final NodeHandler<T> handler)
{
if (parentKey == null)
{
@@ -234,7 +234,7 @@ public class XPathExpressionEngine imple
else
{
- StringBuilder buf =
+ final StringBuilder buf =
new StringBuilder(parentKey.length()
+ handler.nodeName(node).length()
+ PATH_DELIMITER.length());
@@ -249,9 +249,9 @@ public class XPathExpressionEngine imple
}
@Override
- public String attributeKey(String parentKey, String attributeName)
+ public String attributeKey(final String parentKey, final String attributeName)
{
- StringBuilder buf =
+ final StringBuilder buf =
new StringBuilder(StringUtils.length(parentKey)
+ StringUtils.length(attributeName)
+ PATH_DELIMITER.length() + ATTR_DELIMITER.length());
@@ -268,17 +268,17 @@ public class XPathExpressionEngine imple
* always adds an index expression to the resulting key.
*/
@Override
- public <T> String canonicalKey(T node, String parentKey,
- NodeHandler<T> handler)
+ public <T> String canonicalKey(final T node, final String parentKey,
+ final NodeHandler<T> handler)
{
- T parent = handler.getParent(node);
+ final T parent = handler.getParent(node);
if (parent == null)
{
// this is the root node
return StringUtils.defaultString(parentKey);
}
- StringBuilder buf = new StringBuilder(BUF_SIZE);
+ final StringBuilder buf = new StringBuilder(BUF_SIZE);
if (StringUtils.isNotEmpty(parentKey))
{
buf.append(parentKey).append(PATH_DELIMITER);
@@ -295,8 +295,8 @@ public class XPathExpressionEngine imple
* the class comment.
*/
@Override
- public <T> NodeAddData<T> prepareAdd(T root, String key,
- NodeHandler<T> handler)
+ public <T> NodeAddData<T> prepareAdd(final T root, final String key,
+ final NodeHandler<T> handler)
{
if (key == null)
{
@@ -316,7 +316,7 @@ public class XPathExpressionEngine imple
invalidPath(addKey, " new node path must not be empty.");
}
- List<QueryResult<T>> nodes =
+ final List<QueryResult<T>> nodes =
query(root, addKey.substring(0, index).trim(), handler);
if (nodes.size() != 1)
{
@@ -335,7 +335,7 @@ public class XPathExpressionEngine imple
* @param handler the node handler
* @return the new context
*/
- private <T> JXPathContext createContext(T root, NodeHandler<T> handler)
+ private <T> JXPathContext createContext(final T root, final NodeHandler<T> handler)
{
return getContextFactory().createContext(root, handler);
}
@@ -349,23 +349,23 @@ public class XPathExpressionEngine imple
* @param parentNodeResult the parent node
* @param <T> the type of the nodes involved
*/
- <T> NodeAddData<T> createNodeAddData(String path,
- QueryResult<T> parentNodeResult)
+ <T> NodeAddData<T> createNodeAddData(final String path,
+ final QueryResult<T> parentNodeResult)
{
if (parentNodeResult.isAttributeResult())
{
invalidPath(path, " cannot add properties to an attribute.");
}
- List<String> pathNodes = new LinkedList<>();
+ final List<String> pathNodes = new LinkedList<>();
String lastComponent = null;
boolean attr = false;
boolean first = true;
- StringTokenizer tok =
+ final StringTokenizer tok =
new StringTokenizer(path, NODE_PATH_DELIMITERS, true);
while (tok.hasMoreTokens())
{
- String token = tok.nextToken();
+ final String token = tok.nextToken();
if (PATH_DELIMITER.equals(token))
{
if (attr)
@@ -440,17 +440,17 @@ public class XPathExpressionEngine imple
* @param handler the node handler
* @return the key to be used for adding the property
*/
- private <T> String generateKeyForAdd(T root, String key,
- NodeHandler<T> handler)
+ private <T> String generateKeyForAdd(final T root, final String key,
+ final NodeHandler<T> handler)
{
int pos = key.lastIndexOf(PATH_DELIMITER, key.length());
while (pos >= 0)
{
- String keyExisting = key.substring(0, pos);
+ final String keyExisting = key.substring(0, pos);
if (!query(root, keyExisting, handler).isEmpty())
{
- StringBuilder buf = new StringBuilder(key.length() + 1);
+ final StringBuilder buf = new StringBuilder(key.length() + 1);
buf.append(keyExisting).append(SPACE);
buf.append(key.substring(pos + 1));
return buf.toString();
@@ -471,8 +471,8 @@ public class XPathExpressionEngine imple
* @param <T> the type of the nodes involved
* @return the index of this child node
*/
- private static <T> int determineIndex(T parent, T child,
- NodeHandler<T> handler)
+ private static <T> int determineIndex(final T parent, final T child,
+ final NodeHandler<T> handler)
{
return handler.getChildren(parent, handler.nodeName(child)).indexOf(
child) + 1;
@@ -484,7 +484,7 @@ public class XPathExpressionEngine imple
* @param path the invalid path
* @param msg the exception message
*/
- private static void invalidPath(String path, String msg)
+ private static void invalidPath(final String path, final String msg)
{
throw new IllegalArgumentException("Invalid node path: \"" + path
+ "\" " + msg);
@@ -497,7 +497,7 @@ public class XPathExpressionEngine imple
* @param key the key
* @return the position of the delimiter
*/
- private static int findKeySeparator(String key)
+ private static int findKeySeparator(final String key)
{
int index = key.length() - 1;
while (index >= 0 && !Character.isWhitespace(key.charAt(index)))
@@ -515,13 +515,13 @@ public class XPathExpressionEngine imple
* @param <T> the type of results to be produced
* @return the result list
*/
- private static <T> List<QueryResult<T>> convertResults(List<?> results)
+ private static <T> List<QueryResult<T>> convertResults(final List<?> results)
{
- List<QueryResult<T>> queryResults =
+ final List<QueryResult<T>> queryResults =
new ArrayList<>(results.size());
- for (Object res : results)
+ for (final Object res : results)
{
- QueryResult<T> queryResult = createResult(res);
+ final QueryResult<T> queryResult = createResult(res);
queryResults.add(queryResult);
}
return queryResults;
@@ -543,7 +543,7 @@ public class XPathExpressionEngine imple
* @return the {@code QueryResult}
*/
@SuppressWarnings("unchecked")
- private static <T> QueryResult<T> createResult(Object resObj)
+ private static <T> QueryResult<T> createResult(final Object resObj)
{
if (resObj instanceof QueryResult)
{
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java Thu Sep 27 22:24:23 2018
@@ -41,13 +41,13 @@ public class AppletConfiguration extends
*
* @param applet the applet
*/
- public AppletConfiguration(Applet applet)
+ public AppletConfiguration(final Applet applet)
{
this.applet = applet;
}
@Override
- protected Object getPropertyInternal(String key)
+ protected Object getPropertyInternal(final String key)
{
return handleDelimiters(applet.getParameter(key));
}
@@ -55,8 +55,8 @@ public class AppletConfiguration extends
@Override
protected Iterator<String> getKeysInternal()
{
- String[][] paramsInfo = applet.getParameterInfo();
- String[] keys = new String[paramsInfo != null ? paramsInfo.length : 0];
+ final String[][] paramsInfo = applet.getParameterInfo();
+ final String[] keys = new String[paramsInfo != null ? paramsInfo.length : 0];
for (int i = 0; i < keys.length; i++)
{
keys[i] = paramsInfo[i][0];
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/BaseWebConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/BaseWebConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/BaseWebConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/BaseWebConfiguration.java Thu Sep 27 22:24:23 2018
@@ -58,7 +58,7 @@ abstract class BaseWebConfiguration exte
* @return a flag whether this key exists in this configuration
*/
@Override
- protected boolean containsKeyInternal(String key)
+ protected boolean containsKeyInternal(final String key)
{
return getPropertyInternal(key) != null;
}
@@ -72,7 +72,7 @@ abstract class BaseWebConfiguration exte
* allowed
*/
@Override
- protected void clearPropertyDirect(String key)
+ protected void clearPropertyDirect(final String key)
{
throw new UnsupportedOperationException("Read only configuration");
}
@@ -87,7 +87,7 @@ abstract class BaseWebConfiguration exte
* allowed
*/
@Override
- protected void addPropertyDirect(String key, Object obj)
+ protected void addPropertyDirect(final String key, final Object obj)
{
throw new UnsupportedOperationException("Read only configuration");
}
@@ -104,7 +104,7 @@ abstract class BaseWebConfiguration exte
{
if (value instanceof String)
{
- Collection<String> values =
+ final Collection<String> values =
getListDelimiterHandler().split((String) value, true);
value = values.size() > 1 ? values : values.iterator().next();
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletConfiguration.java Thu Sep 27 22:24:23 2018
@@ -44,7 +44,7 @@ public class ServletConfiguration extend
*
* @param servlet the servlet
*/
- public ServletConfiguration(Servlet servlet)
+ public ServletConfiguration(final Servlet servlet)
{
this(servlet.getServletConfig());
}
@@ -54,13 +54,13 @@ public class ServletConfiguration extend
*
* @param config the servlet configuration
*/
- public ServletConfiguration(ServletConfig config)
+ public ServletConfiguration(final ServletConfig config)
{
this.config = config;
}
@Override
- protected Object getPropertyInternal(String key)
+ protected Object getPropertyInternal(final String key)
{
return handleDelimiters(config.getInitParameter(key));
}
@@ -70,7 +70,7 @@ public class ServletConfiguration extend
{
// According to the documentation of getInitParameterNames() the
// enumeration is of type String.
- Enumeration<String> en = config.getInitParameterNames();
+ final Enumeration<String> en = config.getInitParameterNames();
return Collections.list(en).iterator();
}
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletContextConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletContextConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletContextConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletContextConfiguration.java Thu Sep 27 22:24:23 2018
@@ -44,7 +44,7 @@ public class ServletContextConfiguration
*
* @param servlet the servlet
*/
- public ServletContextConfiguration(Servlet servlet)
+ public ServletContextConfiguration(final Servlet servlet)
{
this.context = servlet.getServletConfig().getServletContext();
}
@@ -55,13 +55,13 @@ public class ServletContextConfiguration
*
* @param context the servlet context
*/
- public ServletContextConfiguration(ServletContext context)
+ public ServletContextConfiguration(final ServletContext context)
{
this.context = context;
}
@Override
- protected Object getPropertyInternal(String key)
+ protected Object getPropertyInternal(final String key)
{
return handleDelimiters(context.getInitParameter(key));
}
@@ -71,7 +71,7 @@ public class ServletContextConfiguration
{
// According to the documentation of getInitParameterNames() the
// enumeration is of type String.
- Enumeration<String> en = context.getInitParameterNames();
+ final Enumeration<String> en = context.getInitParameterNames();
return Collections.list(en).iterator();
}
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletFilterConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletFilterConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletFilterConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletFilterConfiguration.java Thu Sep 27 22:24:23 2018
@@ -42,13 +42,13 @@ public class ServletFilterConfiguration
*
* @param config the filter configuration
*/
- public ServletFilterConfiguration(FilterConfig config)
+ public ServletFilterConfiguration(final FilterConfig config)
{
this.config = config;
}
@Override
- protected Object getPropertyInternal(String key)
+ protected Object getPropertyInternal(final String key)
{
return handleDelimiters(config.getInitParameter(key));
}
@@ -58,7 +58,7 @@ public class ServletFilterConfiguration
{
// According to the documentation of getInitParameterNames() the
// enumeration is of type String.
- Enumeration<String> en = config.getInitParameterNames();
+ final Enumeration<String> en = config.getInitParameterNames();
return Collections.list(en).iterator();
}
}
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletRequestConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletRequestConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletRequestConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/web/ServletRequestConfiguration.java Thu Sep 27 22:24:23 2018
@@ -43,15 +43,15 @@ public class ServletRequestConfiguration
*
* @param request the servlet request
*/
- public ServletRequestConfiguration(ServletRequest request)
+ public ServletRequestConfiguration(final ServletRequest request)
{
this.request = request;
}
@Override
- protected Object getPropertyInternal(String key)
+ protected Object getPropertyInternal(final String key)
{
- String[] values = request.getParameterValues(key);
+ final String[] values = request.getParameterValues(key);
if (values == null || values.length == 0)
{
@@ -64,10 +64,10 @@ public class ServletRequestConfiguration
else
{
// ensure that escape characters in all list elements are removed
- List<Object> result = new ArrayList<>(values.length);
- for (String value : values)
+ final List<Object> result = new ArrayList<>(values.length);
+ for (final String value : values)
{
- Object val = handleDelimiters(value);
+ final Object val = handleDelimiters(value);
if (val instanceof Collection)
{
result.addAll((Collection<?>) val);
@@ -85,7 +85,7 @@ public class ServletRequestConfiguration
protected Iterator<String> getKeysInternal()
{
// According to the documentation of getParameterMap(), keys are Strings.
- Map<String, ?> parameterMap = request.getParameterMap();
+ final Map<String, ?> parameterMap = request.getParameterMap();
return parameterMap.keySet().iterator();
}
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java Thu Sep 27 22:24:23 2018
@@ -48,7 +48,7 @@ public abstract class BaseNonStringPrope
@Test
public void testBooleanArrayValue() throws Exception
{
- boolean booleanValue = conf.getBoolean("test.boolean");
+ final boolean booleanValue = conf.getBoolean("test.boolean");
assertTrue(booleanValue);
assertEquals(2, conf.getList("test.boolean.array").size());
}
@@ -62,8 +62,8 @@ public abstract class BaseNonStringPrope
@Test
public void testByteArrayValue() throws Exception
{
- byte testValue = 10;
- byte byteValue = conf.getByte("test.byte");
+ final byte testValue = 10;
+ final byte byteValue = conf.getByte("test.byte");
assertEquals(testValue, byteValue);
assertEquals(2, conf.getList("test.byte.array").size());
}
@@ -83,8 +83,8 @@ public abstract class BaseNonStringPrope
@Test
public void testDoubleArrayValue() throws Exception
{
- double testValue = 10.25;
- double doubleValue = conf.getDouble("test.double");
+ final double testValue = 10.25;
+ final double doubleValue = conf.getDouble("test.double");
assertEquals(testValue, doubleValue, 0.01);
assertEquals(2, conf.getList("test.double.array").size());
}
@@ -105,8 +105,8 @@ public abstract class BaseNonStringPrope
@Test
public void testFloatArrayValue() throws Exception
{
- float testValue = (float) 20.25;
- float floatValue = conf.getFloat("test.float");
+ final float testValue = (float) 20.25;
+ final float floatValue = conf.getFloat("test.float");
assertEquals(testValue, floatValue, 0.01);
assertEquals(2, conf.getList("test.float.array").size());
}
@@ -126,7 +126,7 @@ public abstract class BaseNonStringPrope
@Test
public void testIntegerArrayValue() throws Exception
{
- int intValue = conf.getInt("test.integer");
+ final int intValue = conf.getInt("test.integer");
assertEquals(10, intValue);
assertEquals(2, conf.getList("test.integer.array").size());
}
@@ -146,7 +146,7 @@ public abstract class BaseNonStringPrope
@Test
public void testLongArrayValue() throws Exception
{
- long longValue = conf.getLong("test.long");
+ final long longValue = conf.getLong("test.long");
assertEquals(1000000, longValue);
assertEquals(2, conf.getList("test.long.array").size());
}
@@ -166,7 +166,7 @@ public abstract class BaseNonStringPrope
@Test
public void testShortArrayValue() throws Exception
{
- short shortValue = conf.getShort("test.short");
+ final short shortValue = conf.getShort("test.short");
assertEquals(1, shortValue);
assertEquals(2, conf.getList("test.short.array").size());
}