Changeset: 8b7f26f21725 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b7f26f21725
Modified Files:
java/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
Branch: default
Log Message:
Resolving javac -Xlint warnings:
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:832: warning: [rawtypes]
found raw type: Map
Map map = getConnection().getTypeMap();
^
missing type arguments for generic class Map<K,V>
where K,V are type-variables:
K extends Object declared in interface Map
V extends Object declared in interface Map
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:833: warning: [rawtypes]
found raw type: Class
Class c;
^
missing type arguments for generic class Class<T>
where T is a type-variable:
T extends Object declared in class Class
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:1225: warning: [cast]
redundant cast to int
setCharacterStream(parameterIndex, reader, (int)0);
^
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:1873: warning: [cast]
redundant cast to int
setInt(parameterIndex, (int)(val ? 1 :
0));
^
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:1883: warning: [cast]
redundant cast to double
setDouble(parameterIndex, (double)(val
? 1.0 : 0.0));
^
./nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:2390: warning: [dep-ann]
deprecated item is not annotated with @Deprecated
public void setUnicodeStream(int parameterIndex, InputStream x, int
length)
^
6 warnings
diffs (49 lines):
diff --git a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -829,8 +829,8 @@ public class MonetPreparedStatement
*/
@Override
public String getParameterClassName(int param) throws
SQLException {
- Map map = getConnection().getTypeMap();
- Class c;
+ Map<String,Class<?>> map =
getConnection().getTypeMap();
+ Class<?> c;
if
(map.containsKey(monetdbType[getParamIdx(param)])) {
c =
(Class)map.get(monetdbType[getParamIdx(param)]);
} else {
@@ -1222,7 +1222,7 @@ public class MonetPreparedStatement
public void setCharacterStream(int parameterIndex, Reader reader)
throws SQLException
{
- setCharacterStream(parameterIndex, reader, (int)0);
+ setCharacterStream(parameterIndex, reader, 0);
}
/**
@@ -1870,7 +1870,7 @@ public class MonetPreparedStatement
setShort(parameterIndex, (short)(val ?
1 : 0));
break;
case Types.INTEGER:
- setInt(parameterIndex, (int)(val ? 1 :
0));
+ setInt(parameterIndex, (val ? 1 : 0));
// do not cast to (int) as it generates a compiler warning
break;
case Types.BIGINT:
setLong(parameterIndex, (long)(val ? 1
: 0));
@@ -1880,7 +1880,7 @@ public class MonetPreparedStatement
break;
case Types.FLOAT:
case Types.DOUBLE:
- setDouble(parameterIndex, (double)(val
? 1.0 : 0.0));
+ setDouble(parameterIndex, (val ? 1.0 :
0.0)); // do no cast to (double) as it generates a compiler warning
break;
case Types.DECIMAL:
case Types.NUMERIC:
@@ -2387,6 +2387,7 @@ public class MonetPreparedStatement
* @throws SQLException if a database access error occurs
*/
@Override
+ @Deprecated
public void setUnicodeStream(int parameterIndex, InputStream x, int
length)
throws SQLException
{
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list