changeset 721:b78d8167a997

Remove finalize() method as it is deprecated and marked for removal in a future JDK. See also: https://openjdk.org/jeps/421 Add missing documentation for connect() method.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 19 Jan 2023 18:55:10 +0100 (2023-01-19)
parents 99baab703566
children 9a243dce3b15
files src/main/java/org/monetdb/mcl/net/MapiSocket.java
diffstat 1 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/monetdb/mcl/net/MapiSocket.java
+++ b/src/main/java/org/monetdb/mcl/net/MapiSocket.java
@@ -263,6 +263,24 @@ public class MapiSocket {	/* cannot (yet
 		return connect(host, port, user, pass, true);
 	}
 
+	/**
+	 * Connects to the given host and port, logging in as the given
+	 * user.  If followRedirect is false, a RedirectionException is
+	 * thrown when a redirect is encountered.
+	 *
+	 * @param host the hostname, or null for the loopback address
+	 * @param port the port number (must be between 0 and 65535, inclusive)
+	 * @param user the username
+	 * @param pass the password
+	 * @param makeConnection whether a new socket connection needs to be created
+	 * @return A List with informational (warning) messages. If this
+	 *		list is empty; then there are no warnings.
+	 * @throws IOException if an I/O error occurs when creating the socket
+	 * @throws SocketException - if there is an error in the underlying protocol, such as a TCP error.
+	 * @throws UnknownHostException if the IP address of the host could not be determined
+	 * @throws MCLParseException if bogus data is received
+	 * @throws MCLException if an MCL related error occurs
+	 */
 	private List<String> connect(final String host, final int port, final String user, final String pass, final boolean makeConnection)
 		throws IOException, SocketException, UnknownHostException, MCLParseException, MCLException
 	{
@@ -1238,20 +1256,6 @@ public class MapiSocket {	/* cannot (yet
 		return new DownloadStream(fromMonet.getRaw(), toMonet, prependCr);
 	}
 
-	/**
-	 * Destructor called by garbage collector before destroying this
-	 * object tries to disconnect the MonetDB connection if it has not
-	 * been disconnected already.
-	 *
-	 * @deprecated (since="9")
-	 */
-	@Override
-	@Deprecated
-	protected void finalize() throws Throwable {
-		close();
-		super.finalize();
-	}
-
 
 	/**
 	 * Stream of data sent to the server