Author: kinow Date: Wed Nov 13 20:14:17 2013 New Revision: 1541690 URL: http://svn.apache.org/r1541690 Log: Fix checkstyle issues
Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/NumericRange.java Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java?rev=1541690&r1=1541689&r2=1541690&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java Wed Nov 13 20:14:17 2013 @@ -27,44 +27,73 @@ import org.apache.commons.lang3.Validate * @version $Revision: 1508677 $ $Date: 2013-07-30 19:48:02 -0300 (Tue, 30 Jul 2013) $ */ public final class IteratorToGeneratorAdapter<E> extends LoopGenerator<E> { + /** + * Helper iterator. + * @param <E> the type of elements in this iterator. + */ private static class EqualityIterator<E> implements Iterator<E> { + /** + * Iterable that owns this iterator. + */ final Iterable<? extends E> owner; + /** + * Wrapped iterator. + */ final Iterator<? extends E> wrapped; - + /** + * Create a new EqualityIterator. + * @param owner iterable that owns this iterator + */ EqualityIterator(Iterable<? extends E> owner) { super(); this.owner = Validate.notNull(owner); this.wrapped = owner.iterator(); } + /** + * {@inheritDoc} + */ public boolean hasNext() { return wrapped.hasNext(); } + /** + * {@inheritDoc} + */ public E next() { return wrapped.next(); } + /** + * {@inheritDoc} + */ public void remove() { wrapped.remove(); } + /** + * {@inheritDoc} + */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } - if (obj instanceof EqualityIterator<?> == false) { + if (!(obj instanceof EqualityIterator)) { return false; } return ((EqualityIterator<?>) obj).owner.equals(owner); } - + + /** + * {@inheritDoc} + */ @Override public int hashCode() { - int result = 71 << 4; - result |= owner.hashCode(); - return result; + int hash = "IteratorToGeneratorAdapater$EqualityIterator".hashCode(); + hash <<= 2; + hash ^= owner.hashCode(); + return hash; } } Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java?rev=1541690&r1=1541689&r2=1541690&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java Wed Nov 13 20:14:17 2013 @@ -48,6 +48,9 @@ public abstract class AbstractRange<T ex */ protected final S step; + /** + * Function to implement the taking of a step. + */ private final BinaryFunction<T, S, T> nextValue; /** @@ -58,7 +61,8 @@ public abstract class AbstractRange<T ex * @param step increment step * @param nextValue function to implement the taking of a step */ - protected AbstractRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, S step, BinaryFunction<T, S, T> nextValue) { + protected AbstractRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, S step, + BinaryFunction<T, S, T> nextValue) { super(); this.leftEndpoint = Validate.notNull(leftEndpoint, "Left Endpoint argument must not be null"); this.rightEndpoint = Validate.notNull(rightEndpoint, "Right Endpoint argument must not be null"); @@ -121,7 +125,7 @@ public abstract class AbstractRange<T ex /** * Create a non-empty iterator. - * + * * @return Iterator */ protected abstract Iterator<T> createIterator(); Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java?rev=1541690&r1=1541689&r2=1541690&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java Wed Nov 13 20:14:17 2013 @@ -23,7 +23,7 @@ import org.apache.commons.lang3.Validate /** * A range of integers. - * + * * @since 1.0 * @version $Revision: 1385335 $ $Date: 2012-09-16 15:08:31 -0300 (Sun, 16 Sep 2012) $ */ @@ -47,7 +47,7 @@ public class IntegerRange extends Numeri // --------------------------------------------------------------- /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -59,7 +59,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -73,7 +73,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -85,7 +85,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -99,7 +99,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -113,7 +113,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param leftBoundType @@ -128,10 +128,10 @@ public class IntegerRange extends Numeri public IntegerRange(int from, BoundType leftBoundType, int to, BoundType rightBoundType) { this(from, leftBoundType, to, rightBoundType, DEFAULT_STEP.evaluate(from, to)); } - + /** * Create a new IntegerRange. - * + * * @param from * start * @param to @@ -158,7 +158,7 @@ public class IntegerRange extends Numeri /** * Create a new IntegerRange. - * + * * @param from * start * @param leftBoundType Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/NumericRange.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/NumericRange.java?rev=1541690&r1=1541689&r2=1541690&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/NumericRange.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/range/NumericRange.java Wed Nov 13 20:14:17 2013 @@ -34,13 +34,14 @@ import org.apache.commons.functor.Binary public abstract class NumericRange<T extends Number & Comparable<T>> extends AbstractRange<T, T> { /** - * Construct a new {@link NumericRange}.T + * Construct a new {@link NumericRange}. * @param leftEndpoint left endpoint * @param rightEndpoint right endpoint * @param step increment step * @param nextValue function to implement the taking of a step */ - protected NumericRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, T step, BinaryFunction<T, T, T> nextValue) { + protected NumericRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, T step, + BinaryFunction<T, T, T> nextValue) { super(leftEndpoint, rightEndpoint, step, nextValue); }