提交 2f66a543 编写于 作者: L lancea

7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC

Reviewed-by: alanb, smarks
上级 53ade9d3
...@@ -2039,6 +2039,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -2039,6 +2039,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* the cursor is not on a valid row, or this method fails * the cursor is not on a valid row, or this method fails
* @deprecated * @deprecated
*/ */
@Deprecated
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
Object value; Object value;
BigDecimal bDecimal, retVal; BigDecimal bDecimal, retVal;
...@@ -2374,6 +2375,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -2374,6 +2375,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @throws SQLException if an error occurs * @throws SQLException if an error occurs
* @deprecated * @deprecated
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
// always free an old stream // always free an old stream
unicodeStream = null; unicodeStream = null;
...@@ -2643,6 +2645,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -2643,6 +2645,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @deprecated Use the <code>getBigDecimal(String columnName)</code> * @deprecated Use the <code>getBigDecimal(String columnName)</code>
* method instead * method instead
*/ */
@Deprecated
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
return getBigDecimal(getColIdxByName(columnName), scale); return getBigDecimal(getColIdxByName(columnName), scale);
} }
...@@ -2774,6 +2777,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -2774,6 +2777,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* this rowset's rows or its insert row * this rowset's rows or its insert row
* @deprecated use the method <code>getCharacterStream</code> instead * @deprecated use the method <code>getCharacterStream</code> instead
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
return getUnicodeStream(getColIdxByName(columnName)); return getUnicodeStream(getColIdxByName(columnName));
} }
......
...@@ -1016,6 +1016,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { ...@@ -1016,6 +1016,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
* prepared statement, and result set * prepared statement, and result set
* @deprecated * @deprecated
*/ */
@Deprecated
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
checkState(); checkState();
...@@ -1154,6 +1155,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { ...@@ -1154,6 +1155,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
* @deprecated use <code>getCharacterStream</code> in place of * @deprecated use <code>getCharacterStream</code> in place of
* <code>getUnicodeStream</code> * <code>getUnicodeStream</code>
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
checkState(); checkState();
...@@ -1336,6 +1338,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { ...@@ -1336,6 +1338,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
* prepared statement, and result set * prepared statement, and result set
* @deprecated * @deprecated
*/ */
@Deprecated
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
return getBigDecimal(findColumn(columnName), scale); return getBigDecimal(findColumn(columnName), scale);
} }
...@@ -1461,6 +1464,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { ...@@ -1461,6 +1464,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
* prepared statement, and result set * prepared statement, and result set
* @deprecated * @deprecated
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
return getUnicodeStream(findColumn(columnName)); return getUnicodeStream(findColumn(columnName));
} }
......
...@@ -1153,6 +1153,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -1153,6 +1153,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* the cursor is not on a valid row, or this method fails * the cursor is not on a valid row, or this method fails
* @deprecated * @deprecated
*/ */
@Deprecated
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
return crsInternal.getBigDecimal(columnIndex); return crsInternal.getBigDecimal(columnIndex);
} }
...@@ -1264,6 +1265,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -1264,6 +1265,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* @throws SQLException if an error occurs * @throws SQLException if an error occurs
* @deprecated * @deprecated
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
return crsInternal.getUnicodeStream(columnIndex); return crsInternal.getUnicodeStream(columnIndex);
} }
...@@ -1436,6 +1438,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -1436,6 +1438,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* @deprecated use the method <code>getBigDecimal(String columnName)</code> * @deprecated use the method <code>getBigDecimal(String columnName)</code>
* instead * instead
*/ */
@Deprecated
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
return crsInternal.getBigDecimal(columnName); return crsInternal.getBigDecimal(columnName);
} }
...@@ -1552,6 +1555,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -1552,6 +1555,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* this rowset's rows or its insert row * this rowset's rows or its insert row
* @deprecated use the method <code>getCharacterStream</code> instead * @deprecated use the method <code>getCharacterStream</code> instead
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
return crsInternal.getUnicodeStream(columnName); return crsInternal.getUnicodeStream(columnName);
} }
......
...@@ -1288,6 +1288,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { ...@@ -1288,6 +1288,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* the cursor is not on a valid row, or this method fails * the cursor is not on a valid row, or this method fails
* @deprecated * @deprecated
*/ */
@Deprecated
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -1424,6 +1425,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { ...@@ -1424,6 +1425,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* @throws SQLException if an error occurs * @throws SQLException if an error occurs
* @deprecated * @deprecated
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -1653,6 +1655,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { ...@@ -1653,6 +1655,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* @deprecated Use the <code>getBigDecimal(String columnName)</code> * @deprecated Use the <code>getBigDecimal(String columnName)</code>
* method instead * method instead
*/ */
@Deprecated
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -1784,6 +1787,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { ...@@ -1784,6 +1787,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* this rowset's rows or its insert row * this rowset's rows or its insert row
* @deprecated use the method <code>getCharacterStream</code> instead * @deprecated use the method <code>getCharacterStream</code> instead
*/ */
@Deprecated
public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
......
...@@ -295,6 +295,7 @@ public interface CallableStatement extends PreparedStatement { ...@@ -295,6 +295,7 @@ public interface CallableStatement extends PreparedStatement {
* or <code>getBigDecimal(String parameterName)</code> * or <code>getBigDecimal(String parameterName)</code>
* @see #setBigDecimal * @see #setBigDecimal
*/ */
@Deprecated
BigDecimal getBigDecimal(int parameterIndex, int scale) BigDecimal getBigDecimal(int parameterIndex, int scale)
throws SQLException; throws SQLException;
......
...@@ -51,6 +51,7 @@ public class Date extends java.util.Date { ...@@ -51,6 +51,7 @@ public class Date extends java.util.Date {
* @param day 1 to 31 * @param day 1 to 31
* @deprecated instead use the constructor <code>Date(long date)</code> * @deprecated instead use the constructor <code>Date(long date)</code>
*/ */
@Deprecated
public Date(int year, int month, int day) { public Date(int year, int month, int day) {
super(year, month, day); super(year, month, day);
} }
...@@ -179,6 +180,7 @@ public class Date extends java.util.Date { ...@@ -179,6 +180,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #setHours * @see #setHours
*/ */
@Deprecated
public int getHours() { public int getHours() {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
...@@ -191,6 +193,7 @@ public class Date extends java.util.Date { ...@@ -191,6 +193,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #setMinutes * @see #setMinutes
*/ */
@Deprecated
public int getMinutes() { public int getMinutes() {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
...@@ -203,6 +206,7 @@ public class Date extends java.util.Date { ...@@ -203,6 +206,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #setSeconds * @see #setSeconds
*/ */
@Deprecated
public int getSeconds() { public int getSeconds() {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
...@@ -215,6 +219,7 @@ public class Date extends java.util.Date { ...@@ -215,6 +219,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #getHours * @see #getHours
*/ */
@Deprecated
public void setHours(int i) { public void setHours(int i) {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
...@@ -227,6 +232,7 @@ public class Date extends java.util.Date { ...@@ -227,6 +232,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #getMinutes * @see #getMinutes
*/ */
@Deprecated
public void setMinutes(int i) { public void setMinutes(int i) {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
...@@ -239,6 +245,7 @@ public class Date extends java.util.Date { ...@@ -239,6 +245,7 @@ public class Date extends java.util.Date {
* @exception java.lang.IllegalArgumentException if this method is invoked * @exception java.lang.IllegalArgumentException if this method is invoked
* @see #getSeconds * @see #getSeconds
*/ */
@Deprecated
public void setSeconds(int i) { public void setSeconds(int i) {
throw new java.lang.IllegalArgumentException(); throw new java.lang.IllegalArgumentException();
} }
......
...@@ -412,13 +412,14 @@ public class DriverManager { ...@@ -412,13 +412,14 @@ public class DriverManager {
* method throws a <code>java.lang.SecurityException</code>. * method throws a <code>java.lang.SecurityException</code>.
* *
* @param out the new logging/tracing PrintStream; to disable, set to <code>null</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 * @throws SecurityException if a security manager exists and its
* <code>checkPermission</code> method denies setting the log stream * <code>checkPermission</code> method denies setting the log stream
* *
* @see SecurityManager#checkPermission * @see SecurityManager#checkPermission
* @see #getLogStream * @see #getLogStream
*/ */
@Deprecated
public static void setLogStream(java.io.PrintStream out) { public static void setLogStream(java.io.PrintStream out) {
SecurityManager sec = System.getSecurityManager(); SecurityManager sec = System.getSecurityManager();
...@@ -438,9 +439,10 @@ public class DriverManager { ...@@ -438,9 +439,10 @@ public class DriverManager {
* and all drivers. * and all drivers.
* *
* @return the logging/tracing PrintStream; if disabled, is <code>null</code> * @return the logging/tracing PrintStream; if disabled, is <code>null</code>
* @deprecated * @deprecated Use {@code getLogWriter)
* @see #setLogStream * @see #setLogStream
*/ */
@Deprecated
public static java.io.PrintStream getLogStream() { public static java.io.PrintStream getLogStream() {
return logStream; return logStream;
} }
......
...@@ -342,8 +342,9 @@ public interface PreparedStatement extends Statement { ...@@ -342,8 +342,9 @@ public interface PreparedStatement extends Statement {
* this method is called on a closed <code>PreparedStatement</code> * this method is called on a closed <code>PreparedStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method * this method
* @deprecated * @deprecated Use {@code setCharacterStream}
*/ */
@Deprecated
void setUnicodeStream(int parameterIndex, java.io.InputStream x, void setUnicodeStream(int parameterIndex, java.io.InputStream x,
int length) throws SQLException; int length) throws SQLException;
......
...@@ -356,8 +356,10 @@ public interface ResultSet extends Wrapper, AutoCloseable { ...@@ -356,8 +356,10 @@ public interface ResultSet extends Wrapper, AutoCloseable {
* called on a closed result set * called on a closed result set
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method * this method
* @deprecated * @deprecated Use {@code getBigDecimal(int columnIndex)}
* or {@code getBigDecimal(String columnLabel)}
*/ */
@Deprecated
BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException; BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
/** /**
...@@ -477,6 +479,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { ...@@ -477,6 +479,7 @@ public interface ResultSet extends Wrapper, AutoCloseable {
* @deprecated use <code>getCharacterStream</code> in place of * @deprecated use <code>getCharacterStream</code> in place of
* <code>getUnicodeStream</code> * <code>getUnicodeStream</code>
*/ */
@Deprecated
java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException; java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
/** /**
...@@ -641,8 +644,10 @@ public interface ResultSet extends Wrapper, AutoCloseable { ...@@ -641,8 +644,10 @@ public interface ResultSet extends Wrapper, AutoCloseable {
* called on a closed result set * called on a closed result set
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method * this method
* @deprecated * @deprecated Use {@code getBigDecimal(int columnIndex)}
* or {@code getBigDecimal(String columnLabel)}
*/ */
@Deprecated
BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException; BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException;
/** /**
...@@ -760,6 +765,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { ...@@ -760,6 +765,7 @@ public interface ResultSet extends Wrapper, AutoCloseable {
* this method * this method
* @deprecated use <code>getCharacterStream</code> instead * @deprecated use <code>getCharacterStream</code> instead
*/ */
@Deprecated
java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException; java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException;
/** /**
......
...@@ -2389,7 +2389,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { ...@@ -2389,7 +2389,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
* @deprecated getCharacterStream should be used in its place * @deprecated getCharacterStream should be used in its place
* @see #getParams * @see #getParams
*/ */
@Deprecated
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
Object unicodeStream[]; Object unicodeStream[];
checkParamIndex(parameterIndex); checkParamIndex(parameterIndex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册