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

cleanup some generics warning in the jaqu package

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