Static code analysis. (#1017)

This commit is contained in:
Koen De Groote authored and Rob Bygrave committed 2017-04-30 14:47:02 +12:00
1 parent a120c2aaee
commit 335c4de109
16 files changed
+20 -85

No files matched your search

@@ -62,8 +62,7 @@ public class ChainedBeanPersistController implements BeanPersistController {
if (list.contains(c)) {
return this;
} else {
ArrayList<BeanPersistController> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPersistController> newList = new ArrayList<>(list);
newList.add(c);
return new ChainedBeanPersistController(newList);
@@ -77,8 +76,7 @@ public class ChainedBeanPersistController implements BeanPersistController {
if (!list.contains(c)) {
return this;
} else {
ArrayList<BeanPersistController> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPersistController> newList = new ArrayList<>(list);
newList.remove(c);
return new ChainedBeanPersistController(newList);
@@ -60,8 +60,7 @@ public class ChainedBeanPersistListener implements BeanPersistListener {
if (list.contains(c)) {
return this;
} else {
List<BeanPersistListener> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPersistListener> newList = new ArrayList<>(list);
newList.add(c);
return new ChainedBeanPersistListener(newList);
@@ -75,8 +74,7 @@ public class ChainedBeanPersistListener implements BeanPersistListener {
if (!list.contains(c)) {
return this;
} else {
ArrayList<BeanPersistListener> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPersistListener> newList = new ArrayList<>(list);
newList.remove(c);
return new ChainedBeanPersistListener(newList);
@@ -29,8 +29,7 @@ public class ChainedBeanPostLoad implements BeanPostLoad {
if (list.contains(c)) {
return this;
} else {
List<BeanPostLoad> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPostLoad> newList = new ArrayList<>(list);
newList.add(c);
return new ChainedBeanPostLoad(newList);
@@ -44,8 +43,7 @@ public class ChainedBeanPostLoad implements BeanPostLoad {
if (!list.contains(c)) {
return this;
} else {
ArrayList<BeanPostLoad> newList = new ArrayList<>();
newList.addAll(list);
List<BeanPostLoad> newList = new ArrayList<>(list);
newList.remove(c);
return new ChainedBeanPostLoad(newList);
@@ -36,8 +36,7 @@ public class ChainedBeanQueryAdapter implements BeanQueryAdapter {
if (list.contains(c)) {
return this;
} else {
List<BeanQueryAdapter> newList = new ArrayList<>();
newList.addAll(list);
List<BeanQueryAdapter> newList = new ArrayList<>(list);
newList.add(c);
return new ChainedBeanQueryAdapter(newList);
@@ -51,8 +50,7 @@ public class ChainedBeanQueryAdapter implements BeanQueryAdapter {
if (!list.contains(c)) {
return this;
} else {
ArrayList<BeanQueryAdapter> newList = new ArrayList<>();
newList.addAll(list);
List<BeanQueryAdapter> newList = new ArrayList<>(list);
newList.remove(c);
return new ChainedBeanQueryAdapter(newList);
@@ -36,7 +36,6 @@ import javax.persistence.MappedSuperclass;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;