Skip to content

Commit

Permalink
[GSCOLLECT-1497] Update Inspections settings for IntelliJ 14.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://gscollections.svn.services.gs.com/svnroot/gscollections-svn/trunk@728 d5c9223b-1aff-41ac-aadd-f810b4a99ac4
  • Loading branch information
motlin committed Nov 23, 2014
1 parent 53aa75d commit d7417a5
Show file tree
Hide file tree
Showing 84 changed files with 210 additions and 460 deletions.
5 changes: 2 additions & 3 deletions collections-api/gs-collections-api.iml
Expand Up @@ -4,13 +4,12 @@
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/java" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
</component>
</module>

</module>
5 changes: 2 additions & 3 deletions collections/gs-collections.iml
Expand Up @@ -4,14 +4,13 @@
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/java" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="gs-collections-api" />
<orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
</component>
</module>

</module>
Expand Up @@ -19,11 +19,9 @@ package com.gs.collections.api.list.primitive;

import java.util.List;

import com.gs.collections.api.<name>Iterable;
import com.gs.collections.api.block.function.primitive.<name>ToObjectFunction;
import com.gs.collections.api.block.predicate.primitive.<name>Predicate;
import com.gs.collections.api.list.ListIterable;
import com.gs.collections.api.Lazy<name>Iterable;
import com.gs.collections.api.ordered.primitive.Reversible<name>Iterable;

