提交 0d1713bb authored 作者: noelgrandin's avatar noelgrandin

cleanup some generics warning in the jaqu package

上级 ed014b69
......@@ -385,7 +385,7 @@ public class Query<T> {
if (!orderByList.isEmpty()) {
stat.appendSQL(" ORDER BY ");
int i = 0;
for (OrderExpression o : orderByList) {
for (OrderExpression<T> o : orderByList) {
if (i++ > 0) {
stat.appendSQL(", ");
}
......
......@@ -633,7 +633,8 @@ public class TableInspector {
append('=');
if (value instanceof List) {
append("{ ");
List list = (List) value;
@SuppressWarnings("unchecked")
List<Object> list = (List<Object>) value;
StatementBuilder flat = new StatementBuilder();
for (Object o:list) {
flat.appendExceptFirst(", ");
......
......@@ -63,15 +63,15 @@ public class ClassUtils {
} else if (clazz == java.util.Date.class) {
return (T) new java.util.Date(COUNTER.getAndIncrement());
} else if (clazz == List.class) {
return (T) new ArrayList();
return (T) new ArrayList<Object>();
}
try {
return clazz.newInstance();
} catch (Exception e) {
if (MAKE_ACCESSIBLE) {
Constructor[] constructors = clazz.getDeclaredConstructors();
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
// try 0 length constructors
for (Constructor c : constructors) {
for (Constructor<?> c : constructors) {
if (c.getParameterTypes().length == 0) {
c.setAccessible(true);
try {
......@@ -82,7 +82,7 @@ public class ClassUtils {
}
}
// try 1 length constructors
for (Constructor c : constructors) {
for (Constructor<?> c : constructors) {
if (c.getParameterTypes().length == 1) {
c.setAccessible(true);
try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论