Fix Eclipse warnings: References to generic type should be parameterized
Change-Id: Iff4e6554309110d89d93f0057af757c19cd39738
diff --git a/src/main/java/com/google/gwtorm/client/StringKey.java b/src/main/java/com/google/gwtorm/client/StringKey.java
index 0944a8b..4c85d2a 100644
--- a/src/main/java/com/google/gwtorm/client/StringKey.java
+++ b/src/main/java/com/google/gwtorm/client/StringKey.java
@@ -26,7 +26,7 @@
*/
@SuppressWarnings("serial")
public abstract class StringKey<P extends Key<?>> implements Key<P>,
- Serializable, Comparable<StringKey> {
+ Serializable, Comparable<StringKey<?>> {
/**
* @return name of the entity instance.
*/
@@ -64,7 +64,7 @@
}
@Override
- public int compareTo(final StringKey other) {
+ public int compareTo(final StringKey<?> other) {
return get().compareTo(other.get());
}
diff --git a/src/main/java/com/google/gwtorm/jdbc/Database.java b/src/main/java/com/google/gwtorm/jdbc/Database.java
index a72e258..2c8d256 100644
--- a/src/main/java/com/google/gwtorm/jdbc/Database.java
+++ b/src/main/java/com/google/gwtorm/jdbc/Database.java
@@ -88,7 +88,7 @@
implDialect = dialect;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
private Class<T> generate(final SqlDialect dialect,
final GeneratedClassLoader loader) throws OrmException {
return new SchemaGen(loader, schemaModel, getClass(), JdbcSchema.class,
diff --git a/src/main/java/com/google/gwtorm/nosql/AccessGen.java b/src/main/java/com/google/gwtorm/nosql/AccessGen.java
index 8c9c4a3..91fc97b 100644
--- a/src/main/java/com/google/gwtorm/nosql/AccessGen.java
+++ b/src/main/java/com/google/gwtorm/nosql/AccessGen.java
@@ -70,6 +70,7 @@
AccessGen(final GeneratedClassLoader loader, final RelationModel rm,
final Class<? extends NoSqlSchema> schemaClazz,
+ @SuppressWarnings("rawtypes")
final Class<? extends NoSqlAccess> accessClazz) throws OrmException {
classLoader = loader;
model = rm;
@@ -119,7 +120,7 @@
return c;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
private void initObjectCodec(final Class<?> clazz) throws OrmException {
ProtobufCodec oc = CodecFactory.encoder(modelClass);
if (model.getRelationID() > 0) {
@@ -143,7 +144,7 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
private void initQueryIndexes(final Class<?> clazz) throws OrmException {
final Collection<QueryModel> queries = model.getQueries();
final ArrayList<IndexFunction> indexes = new ArrayList<IndexFunction>();
@@ -158,7 +159,7 @@
e.setAccessible(true);
e.set(null, indexes.toArray(new IndexFunction[indexes.size()]));
- for (IndexFunction f : indexes) {
+ for (IndexFunction<?> f : indexes) {
e = clazz.getDeclaredField("index_" + f.getName());
e.setAccessible(true);
e.set(null, f);
diff --git a/src/main/java/com/google/gwtorm/nosql/NoSqlDatabase.java b/src/main/java/com/google/gwtorm/nosql/NoSqlDatabase.java
index 971e046..14b3526 100644
--- a/src/main/java/com/google/gwtorm/nosql/NoSqlDatabase.java
+++ b/src/main/java/com/google/gwtorm/nosql/NoSqlDatabase.java
@@ -47,6 +47,7 @@
* @param <S> type of the implementation's base for Schema implementations.
* @param <A> type of the implementation's base for Access implementations.
*/
+@SuppressWarnings("rawtypes")
public abstract class NoSqlDatabase<T extends Schema, S extends NoSqlSchema, A extends NoSqlAccess>
implements SchemaFactory<T> {
static {
diff --git a/src/main/java/com/google/gwtorm/nosql/generic/GenericDatabase.java b/src/main/java/com/google/gwtorm/nosql/generic/GenericDatabase.java
index 82ee14b..7b946e2 100644
--- a/src/main/java/com/google/gwtorm/nosql/generic/GenericDatabase.java
+++ b/src/main/java/com/google/gwtorm/nosql/generic/GenericDatabase.java
@@ -47,6 +47,7 @@
* @param <S> type of the implementation's base for Schema implementations.
* @param <A> type of the implementation's base for Access implementations.
*/
+@SuppressWarnings("rawtypes")
public abstract class GenericDatabase<T extends Schema, S extends GenericSchema, A extends GenericAccess>
extends NoSqlDatabase<T, S, A> {
private static final long DEFAULT_FOSSIL_AGE =
diff --git a/src/main/java/com/google/gwtorm/nosql/heap/FileDatabase.java b/src/main/java/com/google/gwtorm/nosql/heap/FileDatabase.java
index ea82f1d..1799865 100644
--- a/src/main/java/com/google/gwtorm/nosql/heap/FileDatabase.java
+++ b/src/main/java/com/google/gwtorm/nosql/heap/FileDatabase.java
@@ -301,6 +301,7 @@
}
}
+ @SuppressWarnings("rawtypes")
public static abstract class LoggingAccess extends TreeMapAccess {
protected LoggingAccess(LoggingSchema s) {
super(s);
diff --git a/src/main/java/com/google/gwtorm/nosql/heap/MemoryDatabase.java b/src/main/java/com/google/gwtorm/nosql/heap/MemoryDatabase.java
index 54e5ed9..5c8aaab 100644
--- a/src/main/java/com/google/gwtorm/nosql/heap/MemoryDatabase.java
+++ b/src/main/java/com/google/gwtorm/nosql/heap/MemoryDatabase.java
@@ -28,6 +28,7 @@
* @param <T> type of the application schema.
* @see FileDatabase
*/
+@SuppressWarnings("rawtypes")
public class MemoryDatabase<T extends Schema> extends
TreeMapDatabase<T, TreeMapSchema, TreeMapAccess> {
diff --git a/src/main/java/com/google/gwtorm/nosql/heap/TreeMapDatabase.java b/src/main/java/com/google/gwtorm/nosql/heap/TreeMapDatabase.java
index b33404b..1e0bb21 100644
--- a/src/main/java/com/google/gwtorm/nosql/heap/TreeMapDatabase.java
+++ b/src/main/java/com/google/gwtorm/nosql/heap/TreeMapDatabase.java
@@ -37,6 +37,7 @@
*
* @param <T> type of the application schema.
*/
+@SuppressWarnings("rawtypes")
abstract class TreeMapDatabase<T extends Schema, S extends TreeMapSchema, A extends TreeMapAccess>
extends GenericDatabase<T, S, A> {
diff --git a/src/main/java/com/google/gwtorm/protobuf/CodecGen.java b/src/main/java/com/google/gwtorm/protobuf/CodecGen.java
index e0d3222..abf0e97 100644
--- a/src/main/java/com/google/gwtorm/protobuf/CodecGen.java
+++ b/src/main/java/com/google/gwtorm/protobuf/CodecGen.java
@@ -312,7 +312,7 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
private NestedCodec nestedFor(JavaColumnModel f) {
Class clazz = f.getNestedClass();
NestedCodec n = nestedCodecs.get(clazz);
@@ -1244,7 +1244,7 @@
final Type codecType;
final Type pojoType;
- NestedCodec(String field, Class impl, Type pojoType) {
+ NestedCodec(String field, Class<?> impl, Type pojoType) {
this.field = field;
this.codecType = Type.getType(impl);
this.pojoType = pojoType;
diff --git a/src/test/java/com/google/gwtorm/nosql/IndexFunctionTest.java b/src/test/java/com/google/gwtorm/nosql/IndexFunctionTest.java
index 5f9f432..ff827ba 100644
--- a/src/test/java/com/google/gwtorm/nosql/IndexFunctionTest.java
+++ b/src/test/java/com/google/gwtorm/nosql/IndexFunctionTest.java
@@ -187,6 +187,7 @@
assertEqualToBuilderResult(new byte[] {}, b);
}
+ @SuppressWarnings("rawtypes")
private IndexFunction<Person> index(String name, String query)
throws OrmException {
final QueryModel qm = new QueryModel(people, name, query);