Changeset: 59bc8bebbfe9 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=59bc8bebbfe9
Modified Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
        src/main/java/nl/cwi/monetdb/mcl/net/MapiSocket.java
        tests/Bug_PrepStmtSetString_6382.java
Branch: default
Log Message:

Resolve javac -Xlint warnings when compiled on Java 9 or higher

nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:1823: warning: [deprecation] 
ROUND_HALF_UP in BigDecimal has been deprecated
                                                setLong(parameterIndex, 
bd.setScale(scale, BigDecimal.ROUND_HALF_UP).longValue());
                                                                                
                     ^
nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:1823: warning: [deprecation] 
setScale(int,int) in BigDecimal has been deprecated
                                                setLong(parameterIndex, 
bd.setScale(scale, BigDecimal.ROUND_HALF_UP).longValue());
                                                                          ^
nl/cwi/monetdb/jdbc/MonetPreparedStatement.java:2631: warning: [deprecation] 
finalize() in Object has been deprecated
        protected void finalize() {
                       ^
nl/cwi/monetdb/mcl/net/MapiSocket.java:1085: warning: [deprecation] finalize() 
in Object has been deprecated
        protected void finalize() throws Throwable {
                       ^
nl/cwi/monetdb/mcl/net/MapiSocket.java:1087: warning: [deprecation] finalize() 
in Object has been deprecated
                super.finalize();
                     ^
tests/Bug_PrepStmtSetString_6382.java:85: warning: [deprecation] Integer(int) 
in Integer has been deprecated
                        pstmt.setObject(1, new Integer(row));
                                           ^


diffs (60 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -1820,7 +1820,7 @@ public class MonetPreparedStatement
                                case Types.BIGINT:
                                        if (x instanceof BigDecimal) {
                                                BigDecimal bd = (BigDecimal)x;
-                                               setLong(parameterIndex, 
bd.setScale(scale, BigDecimal.ROUND_HALF_UP).longValue());
+                                               setLong(parameterIndex, 
bd.setScale(scale, java.math.RoundingMode.HALF_UP).longValue());
                                        } else {
                                                setLong(parameterIndex, 
num.longValue());
                                        }
@@ -2561,7 +2561,7 @@ public class MonetPreparedStatement
         * Note: This stream object can either be a standard Java stream object 
or
         * your own subclass that implements the standard interface.
         *
-        * @deprecated
+        * @deprecated Use setCharacterStream
         * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x a java.io.InputStream object that contains the Unicode
         *          parameter value as two-byte Unicode characters
@@ -2626,8 +2626,11 @@ public class MonetPreparedStatement
        /**
         * Call close to release the server-sided handle for this
         * PreparedStatement.
+        *
+        * @deprecated (since="9")
         */
        @Override
+       @Deprecated
        protected void finalize() {
                close();
        }
diff --git a/src/main/java/nl/cwi/monetdb/mcl/net/MapiSocket.java 
b/src/main/java/nl/cwi/monetdb/mcl/net/MapiSocket.java
--- a/src/main/java/nl/cwi/monetdb/mcl/net/MapiSocket.java
+++ b/src/main/java/nl/cwi/monetdb/mcl/net/MapiSocket.java
@@ -1080,8 +1080,11 @@ public final class MapiSocket {
         * 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();
diff --git a/tests/Bug_PrepStmtSetString_6382.java 
b/tests/Bug_PrepStmtSetString_6382.java
--- a/tests/Bug_PrepStmtSetString_6382.java
+++ b/tests/Bug_PrepStmtSetString_6382.java
@@ -82,7 +82,7 @@ public class Bug_PrepStmtSetString_6382 
 
                        /* also test generic setObject(int, String) */
                        row++;  // row 7
-                       pstmt.setObject(1, new Integer(row));
+                       pstmt.setObject(1, Integer.valueOf​(row));
                        pstmt.setObject(2, "row " + row);
                        pstmt.setObject(3, "{\"menu\": {\n    \"header\": \"SVG 
Viewer\",\n    \"items\": [\n        {\"id\": \"Open\"},\n        {\"id\": 
\"OpenNew\", \"label\": \"Open New\"},\n        null,\n        {\"id\": 
\"ZoomIn\", \"label\": \"Zoom In\"},\n        {\"id\": \"ZoomOut\", \"label\": 
\"Zoom Out\"},\n        {\"id\": \"OriginalView\", \"label\": \"Original 
View\"},\n        null,\n        {\"id\": \"Quality\"},\n        {\"id\": 
\"Pause\"},\n        {\"id\": \"Mute\"},\n        null,\n        {\"id\": 
\"Help\"},\n        {\"id\": \"About\", \"label\": \"About Adobe CVG 
Viewer...\"}\n    ]\n}}");
                        pstmt.setObject(4, 
"b39dc76e-4faf-4fd9-bc1e-17df48acf764");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to