7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
authorlancea
Tue, 09 Oct 2012 08:58:27 -0400
changeset 14171 94eb36844bd7
parent 14170 c819974fc133
child 14172 fad44417edf8
7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC Reviewed-by: alanb, smarks
jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java
jdk/src/share/classes/java/sql/CallableStatement.java
jdk/src/share/classes/java/sql/Date.java
jdk/src/share/classes/java/sql/DriverManager.java
jdk/src/share/classes/java/sql/PreparedStatement.java
jdk/src/share/classes/java/sql/ResultSet.java
jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
--- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Tue Oct 09 08:58:27 2012 -0400
@@ -2039,6 +2039,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         Object value;
         BigDecimal bDecimal, retVal;
@@ -2374,6 +2375,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         // always free an old stream
         unicodeStream = null;
@@ -2643,6 +2645,7 @@
      * @deprecated Use the <code>getBigDecimal(String columnName)</code>
      *             method instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return getBigDecimal(getColIdxByName(columnName), scale);
     }
@@ -2774,6 +2777,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return getUnicodeStream(getColIdxByName(columnName));
     }
--- a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Tue Oct 09 08:58:27 2012 -0400
@@ -1016,6 +1016,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         checkState();
 
@@ -1154,6 +1155,7 @@
      * @deprecated use <code>getCharacterStream</code> in place of
      *              <code>getUnicodeStream</code>
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         checkState();
 
@@ -1336,6 +1338,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return getBigDecimal(findColumn(columnName), scale);
     }
@@ -1461,6 +1464,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return getUnicodeStream(findColumn(columnName));
     }
--- a/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Tue Oct 09 08:58:27 2012 -0400
@@ -1153,6 +1153,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         return crsInternal.getBigDecimal(columnIndex);
     }
@@ -1264,6 +1265,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         return crsInternal.getUnicodeStream(columnIndex);
     }
@@ -1436,6 +1438,7 @@
      * @deprecated use the method <code>getBigDecimal(String columnName)</code>
      *             instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return crsInternal.getBigDecimal(columnName);
     }
@@ -1552,6 +1555,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return crsInternal.getUnicodeStream(columnName);
     }
--- a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Tue Oct 09 08:58:27 2012 -0400
@@ -1288,6 +1288,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -1424,6 +1425,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -1653,6 +1655,7 @@
      * @deprecated Use the <code>getBigDecimal(String columnName)</code>
      *             method instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         throw new UnsupportedOperationException();
     }
@@ -1784,6 +1787,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         throw new UnsupportedOperationException();
     }
--- a/jdk/src/share/classes/java/sql/CallableStatement.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/java/sql/CallableStatement.java	Tue Oct 09 08:58:27 2012 -0400
@@ -295,6 +295,7 @@
      *             or <code>getBigDecimal(String parameterName)</code>
      * @see #setBigDecimal
      */
+    @Deprecated
     BigDecimal getBigDecimal(int parameterIndex, int scale)
         throws SQLException;
 
--- a/jdk/src/share/classes/java/sql/Date.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/java/sql/Date.java	Tue Oct 09 08:58:27 2012 -0400
@@ -51,6 +51,7 @@
      * @param day 1 to 31
      * @deprecated instead use the constructor <code>Date(long date)</code>
      */
+    @Deprecated
     public Date(int year, int month, int day) {
         super(year, month, day);
     }
@@ -179,6 +180,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setHours
     */
+    @Deprecated
     public int getHours() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -191,6 +193,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setMinutes
     */
+    @Deprecated
     public int getMinutes() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -203,6 +206,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setSeconds
     */
+    @Deprecated
     public int getSeconds() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -215,6 +219,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getHours
     */
+    @Deprecated
     public void setHours(int i) {
         throw new java.lang.IllegalArgumentException();
     }
@@ -227,6 +232,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getMinutes
     */
+    @Deprecated
     public void setMinutes(int i) {
         throw new java.lang.IllegalArgumentException();
     }
@@ -239,6 +245,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getSeconds
     */
+    @Deprecated
     public void setSeconds(int i) {
         throw new java.lang.IllegalArgumentException();
     }
--- a/jdk/src/share/classes/java/sql/DriverManager.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/java/sql/DriverManager.java	Tue Oct 09 08:58:27 2012 -0400
@@ -412,13 +412,14 @@
      * method throws a <code>java.lang.SecurityException</code>.
      *
      * @param out the new logging/tracing PrintStream; to disable, set to <code>null</code>
-     * @deprecated
+     * @deprecated Use {@code setLogWriter)
      * @throws SecurityException if a security manager exists and its
      *    <code>checkPermission</code> method denies setting the log stream
      *
      * @see SecurityManager#checkPermission
      * @see #getLogStream
      */
+    @Deprecated
     public static void setLogStream(java.io.PrintStream out) {
 
         SecurityManager sec = System.getSecurityManager();
@@ -438,9 +439,10 @@
      * and all drivers.
      *
      * @return the logging/tracing PrintStream; if disabled, is <code>null</code>
-     * @deprecated
+     * @deprecated  Use {@code getLogWriter)
      * @see #setLogStream
      */
+    @Deprecated
     public static java.io.PrintStream getLogStream() {
         return logStream;
     }
--- a/jdk/src/share/classes/java/sql/PreparedStatement.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/java/sql/PreparedStatement.java	Tue Oct 09 08:58:27 2012 -0400
@@ -342,8 +342,9 @@
      * this method is called on a closed <code>PreparedStatement</code>
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code setCharacterStream}
      */
+    @Deprecated
     void setUnicodeStream(int parameterIndex, java.io.InputStream x,
                           int length) throws SQLException;
 
--- a/jdk/src/share/classes/java/sql/ResultSet.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/java/sql/ResultSet.java	Tue Oct 09 08:58:27 2012 -0400
@@ -356,8 +356,10 @@
      *            called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code getBigDecimal(int columnIndex)}
+     *             or {@code getBigDecimal(String columnLabel)}
      */
+    @Deprecated
     BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
 
     /**
@@ -477,6 +479,7 @@
      * @deprecated use <code>getCharacterStream</code> in place of
      *              <code>getUnicodeStream</code>
      */
+    @Deprecated
     java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
 
     /**
@@ -641,8 +644,10 @@
      *            called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code getBigDecimal(int columnIndex)}
+     *             or {@code getBigDecimal(String columnLabel)}
      */
+    @Deprecated
     BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException;
 
     /**
@@ -760,6 +765,7 @@
      * this method
      * @deprecated use <code>getCharacterStream</code> instead
      */
+    @Deprecated
     java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException;
 
     /**
--- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Oct 09 13:28:32 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Oct 09 08:58:27 2012 -0400
@@ -2389,7 +2389,7 @@
      * @deprecated getCharacterStream should be used in its place
      * @see #getParams
      */
-
+    @Deprecated
     public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
         Object unicodeStream[];
         checkParamIndex(parameterIndex);