/**
Expand Down
Expand Up @@ -19,14 +19,11 @@ package com.gs.collections.api.map.primitive;

import java.util.Map;

import com.gs.collections.api.<name2>Iterable;
import com.gs.collections.api.Lazy<name1>Iterable;
import com.gs.collections.api.RichIterable;
import com.gs.collections.api.block.predicate.primitive.<name1><name2>Predicate;
import com.gs.collections.api.block.procedure.primitive.<name1><name2>Procedure;
import com.gs.collections.api.block.procedure.primitive.<name1>Procedure;
<if(!sameTwoPrimitives)>import com.gs.collections.api.block.procedure.primitive.<name2>Procedure;<endif>
import com.gs.collections.api.collection.primitive.Mutable<name2>Collection;
import com.gs.collections.api.set.primitive.Mutable<name1>Set;
import com.gs.collections.api.tuple.primitive.<name1><name2>Pair;

Expand Down
Expand Up @@ -20,25 +20,14 @@ import java.util.Arrays;

import com.gs.collections.api.<name>Iterable;
import com.gs.collections.api.Lazy<name>Iterable;
import com.gs.collections.api.RichIterable;
import com.gs.collections.api.LazyIterable;
import com.gs.collections.api.bag.primitive.Mutable<name>Bag;
import com.gs.collections.api.block.function.primitive.<name>ToObjectFunction;
import com.gs.collections.api.block.function.primitive.Object<name>ToObjectFunction;
import com.gs.collections.api.block.predicate.primitive.<name>Predicate;
import com.gs.collections.api.block.procedure.primitive.<name>Procedure;
import com.gs.collections.api.iterator.<name>Iterator;
import com.gs.collections.api.list.primitive.Mutable<name>List;
import com.gs.collections.api.set.primitive.Mutable<name>Set;
import com.gs.collections.impl.bag.mutable.primitive.<name>HashBag;
import com.gs.collections.impl.block.factory.primitive.<name>Predicates;
import com.gs.collections.impl.factory.primitive.<name>Sets;
import com.gs.collections.impl.lazy.primitive.Select<name>Iterable;
import com.gs.collections.impl.lazy.primitive.Lazy<name>IterableAdapter;
import com.gs.collections.impl.list.mutable.primitive.<name>ArrayList;
import com.gs.collections.impl.set.mutable.primitive.<name>HashSet;
import com.gs.collections.impl.utility.internal.primitive.<name>IterableIterate;
import com.gs.collections.impl.utility.primitive.Lazy<name>Iterate;

/**
* This file was automatically generated from template file abstractPrimitiveIterable.stg.
Expand Down
Expand Up @@ -193,7 +193,7 @@ final class Immutable<name>HashBag implements Immutable<name>Bag, Serializable

public \<T> T injectInto(T injectedValue, Object<name>ToObjectFunction\<? super T, ? extends T> function)
{
return ((<name>HashBag) this.delegate).injectInto(injectedValue, function);
return this.delegate.injectInto(injectedValue, function);
}

@Override
Expand Down
Expand Up @@ -14,8 +14,6 @@ body(type, name) ::= <<

package com.gs.collections.impl.iterator;

import java.util.NoSuchElementException;

import com.gs.collections.api.iterator.<name>Iterator;
import com.gs.collections.api.iterator.Mutable<name>Iterator;

Expand All @@ -25,7 +23,7 @@ import com.gs.collections.api.iterator.Mutable<name>Iterator;
*/
public class Unmodifiable<name>Iterator implements Mutable<name>Iterator
{
private <name>Iterator <type>Iterator;
private final <name>Iterator <type>Iterator;

public Unmodifiable<name>Iterator(<name>Iterator <type>Iterator)
{
Expand Down
Expand Up @@ -44,7 +44,7 @@ public class Collect<name>ToObjectIterable\<V>
this.function = function;
}

public void forEach(final Procedure\<? super V> procedure)
public void forEach(Procedure\<? super V> procedure)
{
this.each(procedure);
}
Expand Down
Expand Up @@ -21,26 +21,22 @@ import java.util.Arrays;
import java.util.NoSuchElementException;

import com.gs.collections.api.<name>Iterable;
import com.gs.collections.api.Lazy<name>Iterable;
import com.gs.collections.api.LazyIterable;
import com.gs.collections.api.block.function.primitive.<name>ToObjectFunction;
import com.gs.collections.api.block.function.primitive.Object<name>ToObjectFunction;
import com.gs.collections.api.bag.primitive.Mutable<name>Bag;
import com.gs.collections.api.block.predicate.primitive.<name>Predicate;
import com.gs.collections.api.block.procedure.primitive.<name>Procedure;
import com.gs.collections.api.iterator.<name>Iterator;
import com.gs.collections.api.bag.primitive.Mutable<name>Bag;
import com.gs.collections.api.list.primitive.Mutable<name>List;
import com.gs.collections.api.set.primitive.Mutable<name>Set;
import com.gs.collections.impl.bag.mutable.primitive.<name>HashBag;
import com.gs.collections.impl.set.mutable.primitive.<name>HashSet;
import com.gs.collections.impl.list.mutable.primitive.<name>ArrayList;
import com.gs.collections.impl.block.factory.primitive.<name>Predicates;
import com.gs.collections.impl.list.mutable.primitive.<name>ArrayList;
import com.gs.collections.impl.set.mutable.primitive.<name>HashSet;

/**
* This file was automatically generated from template file selectPrimitiveIterable.stg.
*/
public class Select<name>Iterable
extends AbstractLazy<name>Iterable
extends AbstractLazy<name>Iterable
{
private final <name>Iterable delegate;
private final <name>Predicate predicate;
Expand Down Expand Up @@ -105,7 +101,6 @@ public class Select<name>Iterable
return !this.anySatisfy(predicate);
}

<(arithmeticMethods.(type))(name, type)>
@Override
public <type>[] toArray()
{
Expand Down Expand Up @@ -261,114 +256,3 @@ public class Select<name>Iterable
}

>>

arithmeticMethods ::= [
"byte": "allMethods",
"short": "allMethods",
"char": "allMethods",
"int": "allMethods",
"long": "allMethods",
"float": "allMethods",
"double": "allMethods",
"boolean": "noMethods"
]


allMethods(name, type) ::=<<
public <wideType.(type)> sum()
{
<wideType.(type)> sum = <wideZero.(type)>;
for (<name>Iterator <type>Iterator = this.<type>Iterator(); <type>Iterator.hasNext(); )
{
sum += <type>Iterator.next();
}
return sum;
}

public <type> max()
{
<name>Iterator <type>Iterator = this.<type>Iterator();
<type> max = <type>Iterator.next();
while (<type>Iterator.hasNext())
{
max = (<type>) Math.max(max, <type>Iterator.next());
}
return max;
}

public <type> min()
{
<name>Iterator <type>Iterator = this.<type>Iterator();
<type> min = <type>Iterator.next();
while (<type>Iterator.hasNext())
{
min = (<type>) Math.min(min, <type>Iterator.next());
}
return min;
}

public <type> minIfEmpty(<type> defaultValue)
{
try
{
return this.min();
}
catch (NoSuchElementException ex)
{
}
return defaultValue;
}

public <type> maxIfEmpty(<type> defaultValue)
{
try
{
return this.max();
}
catch (NoSuchElementException ex)
{
}
return defaultValue;
}

public double average()
{
if (this.isEmpty())
{
throw new ArithmeticException();
}
return <castSum.(type)>this.sum() / (double) this.size();
}

public double median()
{
if (this.isEmpty())
{
throw new ArithmeticException();
}
<type>[] sortedArray = this.toSortedArray();
int middleIndex = sortedArray.length >\> 1;
if (sortedArray.length > 1 && (sortedArray.length & 1) == 0)
{
<type> first = sortedArray[middleIndex];
<type> second = sortedArray[middleIndex - 1];
return (<castDouble.(type)>first + <castDouble.(type)>second) / 2.0;
}
return <castDouble.(type)>sortedArray[middleIndex];
}

public <type>[] toSortedArray()
{
<type>[] array = this.toArray();
Arrays.sort(array);
return array;
}

public Mutable<name>List toSortedList()
{
return <name>ArrayList.newList(this).sortThis();
}

>>

noMethods(name, type) ::= ""
Expand Up @@ -25,28 +25,22 @@ import java.util.NoSuchElementException;

import com.gs.collections.api.<name>Iterable;
import com.gs.collections.api.Lazy<name>Iterable;
import com.gs.collections.api.RichIterable;
import com.gs.collections.impl.primitive.Abstract<name>Iterable;
import com.gs.collections.api.bag.primitive.Mutable<name>Bag;
import com.gs.collections.api.block.function.primitive.Object<name>IntToObjectFunction;
import com.gs.collections.api.block.function.primitive.Object<name>ToObjectFunction;
import com.gs.collections.api.block.function.primitive.<name>ToObjectFunction;
import com.gs.collections.api.block.predicate.primitive.<name>Predicate;
import com.gs.collections.api.block.procedure.primitive.<name>IntProcedure;
import com.gs.collections.api.block.procedure.primitive.<name>Procedure;
import com.gs.collections.api.iterator.<name>Iterator;
import com.gs.collections.api.iterator.Mutable<name>Iterator;
import com.gs.collections.api.list.MutableList;
import com.gs.collections.api.list.primitive.<name>List;
import com.gs.collections.api.list.primitive.Immutable<name>List;
import com.gs.collections.api.list.primitive.Mutable<name>List;
import com.gs.collections.api.set.primitive.<name>Set;
import com.gs.collections.api.set.primitive.Mutable<name>Set;
import com.gs.collections.impl.bag.mutable.primitive.<name>HashBag;
import com.gs.collections.impl.factory.primitive.<name>Lists;
import com.gs.collections.impl.lazy.primitive.Lazy<name>IterableAdapter;
import com.gs.collections.impl.lazy.primitive.Reverse<name>Iterable;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.primitive.Abstract<name>Iterable;
import com.gs.collections.impl.set.mutable.primitive.<name>HashSet;
import net.jcip.annotations.NotThreadSafe;

Expand Down
Expand Up @@ -110,7 +110,7 @@ final class ImmutableObject<name>HashMap\<K> extends AbstractImmutableObject<nam

public \<T> T injectInto(T injectedValue, Object<name>ToObjectFunction\<? super T, ? extends T> function)
{
return ((Object<name>HashMap\<T>) this.delegate).injectInto(injectedValue, function);
return this.delegate.injectInto(injectedValue, function);
}

public \<V> ImmutableCollection\<V> collect(<name>ToObjectFunction\<? extends V> function)
Expand Down
Expand Up @@ -535,26 +535,22 @@ final class Immutable<name>ObjectEmptyMap\<V> implements Immutable<name>ObjectMa

public \<V1> ObjectLongMap\<V1> sumByInt(Function\<V, V1> groupBy, IntFunction\<? super V> function)
{
ObjectLongHashMap\<V1> result = ObjectLongHashMap.newMap();
return result;
return ObjectLongHashMap.newMap();
}

public \<V1> ObjectDoubleMap\<V1> sumByFloat(Function\<V, V1> groupBy, FloatFunction\<? super V> function)
{
ObjectDoubleHashMap\<V1> result = ObjectDoubleHashMap.newMap();
return result;
return ObjectDoubleHashMap.newMap();
}

public \<V1> ObjectLongMap\<V1> sumByLong(Function\<V, V1> groupBy, LongFunction\<? super V> function)
{
ObjectLongHashMap\<V1> result = ObjectLongHashMap.newMap();
return result;
return ObjectLongHashMap.newMap();
}

public \<V1> ObjectDoubleMap\<V1> sumByDouble(Function\<V, V1> groupBy, DoubleFunction\<? super V> function)
{
ObjectDoubleHashMap\<V1> result = ObjectDoubleHashMap.newMap();
return result;
return ObjectDoubleHashMap.newMap();
}

public Mutable<name>Set keySet()
Expand Down
Expand Up @@ -134,7 +134,7 @@ final class Immutable<name1><name2>HashMap implements Immutable<name1><name2>Map

public \<T> T injectInto(T injectedValue, Object<name2>ToObjectFunction\<? super T, ? extends T> function)
{
return ((<name1><name2>HashMap) this.delegate).injectInto(injectedValue, function);
return this.delegate.injectInto(injectedValue, function);
}

public Immutable<name1><name2>Map toImmutable()
Expand Down
Expand Up @@ -256,7 +256,7 @@ public class Object<name>HashMap\<K> implements MutableObject<name>Map\<K>, Exte
{
appendable.append(", ");
}
appendable.append(String.valueOf(this.toNonSentinel(key))).append("=").append(String.valueOf(this.values[i]));
appendable.append(this.toNonSentinel(key)).append("=").append(this.values[i]);
first = false;
}
}
Expand Down Expand Up @@ -1816,10 +1816,10 @@ public class Object<name>HashMap\<K> implements MutableObject<name>Map\<K>, Exte

public Iterator\<K> iterator()
{
return new InternalKeysViewIterator\<K>();
return new InternalKeysViewIterator();
}

public class InternalKeysViewIterator\<K> implements Iterator\<K>
public class InternalKeysViewIterator implements Iterator\<K>
{
private int count;
private int position;
Expand Down
Expand Up @@ -752,7 +752,7 @@ public class <name>BooleanHashMap extends AbstractMutableBooleanValuesMap implem

private void addKeyValueAtIndex(<type> key, boolean value, int index)
{
if (this.keys[index] == REMOVED_KEY)
if (<(equals.(type))("this.keys[index]", "REMOVED_KEY")>)
{
this.occupiedWithSentinels--;
}
Expand Down

0 comments on commit d7417a5

Please sign in to comment.