Skip to content
Permalink
Browse files

style: Use more generics

There are some users of raw types left that can easily be converted to
using generics.

closes #519
  • Loading branch information
marschall authored and vlsi committed Feb 25, 2016
1 parent df2a4c3 commit 88e39a0087f6bc7447877972278307f4befff16d
@@ -13,7 +13,7 @@
super(statement, queries, parameterLists, updateCounts, false);
}

public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
public void handleResultRows(Query fromQuery, Field[] fields, List<byte[][]> tuples, ResultCursor cursor) {
/* ignore */
}
}
@@ -459,7 +459,7 @@ public Clob getClob(int i) throws SQLException {
throw Driver.notImplemented(this.getClass(), "getClob(int)");
}

public Object getObjectImpl(int i, java.util.Map map) throws SQLException {
public Object getObjectImpl(int i, Map<String, Class<?>> map) throws SQLException {
if (map == null || map.isEmpty()) {
return getObject(i);
}
@@ -872,7 +872,7 @@ public BigDecimal getBigDecimal(String parameterName) throws SQLException {
throw Driver.notImplemented(this.getClass(), "getBigDecimal(String)");
}

public Object getObjectImpl(String parameterName, java.util.Map map) throws SQLException {
public Object getObjectImpl(String parameterName, Map<String, Class<?>> map) throws SQLException {
throw Driver.notImplemented(this.getClass(), "getObject(String,Map)");
}

@@ -547,7 +547,7 @@ private void setPGobject(int parameterIndex, PGobject x) throws SQLException {
}
}

private void setMap(int parameterIndex, Map x) throws SQLException {
private void setMap(int parameterIndex, Map<?, ?> x) throws SQLException {
int oid = connection.getTypeInfo().getPGType("hstore");
if (oid == Oid.UNSPECIFIED) {
throw new PSQLException(GT.tr("No hstore extension installed."),
@@ -1033,7 +1033,7 @@ public void setObject(int parameterIndex, Object x) throws SQLException {
setTimestamp(parameterIndex, (OffsetDateTime) x);
//#endif
} else if (x instanceof Map) {
setMap(parameterIndex, (Map) x);
setMap(parameterIndex, (Map<?, ?>) x);
} else {
// Can't infer a type.
throw new PSQLException(GT.tr(
@@ -34,8 +34,8 @@ public static Object instantiate(String classname, Properties info, boolean tryS
IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetException {
Object[] args = {info};
Constructor ctor = null;
Class cls;
Constructor<?> ctor = null;
Class<?> cls;
cls = Class.forName(classname);
try {
ctor = cls.getConstructor(new Class[]{Properties.class});

0 comments on commit 88e39a0

Please sign in to comment.
You can’t perform that action at this time.