changeset 257:529b92d09fc6

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
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 22 Nov 2018 13:12:53 +0100 (2018-11-22)
parents 37b537a7ad60
children acf34e20a832
files example/MJDBCTest.java tests/SQLcopyinto.java tests/Test_Rmetadata.java
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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) {
--- 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());
 				}
 			}
--- 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 {