mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
FIX some java warnings / rawtypes
This commit is contained in:
1 parent
fad8358a9d
commit
3701b314a0
40 files changed
+72
-66
No files matched your search
+1
-1
@@ -63,7 +63,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
this.queryTuner = new BaseQueryTuner(config, server, profileManager);
|
||||
this.skipGarbageCollectionOnShutdown = config.isSkipGarbageCollectionOnShutdown();
|
||||
this.skipProfileReportingOnShutdown = config.isSkipProfileReportingOnShutdown();
|
||||
this.defaultGarbageCollectionWait = (long) config.getGarbageCollectionWait();
|
||||
this.defaultGarbageCollectionWait = config.getGarbageCollectionWait();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class TunedQueryInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8661702592481810396L;
|
||||
|
||||
private final Origin origin;
|
||||
|
||||
private final OrmQueryDetail tunedDetail;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CacheChangeSet {
|
||||
|
||||
private final List<CacheChange> entries = new ArrayList<CacheChange>();
|
||||
|
||||
private final Set<BeanDescriptor> queryCaches = new HashSet<BeanDescriptor>();
|
||||
private final Set<BeanDescriptor<?>> queryCaches = new HashSet<>();
|
||||
|
||||
private final Map<ManyKey, ManyChange> manyChangeMap = new HashMap<ManyKey, ManyChange>();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class CacheChangeSet {
|
||||
* Return the set of table changes to process invalidation for entities based on views.
|
||||
*/
|
||||
public Set<String> apply() {
|
||||
for (BeanDescriptor entry : queryCaches) {
|
||||
for (BeanDescriptor<?> entry : queryCaches) {
|
||||
entry.queryCacheClear();
|
||||
}
|
||||
for (CacheChange entry : entries) {
|
||||
|
||||
@@ -57,7 +57,6 @@ public class CachedBeanData implements Externalizable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
|
||||
version = in.readLong();
|
||||
whenCreated = in.readLong();
|
||||
|
||||
@@ -140,7 +140,7 @@ public class DefaultBeanLoader {
|
||||
}
|
||||
}
|
||||
|
||||
SpiQuery<?> query = (SpiQuery<?>) server.createQuery(parentDesc.getBeanType());
|
||||
SpiQuery<?> query = server.createQuery(parentDesc.getBeanType());
|
||||
|
||||
if (refresh) {
|
||||
// populate a new collection
|
||||
@@ -205,7 +205,7 @@ public class DefaultBeanLoader {
|
||||
return;
|
||||
}
|
||||
|
||||
SpiQuery<?> query = (SpiQuery<?>) server.createQuery(loadRequest.getBeanType());
|
||||
SpiQuery<?> query = server.createQuery(loadRequest.getBeanType());
|
||||
loadRequest.configureQuery(query, idList);
|
||||
|
||||
List<?> list = executeQuery(loadRequest, query);
|
||||
|
||||
@@ -273,6 +273,10 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
public int getLazyLoadBatchSize() {
|
||||
return lazyLoadBatchSize;
|
||||
}
|
||||
|
||||
public int getQueryBatchSize() {
|
||||
return queryBatchSize;
|
||||
}
|
||||
|
||||
public ServerConfig getServerConfig() {
|
||||
return serverConfig;
|
||||
@@ -1124,7 +1128,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
try {
|
||||
request.initTransIfRequired();
|
||||
return (Set<T>) request.findSet();
|
||||
return request.findSet();
|
||||
|
||||
} finally {
|
||||
request.endTransIfRequired();
|
||||
@@ -1143,7 +1147,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
try {
|
||||
request.initTransIfRequired();
|
||||
return (Map<K, T>) request.findMap();
|
||||
return request.findMap();
|
||||
|
||||
} finally {
|
||||
request.endTransIfRequired();
|
||||
@@ -1152,9 +1156,9 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <A> List<A> findSingleAttributeList(Query<?> query, Transaction t) {
|
||||
public <A, T> List<A> findSingleAttributeList(Query<T> query, Transaction t) {
|
||||
|
||||
SpiOrmQueryRequest request = createQueryRequest(Type.ATTRIBUTE, query, t);
|
||||
SpiOrmQueryRequest<T> request = createQueryRequest(Type.ATTRIBUTE, query, t);
|
||||
Object result = request.getFromQueryCache();
|
||||
if (result != null) {
|
||||
return (List<A>) result;
|
||||
@@ -1190,12 +1194,12 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
public <A> List<A> findIds(Query<?> query, Transaction t) {
|
||||
public <A, T> List<A> findIds(Query<T> query, Transaction t) {
|
||||
|
||||
return findIdsWithCopy(((SpiQuery<?>) query).copy(), t);
|
||||
return findIdsWithCopy(((SpiQuery<T>) query).copy(), t);
|
||||
}
|
||||
|
||||
public <A> List<A> findIdsWithCopy(Query<?> query, Transaction t) {
|
||||
public <A, T> List<A> findIdsWithCopy(Query<T> query, Transaction t) {
|
||||
|
||||
SpiOrmQueryRequest<?> request = createQueryRequest(Type.ID_LIST, query, t);
|
||||
try {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DiffHelp {
|
||||
iterator.remove();
|
||||
|
||||
} else if (beanProperty instanceof BeanPropertyAssocOne) {
|
||||
BeanPropertyAssocOne assoc = (BeanPropertyAssocOne)beanProperty;
|
||||
BeanPropertyAssocOne<?> assoc = (BeanPropertyAssocOne<?>)beanProperty;
|
||||
if (!assoc.isEmbedded()) {
|
||||
// flatten for assoc one beans
|
||||
if (flattened == null) {
|
||||
@@ -90,7 +90,7 @@ public class DiffHelp {
|
||||
return values;
|
||||
}
|
||||
|
||||
private static void flattenToId(Map<String, ValuePair> flattened, Map.Entry<String, ValuePair> entry, BeanProperty beanProperty, BeanPropertyAssocOne assoc) {
|
||||
private static void flattenToId(Map<String, ValuePair> flattened, Map.Entry<String, ValuePair> entry, BeanProperty beanProperty, BeanPropertyAssocOne<?> assoc) {
|
||||
|
||||
BeanDescriptor<?> oneDesc = assoc.getTargetDescriptor();
|
||||
|
||||
|
||||
@@ -968,6 +968,8 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
docStoreUpdates.queueIndex(beanDescriptor.getDocStoreQueueId(), idValue);
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ import java.sql.SQLException;
|
||||
*/
|
||||
abstract class AssocOneHelp {
|
||||
|
||||
protected final BeanPropertyAssocOne property;
|
||||
protected final BeanPropertyAssocOne<?> property;
|
||||
|
||||
protected final BeanDescriptor target;
|
||||
protected final BeanDescriptor<?> target;
|
||||
|
||||
AssocOneHelp(BeanPropertyAssocOne property) {
|
||||
AssocOneHelp(BeanPropertyAssocOne<?> property) {
|
||||
this.property = property;
|
||||
this.target = property.targetDescriptor;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.sql.SQLException;
|
||||
*/
|
||||
final class AssocOneHelpEmbedded extends AssocOneHelp {
|
||||
|
||||
public AssocOneHelpEmbedded(BeanPropertyAssocOne property) {
|
||||
public AssocOneHelpEmbedded(BeanPropertyAssocOne<?> property) {
|
||||
super(property);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.avaje.ebeaninternal.server.query.SqlJoinType;
|
||||
*/
|
||||
class AssocOneHelpRefExported extends AssocOneHelp {
|
||||
|
||||
public AssocOneHelpRefExported(BeanPropertyAssocOne property) {
|
||||
public AssocOneHelpRefExported(BeanPropertyAssocOne<?> property) {
|
||||
super(property);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
|
||||
private final InheritInfo inherit;
|
||||
|
||||
AssocOneHelpRefInherit(BeanPropertyAssocOne property) {
|
||||
AssocOneHelpRefInherit(BeanPropertyAssocOne<?> property) {
|
||||
super(property);
|
||||
this.inherit = property.targetInheritInfo;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ package com.avaje.ebeaninternal.server.deploy;
|
||||
*/
|
||||
class AssocOneHelpRefSimple extends AssocOneHelp {
|
||||
|
||||
AssocOneHelpRefSimple(BeanPropertyAssocOne property) {
|
||||
AssocOneHelpRefSimple(BeanPropertyAssocOne<?> property) {
|
||||
super(property);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ public final class BeanDescriptorDraftHelp<T> {
|
||||
* This will recursive transfer values to all @DraftableElement properties.
|
||||
* </p>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T publish(T draftBean, T liveBean) {
|
||||
|
||||
if (liveBean == null) {
|
||||
|
||||
@@ -645,6 +645,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
/**
|
||||
* Return the bean deploy info for the given class.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> DeployBeanInfo<T> getDeploy(Class<T> cls) {
|
||||
return (DeployBeanInfo<T>) deployInfoMap.get(cls);
|
||||
}
|
||||
|
||||
@@ -92,16 +92,14 @@ public final class BeanMapHelp<T> implements BeanCollectionHelp<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanCollection<T> createEmptyNoParent() {
|
||||
return new BeanMap();
|
||||
return new BeanMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanCollection<T> createEmpty(EntityBean ownerBean) {
|
||||
|
||||
BeanMap beanMap = new BeanMap(loader, ownerBean, propertyName);
|
||||
BeanMap<?,T> beanMap = new BeanMap<>(loader, ownerBean, propertyName);
|
||||
if (many != null) {
|
||||
beanMap.setModifyListening(many.getModifyListenMode());
|
||||
}
|
||||
|
||||
@@ -1032,6 +1032,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<Object,T> liveBeansAsMap(BeanCollection<?> liveVal) {
|
||||
|
||||
liveVal.size();
|
||||
|
||||
@@ -125,10 +125,8 @@ public class BeanPropertyCompound extends BeanProperty {
|
||||
* Read the data from the resultSet effectively ignoring it and returning
|
||||
* null.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object read(DbReadContext ctx) throws SQLException {
|
||||
|
||||
return compoundType.read(ctx.getDataReader());
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,10 @@ public class BeanPropertyCompoundScalar extends BeanProperty {
|
||||
/**
|
||||
* Return one of the scalar values from a compound type.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getValueObject(Object compoundValue) {
|
||||
return ctProperty.getValue(compoundValue);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getValue(EntityBean valueObject) {
|
||||
return ctProperty.getValue(valueObject);
|
||||
@@ -39,7 +37,6 @@ public class BeanPropertyCompoundScalar extends BeanProperty {
|
||||
setValueInCompound(bean, value, false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setValueInCompound(EntityBean bean, Object value, boolean intercept) {
|
||||
|
||||
Object compoundValue = ctProperty.setValue(bean, value);
|
||||
|
||||
@@ -70,9 +70,8 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanCollection<T> createEmptyNoParent() {
|
||||
return new BeanSet();
|
||||
return new BeanSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -244,6 +244,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
/**
|
||||
* Convert back from a Map to embedded bean.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object convertIdFromJson(Object value) {
|
||||
|
||||
Map<String,Object> map = (Map<String, Object>)value;
|
||||
|
||||
+3
-3
@@ -291,7 +291,7 @@ public class DefaultExampleExpression implements SpiExpression, ExampleExpressio
|
||||
String propName = SplitName.add(prefix, beanProperty.getName());
|
||||
if (beanProperty.isScalar()) {
|
||||
if (value instanceof String) {
|
||||
list.add(new LikeExpression(propName, (String) value, caseInsensitive, likeType));
|
||||
list.add(new LikeExpression(propName, value, caseInsensitive, likeType));
|
||||
} else {
|
||||
// exclude the zero values typically to weed out
|
||||
// primitive int and long that initialise to 0
|
||||
@@ -301,8 +301,8 @@ public class DefaultExampleExpression implements SpiExpression, ExampleExpressio
|
||||
}
|
||||
|
||||
} else if ((beanProperty instanceof BeanPropertyAssocOne) && (value instanceof EntityBean)) {
|
||||
BeanPropertyAssocOne assocOne = (BeanPropertyAssocOne) beanProperty;
|
||||
BeanDescriptor targetDescriptor = assocOne.getTargetDescriptor();
|
||||
BeanPropertyAssocOne<?> assocOne = (BeanPropertyAssocOne<?>) beanProperty;
|
||||
BeanDescriptor<?> targetDescriptor = assocOne.getTargetDescriptor();
|
||||
addExpressions(list, targetDescriptor, (EntityBean) value, propName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class NamedParamHelp {
|
||||
|
||||
Object value = value(sourceValue);
|
||||
if (value instanceof Collection) {
|
||||
values.addAll((Collection)value);
|
||||
values.addAll((Collection<?>)value);
|
||||
} else {
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import java.util.List;
|
||||
|
||||
class EqlAdapterHelper {
|
||||
|
||||
private final EqlAdapter owner;
|
||||
private final EqlAdapter<?> owner;
|
||||
|
||||
public EqlAdapterHelper(EqlAdapter owner) {
|
||||
public EqlAdapterHelper(EqlAdapter<?> owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ class EqlAdapterHelper {
|
||||
peekExprList().between(path, bind(value1), bind(value2));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addIn(String path, List<Object> inValues) {
|
||||
peekExprList().in(path, inValues);
|
||||
}
|
||||
@@ -117,7 +116,7 @@ class EqlAdapterHelper {
|
||||
return getBindValue(valueType, value);
|
||||
}
|
||||
|
||||
private ExpressionList peekExprList() {
|
||||
private ExpressionList<?> peekExprList() {
|
||||
return owner.peekExprList();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,27 +15,27 @@ interface ArrayElementConverter<T> {
|
||||
/**
|
||||
* The UUID converter implementation.
|
||||
*/
|
||||
ArrayElementConverter UUID = new UuidConverter();
|
||||
ArrayElementConverter<UUID> UUID = new UuidConverter();
|
||||
|
||||
/**
|
||||
* The String converter implementation.
|
||||
*/
|
||||
ArrayElementConverter STRING = new StringConverter();
|
||||
ArrayElementConverter<String> STRING = new StringConverter();
|
||||
|
||||
/**
|
||||
* The Long converter implementation.
|
||||
*/
|
||||
ArrayElementConverter LONG = new LongConverter();
|
||||
ArrayElementConverter<Long> LONG = new LongConverter();
|
||||
|
||||
/**
|
||||
* The Integer converter implementation.
|
||||
*/
|
||||
ArrayElementConverter INTEGER = new IntegerConverter();
|
||||
ArrayElementConverter<Integer> INTEGER = new IntegerConverter();
|
||||
|
||||
/**
|
||||
* The Double converter implementation.
|
||||
*/
|
||||
ArrayElementConverter DOUBLE = new DoubleConverter();
|
||||
ArrayElementConverter<Double> DOUBLE = new DoubleConverter();
|
||||
|
||||
class LongConverter implements ArrayElementConverter<Long> {
|
||||
|
||||
@@ -87,6 +87,7 @@ interface ArrayElementConverter<T> {
|
||||
|
||||
class NoopConverter<T> implements ArrayElementConverter<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public T toElement(Object rawValue) {
|
||||
return (T) rawValue;
|
||||
|
||||
@@ -25,16 +25,15 @@ public class BeanCollectionFactory {
|
||||
/**
|
||||
* Create a BeanCollection for the given parameters.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static BeanCollection<?> create(SpiQuery.Type manyType) {
|
||||
|
||||
switch (manyType) {
|
||||
case MAP:
|
||||
return new BeanMap(new LinkedHashMap(defaultMapInitialCapacity));
|
||||
return new BeanMap<>(new LinkedHashMap<>(defaultMapInitialCapacity));
|
||||
case LIST:
|
||||
return new BeanList(new ArrayList(defaultListInitialCapacity));
|
||||
return new BeanList<>(new ArrayList<>(defaultListInitialCapacity));
|
||||
case SET:
|
||||
return new BeanSet(new LinkedHashSet(defaultSetInitialCapacity));
|
||||
return new BeanSet<>(new LinkedHashSet<>(defaultSetInitialCapacity));
|
||||
|
||||
default:
|
||||
throw new RuntimeException("Invalid Arg " + manyType);
|
||||
|
||||
Reference in new issue
Block a user