#1738 - Refactor tidy suppressWarnings

This commit is contained in:
rob bygrave committed 2019-06-28 23:04:20 +12:00
1 parent b4182d4519
commit 30a0935300
12 files changed
+18 -22

No files matched your search

@@ -658,7 +658,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* </p>
*/
@Override
@SuppressWarnings("unchecked")
public <T> T createEntityBean(Class<T> type) {
return getBeanDescriptor(type).createBean();
}
@@ -815,7 +815,6 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
return new BeanTable(beanTable, this);
}
@SuppressWarnings({"unchecked", "rawtypes"})
private void readEntityRelationships() {
// We only perform 'circular' checks etc after we have
@@ -1650,7 +1649,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
return changeLogListener;
}
public void addPrimaryKeyJoin(DeployBeanPropertyAssocOne<?> prop) {
private void addPrimaryKeyJoin(DeployBeanPropertyAssocOne<?> prop) {
String baseTable = prop.getDesc().getBaseTable();
DeployTableJoin inverse = prop.getTableJoin().createInverse(baseTable);
@@ -249,7 +249,7 @@ public class DeployBeanProperty {
/**
* Wrap the ScalarType using a ScalarTypeConverter.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private ScalarType<?> wrapScalarType(Class<?> propertyType, ScalarType<?> scalarType, ScalarTypeConverter<?, ?> typeConverter) {
if (typeConverter == null) {
return scalarType;
@@ -71,7 +71,7 @@ public class DeployBeanPropertyLists {
private final BeanPropertyAssocOne<?> unidirectional;
private final BeanProperty orderColumn;
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
public DeployBeanPropertyLists(BeanDescriptorMap owner, BeanDescriptor<?> desc, DeployBeanDescriptor<?> deploy) {
this.desc = desc;
@@ -54,7 +54,7 @@ public class DeployBeanTable {
return idProperty == null ? null : createProperty(owner, idProperty);
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private BeanProperty createProperty(BeanDescriptorMap owner, DeployBeanProperty prop) {
if (prop instanceof DeployBeanPropertyAssocOne<?>) {
@@ -496,7 +496,7 @@ public class AnnotationFields extends AnnotationParser {
}
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private ScalarTypeEncryptedWrapper<?> createScalarType(DeployBeanProperty prop, ScalarType<?> st) {
// Use Java Encryptor wrapping the logical scalar type
@@ -199,7 +199,7 @@ public class DeployCreateProperties {
return null;
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private DeployBeanProperty createManyType(DeployBeanDescriptor<?> desc, Class<?> targetType, ManyType manyType) {
try {
@@ -213,7 +213,7 @@ public class DeployCreateProperties {
return new DeployBeanPropertyAssocMany(desc, targetType, manyType);
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private DeployBeanProperty createProp(DeployBeanDescriptor<?> desc, Field field) {
Class<?> propertyType = field.getType();
@@ -175,7 +175,7 @@ class ElMatchBuilder {
final Set<?> set;
final ElPropertyValue elGetValue;
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
public InSet(Set<?> set, ElPropertyValue elGetValue) {
this.set = new HashSet(set);
this.elGetValue = elGetValue;
@@ -1244,15 +1244,15 @@ public final class DefaultPersister implements Persister {
* perform an insert, update or delete.
*/
private <T> PersistRequestBean<T> createRequest(T bean, Transaction t, PersistRequest.Type type) {
return createRequestInternal(bean, t, type, Flags.ZERO);
return createRequestInternal(bean, t, type);
}
/**
* Create the Persist Request Object additionally specifying the publish status.
*/
private <T> PersistRequestBean<T> createRequestInternal(T bean, Transaction t, PersistRequest.Type type, int flags) {
private <T> PersistRequestBean<T> createRequestInternal(T bean, Transaction t, PersistRequest.Type type) {
BeanManager<T> mgr = getBeanManager(bean);
return createRequest(bean, t, null, mgr, type, flags);
return createRequest(bean, t, null, mgr, type, Flags.ZERO);
}
/**
@@ -1280,7 +1280,7 @@ public final class DefaultPersister implements Persister {
* Create the Persist Request Object that wraps all the objects used to
* perform an insert, update or delete.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked"})
private <T> PersistRequestBean<T> createRequest(T bean, Transaction t, Object parentBean, BeanManager<?> mgr,
PersistRequest.Type type, int flags) {
@@ -1292,13 +1292,12 @@ public final class DefaultPersister implements Persister {
return createDeleteRequest(bean, t, type, Flags.unsetRecurse(flags));
}
@SuppressWarnings({"unchecked", "rawtypes"})
private <T> PersistRequestBean<T> createDeleteRequest(EntityBean bean, Transaction t, Type type) {
return createDeleteRequest(bean, t, type, Flags.ZERO);
}
@SuppressWarnings({"unchecked", "rawtypes"})
public <T> PersistRequestBean<T> createDeleteRequest(Object bean, Transaction t, PersistRequest.Type type, int flags) {
@SuppressWarnings({"unchecked"})
private <T> PersistRequestBean<T> createDeleteRequest(Object bean, Transaction t, PersistRequest.Type type, int flags) {
BeanManager<T> mgr = getBeanManager(bean);
if (type == Type.DELETE_PERMANENT) {
@@ -1308,7 +1307,7 @@ public final class DefaultPersister implements Persister {
type = Type.DELETE_SOFT;
}
PersistRequestBean<T> request = new PersistRequestBean<T>(server, (T)bean, null, mgr, (SpiTransaction) t, persistExecute, type, flags);
PersistRequestBean<T> request = new PersistRequestBean<>(server, (T)bean, null, mgr, (SpiTransaction) t, persistExecute, type, flags);
request.initForSoftDelete();
return request;
}
@@ -178,7 +178,6 @@ public class OrmQueryProperties implements Serializable {
/**
* Move a OrderBy.Property from the main query to this query join.
*/
@SuppressWarnings("rawtypes")
void addSecJoinOrderProperty(OrderBy.Property orderProp) {
if (orderBy == null) {
orderBy = new OrderBy();
@@ -194,7 +193,7 @@ public class OrmQueryProperties implements Serializable {
* Return the expressions used to filter on this path. This should be a many path to use this
* method.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings({"unchecked"})
public <T> SpiExpressionList<T> filterMany(Query<T> rootQuery) {
if (filterMany == null) {
FilterExprPath exprPath = new FilterExprPath(path);
@@ -49,7 +49,7 @@ class ScalarTypeArraySetH2<T> extends ScalarTypeArraySet<T> {
}
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"rawtypes"})
public ScalarTypeArraySetH2 typeForEnum(ScalarType<?> scalarType) {
return new ScalarTypeArraySetH2("varchar", DocPropertyType.TEXT, new ArrayElementConverter.EnumConverter(scalarType));
}