Skip to content

Commit

Permalink
Turn on additional IntelliJ inspections and fix violations (Method is…
Browse files Browse the repository at this point in the history
… identical to its super method). #1323

Signed-off-by: Alexander Goldberg <alexander.goldberg@bnymellon.com>
  • Loading branch information
goldbal330 committed Dec 5, 2022
1 parent 73d6e96 commit e6c2a9c
Show file tree
Hide file tree
Showing 29 changed files with 1,385 additions and 244 deletions.
1,408 changes: 1,385 additions & 23 deletions .idea/inspectionProfiles/2_Inconsistent_Constructs.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,6 @@ public MutableMap<T, Integer> toMapOfItemToCount()
return UnifiedMap.newWithKeysValues(this.value, 1);
}

@Override
public ImmutableBag<T> toImmutable()
{
return this;
}

@Override
public void each(Procedure<? super T> procedure)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.Comparator;
import java.util.Iterator;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.ImmutableBag;
import org.eclipse.collections.api.bag.MutableBag;
Expand All @@ -39,7 +38,6 @@
import org.eclipse.collections.api.factory.Bags;
import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.factory.SortedBags;
import org.eclipse.collections.api.factory.Stacks;
import org.eclipse.collections.api.factory.primitive.BooleanLists;
import org.eclipse.collections.api.factory.primitive.ByteLists;
import org.eclipse.collections.api.factory.primitive.CharLists;
Expand All @@ -63,7 +61,6 @@
import org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag;
import org.eclipse.collections.api.partition.bag.sorted.PartitionMutableSortedBag;
import org.eclipse.collections.api.set.sorted.ImmutableSortedSet;
import org.eclipse.collections.api.stack.MutableStack;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.primitive.ObjectIntPair;
import org.eclipse.collections.impl.bag.immutable.AbstractImmutableBagIterable;
Expand Down Expand Up @@ -418,12 +415,6 @@ private MutableList<ObjectIntPair<T>> occurrencesSortingBy(int n, IntFunction<Ob
return results;
}

@Override
public MutableStack<T> toStack()
{
return Stacks.mutable.withAll(this);
}

@Override
public RichIterable<RichIterable<T>> chunk(int size)
{
Expand Down Expand Up @@ -460,10 +451,4 @@ public int detectLastIndex(Predicate<? super T> predicate)
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".detectLastIndex() not implemented yet");
}

@Override
public LazyIterable<T> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.Optional;
import java.util.concurrent.ExecutorService;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.ParallelBag;
import org.eclipse.collections.api.bag.sorted.ImmutableSortedBag;
Expand Down Expand Up @@ -699,12 +698,6 @@ public void reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)
}
}

@Override
public LazyIterable<T> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super T> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.collections.api.map.ConcurrentMutableMap;
import org.eclipse.collections.api.map.MapIterable;
import org.eclipse.collections.api.multimap.set.UnsortedSetMultimap;
import org.eclipse.collections.api.set.ParallelUnsortedSetIterable;
import org.eclipse.collections.impl.lazy.parallel.list.DistinctBatch;
import org.eclipse.collections.impl.lazy.parallel.set.AbstractParallelUnsortedSetIterable;
import org.eclipse.collections.impl.lazy.parallel.set.UnsortedSetBatch;
Expand Down Expand Up @@ -57,12 +56,6 @@ public LazyIterable<UnsortedSetBatch<T>> split()
return this.delegate.split().collect(batch -> new DistinctBatch<>(batch, distinct));
}

@Override
public ParallelUnsortedSetIterable<T> asUnique()
{
return this;
}

@Override
public void forEach(Procedure<? super T> procedure)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.collections.api.map.ConcurrentMutableMap;
import org.eclipse.collections.api.map.MapIterable;
import org.eclipse.collections.api.multimap.set.UnsortedSetMultimap;
import org.eclipse.collections.api.set.ParallelUnsortedSetIterable;
import org.eclipse.collections.impl.lazy.parallel.set.AbstractParallelUnsortedSetIterable;
import org.eclipse.collections.impl.lazy.parallel.set.UnsortedSetBatch;
import org.eclipse.collections.impl.map.mutable.ConcurrentHashMap;
Expand Down Expand Up @@ -56,12 +55,6 @@ public LazyIterable<UnsortedSetBatch<T>> split()
return this.delegate.split().collect(listBatch -> listBatch.distinct(distinct));
}

@Override
public ParallelUnsortedSetIterable<T> asUnique()
{
return this;
}

@Override
public void forEach(Procedure<? super T> procedure)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.eclipse.collections.impl.list.mutable.FastList;
import org.eclipse.collections.impl.list.mutable.ListAdapter;
import org.eclipse.collections.impl.utility.ArrayIterate;
import org.eclipse.collections.impl.utility.Iterate;
import org.eclipse.collections.impl.utility.ListIterate;
import org.eclipse.collections.impl.utility.internal.InternalArrayIterate;
import org.eclipse.collections.impl.utility.internal.RandomAccessListIterate;
Expand Down Expand Up @@ -296,12 +295,6 @@ public boolean remove(Object o)
throw new UnsupportedOperationException("Cannot call remove() on " + this.getClass().getSimpleName());
}

@Override
public boolean containsAll(Collection<?> collection)
{
return Iterate.allSatisfyWith(collection, Predicates2.in(), this);
}

