# HG changeset patch # User Martin van Dinther <martin.van.dinther@monetdbsolutions.com> # Date 1542888773 -3600 # Node ID 529b92d09fc62cf920774393dc189b6cdeb50b30 # Parent 37b537a7ad60ac44e4da4e0cb02c9a10ec309f9c Resolve compilation warnings when compiled with javac -Xlint such as: tests/SQLcopyinto.java:93: warning: [rawtypes] found raw type: List List warning = server.connect(host, port, login, passw); ^ missing type arguments for generic class List<E> where E is a type-variable: E extends Object declared in interface List tests/SQLcopyinto.java:95: warning: [rawtypes] found raw type: Iterator for (Iterator it = warning.iterator(); it.hasNext(); ) { ^ missing type arguments for generic class Iterator<E> where E is a type-variable: E extends Object declared in interface Iterator diff --git a/example/MJDBCTest.java b/example/MJDBCTest.java --- a/example/MJDBCTest.java +++ b/example/MJDBCTest.java @@ -18,7 +18,7 @@ import java.sql.*; public class MJDBCTest { public static void main(String[] args) throws Exception { String MonetDB_JDBC_URL = "jdbc:monetdb://localhost:50000/demo"; // change host, port and databasename - Connection con; + Connection con = null; try { con = DriverManager.getConnection(MonetDB_JDBC_URL, "monetdb", "monetdb"); } catch (SQLException e) { diff --git a/tests/SQLcopyinto.java b/tests/SQLcopyinto.java --- a/tests/SQLcopyinto.java +++ b/tests/SQLcopyinto.java @@ -90,9 +90,9 @@ public class SQLcopyinto { // System.out.println("host: " + host + " port: " + port + " login: " + login + " passwd: " + passw); System.out.println("Before connecting to MonetDB server via MapiSocket"); - List warning = server.connect(host, port, login, passw); + List<String> warning = server.connect(host, port, login, passw); if (warning != null) { - for (Iterator it = warning.iterator(); it.hasNext(); ) { + for (Iterator<String> it = warning.iterator(); it.hasNext(); ) { System.out.println("Warning: " + it.next().toString()); } } diff --git a/tests/Test_Rmetadata.java b/tests/Test_Rmetadata.java --- a/tests/Test_Rmetadata.java +++ b/tests/Test_Rmetadata.java @@ -74,10 +74,10 @@ public class Test_Rmetadata { } private static String isInstance(Object obj, String type) { - if (obj == null) + if (obj == null || type == null) return("(null)"); try { - Class c = Class.forName(type); + Class<?> c = Class.forName(type); if (c.isInstance(obj)) { return(obj.getClass().getName() + " is an instance of " + type); } else {