Fixed checkstyle.

Add missing newlines at end of files.

Remove redundant modifiers.

Fix incorrect Apache license header.

Fix whitespace around elements.

Remove tab characters.

Fix right-curly location.

Correct modifier order.
This commit is contained in:
Alex Herbert 2020-02-18 23:07:19 +00:00
parent 72f45156d3
commit 4797acefba
163 changed files with 2073 additions and 2085 deletions

View File

@ -20,7 +20,7 @@ limitations under the License.
"-//Puppy Crawl//DTD Check Configuration 1.1//EN" "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
<!-- Apache Commons Lang customization of default Checkstyle behavior --> <!-- Apache Commons Collections customization of default Checkstyle behavior -->
<module name="Checker"> <module name="Checker">
<property name="localeLanguage" value="en"/> <property name="localeLanguage" value="en"/>
<module name="JavadocPackage"/> <module name="JavadocPackage"/>

View File

@ -73,7 +73,7 @@ public class CollectionUtils {
* @param a the first collection * @param a the first collection
* @param b the second collection * @param b the second collection
*/ */
public CardinalityHelper(final Iterable<? extends O> a, final Iterable<? extends O> b) { CardinalityHelper(final Iterable<? extends O> a, final Iterable<? extends O> b) {
cardinalityA = CollectionUtils.<O>getCardinalityMap(a); cardinalityA = CollectionUtils.<O>getCardinalityMap(a);
cardinalityB = CollectionUtils.<O>getCardinalityMap(b); cardinalityB = CollectionUtils.<O>getCardinalityMap(b);
} }
@ -140,7 +140,7 @@ public class CollectionUtils {
* @param a the first collection * @param a the first collection
* @param b the second collection * @param b the second collection
*/ */
public SetOperationCardinalityHelper(final Iterable<? extends O> a, final Iterable<? extends O> b) { SetOperationCardinalityHelper(final Iterable<? extends O> a, final Iterable<? extends O> b) {
super(a, b); super(a, b);
elements = new HashSet<>(); elements = new HashSet<>();
addAll(elements, a); addAll(elements, a);
@ -622,7 +622,7 @@ public class CollectionUtils {
private final Equator<? super O> equator; private final Equator<? super O> equator;
private final O object; private final O object;
public EquatorWrapper(final Equator<? super O> equator, final O object) { EquatorWrapper(final Equator<? super O> equator, final O object) {
this.equator = equator; this.equator = equator;
this.object = object; this.object = object;
} }

View File

@ -1,12 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license * Licensed to the Apache Software Foundation (ASF) under one or more
* agreements. See the NOTICE file distributed with this work for additional information regarding * contributor license agreements. See the NOTICE file distributed with
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the * this work for additional information regarding copyright ownership.
* "License"); you may not use this file except in compliance with the License. You may obtain a * The ASF licenses this file to You under the Apache License, Version 2.0
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable * (the "License"); you may not use this file except in compliance with
* law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * the License. You may obtain a copy of the License at
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License *
* for the specific language governing permissions and limitations under the License. * http://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,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4; package org.apache.commons.collections4;

View File

@ -478,7 +478,7 @@ public class IterableUtils {
private static final class UnmodifiableIterable<E> extends FluentIterable<E> { private static final class UnmodifiableIterable<E> extends FluentIterable<E> {
private final Iterable<E> unmodifiable; private final Iterable<E> unmodifiable;
public UnmodifiableIterable(final Iterable<E> iterable) { UnmodifiableIterable(final Iterable<E> iterable) {
super(); super();
this.unmodifiable = iterable; this.unmodifiable = iterable;
} }

View File

@ -611,7 +611,7 @@ public class ListUtils {
private static final class LcsVisitor<E> implements CommandVisitor<E> { private static final class LcsVisitor<E> implements CommandVisitor<E> {
private final ArrayList<E> sequence; private final ArrayList<E> sequence;
public LcsVisitor() { LcsVisitor() {
sequence = new ArrayList<>(); sequence = new ArrayList<>();
} }
@ -639,10 +639,9 @@ public class ListUtils {
* A simple wrapper to use a CharSequence as List. * A simple wrapper to use a CharSequence as List.
*/ */
private static final class CharSequenceAsList extends AbstractList<Character> { private static final class CharSequenceAsList extends AbstractList<Character> {
private final CharSequence sequence; private final CharSequence sequence;
public CharSequenceAsList(final CharSequence sequence) { CharSequenceAsList(final CharSequence sequence) {
this.sequence = sequence; this.sequence = sequence;
} }
@ -655,7 +654,6 @@ public class ListUtils {
public int size() { public int size() {
return sequence.length(); return sequence.length();
} }
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------

View File

@ -58,7 +58,7 @@ public class SetUtils {
* @param <E> the element type * @param <E> the element type
* @since 4.1 * @since 4.1
*/ */
public static abstract class SetView<E> extends AbstractSet<E> { public abstract static class SetView<E> extends AbstractSet<E> {
/** /**
* Copies the contents of this view into the provided set. * Copies the contents of this view into the provided set.

View File

@ -191,7 +191,7 @@ public abstract class AbstractMapBag<E> implements Bag<E> {
* *
* @param parent the parent bag * @param parent the parent bag
*/ */
public BagIterator(final AbstractMapBag<E> parent) { BagIterator(final AbstractMapBag<E> parent) {
this.parent = parent; this.parent = parent;
this.entryIterator = parent.map.entrySet().iterator(); this.entryIterator = parent.map.entrySet().iterator();
this.current = null; this.current = null;

View File

@ -344,7 +344,7 @@ public abstract class AbstractDualBidiMap<K, V> implements BidiMap<K, V> {
/** /**
* Inner class View. * Inner class View.
*/ */
protected static abstract class View<K, V, E> extends AbstractCollectionDecorator<E> { protected abstract static class View<K, V, E> extends AbstractCollectionDecorator<E> {
/** Generated serial version ID. */ /** Generated serial version ID. */
private static final long serialVersionUID = 4621510560119690639L; private static final long serialVersionUID = 4621510560119690639L;

View File

@ -1521,7 +1521,7 @@ public class TreeBidiMap<K extends Comparable<K>, V extends Comparable<V>>
/** /**
* Create a new TreeBidiMap.KeyView. * Create a new TreeBidiMap.KeyView.
*/ */
public KeyView(final DataElement orderType) { KeyView(final DataElement orderType) {
super(orderType); super(orderType);
} }
@ -1548,7 +1548,7 @@ public class TreeBidiMap<K extends Comparable<K>, V extends Comparable<V>>
/** /**
* Create a new TreeBidiMap.ValueView. * Create a new TreeBidiMap.ValueView.
*/ */
public ValueView(final DataElement orderType) { ValueView(final DataElement orderType) {
super(orderType); super(orderType);
} }
@ -1792,7 +1792,7 @@ public class TreeBidiMap<K extends Comparable<K>, V extends Comparable<V>>
/** /**
* Create a new TreeBidiMap.InverseViewMapIterator. * Create a new TreeBidiMap.InverseViewMapIterator.
*/ */
public InverseViewMapIterator(final DataElement orderType) { InverseViewMapIterator(final DataElement orderType) {
super(orderType); super(orderType);
} }

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -168,7 +167,7 @@ public abstract class AbstractBloomFilter implements BloomFilter {
* @param other the other Bloom filter. * @param other the other Bloom filter.
*/ */
@Override @Override
abstract public void merge(BloomFilter other); public abstract void merge(BloomFilter other);
/** /**
* Merge the decomposed Bloom filter defined by the hasher into this Bloom * Merge the decomposed Bloom filter defined by the hasher into this Bloom
@ -179,7 +178,7 @@ public abstract class AbstractBloomFilter implements BloomFilter {
* this filter, or if the hasher is not the specified one * this filter, or if the hasher is not the specified one
*/ */
@Override @Override
abstract public void merge(Hasher hasher); public abstract void merge(Hasher hasher);
@Override @Override
public int orCardinality(final BloomFilter other) { public int orCardinality(final BloomFilter other) {

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -15,9 +14,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* Implementations of org.apache.commons.collections4.bloomfilter.hasher.HasherFunction * Implementations of org.apache.commons.collections4.bloomfilter.hasher.HasherFunction
* interface. * interface.
*
* @since 4.5 * @since 4.5
*/ */
package org.apache.commons.collections4.bloomfilter.hasher.function; package org.apache.commons.collections4.bloomfilter.hasher.function;

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -15,9 +14,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* Implementations of org.apache.commons.collections4.bloomfilter.Hasher * Implementations of org.apache.commons.collections4.bloomfilter.Hasher
* interface. * interface.
*
* @since 4.5 * @since 4.5
*/ */
package org.apache.commons.collections4.bloomfilter.hasher; package org.apache.commons.collections4.bloomfilter.hasher;

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -15,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* A collection of extensible Bloom filter classes and interfaces. * A collection of extensible Bloom filter classes and interfaces.
* *

View File

@ -132,9 +132,15 @@ public class NullComparator<E> implements Comparator<E>, Serializable {
**/ **/
@Override @Override
public int compare(final E o1, final E o2) { public int compare(final E o1, final E o2) {
if(o1 == o2) { return 0; } if (o1 == o2) {
if(o1 == null) { return this.nullsAreHigh ? 1 : -1; } return 0;
if(o2 == null) { return this.nullsAreHigh ? -1 : 1; } }
if (o1 == null) {
return this.nullsAreHigh ? 1 : -1;
}
if (o2 == null) {
return this.nullsAreHigh ? -1 : 1;
}
return this.nonNullComparator.compare(o1, o2); return this.nonNullComparator.compare(o1, o2);
} }
@ -163,14 +169,19 @@ public class NullComparator<E> implements Comparator<E>, Serializable {
**/ **/
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
if(obj == null) { return false; } if (obj == null) {
if(obj == this) { return true; } return false;
if(!obj.getClass().equals(this.getClass())) { return false; } }
if (obj == this) {
return true;
}
if (!obj.getClass().equals(this.getClass())) {
return false;
}
final NullComparator<?> other = (NullComparator<?>) obj; final NullComparator<?> other = (NullComparator<?>) obj;
return this.nullsAreHigh == other.nullsAreHigh && return this.nullsAreHigh == other.nullsAreHigh &&
this.nonNullComparator.equals(other.nonNullComparator); this.nonNullComparator.equals(other.nonNullComparator);
} }
} }

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -1,9 +1,10 @@
/* /*
* Copyright 2013 The Apache Software Foundation. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -227,8 +227,7 @@ public class MultiKey<K> implements Serializable {
* Calculate the hash code of the instance using the provided keys. * Calculate the hash code of the instance using the provided keys.
* @param keys the keys to calculate the hash code for * @param keys the keys to calculate the hash code for
*/ */
private void calculateHashCode(final Object[] keys) private void calculateHashCode(final Object[] keys) {
{
int total = 0; int total = 0;
for (final Object key : keys) { for (final Object key : keys) {
if (key != null) { if (key != null) {

View File

@ -1164,7 +1164,7 @@ public class AbstractHashedMap<K, V> extends AbstractMap<K, V> implements Iterab
* @param <K> the type of the keys in the map * @param <K> the type of the keys in the map
* @param <V> the type of the values in the map * @param <V> the type of the values in the map
*/ */
protected static abstract class HashIterator<K, V> { protected abstract static class HashIterator<K, V> {
/** The parent map */ /** The parent map */
private final AbstractHashedMap<K, V> parent; private final AbstractHashedMap<K, V> parent;

View File

@ -543,7 +543,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im
/** /**
* Base Iterator that iterates in link order. * Base Iterator that iterates in link order.
*/ */
protected static abstract class LinkIterator<K, V> { protected abstract static class LinkIterator<K, V> {
/** The parent map */ /** The parent map */
protected final AbstractLinkedMap<K, V> parent; protected final AbstractLinkedMap<K, V> parent;

View File

@ -794,7 +794,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
int expectedModCount; int expectedModCount;
public ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) { ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) {
super(); super();
this.parent = parent; this.parent = parent;
index = parent.size() != 0 ? parent.data.length : 0; index = parent.size() != 0 ? parent.data.length : 0;
@ -876,7 +876,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
static class ReferenceEntrySetIterator<K, V> static class ReferenceEntrySetIterator<K, V>
extends ReferenceBaseIterator<K, V> implements Iterator<Map.Entry<K, V>> { extends ReferenceBaseIterator<K, V> implements Iterator<Map.Entry<K, V>> {
public ReferenceEntrySetIterator(final AbstractReferenceMap<K, V> parent) { ReferenceEntrySetIterator(final AbstractReferenceMap<K, V> parent) {
super(parent); super(parent);
} }
@ -973,7 +973,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
/** the hashCode of the key (even if the reference points to a value) */ /** the hashCode of the key (even if the reference points to a value) */
private final int hash; private final int hash;
public SoftRef(final int hash, final T r, final ReferenceQueue<? super T> q) { SoftRef(final int hash, final T r, final ReferenceQueue<? super T> q) {
super(r, q); super(r, q);
this.hash = hash; this.hash = hash;
} }
@ -991,7 +991,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
/** the hashCode of the key (even if the reference points to a value) */ /** the hashCode of the key (even if the reference points to a value) */
private final int hash; private final int hash;
public WeakRef(final int hash, final T r, final ReferenceQueue<? super T> q) { WeakRef(final int hash, final T r, final ReferenceQueue<? super T> q) {
super(r, q); super(r, q);
this.hash = hash; this.hash = hash;
} }

View File

@ -809,7 +809,7 @@ public class Flat3Map<K, V> implements IterableMap<K, V>, Serializable, Cloneabl
private final int index; private final int index;
private volatile boolean removed; private volatile boolean removed;
public FlatMapEntry(final Flat3Map<K, V> parent, final int index) { FlatMapEntry(final Flat3Map<K, V> parent, final int index) {
this.parent = parent; this.parent = parent;
this.index = index; this.index = index;
this.removed = false; this.removed = false;
@ -918,7 +918,7 @@ public class Flat3Map<K, V> implements IterableMap<K, V>, Serializable, Cloneabl
} }
static abstract class EntryIterator<K, V> { abstract static class EntryIterator<K, V> {
private final Flat3Map<K, V> parent; private final Flat3Map<K, V> parent;
private int nextIndex = 0; private int nextIndex = 0;
private FlatMapEntry<K, V> currentEntry = null; private FlatMapEntry<K, V> currentEntry = null;
@ -926,7 +926,7 @@ public class Flat3Map<K, V> implements IterableMap<K, V>, Serializable, Cloneabl
/** /**
* Create a new Flat3Map.EntryIterator. * Create a new Flat3Map.EntryIterator.
*/ */
public EntryIterator(final Flat3Map<K, V> parent) { EntryIterator(final Flat3Map<K, V> parent) {
this.parent = parent; this.parent = parent;
} }

View File

@ -600,7 +600,7 @@ public class ListOrderedMap<K, V>
private final List<K> insertOrder; private final List<K> insertOrder;
private Set<Map.Entry<K, V>> entrySet; private Set<Map.Entry<K, V>> entrySet;
public EntrySetView(final ListOrderedMap<K, V> parent, final List<K> insertOrder) { EntrySetView(final ListOrderedMap<K, V> parent, final List<K> insertOrder) {
super(); super();
this.parent = parent; this.parent = parent;
this.insertOrder = insertOrder; this.insertOrder = insertOrder;

View File

@ -517,7 +517,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
private final Collection<V> values; private final Collection<V> values;
private final Iterator<V> iterator; private final Iterator<V> iterator;
public ValuesIterator(final Object key) { ValuesIterator(final Object key) {
this.key = key; this.key = key;
this.values = getCollection(key); this.values = getCollection(key);
this.iterator = values.iterator(); this.iterator = values.iterator();
@ -552,7 +552,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
private final Class<T> clazz; private final Class<T> clazz;
public ReflectionFactory(final Class<T> clazz) { ReflectionFactory(final Class<T> clazz) {
this.clazz = clazz; this.clazz = clazz;
} }

View File

@ -500,7 +500,7 @@ public final class StaticBucketMap<K, V> extends AbstractIterableMap<K, V> {
/** /**
* The lock object, which also includes a count of the nodes in this lock. * The lock object, which also includes a count of the nodes in this lock.
*/ */
private final static class Lock { private static final class Lock {
public int size; public int size;
} }

View File

@ -109,7 +109,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
*/ */
private class WrappedList extends WrappedCollection implements List<V> { private class WrappedList extends WrappedCollection implements List<V> {
public WrappedList(final K key) { WrappedList(final K key) {
super(key); super(key);
} }
@ -220,13 +220,13 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
private List<V> values; private List<V> values;
private ListIterator<V> iterator; private ListIterator<V> iterator;
public ValuesListIterator(final K key) { ValuesListIterator(final K key) {
this.key = key; this.key = key;
this.values = ListUtils.emptyIfNull(getMap().get(key)); this.values = ListUtils.emptyIfNull(getMap().get(key));
this.iterator = values.listIterator(); this.iterator = values.listIterator();
} }
public ValuesListIterator(final K key, final int index) { ValuesListIterator(final K key, final int index) {
this.key = key; this.key = key;
this.values = ListUtils.emptyIfNull(getMap().get(key)); this.values = ListUtils.emptyIfNull(getMap().get(key));
this.iterator = values.listIterator(index); this.iterator = values.listIterator(index);

View File

@ -398,7 +398,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
protected final K key; protected final K key;
public WrappedCollection(final K key) { WrappedCollection(final K key) {
this.key = key; this.key = key;
} }
@ -636,7 +636,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
*/ */
private class MultiValuedMapEntry extends AbstractMapEntry<K, V> { private class MultiValuedMapEntry extends AbstractMapEntry<K, V> {
public MultiValuedMapEntry(final K key, final V value) { MultiValuedMapEntry(final K key, final V value) {
super(key, value); super(key, value);
} }
@ -656,7 +656,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
private Entry<K, V> current = null; private Entry<K, V> current = null;
public MultiValuedMapIterator() { MultiValuedMapIterator() {
this.it = AbstractMultiValuedMap.this.entries().iterator(); this.it = AbstractMultiValuedMap.this.entries().iterator();
} }
@ -734,7 +734,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
private final Collection<V> values; private final Collection<V> values;
private final Iterator<V> iterator; private final Iterator<V> iterator;
public ValuesIterator(final Object key) { ValuesIterator(final Object key) {
this.key = key; this.key = key;
this.values = getMap().get(key); this.values = getMap().get(key);
this.iterator = values.iterator(); this.iterator = values.iterator();

View File

@ -109,7 +109,7 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
*/ */
private class WrappedSet extends WrappedCollection implements Set<V> { private class WrappedSet extends WrappedCollection implements Set<V> {
public WrappedSet(final K key) { WrappedSet(final K key) {
super(key); super(key);
} }
@ -133,5 +133,4 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
} }
} }
} }

View File

@ -165,7 +165,7 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
* *
* @param parent the parent multiset * @param parent the parent multiset
*/ */
public MapBasedMultiSetIterator(final AbstractMapMultiSet<E> parent) { MapBasedMultiSetIterator(final AbstractMapMultiSet<E> parent) {
this.parent = parent; this.parent = parent;
this.entryIterator = parent.map.entrySet().iterator(); this.entryIterator = parent.map.entrySet().iterator();
this.current = null; this.current = null;

View File

@ -138,7 +138,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
* *
* @param parent the parent multiset * @param parent the parent multiset
*/ */
public MultiSetIterator(final AbstractMultiSet<E> parent) { MultiSetIterator(final AbstractMultiSet<E> parent) {
this.parent = parent; this.parent = parent;
this.entryIterator = parent.entrySet().iterator(); this.entryIterator = parent.entrySet().iterator();
this.current = null; this.current = null;
@ -404,7 +404,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
/** /**
* Inner class AbstractEntry. * Inner class AbstractEntry.
*/ */
protected static abstract class AbstractEntry<E> implements Entry<E> { protected abstract static class AbstractEntry<E> implements Entry<E> {
@Override @Override
public boolean equals(final Object object) { public boolean equals(final Object object) {

View File

@ -82,7 +82,7 @@ public abstract class AbstractPropertiesFactory<T extends Properties> {
* @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence.
*/ */
public T load(final ClassLoader classLoader, final String name) throws IOException { public T load(final ClassLoader classLoader, final String name) throws IOException {
try (final InputStream inputStream = classLoader.getResourceAsStream(name)) { try (InputStream inputStream = classLoader.getResourceAsStream(name)) {
return load(inputStream, PropertyFormat.toPropertyFormat(name)); return load(inputStream, PropertyFormat.toPropertyFormat(name));
} }
} }
@ -100,7 +100,7 @@ public abstract class AbstractPropertiesFactory<T extends Properties> {
* the file. * the file.
*/ */
public T load(final File file) throws FileNotFoundException, IOException { public T load(final File file) throws FileNotFoundException, IOException {
try (final FileInputStream inputStream = new FileInputStream(file)) { try (FileInputStream inputStream = new FileInputStream(file)) {
return load(inputStream, PropertyFormat.toPropertyFormat(file.getName())); return load(inputStream, PropertyFormat.toPropertyFormat(file.getName()));
} }
} }
@ -154,7 +154,7 @@ public abstract class AbstractPropertiesFactory<T extends Properties> {
* @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence.
*/ */
public T load(final Path path) throws IOException { public T load(final Path path) throws IOException {
try (final InputStream inputStream = Files.newInputStream(path)) { try (InputStream inputStream = Files.newInputStream(path)) {
return load(inputStream, PropertyFormat.toPropertyFormat(Objects.toString(path.getFileName(), null))); return load(inputStream, PropertyFormat.toPropertyFormat(Objects.toString(path.getFileName(), null)));
} }
} }
@ -182,7 +182,7 @@ public abstract class AbstractPropertiesFactory<T extends Properties> {
* @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence.
*/ */
public T load(final String name) throws IOException { public T load(final String name) throws IOException {
try (final FileInputStream inputStream = new FileInputStream(name)) { try (FileInputStream inputStream = new FileInputStream(name)) {
return load(inputStream, PropertyFormat.toPropertyFormat(name)); return load(inputStream, PropertyFormat.toPropertyFormat(name));
} }
} }
@ -208,7 +208,7 @@ public abstract class AbstractPropertiesFactory<T extends Properties> {
* @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence.
*/ */
public T load(final URL url) throws IOException { public T load(final URL url) throws IOException {
try (final InputStream inputStream = url.openStream()) { try (InputStream inputStream = url.openStream()) {
return load(inputStream, PropertyFormat.toPropertyFormat(url.getFile())); return load(inputStream, PropertyFormat.toPropertyFormat(url.getFile()));
} }
} }

View File

@ -314,7 +314,7 @@ public class SequencesComparator<T> {
* @param end end index of the snake * @param end end index of the snake
* @param diag diagonal number * @param diag diagonal number
*/ */
public Snake(final int start, final int end, final int diag) { Snake(final int start, final int end, final int diag) {
this.start = start; this.start = start;
this.end = end; this.end = end;
this.diag = diag; this.diag = diag;

View File

@ -150,11 +150,11 @@ public abstract class AbstractBitwiseTrie<K, V> extends AbstractMap<K, V>
protected V value; protected V value;
public BasicEntry(final K key) { BasicEntry(final K key) {
this.key = key; this.key = key;
} }
public BasicEntry(final K key, final V value) { BasicEntry(final K key, final V value) {
this.key = key; this.key = key;
this.value = value; this.value = value;
} }

View File

@ -1965,7 +1965,7 @@ abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K, V> {
/** /**
* Creates a {@link RangeEntrySet}. * Creates a {@link RangeEntrySet}.
*/ */
public RangeEntrySet(final RangeMap delegate) { RangeEntrySet(final RangeMap delegate) {
this.delegate = Objects.requireNonNull(delegate, "delegate"); this.delegate = Objects.requireNonNull(delegate, "delegate");
} }
@ -2275,7 +2275,7 @@ abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K, V> {
/** /**
* Creates a {@link PrefixRangeEntrySet}. * Creates a {@link PrefixRangeEntrySet}.
*/ */
public PrefixRangeEntrySet(final PrefixRangeMap delegate) { PrefixRangeEntrySet(final PrefixRangeMap delegate) {
super(delegate); super(delegate);
this.delegate = delegate; this.delegate = delegate;
} }
@ -2311,7 +2311,7 @@ abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K, V> {
private int hit = 0; private int hit = 0;
public SingletonIterator(final TrieEntry<K, V> entry) { SingletonIterator(final TrieEntry<K, V> entry) {
this.entry = entry; this.entry = entry;
} }

View File

@ -287,7 +287,7 @@ class BulkTestSuiteMaker {
* *
* @param startingClass the starting class * @param startingClass the starting class
*/ */
public BulkTestSuiteMaker(final Class<? extends BulkTest> startingClass) { BulkTestSuiteMaker(final Class<? extends BulkTest> startingClass) {
this.startingClass = startingClass; this.startingClass = startingClass;
} }

View File

@ -53,7 +53,6 @@ import org.junit.Test;
/** /**
* Tests for MapUtils. * Tests for MapUtils.
*
*/ */
@SuppressWarnings("boxing") @SuppressWarnings("boxing")
public class MapUtilsTest extends AbstractAvailableLocalesTest { public class MapUtilsTest extends AbstractAvailableLocalesTest {
@ -821,11 +820,11 @@ public class MapUtilsTest extends AbstractAvailableLocalesTest {
/** /**
* Test class for populateMap(MultiMap). * Test class for populateMap(MultiMap).
*/ */
public static class X implements Comparable<X> { static class X implements Comparable<X> {
int key; int key;
String name; String name;
public X(final int key, final String name) { X(final int key, final String name) {
this.key = key; this.key = key;
this.name = name; this.name = name;
} }
@ -834,7 +833,6 @@ public class MapUtilsTest extends AbstractAvailableLocalesTest {
public int compareTo(final X o) { public int compareTo(final X o) {
return key - o.key | name.compareTo(o.name); return key - o.key | name.compareTo(o.name);
} }
} }
@Test @Test
@ -1226,6 +1224,4 @@ public class MapUtilsTest extends AbstractAvailableLocalesTest {
} }
return '.'; return '.';
} }
} }

View File

@ -187,8 +187,7 @@ public class SetUtilsTest {
} }
@Test @Test
public void testHashSet() public void testHashSet() {
{
final Set<?> set1 = SetUtils.unmodifiableSet(); final Set<?> set1 = SetUtils.unmodifiableSet();
assertTrue("set is empty", set1.isEmpty()); assertTrue("set is empty", set1.isEmpty());
@ -249,8 +248,7 @@ public class SetUtilsTest {
} }
@Test @Test
public void testUnmodifiableSet() public void testUnmodifiableSet() {
{
final Set<?> set1 = SetUtils.unmodifiableSet(); final Set<?> set1 = SetUtils.unmodifiableSet();
assertTrue("set is empty", set1.isEmpty()); assertTrue("set is empty", set1.isEmpty());
@ -275,8 +273,7 @@ public class SetUtilsTest {
} }
@Test @Test
public void testUnmodifiableSetWrap() public void testUnmodifiableSetWrap() {
{
final Set<Integer> set1 = SetUtils.unmodifiableSet(1, 2, 2, 3); final Set<Integer> set1 = SetUtils.unmodifiableSet(1, 2, 2, 3);
final Set<Integer> set2 = SetUtils.unmodifiableSet(set1); final Set<Integer> set2 = SetUtils.unmodifiableSet(set1);
assertSame(set1, set2); assertSame(set1, set2);

View File

@ -69,11 +69,11 @@ public class AbstractOrderedBidiMapDecoratorTest<K, V>
private TestOrderedBidiMap<V, K> inverse = null; private TestOrderedBidiMap<V, K> inverse = null;
public TestOrderedBidiMap() { TestOrderedBidiMap() {
super(new DualTreeBidiMap<K, V>()); super(new DualTreeBidiMap<K, V>());
} }
public TestOrderedBidiMap(final OrderedBidiMap<K, V> map) { TestOrderedBidiMap(final OrderedBidiMap<K, V> map) {
super(map); super(map);
} }

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -25,7 +24,6 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.IntStream;
import org.apache.commons.collections4.bloomfilter.hasher.Hasher; import org.apache.commons.collections4.bloomfilter.hasher.Hasher;
import org.apache.commons.collections4.bloomfilter.hasher.Shape; import org.apache.commons.collections4.bloomfilter.hasher.Shape;

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -46,7 +45,7 @@ public class DefaultBloomFilterMethodsTest extends AbstractBloomFilterTest {
* @param hasher the Hasher to use. * @param hasher the Hasher to use.
* @param shape the desired shape of the filter. * @param shape the desired shape of the filter.
*/ */
public BF(final Hasher hasher, final Shape shape) { BF(final Hasher hasher, final Shape shape) {
this(shape); this(shape);
verifyHasher(hasher); verifyHasher(hasher);
hasher.getBits(shape).forEachRemaining((IntConsumer) bitSet::set); hasher.getBits(shape).forEachRemaining((IntConsumer) bitSet::set);
@ -57,7 +56,7 @@ public class DefaultBloomFilterMethodsTest extends AbstractBloomFilterTest {
* *
* @param shape the desired shape of the filter. * @param shape the desired shape of the filter.
*/ */
public BF(final Shape shape) { BF(final Shape shape) {
super(shape); super(shape);
this.bitSet = new BitSet(); this.bitSet = new BitSet();
} }

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -52,7 +51,7 @@ public class HashFunctionIdentityImplTest {
@Override @Override
public long getSignature() { public long getSignature() {
return -1l; return -1L;
} }
@Override @Override
@ -66,7 +65,7 @@ public class HashFunctionIdentityImplTest {
assertEquals("Provider", impl.getProvider()); assertEquals("Provider", impl.getProvider());
assertEquals(Signedness.SIGNED, impl.getSignedness()); assertEquals(Signedness.SIGNED, impl.getSignedness());
assertEquals(ProcessType.CYCLIC, impl.getProcessType()); assertEquals(ProcessType.CYCLIC, impl.getProcessType());
assertEquals(-1l, impl.getSignature()); assertEquals(-1L, impl.getSignature());
} }
/** /**
@ -75,11 +74,11 @@ public class HashFunctionIdentityImplTest {
@Test @Test
public void valuesConstructorTest() { public void valuesConstructorTest() {
final HashFunctionIdentityImpl impl = new HashFunctionIdentityImpl("Provider", "NAME", Signedness.UNSIGNED, final HashFunctionIdentityImpl impl = new HashFunctionIdentityImpl("Provider", "NAME", Signedness.UNSIGNED,
ProcessType.ITERATIVE, -2l); ProcessType.ITERATIVE, -2L);
assertEquals("NAME", impl.getName()); assertEquals("NAME", impl.getName());
assertEquals("Provider", impl.getProvider()); assertEquals("Provider", impl.getProvider());
assertEquals(Signedness.UNSIGNED, impl.getSignedness()); assertEquals(Signedness.UNSIGNED, impl.getSignedness());
assertEquals(ProcessType.ITERATIVE, impl.getProcessType()); assertEquals(ProcessType.ITERATIVE, impl.getProcessType());
assertEquals(-2l, impl.getSignature()); assertEquals(-2L, impl.getSignature());
} }
} }

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -23,8 +22,6 @@ import static org.junit.Assert.fail;
import java.util.Objects; import java.util.Objects;
import org.apache.commons.collections4.bloomfilter.hasher.HashFunctionIdentity;
import org.apache.commons.collections4.bloomfilter.hasher.Shape;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -132,7 +131,9 @@ public class StaticHasherTest {
} }
@Override @Override
public boolean isEmpty() { return false; } public boolean isEmpty() {
return false;
}
}; };
final StaticHasher hasher = new StaticHasher(testHasher, shape); final StaticHasher hasher = new StaticHasher(testHasher, shape);
@ -164,7 +165,9 @@ public class StaticHasherTest {
} }
@Override @Override
public boolean isEmpty() { return false; } public boolean isEmpty() {
return false;
}
}; };
try { try {

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -22,7 +21,6 @@ import static org.junit.Assert.assertEquals;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Locale; import java.util.Locale;
import org.apache.commons.collections4.bloomfilter.hasher.function.MD5Cyclic;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -22,7 +21,6 @@ import static org.junit.Assert.assertEquals;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Locale; import java.util.Locale;
import org.apache.commons.collections4.bloomfilter.hasher.function.Murmur128x86Cyclic;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -22,7 +21,6 @@ import static org.junit.Assert.assertEquals;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Locale; import java.util.Locale;
import org.apache.commons.collections4.bloomfilter.hasher.function.Murmur32x86Iterative;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -22,7 +21,6 @@ import static org.junit.Assert.assertEquals;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
import org.apache.commons.collections4.bloomfilter.hasher.function.ObjectsHashIterative;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -48,7 +48,7 @@ public abstract class AbstractCompositePredicateTest<T> extends AbstractMockPred
* *
* @return a predicate to test. * @return a predicate to test.
*/ */
protected abstract Predicate<T> getPredicateInstance(final Predicate<? super T> ... predicates); protected abstract Predicate<T> getPredicateInstance(Predicate<? super T>... predicates);
/** /**
* Creates an instance of the predicate to test. * Creates an instance of the predicate to test.
@ -57,7 +57,7 @@ public abstract class AbstractCompositePredicateTest<T> extends AbstractMockPred
* *
* @return a predicate to test. * @return a predicate to test.
*/ */
protected abstract Predicate<T> getPredicateInstance(final Collection<Predicate<T>> predicates); protected abstract Predicate<T> getPredicateInstance(Collection<Predicate<T>> predicates);
/** /**
* Creates an instance of the predicate to test. * Creates an instance of the predicate to test.

View File

@ -56,8 +56,7 @@ public abstract class AbstractMockPredicateTest<T> {
* Creates the list of predicates to verify. * Creates the list of predicates to verify.
*/ */
@Before @Before
public final void createVerifyList() public final void createVerifyList() {
{
mockPredicatesToVerify = new ArrayList<>(); mockPredicatesToVerify = new ArrayList<>();
} }
@ -65,8 +64,7 @@ public abstract class AbstractMockPredicateTest<T> {
* Verifies all the mock predicates created for the test. * Verifies all the mock predicates created for the test.
*/ */
@After @After
public final void verifyPredicates() public final void verifyPredicates() {
{
for (final Predicate<? super T> predicate : mockPredicatesToVerify) { for (final Predicate<? super T> predicate : mockPredicatesToVerify) {
verify(predicate); verify(predicate);
} }

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -63,11 +63,21 @@ public class FilterListIteratorTest {
sixes = new ArrayList<>(); sixes = new ArrayList<>();
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
list.add(Integer.valueOf(i)); list.add(Integer.valueOf(i));
if (i % 2 == 0) { evens.add(Integer.valueOf(i)); } if (i % 2 == 0) {
if (i % 2 != 0) { odds.add(Integer.valueOf(i)); } evens.add(Integer.valueOf(i));
if (i % 3 == 0) { threes.add(Integer.valueOf(i)); } }
if (i % 4 == 0) { fours.add(Integer.valueOf(i)); } if (i % 2 != 0) {
if (i % 6 == 0) { sixes.add(Integer.valueOf(i)); } odds.add(Integer.valueOf(i));
}
if (i % 3 == 0) {
threes.add(Integer.valueOf(i));
}
if (i % 4 == 0) {
fours.add(Integer.valueOf(i));
}
if (i % 6 == 0) {
sixes.add(Integer.valueOf(i));
}
} }
truePred = x -> true; truePred = x -> true;

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -1,9 +1,10 @@
/* /*
* Copyright 2013 The Apache Software Foundation. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,11 +1,10 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one or more
* or more contributor license agreements. See the NOTICE file * contributor license agreements. See the NOTICE file distributed with
* distributed with this work for additional information * this work for additional information regarding copyright ownership.
* regarding copyright ownership. The ASF licenses this file * The ASF licenses this file to You under the Apache License, Version 2.0
* to you under the Apache License, Version 2.0 (the * (the "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance * the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *

View File

@ -1,15 +1,18 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this * contributor license agreements. See the NOTICE file distributed with
* work for additional information regarding copyright ownership. The ASF * this work for additional information regarding copyright ownership.
* licenses this file to You under the Apache License, Version 2.0 (the * The ASF licenses this file to You under the Apache License, Version 2.0
* "License"); you may not use this file except in compliance with the License. * (the "License"); you may not use this file except in compliance with
* You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law *
* or agreed to in writing, software distributed under the License is * http://www.apache.org/licenses/LICENSE-2.0
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the specific language * Unless required by applicable law or agreed to in writing, software
* governing permissions and limitations under the License. * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.apache.commons.collections4.iterators; package org.apache.commons.collections4.iterators;

View File

@ -40,7 +40,7 @@ public class MultiKeyTest {
private static final long serialVersionUID = 1928896152249821416L; private static final long serialVersionUID = 1928896152249821416L;
public DerivedMultiKey(final T key1, final T key2) { DerivedMultiKey(final T key1, final T key2) {
super(key1, key2); super(key1, key2);
} }
@ -60,21 +60,18 @@ public class MultiKeyTest {
private final String name; private final String name;
private int hashCode = 1; private int hashCode = 1;
public SystemHashCodeSimulatingKey(final String name) SystemHashCodeSimulatingKey(final String name) {
{
this.name = name; this.name = name;
} }
@Override @Override
public boolean equals(final Object obj) public boolean equals(final Object obj) {
{
return obj instanceof SystemHashCodeSimulatingKey return obj instanceof SystemHashCodeSimulatingKey
&& name.equals(((SystemHashCodeSimulatingKey) obj).name); && name.equals(((SystemHashCodeSimulatingKey) obj).name);
} }
@Override @Override
public int hashCode() public int hashCode() {
{
return hashCode; return hashCode;
} }
@ -168,8 +165,7 @@ public class MultiKeyTest {
} }
@Test @Test
public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException {
{
SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test"); SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test");
final MultiKey<?> mk = new MultiKey<Object>(ONE, sysKey); final MultiKey<?> mk = new MultiKey<Object>(ONE, sysKey);
final Map<MultiKey<?>, Integer> map = new HashMap<>(); final Map<MultiKey<?>, Integer> map = new HashMap<>();
@ -196,8 +192,7 @@ public class MultiKeyTest {
} }
@Test @Test
public void testEqualsAfterSerializationOfDerivedClass() throws IOException, ClassNotFoundException public void testEqualsAfterSerializationOfDerivedClass() throws IOException, ClassNotFoundException {
{
final DerivedMultiKey<?> mk = new DerivedMultiKey<>("A", "B"); final DerivedMultiKey<?> mk = new DerivedMultiKey<>("A", "B");
// serialize // serialize

View File

@ -38,7 +38,7 @@ public class SetUniqueListTest<E> extends AbstractListTest<E> {
*/ */
private static final long serialVersionUID = 1415013031022962158L; private static final long serialVersionUID = 1415013031022962158L;
public SetUniqueList307(final List<E> list, final Set<E> set) { SetUniqueList307(final List<E> list, final Set<E> set) {
super(list, set); super(list, set);
} }
} }

View File

@ -109,7 +109,7 @@ public abstract class AbstractSortedMapTest<K, V> extends AbstractMapTest<K, V>
return new TestSubMap<>(this); return new TestSubMap<>(this);
} }
public static abstract class TestViewMap <K, V> extends AbstractSortedMapTest<K, V> { public abstract static class TestViewMap<K, V> extends AbstractSortedMapTest<K, V> {
protected final AbstractMapTest<K, V> main; protected final AbstractMapTest<K, V> main;
protected final List<K> subSortedKeys = new ArrayList<>(); protected final List<K> subSortedKeys = new ArrayList<>();
protected final List<V> subSortedValues = new ArrayList<>(); protected final List<V> subSortedValues = new ArrayList<>();

View File

@ -335,7 +335,7 @@ public class ReferenceMapTest<K, V> extends AbstractIterableMapTest<K, V> {
final AbstractReferenceMap<K, V> parent; final AbstractReferenceMap<K, V> parent;
final Consumer<V> consumer; final Consumer<V> consumer;
public AccessibleEntry(final AbstractReferenceMap<K, V> parent, final HashEntry<K, V> next, final int hashCode, final K key, final V value, final Consumer<V> consumer) { AccessibleEntry(final AbstractReferenceMap<K, V> parent, final HashEntry<K, V> next, final int hashCode, final K key, final V value, final Consumer<V> consumer) {
super(parent, next, hashCode, key, value); super(parent, next, hashCode, key, value);
this.parent = parent; this.parent = parent;
this.consumer = consumer; this.consumer = consumer;

View File

@ -98,7 +98,7 @@ public abstract class AbstractPropertiesFactoryTest<T extends Properties> {
// Can't tell what we are reading // Can't tell what we are reading
Assume.assumeFalse(isXmlTest()); Assume.assumeFalse(isXmlTest());
// //
try (final FileInputStream inputStream = new FileInputStream(pathString)) { try (FileInputStream inputStream = new FileInputStream(pathString)) {
assertContents(factory.load(inputStream)); assertContents(factory.load(inputStream));
} }
} }
@ -113,7 +113,7 @@ public abstract class AbstractPropertiesFactoryTest<T extends Properties> {
// Can't tell what we are reading // Can't tell what we are reading
Assume.assumeFalse(isXmlTest()); Assume.assumeFalse(isXmlTest());
// //
try (final BufferedReader inputStream = Files.newBufferedReader(Paths.get(pathString))) { try (BufferedReader inputStream = Files.newBufferedReader(Paths.get(pathString))) {
assertContents(factory.load(inputStream)); assertContents(factory.load(inputStream));
} }
} }

View File

@ -185,7 +185,7 @@ public class EmptyPropertiesTest {
@Test(expected = UnsupportedOperationException.class) @Test(expected = UnsupportedOperationException.class)
public void testLoadReader() throws IOException { public void testLoadReader() throws IOException {
try (final NullReader reader = new NullReader(0)) { try (NullReader reader = new NullReader(0)) {
PropertiesFactory.EMPTY_PROPERTIES.load(reader); PropertiesFactory.EMPTY_PROPERTIES.load(reader);
} }
} }

View File

@ -32,7 +32,7 @@ class EmptySetMutator<E> implements CompositeSet.SetMutator<E> {
private final Set<E> contained; private final Set<E> contained;
public EmptySetMutator(final Set<E> set) { EmptySetMutator(final Set<E> set) {
this.contained = set; this.contained = set;
} }