@Override
public boolean addAll(Collection<? extends T> collection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,12 +947,6 @@ protected Object writeReplace()
return Lists.immutable.withAll(this);
}

@Override
public Iterator<T> iterator()
{
return this.listIterator(0);
}

@Override
public ImmutableSubList<T> subList(int fromIndex, int toIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,6 @@ public void add(T o)
};
}

@Override
public MutableList<T> subList(int fromIndex, int toIndex)
{
return new SubList<>(this, fromIndex, toIndex);
}

private void checkIfOutOfBounds(int index)
{
if (index >= this.size || index < 0)
Expand Down Expand Up @@ -814,18 +808,6 @@ public MutableStack<T> toStack()
{
return ArrayStack.newStack(this);
}

@Override
public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
{
ListIterate.forEachWithIndex(this, objectIntProcedure);
}

@Override
public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)
{
ListIterate.forEachWith(this, procedure, parameter);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.eclipse.collections.api.partition.list.PartitionMutableList;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.impl.block.procedure.CollectionAddProcedure;
import org.eclipse.collections.impl.lazy.ReverseIterable;
import org.eclipse.collections.impl.multimap.list.FastListMultimap;
import org.eclipse.collections.impl.utility.ArrayIterate;
import org.eclipse.collections.impl.utility.ArrayListIterate;
Expand Down Expand Up @@ -429,10 +428,4 @@ public PartitionMutableList<T> partitionWhile(Predicate<? super T> predicate)
{
return ArrayListIterate.partitionWhile(this.delegate, predicate);
}

@Override
public ReverseIterable<T> asReversed()
{
return ReverseIterable.adapt(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
import org.eclipse.collections.api.partition.list.PartitionMutableList;
import org.eclipse.collections.api.tuple.Twin;
import org.eclipse.collections.impl.block.factory.Comparators;
import org.eclipse.collections.impl.block.factory.Predicates2;
import org.eclipse.collections.impl.block.factory.Procedures2;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.eclipse.collections.impl.multimap.list.FastListMultimap;
Expand Down Expand Up @@ -342,18 +341,6 @@ private void addAllCollection(Collection<? extends T> source)
Iterate.forEachWith(source, Procedures2.addToCollection(), this);
}

@Override
public boolean containsAll(Collection<?> source)
{
return Iterate.allSatisfyWith(source, Predicates2.in(), this);
}

@Override
public boolean containsAllArguments(Object... source)
{
return ArrayIterate.allSatisfyWith(source, Predicates2.in(), this);
}

@Override
public <E> E[] toArray(E[] array)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure;
import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.factory.Sets;
import org.eclipse.collections.api.map.ImmutableMap;
import org.eclipse.collections.api.map.MapIterable;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.UnsortedMapIterable;
Expand Down Expand Up @@ -3318,10 +3316,4 @@ private boolean nonNullTableObjectEquals(Object cur, K key)
{
return cur == key || (cur == NULL_KEY ? key == null : cur.equals(key));
}

@Override
public ImmutableMap<K, V> toImmutable()
{
return Maps.immutable.withAll(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Map;
import java.util.Optional;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.MutableBag;
import org.eclipse.collections.api.block.function.Function;
Expand Down Expand Up @@ -570,12 +569,6 @@ public <VV> MutableOrderedMap<VV, V> groupByUniqueKey(Function<? super V, ? exte
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".groupByUniqueKey() not implemented yet");
}

@Override
public LazyIterable<V> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super V> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Optional;
import java.util.SortedMap;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.bag.ImmutableBag;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function0;
Expand Down Expand Up @@ -505,12 +504,6 @@ public <V1> ImmutableObjectDoubleMap<V1> sumByDouble(Function<? super V, ? exten
return this.injectInto(result, PrimitiveFunctions.sumByDoubleFunction(groupBy, function)).toImmutable();
}

@Override
public LazyIterable<V> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public ImmutableSortedMap<K, V> toReversed()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

package org.eclipse.collections.impl.map.sorted.mutable;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
Expand Down Expand Up @@ -325,12 +324,6 @@ public <VV> MutableMap<VV, V> groupByUniqueKey(Function<? super V, ? extends VV>
return this.groupByUniqueKey(function, UnifiedMap.newMap(this.size()));
}

@Override
public LazyIterable<V> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super V> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.Optional;
import java.util.SortedMap;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
Expand Down Expand Up @@ -601,12 +600,6 @@ public void reverseForEachWithIndex(ObjectIntProcedure<? super V> procedure)
}
}

@Override
public LazyIterable<V> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super V> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1320,12 +1320,6 @@ public MutableList<V> distinct()
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".distinct() not implemented yet");
}

@Override
public LazyIterable<V> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super V> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,6 @@ public ParallelSortedSetIterable<T> asParallel(ExecutorService executorService,
return new NonParallelSortedSetIterable<>(this);
}

@Override
public LazyIterable<T> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public ImmutableSortedSet<T> toReversed()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,6 @@ public void reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".reverseForEachWithIndex() not implemented yet");
}

@Override
public LazyIterable<T> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public int detectLastIndex(Predicate<? super T> predicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,6 @@ public void reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)
}
}

@Override
public LazyIterable<T> asReversed()
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
}

@Override
public MutableSortedSet<T> toReversed()
{
Expand Down
Loading

0 comments on commit e6c2a9c

Please sign in to comment.