Skip to content

Commit

Permalink
Imrpove code quality using IntelliJ automatic inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Forslund committed Sep 28, 2016
1 parent 3f17be6 commit 3199f2b
Show file tree
Hide file tree
Showing 445 changed files with 1,641 additions and 1,362 deletions.
Expand Up @@ -26,13 +26,13 @@
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static com.speedment.common.codegen.constant.DefaultValue.string;
import java.lang.reflect.Type;
import static java.util.Objects.requireNonNull;

/**
Expand Down Expand Up @@ -67,7 +67,7 @@ SuppressWarnings.class, string("unchecked")
*
* @param type the type
*/
private DefaultAnnotationUsage(Type type) {
DefaultAnnotationUsage(Type type) {
this (type, null);
}

Expand All @@ -76,7 +76,7 @@ private DefaultAnnotationUsage(Type type) {
*
* @param type the type
*/
private DefaultAnnotationUsage(Type type, Value<?> value) {
DefaultAnnotationUsage(Type type, Value<?> value) {
this.type = requireNonNull(type);
this.value = value;
}
Expand Down
Expand Up @@ -22,7 +22,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.util.Objects.requireNonNull;
import java.util.Optional;
import java.util.Queue;
import java.util.Set;
Expand All @@ -33,6 +32,8 @@
import java.util.function.Supplier;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;

/**
* Constant implementations of the {@link Type} interface that can be used to
* reference standard java types. If a modifying method is called on any of
Expand Down
Expand Up @@ -44,7 +44,7 @@ private DefaultValue() {}
* @param text the inner text
* @return a value representing that string
*/
public static final Value<String> string(String text) {
public static Value<String> string(String text) {
return new TextValue(requireNonNull(text));
}
}
Expand Up @@ -18,10 +18,12 @@

import com.speedment.common.codegen.model.ClassOrInterface;
import com.speedment.common.codegen.model.File;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Objects;

import static java.util.Objects.requireNonNull;

/**
Expand Down
Expand Up @@ -18,8 +18,10 @@

import com.speedment.common.codegen.model.ClassOrInterface;
import com.speedment.common.codegen.model.File;

import java.lang.reflect.Type;
import java.util.Objects;

import static java.util.Objects.requireNonNull;

/**
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.speedment.common.codegen.model.trait.HasName;
import com.speedment.common.codegen.model.trait.HasSupertype;

import java.lang.reflect.Type;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
Expand All @@ -35,10 +36,8 @@
import static com.speedment.common.codegen.constant.DefaultAnnotationUsage.OVERRIDE;
import static com.speedment.common.codegen.constant.DefaultJavadocTag.PARAM;
import static com.speedment.common.codegen.constant.DefaultJavadocTag.RETURN;
import static com.speedment.common.codegen.constant.DefaultType.*;
import static com.speedment.common.codegen.internal.util.Formatting.nl;
import static com.speedment.common.codegen.internal.util.Formatting.tab;
import java.lang.reflect.Type;
import static java.util.Objects.requireNonNull;

/**
Expand Down
Expand Up @@ -29,9 +29,9 @@
import com.speedment.common.codegen.model.trait.HasSupertype;
import com.speedment.common.codegen.model.trait.HasThrows;
import com.speedment.common.codegen.model.trait.HasType;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
Expand Down
Expand Up @@ -16,24 +16,24 @@
*/
package com.speedment.common.codegen.controller;

import com.speedment.common.codegen.constant.SimpleParameterizedType;
import com.speedment.common.codegen.constant.SimpleType;
import com.speedment.common.codegen.model.Class;
import com.speedment.common.codegen.model.Field;
import com.speedment.common.codegen.model.File;
import com.speedment.common.codegen.model.Generic;
import com.speedment.common.codegen.model.Javadoc;
import com.speedment.common.codegen.model.JavadocTag;
import com.speedment.common.codegen.model.Method;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Optional;
import java.util.function.BiPredicate;
import java.util.function.Consumer;

import com.speedment.common.codegen.constant.SimpleParameterizedType;
import com.speedment.common.codegen.constant.SimpleType;
import static com.speedment.common.codegen.internal.util.Formatting.*;
import com.speedment.common.codegen.model.File;
import com.speedment.common.codegen.model.Generic;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import static java.util.Objects.requireNonNull;

/**
Expand Down
Expand Up @@ -26,7 +26,6 @@

import java.util.LinkedList;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;

import static com.speedment.common.codegen.internal.util.NullUtil.requireNonNulls;
Expand Down Expand Up @@ -105,7 +104,7 @@ public <A, B> Stream<Meta<A, B>> metaOn(A from, Class<B> to) {
.map(t -> (Transform<A, B>) t)
.map(t -> transform(t, from, factory))
.filter(Optional::isPresent)
.map((Function<Optional<Meta<A, B>>, Meta<A, B>>) Optional::get)
.map(Optional::get)
;
}

Expand Down
Expand Up @@ -197,11 +197,8 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.imports, other.imports)) {
return false;
}
if (!Objects.equals(this.modifiers, other.modifiers)) {
return false;
}
return true;
}
return Objects.equals(this.modifiers, other.modifiers);
}


}
Expand Up @@ -19,8 +19,8 @@
import com.speedment.common.codegen.internal.util.Copier;
import com.speedment.common.codegen.model.AnnotationUsage;
import com.speedment.common.codegen.model.Value;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -202,10 +202,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.value, other.value)) {
return false;
}
if (!Objects.equals(this.values, other.values)) {
return false;
}
return true;
return Objects.equals(this.values, other.values);
}

}
Expand Up @@ -19,8 +19,8 @@
import com.speedment.common.codegen.internal.util.Copier;
import com.speedment.common.codegen.model.Class;
import com.speedment.common.codegen.model.Constructor;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -121,10 +121,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.superType, other.superType)) {
return false;
}
if (!Objects.equals(this.constructors, other.constructors)) {
return false;
}
return true;
return Objects.equals(this.constructors, other.constructors);
}


Expand Down
Expand Up @@ -25,8 +25,8 @@
import com.speedment.common.codegen.model.Javadoc;
import com.speedment.common.codegen.model.Method;
import com.speedment.common.codegen.model.modifier.Modifier;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
Expand Down Expand Up @@ -62,7 +62,7 @@ public abstract class ClassOrInterfaceImpl<T extends ClassOrInterface<T>>
*
* @param name the name
*/
public ClassOrInterfaceImpl(String name) {
ClassOrInterfaceImpl(String name) {
this.name = requireNonNull(name);
this.javadoc = null;
this.annotations = new ArrayList<>();
Expand All @@ -80,7 +80,7 @@ public ClassOrInterfaceImpl(String name) {
*
* @param prototype the prototype
*/
protected ClassOrInterfaceImpl(ClassOrInterface<T> prototype) {
ClassOrInterfaceImpl(ClassOrInterface<T> prototype) {
name = requireNonNull(prototype).getName();
javadoc = prototype.getJavadoc().map(Copier::copy).orElse(null);
annotations = Copier.copy(prototype.getAnnotations());
Expand Down Expand Up @@ -248,10 +248,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.classes, other.classes)) {
return false;
}
if (!Objects.equals(this.modifiers, other.modifiers)) {
return false;
}
return true;
return Objects.equals(this.modifiers, other.modifiers);
}


Expand Down
Expand Up @@ -22,8 +22,8 @@
import com.speedment.common.codegen.model.Field;
import com.speedment.common.codegen.model.Javadoc;
import com.speedment.common.codegen.model.modifier.Modifier;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashSet;
Expand Down Expand Up @@ -186,10 +186,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.modifiers, other.modifiers)) {
return false;
}
if (!Objects.equals(this.exceptions, other.exceptions)) {
return false;
}
return true;
return Objects.equals(this.exceptions, other.exceptions);
}

}
Expand Up @@ -119,10 +119,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.values, other.values)) {
return false;
}
return true;
return Objects.equals(this.values, other.values);
}


