Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Use more generics #519

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,7 +13,7 @@ class CallableBatchResultHandler extends BatchResultHandler {
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 */
}
}
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)");
}

Expand Down
Expand Up @@ -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."),
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pgjdbc/src/main/java/org/postgresql/util/ObjectFactory.java
Expand Up @@ -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});
Expand Down