> comparatorChain;
+
/** Order - false (clear) = ascend; true (set) = descend. */
private final BitSet orderingBits;
- /** Whether the chain has been "locked". */
+
+ /** Whether the chain has been "locked". */
private boolean isLocked;
/**
* Constructs a ComparatorChain with no Comparators.
* You must add at least one Comparator before calling
- * the compare(Object,Object) method, or an
+ * the compare(Object, Object) method, or an
* UnsupportedOperationException is thrown
*/
public ComparatorChain() {
@@ -182,7 +184,7 @@ private void checkLocked() {
/**
* Perform comparisons on the Objects as per
- * Comparator.compare(o1,o2).
+ * Comparator.compare(o1, o2).
*
* @param o1 the first object to compare
* @param o2 the second object to compare
diff --git a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
index 0952beea06..fa9b3a25a6 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -90,7 +90,6 @@ public enum UnknownObjectBehavior {
/** The behavior in the case of an unknown object */
private UnknownObjectBehavior unknownObjectBehavior = UnknownObjectBehavior.EXCEPTION;
- // Constructors
/**
* Constructs an empty FixedOrderComparator.
*/
@@ -127,7 +126,6 @@ public FixedOrderComparator(final T... items) {
}
}
- // Methods for adding items
/**
* Adds an item, which compares as after all items known to the Comparator.
* If the item is already known to the Comparator, its old position is
@@ -178,7 +176,6 @@ protected void checkLocked() {
}
}
- // Comparator methods
/**
* Compares two objects according to the order of this Comparator.
*
@@ -245,7 +242,6 @@ public int hashCode() {
return Objects.hash(counter, isLocked, map, unknownObjectBehavior);
}
- // Bean methods / state querying methods
/**
* Returns true if modifications cannot be made to the FixedOrderComparator.
* FixedOrderComparators cannot be modified once they have performed a comparison.
diff --git a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
index 8db6b07b70..b38c6203b1 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,99 +35,96 @@ public class NullComparator implements Comparator, Serializable {
private static final long serialVersionUID = -5820772575483504339L;
/**
- * The comparator to use when comparing two non-{@code null} objects.
- **/
+ * The comparator to use when comparing two non-{@code null} objects.
+ */
private final Comparator super E> nonNullComparator;
/**
- * Specifies whether a {@code null} are compared as higher than
- * non-{@code null} objects.
- **/
+ * Specifies whether a {@code null} are compared as higher than
+ * non-{@code null} objects.
+ */
private final boolean nullsAreHigh;
/**
- * Construct an instance that sorts {@code null} higher than any
- * non-{@code null} object it is compared with. When comparing two
- * non-{@code null} objects, the {@link ComparableComparator} is
- * used.
- **/
+ * Construct an instance that sorts {@code null} higher than any
+ * non-{@code null} object it is compared with. When comparing two
+ * non-{@code null} objects, the {@link ComparableComparator} is
+ * used.
+ */
public NullComparator() {
this(ComparatorUtils.NATURAL_COMPARATOR, true);
}
/**
- * Construct an instance that sorts {@code null} higher or lower than
- * any non-{@code null} object it is compared with. When comparing
- * two non-{@code null} objects, the {@link ComparableComparator} is
- * used.
+ * Construct an instance that sorts {@code null} higher or lower than
+ * any non-{@code null} object it is compared with. When comparing
+ * two non-{@code null} objects, the {@link ComparableComparator} is
+ * used.
*
- * @param nullsAreHigh a {@code true} value indicates that
- * {@code null} should be compared as higher than a
- * non-{@code null} object. A {@code false} value indicates
- * that {@code null} should be compared as lower than a
- * non-{@code null} object.
- **/
+ * @param nullsAreHigh a {@code true} value indicates that
+ * {@code null} should be compared as higher than a
+ * non-{@code null} object. A {@code false} value indicates
+ * that {@code null} should be compared as lower than a
+ * non-{@code null} object.
+ */
public NullComparator(final boolean nullsAreHigh) {
this(ComparatorUtils.NATURAL_COMPARATOR, nullsAreHigh);
}
/**
- * Construct an instance that sorts {@code null} higher than any
- * non-{@code null} object it is compared with. When comparing two
- * non-{@code null} objects, the specified {@link Comparator} is
- * used.
+ * Construct an instance that sorts {@code null} higher than any
+ * non-{@code null} object it is compared with. When comparing two
+ * non-{@code null} objects, the specified {@link Comparator} is
+ * used.
*
- * @param nonNullComparator the comparator to use when comparing two
- * non-{@code null} objects. This argument cannot be
- * {@code null}
- *
- * @throws NullPointerException if {@code nonNullComparator} is
- * {@code null}
- **/
+ * @param nonNullComparator the comparator to use when comparing two
+ * non-{@code null} objects. This argument cannot be
+ * {@code null}
+ * @throws NullPointerException if {@code nonNullComparator} is
+ * {@code null}
+ */
public NullComparator(final Comparator super E> nonNullComparator) {
this(nonNullComparator, true);
}
/**
- * Construct an instance that sorts {@code null} higher or lower than
- * any non-{@code null} object it is compared with. When comparing
- * two non-{@code null} objects, the specified {@link Comparator} is
- * used.
- *
- * @param nonNullComparator the comparator to use when comparing two
- * non-{@code null} objects. This argument cannot be
- * {@code null}
+ * Construct an instance that sorts {@code null} higher or lower than
+ * any non-{@code null} object it is compared with. When comparing
+ * two non-{@code null} objects, the specified {@link Comparator} is
+ * used.
*
- * @param nullsAreHigh a {@code true} value indicates that
- * {@code null} should be compared as higher than a
- * non-{@code null} object. A {@code false} value indicates
- * that {@code null} should be compared as lower than a
- * non-{@code null} object.
- *
- * @throws NullPointerException if {@code nonNullComparator} is
- * {@code null}
- **/
+ * @param nonNullComparator the comparator to use when comparing two
+ * non-{@code null} objects. This argument cannot be
+ * {@code null}
+ * @param nullsAreHigh a {@code true} value indicates that
+ * {@code null} should be compared as higher than a
+ * non-{@code null} object. A {@code false} value indicates
+ * that {@code null} should be compared as lower than a
+ * non-{@code null} object.
+ * @throws NullPointerException if {@code nonNullComparator} is
+ * {@code null}
+ */
public NullComparator(final Comparator super E> nonNullComparator, final boolean nullsAreHigh) {
this.nonNullComparator = Objects.requireNonNull(nonNullComparator, "nonNullComparator");
this.nullsAreHigh = nullsAreHigh;
}
/**
- * Perform a comparison between two objects. If both objects are
- * {@code null}, a {@code 0} value is returned. If one object
- * is {@code null} and the other is not, the result is determined on
- * whether the Comparator was constructed to have nulls as higher or lower
- * than other objects. If neither object is {@code null}, an
- * underlying comparator specified in the constructor (or the default) is
- * used to compare the non-{@code null} objects.
+ * Perform a comparison between two objects. If both objects are
+ * {@code null}, a {@code 0} value is returned. If one object
+ * is {@code null} and the other is not, the result is determined on
+ * whether the Comparator was constructed to have nulls as higher or lower
+ * than other objects. If neither object is {@code null}, an
+ * underlying comparator specified in the constructor (or the default) is
+ * used to compare the non-{@code null} objects.
*
- * @param o1 the first object to compare
- * @param o2 the object to compare it to.
- * @return {@code -1} if {@code o1} is "lower" than (less than,
- * before, etc.) {@code o2}; {@code 1} if {@code o1} is
- * "higher" than (greater than, after, etc.) {@code o2}; or
- * {@code 0} if {@code o1} and {@code o2} are equal.
- **/
+ * @param o1 the first object to compare
+ * @param o2 the object to compare it to.
+ * @return {@code -1} if {@code o1} is "lower" than (less than,
+ * before, etc.) {@code o2}; {@code 1} if {@code o1} is
+ * "higher" than (greater than, after, etc.) {@code o2}; or
+ * {@code 0} if {@code o1} and {@code o2} are equal.
+ */
@Override
public int compare(final E o1, final E o2) {
if (o1 == o2) {
@@ -143,16 +140,15 @@ public int compare(final E o1, final E o2) {
}
/**
- * Determines whether the specified object represents a comparator that is
- * equal to this comparator.
- *
- * @param obj the object to compare this comparator with.
+ * Determines whether the specified object represents a comparator that is
+ * equal to this comparator.
*
- * @return {@code true} if the specified object is a NullComparator
- * with equivalent {@code null} comparison behavior
- * (i.e. {@code null} high or low) and with equivalent underlying
- * non-{@code null} object comparators.
- **/
+ * @param obj the object to compare this comparator with.
+ * @return {@code true} if the specified object is a NullComparator
+ * with equivalent {@code null} comparison behavior
+ * (i.e. {@code null} high or low) and with equivalent underlying
+ * non-{@code null} object comparators.
+ */
@Override
public boolean equals(final Object obj) {
if (obj == null) {
@@ -172,11 +168,11 @@ public boolean equals(final Object obj) {
}
/**
- * Implement a hash code for this comparator that is consistent with
- * {@link #equals(Object)}.
+ * Implement a hash code for this comparator that is consistent with
+ * {@link #equals(Object)}.
*
- * @return a hash code for this comparator.
- **/
+ * @return a hash code for this comparator.
+ */
@Override
public int hashCode() {
return (nullsAreHigh ? -1 : 1) * nonNullComparator.hashCode();
diff --git a/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java b/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java
index bdbf297dd8..27cdd69cd2 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java b/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java
index 217aa3a597..54f78e0b58 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/comparators/package-info.java b/src/main/java/org/apache/commons/collections4/comparators/package-info.java
index a78493381c..b5c0742e45 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/package-info.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
index 3cc1f956e7..d091bd6321 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,7 +19,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstract base class for predicates.
+ * Abstract class for predicates.
*
* @param the type of the input to the predicate.
* @since 4.5.0-M3
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
index 0e5e1e352a..062799ddfb 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstract base class for quantification predicates, for example All, Any, None.
+ * Abstract class for quantification predicates, for example All, Any, None.
*
* @param the type of the input to the predicate.
* @since 4.0
diff --git a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java
index 1722e452d7..bcbf38a106 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java
index d1bffe8d9e..5c21374510 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -46,6 +46,7 @@ public static Predicate andPredicate(final Predicate super T> predicate
return new AndPredicate<>(Objects.requireNonNull(predicate1, "predicate1"),
Objects.requireNonNull(predicate2, "predicate2"));
}
+
/** The array of predicates to call */
private final Predicate super T> iPredicate1;
diff --git a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java
index 9484b85981..5ce2545558 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/CatchAndRethrowClosure.java b/src/main/java/org/apache/commons/collections4/functors/CatchAndRethrowClosure.java
index 5dc22f54ae..2dfd37d3d8 100644
--- a/src/main/java/org/apache/commons/collections4/functors/CatchAndRethrowClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/CatchAndRethrowClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java
index 784cab9dd4..b79caccdcd 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java
index 8e7e45090d..e9ca4f253e 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java b/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
index 32a0b87740..9ee8c3c11e 100644
--- a/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java
index 411ab1fd16..6a79999b86 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java b/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java
index b399d82966..9e19499f84 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java b/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
index 5785a97985..64b01f298b 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
index b2362549ea..7e51e3e689 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java b/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
index 59a5d3feaa..b5b283ee56 100644
--- a/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
+++ b/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java b/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java
index b59379e4ad..a7f798a6eb 100644
--- a/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java b/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
index 58e91c64b9..5b7fa3c8ba 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java b/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
index 9b1bc4c4a2..e827d83e03 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java b/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
index e0c4e459b7..14f36ec420 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
index 52429a0da0..3fa2690621 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java b/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java
index 203c7e0906..5def6b94c5 100644
--- a/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java b/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
index 8cf0f4b452..931325ef94 100644
--- a/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java
index 7abb4d7971..8fc4f58011 100644
--- a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -53,6 +53,7 @@ public static Closure forClosure(final int count, final Closure super E
}
return new ForClosure<>(count, closure);
}
+
/** The number of times to loop */
private final int iCount;
diff --git a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
index 6209735c7a..a588ae052e 100644
--- a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,6 +30,17 @@
*/
final class FunctorUtils {
+ /**
+ * Clones the given array or returns null on null input.
+ *
+ * @param The array type.
+ * @param array The array to clone.
+ * @return The cloned array or null.
+ */
+ private static T[] clone(final T... array) {
+ return array != null ? array.clone() : null;
+ }
+
/**
* A very simple method that coerces Predicate super T> to Predicate.
* Due to the {@link Predicate#test(T)} method, Predicate super T> is
@@ -75,10 +86,7 @@ static , P extends java.util.function.
*/
@SuppressWarnings("unchecked")
static >> T[] copy(final T... consumers) {
- if (consumers == null) {
- return null;
- }
- return consumers.clone();
+ return clone(consumers);
}
/**
@@ -91,10 +99,7 @@ static >> T[] copy(final T... consumers) {
*/
@SuppressWarnings("unchecked")
static >> T[] copy(final T... predicates) {
- if (predicates == null) {
- return null;
- }
- return predicates.clone();
+ return clone(predicates);
}
/**
@@ -105,10 +110,7 @@ static >> T[] copy(final T... predicate
*/
@SuppressWarnings("unchecked")
static , ?>> T[] copy(final T... transformers) {
- if (transformers == null) {
- return null;
- }
- return transformers.clone();
+ return clone(transformers);
}
/**
@@ -139,7 +141,7 @@ static Predicate super T>[] validate(final Collection extends java.util.
* @param consumers the consumers to validate.
*/
static void validate(final Consumer>... consumers) {
- Objects.requireNonNull(consumers, "closures");
+ Objects.requireNonNull(consumers, "consumers");
for (int i = 0; i < consumers.length; i++) {
if (consumers[i] == null) {
throw new NullPointerException("closures[" + i + "]");
diff --git a/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java b/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java
index 21522a4ae6..611ebadd5f 100644
--- a/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
index 886127a096..54072b79bc 100644
--- a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,6 +50,7 @@ public class IfClosure implements Closure, Serializable {
public static Closure ifClosure(final Predicate super E> predicate, final Closure super E> trueClosure) {
return IfClosure.ifClosure(predicate, trueClosure, NOPClosure.nopClosure());
}
+
/**
* Factory method that performs validation.
*
@@ -67,6 +68,7 @@ public static Closure ifClosure(final Predicate super E> predicate,
Objects.requireNonNull(trueClosure, "trueClosure"),
Objects.requireNonNull(falseClosure, "falseClosure"));
}
+
/** The test */
private final Predicate super T> iPredicate;
diff --git a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
index 366753db3a..7743c5337a 100644
--- a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -53,6 +53,7 @@ public static Transformer ifTransformer(final Predicate super I>
Objects.requireNonNull(trueTransformer, "trueTransformer"),
Objects.requireNonNull(falseTransformer, "falseTransformer"));
}
+
/**
* Factory method that performs validation.
*
@@ -71,6 +72,7 @@ public static Transformer ifTransformer(
return new IfTransformer<>(Objects.requireNonNull(predicate, "predicate"),
Objects.requireNonNull(trueTransformer, "trueTransformer"), NOPTransformer.nopTransformer());
}
+
/** The test */
private final Predicate super T> iPredicate;
diff --git a/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java b/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java
index 06b74fde55..9e4fdae7e3 100644
--- a/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java
index 72b1c58030..e8f2d22756 100644
--- a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java
+++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -63,10 +63,13 @@ public static Factory instantiateFactory(final Class classToInstantiat
}
return new InstantiateFactory<>(classToInstantiate, paramTypes, args);
}
+
/** The class to create */
private final Class iClassToInstantiate;
+
/** The constructor parameter types */
private final Class>[] iParamTypes;
+
/** The constructor arguments */
private final Object[] iArgs;
diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
index 6f7ec6ca86..18361e5c19 100644
--- a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -49,6 +49,7 @@ public class InstantiateTransformer implements Transformer extends T>
public static Transformer extends T>, T> instantiateTransformer() {
return NO_ARG_INSTANCE;
}
+
/**
* Transformer method that performs validation.
*
diff --git a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java
index 5ed076953a..263a306d09 100644
--- a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -51,6 +51,7 @@ public class InvokerTransformer implements Transformer {
public static Transformer invokerTransformer(final String methodName) {
return new InvokerTransformer<>(Objects.requireNonNull(methodName, "methodName"));
}
+
/**
* Gets an instance of this transformer calling a specific method with specific values.
*
@@ -76,6 +77,7 @@ public static Transformer invokerTransformer(final String methodNam
}
return new InvokerTransformer<>(methodName, paramTypes, args);
}
+
/** The method name to call */
private final String iMethodName;
diff --git a/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java b/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java
index af94dac1fa..a5b63a3e16 100644
--- a/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java b/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
index 1c3feac491..7b6543fc45 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java b/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
index 29ab745225..8c05f12ec8 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java
index 9788c0e238..4649622184 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
index dc9d4e6333..97092c30f0 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java
index 228b5a545f..62b14e80c8 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java
index dae91a2f9e..a63d552001 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java
index 5ad285975b..bcec3baa21 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java
index 19d695f4ba..4f3d776d98 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
index 70f6b529da..bc7d2dd9a8 100644
--- a/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java
index 0213793896..da06d3e262 100644
--- a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java
index b547cd229e..92572a5831 100644
--- a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -46,6 +46,7 @@ public static Predicate orPredicate(final Predicate super T> predicate1
return new OrPredicate<>(Objects.requireNonNull(predicate1, "predicate1"),
Objects.requireNonNull(predicate2, "predicate2"));
}
+
/** The array of predicates to call */
private final Predicate super T> iPredicate1;
diff --git a/src/main/java/org/apache/commons/collections4/functors/PredicateDecorator.java b/src/main/java/org/apache/commons/collections4/functors/PredicateDecorator.java
index 8cf2699132..b8dc9aa198 100644
--- a/src/main/java/org/apache/commons/collections4/functors/PredicateDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/functors/PredicateDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java b/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java
index 00fa8f0dc2..4bc9076e96 100644
--- a/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java
index 36cd29c12b..5c1fada974 100644
--- a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java
+++ b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -51,6 +51,7 @@ static class PrototypeCloneFactory implements Factory {
/** The object to clone each time */
private final T iPrototype;
+
/** The method used to clone */
private transient Method iCloneMethod;
diff --git a/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java b/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java
index 31c3fa3aa5..36f5ed693c 100644
--- a/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
index d623f1cf46..2d20c1ad15 100644
--- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -72,6 +72,7 @@ public static Closure switchClosure(final Map, Closure> p
}
return new SwitchClosure<>(false, preds, closures, defaultClosure);
}
+
/**
* Factory method that performs validation and copies the parameter arrays.
*
@@ -98,6 +99,7 @@ public static Closure switchClosure(final Predicate super E>[] predicat
}
return new SwitchClosure<>(predicates, closures, defaultClosure);
}
+
/** The tests to consider */
private final Predicate super T>[] iPredicates;
diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java
index 4262bf0ed5..213d1d5b95 100644
--- a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -81,6 +81,7 @@ public static Transformer switchTransformer(
}
return new SwitchTransformer<>(false, preds, transformers, defaultTransformer);
}
+
/**
* Factory method that performs validation and copies the parameter arrays.
*
@@ -109,6 +110,7 @@ public static Transformer switchTransformer(final Predicate super
}
return new SwitchTransformer<>(predicates, transformers, defaultTransformer);
}
+
/** The tests to consider */
private final Predicate super T>[] iPredicates;
diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java b/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java
index 6aa2b86017..b30cfc5dc9 100644
--- a/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java b/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java
index 6d47fde5a5..e22c54b5ee 100644
--- a/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java b/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java
index 4e7c91efbe..aec7befa78 100644
--- a/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java b/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
index b333ea050f..56cffc4d5c 100644
--- a/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java b/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java
index 72906f1d08..6069085d81 100644
--- a/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java
index cb4386214a..cd9f984f58 100644
--- a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -51,8 +51,10 @@ public static Closure whileClosure(final Predicate super E> predicate,
return new WhileClosure<>(Objects.requireNonNull(predicate, "predicate"),
Objects.requireNonNull(closure, "closure"), doLoop);
}
+
/** The test condition */
private final Predicate super T> iPredicate;
+
/** The closure to call */
private final Closure super T> iClosure;
diff --git a/src/main/java/org/apache/commons/collections4/functors/package-info.java b/src/main/java/org/apache/commons/collections4/functors/package-info.java
index 545e754c1f..1724839cdd 100644
--- a/src/main/java/org/apache/commons/collections4/functors/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/functors/package-info.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyIterator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyIterator.java
index 72441b6c89..9c5048d58a 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyMapIterator.java
index 4baec53a01..9bee41054a 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractEmptyMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractIteratorDecorator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractIteratorDecorator.java
index b40a171039..c318721d0f 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractIteratorDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractIteratorDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractListIteratorDecorator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractListIteratorDecorator.java
index 9bd6ca5a1a..204513bddc 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractListIteratorDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractListIteratorDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractMapIteratorDecorator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractMapIteratorDecorator.java
index a2985c46c1..f347f3f55a 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractMapIteratorDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractMapIteratorDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractOrderedMapIteratorDecorator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractOrderedMapIteratorDecorator.java
index 154d7b13f3..c93d6a1536 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractOrderedMapIteratorDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractOrderedMapIteratorDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/AbstractUntypedIteratorDecorator.java b/src/main/java/org/apache/commons/collections4/iterators/AbstractUntypedIteratorDecorator.java
index a360a229be..865b1bf5d8 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/AbstractUntypedIteratorDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/AbstractUntypedIteratorDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java
index f0c178d30e..b19a8ec53c 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -41,10 +41,13 @@ public class ArrayIterator implements ResettableIterator {
/** The array to iterate over */
final Object array;
+
/** The start index to loop from */
final int startIndex;
+
/** The end index to loop to */
final int endIndex;
+
/** The current iterator index */
int index;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java
index 1e409e37f4..b85f7565dd 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
index fa8756904c..300910b442 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -82,6 +82,7 @@ public BoundedIterator(final Iterator extends E> iterator, final long offset,
/**
* Checks whether the iterator is still within its bounded range.
+ *
* @return {@code true} if the iterator is within its bounds, {@code false} otherwise
*/
private boolean checkBounds() {
diff --git a/src/main/java/org/apache/commons/collections4/iterators/CartesianProductIterator.java b/src/main/java/org/apache/commons/collections4/iterators/CartesianProductIterator.java
index b4d4a3995c..fc51cc79b8 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/CartesianProductIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/CartesianProductIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java
index 54c1c2060f..6ebe79d8ac 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java
index d963b8d615..791742f96b 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java
index d0370948ea..bd95ca59ed 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
index 3a6d78e6c0..1aac23f18b 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,6 +30,7 @@ public class EmptyMapIterator extends AbstractEmptyMapIterator imple
/**
* Singleton instance of the iterator.
+ *
* @since 3.1
*/
@SuppressWarnings("rawtypes")
@@ -37,6 +38,7 @@ public class EmptyMapIterator extends AbstractEmptyMapIterator imple
/**
* Gets a typed instance of the iterator.
+ *
* @param the key type
* @param the value type
* @return {@link MapIterator}<K, V>
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedIterator.java
index ea5c805f4d..8edda19b2e 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
index 6c3ba3f4df..b3e0fb4de7 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,6 +30,7 @@ public class EmptyOrderedMapIterator extends AbstractEmptyMapIterator extends AbstractEmptyMapIterator the key type
* @param the value type
* @return {@link OrderedMapIterator}<K, V>
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java
index 2e8561cdac..1c7aaf3264 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
index 7bc1f51fa0..9a83e7ebfc 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,12 +31,13 @@ public class EnumerationIterator implements Iterator {
/** The collection to remove elements from */
private final Collection super E> collection;
+
/** The enumeration being converted */
private Enumeration extends E> enumeration;
+
/** The last object retrieved */
private E last;
- // Constructors
/**
* Constructs a new {@code EnumerationIterator} that will not
* function until {@link #setEnumeration(Enumeration)} is called.
@@ -77,7 +78,6 @@ public Enumeration extends E> getEnumeration() {
return enumeration;
}
- // Iterator interface
/**
* Returns true if the underlying enumeration has more elements.
*
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ExtendedIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ExtendedIterator.java
index d393b7b117..20a74b1628 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ExtendedIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ExtendedIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,8 +35,8 @@
public final class ExtendedIterator implements IteratorOperations {
/**
- * Create an ExtendedIterator returning the elements of it. If it is itself an ExtendedIterator, return that; otherwise wrap
- * it.
+ * Create an ExtendedIterator returning the elements of {@code it}. If {@code it} is itself an ExtendedIterator, return that; otherwise wrap
+ * {@code it}.
*
* @param The type of object returned from the iterator.
* @param it The iterator to wrap.
@@ -47,7 +47,7 @@ public static ExtendedIterator create(final Iterator it) {
}
/**
- * Creates an ExtendedIterator wrapped round a {@link Stream}. The extended iterator does not permit .remove().
+ * Creates an ExtendedIterator wrapped round a {@link Stream}. The extended iterator does not permit {@code .remove()}.
*
* The stream should not be used directly. The effect of doing so is undefined.
*
@@ -61,7 +61,7 @@ public static ExtendedIterator create(final Stream stream) {
}
/**
- * Creates an ExtendedIterator wrapped round it, which does not permit .remove() even if it does.
+ * Creates an ExtendedIterator wrapped round {@code it}, which does not permit {@code .remove()} even if {@code it} does.
*
* @param The type of object returned from the iterator.
* @param it The Iterator to wrap.
@@ -93,7 +93,7 @@ public static ExtendedIterator flatten(final Iterator> iterat
}
/**
- * Set to true if this wrapping doesn't permit the use of {@link #remove()}, otherwise removal is delegated to the base iterator.
+ * Set to {@code true} if this wrapping doesn't permit the use of {@link #remove()}, otherwise removal is delegated to the base iterator.
*/
private final boolean throwOnRemove;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java
index 9fc280cd21..2fb4a9d94f 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
index 307537327d..67fb422c49 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -109,6 +109,7 @@ public FilterListIterator(final Predicate super E> predicate) {
/**
* Not supported.
+ *
* @param o the element to insert
*/
@Override
@@ -194,6 +195,7 @@ public void remove() {
/**
* Not supported.
+ *
* @param ignored the element with which to replace the last element returned by
* {@code next} or {@code previous}
*/
diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
index eb339097d1..031fb650c0 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -63,17 +63,22 @@ public class IteratorChain implements Iterator {
private Iterator extends E> currentIterator;
/**
- * The "last used" Iterator is the Iterator upon which next() or hasNext()
+ * The "last used" Iterator is the Iterator upon which next()
* was most recently called used for the remove() operation only
*/
private Iterator extends E> lastUsedIterator;
/**
- * ComparatorChain is "locked" after the first time compare(Object,Object)
+ * ComparatorChain is "locked" after the first time compare(Object, Object)
* is called
*/
private boolean isLocked;
+ /**
+ * Contains the result of the last hasNext() call until next() is invoked
+ */
+ private Boolean cachedHasNextValue;
+
/**
* Constructs an IteratorChain with no Iterators.
*
@@ -163,7 +168,29 @@ public IteratorChain(final Iterator extends E> first, final Iterator extends
*/
public void addIterator(final Iterator extends E> iterator) {
checkLocked();
- iteratorQueue.add(Objects.requireNonNull(iterator, "iterator"));
+ Objects.requireNonNull(iterator, "iterator");
+ if (iterator instanceof UnmodifiableIterator) {
+ final Iterator extends E> underlyingIterator = ((UnmodifiableIterator) iterator).unwrap();
+ if (underlyingIterator instanceof IteratorChain) {
+ // in case it is an IteratorChain, wrap every underlying iterators as unmodifiable
+ // multiple rechainings would otherwise lead to exponential growing number of function calls
+ // when the iteratorChain gets used.
+ for (final Iterator extends E> nestedIterator : ((IteratorChain extends E>) underlyingIterator).iteratorQueue) {
+ iteratorQueue.add(UnmodifiableIterator.unmodifiableIterator(nestedIterator));
+ }
+ } else {
+ // we don't know anything about the underlying iterator, simply add it here
+ iteratorQueue.add(iterator);
+ }
+ } else if (iterator instanceof IteratorChain) {
+ // add the wrapped iterators directly instead of reusing the given instance
+ // multiple rechainings would otherwise lead to exponential growing number of function calls
+ // when the iteratorChain gets used.
+ iteratorQueue.addAll(((IteratorChain) iterator).iteratorQueue);
+ } else {
+ // arbitrary other iterator
+ iteratorQueue.add(iterator);
+ }
}
/**
@@ -183,9 +210,10 @@ private void checkLocked() {
@Override
public boolean hasNext() {
lockChain();
- updateCurrentIterator();
- lastUsedIterator = currentIterator;
- return currentIterator.hasNext();
+ if (cachedHasNextValue == null) {
+ updateCurrentIterator();
+ }
+ return cachedHasNextValue;
}
/**
@@ -219,9 +247,11 @@ private void lockChain() {
@Override
public E next() {
lockChain();
- updateCurrentIterator();
+ if (cachedHasNextValue == null) {
+ updateCurrentIterator();
+ }
lastUsedIterator = currentIterator;
-
+ cachedHasNextValue = null;
return currentIterator.next();
}
@@ -241,10 +271,11 @@ public E next() {
@Override
public void remove() {
lockChain();
- if (currentIterator == null) {
- updateCurrentIterator();
+ if (lastUsedIterator == null) {
+ throw new IllegalStateException("remove() has been invoked without next()");
}
lastUsedIterator.remove();
+ lastUsedIterator = null; // must never be used twice without next() being invoked
}
/**
@@ -267,13 +298,16 @@ protected void updateCurrentIterator() {
} else {
currentIterator = iteratorQueue.remove();
}
- // set last used iterator here, in case the user calls remove
- // before calling hasNext() or next() (although they shouldn't)
- lastUsedIterator = currentIterator;
}
- while (!currentIterator.hasNext() && !iteratorQueue.isEmpty()) {
+ while (true) {
+ cachedHasNextValue = currentIterator.hasNext();
+ if (cachedHasNextValue) {
+ break;
+ }
+ if (iteratorQueue.isEmpty()) {
+ break;
+ }
currentIterator = iteratorQueue.remove();
}
}
-
}
diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java
index c53c54b7e0..60a8d35568 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java
index 20584d43a5..55127a0de7 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorOperations.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorOperations.java
index 54056e2cb4..1020a257ad 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/IteratorOperations.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorOperations.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/LazyIteratorChain.java b/src/main/java/org/apache/commons/collections4/iterators/LazyIteratorChain.java
index 8ffab74ac2..958179f176 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/LazyIteratorChain.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/LazyIteratorChain.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
index 3c5ae62357..dbba4b722f 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -60,13 +60,16 @@ public class ListIteratorWrapper implements ResettableListIterator {
/** The underlying iterator being decorated. */
private final Iterator extends E> iterator;
+
/** The list being used to cache the iterator. */
private final List list = new ArrayList<>();
/** The current index of this iterator. */
private int currentIndex;
+
/** The current index of the wrapped iterator. */
private int wrappedIteratorIndex;
+
/** Recall whether the wrapped iterator's "cursor" is in such a state as to allow remove() to be called */
private boolean removeState;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java
index 65bbe98e58..0bcdea5ee6 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -42,6 +42,7 @@ public class LoopingIterator implements ResettableIterator {
/** The collection to base the iterator on */
private final Collection extends E> collection;
+
/** The current iterator */
private Iterator extends E> iterator;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java
index c0defe371b..1f76ddf046 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -44,6 +44,7 @@ public class LoopingListIterator implements ResettableListIterator {
/** The list to base the iterator on */
private final List list;
+
/** The current list iterator */
private ListIterator iterator;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java
index 01f4c3d11b..916eeab927 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,6 +37,7 @@ public class NodeListIterator implements Iterator {
/** The original NodeList instance */
private final NodeList nodeList;
+
/** The current iterator index */
private int index;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java
index c0178d0a94..2c0d82631f 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,10 +38,13 @@ public class ObjectArrayIterator implements ResettableIterator {
/** The array */
final E[] array;
+
/** The start index to loop from */
final int startIndex;
+
/** The end index to loop to */
final int endIndex;
+
/** The current iterator index */
int index;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java
index 5c48204684..cc8bc4fc76 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java
index 6ccadaf383..daae6e426a 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -84,17 +84,22 @@ public class ObjectGraphIterator implements Iterator {
/** The stack of iterators */
private final Deque extends E>> stack = new ArrayDeque<>(8);
+
/** The root object in the tree */
private E root;
+
/** The transformer to use */
private final Transformer super E, ? extends E> transformer;
/** Whether there is another element in the iteration */
private boolean hasNext;
+
/** The current iterator */
private Iterator extends E> currentIterator;
+
/** The current value */
private E currentValue;
+
/** The last used iterator, needed for remove() */
private Iterator extends E> lastUsedIterator;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java
index 04e2e7acbe..e47d49a92e 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
index 0deaad290e..6aace66579 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -71,6 +71,7 @@ public class PermutationIterator implements Iterator> {
/**
* Standard constructor for this class.
+ *
* @param collection the collection to generate permutations for
* @throws NullPointerException if coll is null
*/
@@ -91,6 +92,7 @@ public PermutationIterator(final Collection extends E> collection) {
/**
* Indicates if there are more permutation available.
+ *
* @return true if there are more permutations, otherwise false
*/
@Override
@@ -100,6 +102,7 @@ public boolean hasNext() {
/**
* Returns the next permutation of the input collection.
+ *
* @return a list of the permutator's elements representing a permutation
* @throws NoSuchElementException if there are no more permutations
*/
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
index 340e793b28..d09f7d12d5 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
index 48b4dd6ff9..921c66f09a 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -42,8 +42,10 @@ public class ReverseListIterator implements ResettableListIterator {
/** The list being wrapped. */
private final List list;
+
/** The list iterator being wrapped. */
private ListIterator iterator;
+
/** Flag to indicate if updating is possible at the moment. */
private boolean validForUpdate = true;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java
index d660489ef8..49b4fb6872 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,10 +32,13 @@ public class SingletonIterator
/** Whether remove is allowed */
private final boolean removeAllowed;
+
/** Is the cursor before the first element */
private boolean beforeFirst = true;
+
/** Has the element been removed */
private boolean removed;
+
/** The object */
private E object;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
index 871010909f..53529a98b2 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -140,6 +140,7 @@ public int previousIndex() {
/**
* Remove the object from this iterator.
+ *
* @throws IllegalStateException if the {@code next} or {@code previous}
* method has not yet been called, or the {@code remove} method
* has already been called after the last call to {@code next}
diff --git a/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java
index 9f03fe49ce..26e4ff2246 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java
index 1b3d774aca..f7b4113fd7 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,6 +31,7 @@ public class TransformIterator implements Iterator {
/** The iterator being used */
private Iterator extends I> iterator;
+
/** The transformer being used */
private Transformer super I, ? extends O> transformer;
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
index 1d4b0a61d7..7370b1bd57 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,9 +31,9 @@
public class UniqueFilterIterator extends FilterIterator {
/**
- * Constructs a new {@code UniqueFilterIterator}.
+ * Constructs a new {@code UniqueFilterIterator}.
*
- * @param iterator the iterator to use
+ * @param iterator the iterator to use
*/
public UniqueFilterIterator(final Iterator extends E> iterator) {
super(iterator, UniquePredicate.uniquePredicate());
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java
index 836b3c1031..1fb56b5ccc 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,18 +24,20 @@
/**
* Decorates an iterator such that it cannot be modified.
*
- * Attempts to modify it will result in an UnsupportedOperationException.
+ * Calling {@link #remove()} throws {@link UnsupportedOperationException}.
*
*
* @param the type of elements returned by this iterator.
+ * @param The wrapped Iterator type.
* @since 3.0
*/
-public final class UnmodifiableIterator implements Iterator, Unmodifiable {
+public final class UnmodifiableIterator extends E>> implements Iterator, Unmodifiable {
/**
* Decorates the specified iterator such that it cannot be modified.
*
* If the iterator is already unmodifiable it is returned directly.
+ *
*
* @param the element type
* @param iterator the iterator to decorate
@@ -49,18 +51,24 @@ public static Iterator unmodifiableIterator(final Iterator extends E> i
final Iterator tmpIterator = (Iterator) iterator;
return tmpIterator;
}
+ return wrap(iterator);
+ }
+
+ static extends E>> UnmodifiableIterator wrap(final T iterator) {
return new UnmodifiableIterator<>(iterator);
}
- /** The iterator being decorated */
- private final Iterator extends E> iterator;
+ /**
+ * The decorated iterator.
+ */
+ private final T iterator;
/**
* Constructs a new instance.
*
- * @param iterator the iterator to decorate
+ * @param iterator the iterator to decorate.
*/
- private UnmodifiableIterator(final Iterator extends E> iterator) {
+ private UnmodifiableIterator(final T iterator) {
this.iterator = iterator;
}
@@ -74,9 +82,13 @@ public E next() {
return iterator.next();
}
+ // TODO This method can be removed in 5.0 since it's implemented as a default method in Iterator.
@Override
public void remove() {
- throw new UnsupportedOperationException("remove() is not supported");
+ throw new UnsupportedOperationException("remove");
}
+ T unwrap() {
+ return iterator;
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java
index ee4689d9a6..ff81b3e403 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java
index 26314208e8..24e7468d56 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java
index a2a0305157..f34437b59d 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java
index 52b8bae0db..7634cf3956 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/iterators/package-info.java b/src/main/java/org/apache/commons/collections4/iterators/package-info.java
index dbf080e83a..4fe80902db 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/package-info.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
index 3c13e71d0d..4a602681a4 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,6 +30,7 @@ public abstract class AbstractKeyValue implements KeyValue {
/** The key */
private K key;
+
/** The value */
private V value;
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java
index 9ace5dd569..af34ddd5b8 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java
index 08bd0d24ed..6cef4c562c 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java
index fcbf02f1f0..78c75c3dd1 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java
index 19b99ea170..3b13a25188 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
index 9e4f451d88..dcc621eb3b 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -233,6 +233,7 @@ public MultiKey(final K[] keys, final boolean makeClone) {
/**
* Calculate the hash code of the instance using the provided keys.
+ *
* @param keys the keys to calculate the hash code for
*/
private void calculateHashCode(final Object[] keys) {
@@ -316,6 +317,7 @@ public int hashCode() {
* Recalculate the hash code after deserialization. The hash code of some
* keys might have change (hash codes based on the system hash code are
* only stable for the same process).
+ *
* @return the instance with recalculated hash code
*/
protected Object readResolve() {
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java
index 92295bbe1a..47c9298a7e 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java
index a966420227..c0d8c65e91 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java b/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
index 1f4b64c633..4a1b204464 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,10 +20,11 @@
* These are usually used in maps, however they can be used as data holders in any collection.
*
* The following key/value designs are included:
+ *
*
- * - Map Entry - various map entry implementations
- *
- KeyValue - a key and value pair, without map entry semantics
- *
- MultiKey - a holder of multiple keys tied together
+ *
- Map Entry - various map entry implementations
+ * - KeyValue - a key and value pair, without map entry semantics
+ * - MultiKey - a holder of multiple keys tied together
*
*/
package org.apache.commons.collections4.keyvalue;
diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java
index a2f6aeef93..fe9e30ea2f 100644
--- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java
+++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,7 +43,7 @@
*
* @param the type of elements in this list
* @since 3.0
- * @deprecated use {@link AbstractLinkedListJava21} instead
+ * @deprecated Use {@link AbstractLinkedListJava21} instead
*/
@Deprecated
public abstract class AbstractLinkedList implements List {
@@ -438,8 +438,10 @@ protected static class Node {
/** A pointer to the node before this node */
protected Node previous;
+
/** A pointer to the node after this node */
protected Node next;
+
/** The object contained within this node */
protected E value;
diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java
index d3a5855381..7a79d4dc3f 100644
--- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java
+++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -229,12 +229,16 @@ public void set(final E obj) {
* @param the type of elements in this list.
*/
protected static class LinkedSubList extends AbstractList {
+
/** The main list */
AbstractLinkedListJava21 parent;
+
/** Offset from the main list */
int offset;
+
/** Sublist size */
int size;
+
/** Sublist modCount */
int expectedModCount;
@@ -437,8 +441,10 @@ protected static class Node