Expand Down
Expand Up @@ -111,10 +111,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.constants, other.constants)) {
return false;
}
if (!Objects.equals(this.constructors, other.constructors)) {
return false;
}
return true;
return Objects.equals(this.constructors, other.constructors);
}


Expand Down
Expand Up @@ -22,8 +22,8 @@
import com.speedment.common.codegen.model.Javadoc;
import com.speedment.common.codegen.model.Value;
import com.speedment.common.codegen.model.modifier.Modifier;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
Expand Down Expand Up @@ -214,10 +214,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.annotations, other.annotations)) {
return false;
}
if (!Objects.equals(this.modifiers, other.modifiers)) {
return false;
}
return true;
return Objects.equals(this.modifiers, other.modifiers);
}


Expand Down
Expand Up @@ -161,10 +161,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.imports, other.imports)) {
return false;
}
if (!Objects.equals(this.classes, other.classes)) {
return false;
}
return true;
return Objects.equals(this.classes, other.classes);
}

}
Expand Up @@ -17,16 +17,15 @@
package com.speedment.common.codegen.internal.model;

import com.speedment.common.codegen.constant.SimpleType;
import com.speedment.common.codegen.internal.util.Copier;
import com.speedment.common.codegen.model.Generic;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

import static com.speedment.common.codegen.internal.util.NullUtil.requireNonNullElements;
import java.lang.reflect.Type;
import static java.util.Arrays.asList;

/**
Expand Down Expand Up @@ -191,10 +190,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.upperBounds, other.upperBounds)) {
return false;
}
if (this.type != other.type) {
return false;
}
return true;
return this.type == other.type;
}


Expand Down
Expand Up @@ -19,8 +19,8 @@
import com.speedment.common.codegen.internal.util.Copier;
import com.speedment.common.codegen.model.Import;
import com.speedment.common.codegen.model.modifier.Modifier;
import java.lang.reflect.Type;

import java.lang.reflect.Type;
import java.util.EnumSet;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -144,10 +144,7 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.type, other.type)) {
return false;
}
if (!Objects.equals(this.modifiers, other.modifiers)) {
return false;
}
return true;
return Objects.equals(this.modifiers, other.modifiers);
}

}

0 comments on commit 3199f2b

Please sign in to comment.