On Thu, Dec 1, 2011 at 10:08 PM, Lance Andersen - Oracle <lance.ander...@oracle.com> wrote:> Sadly, once i start digging, i found more changes :-(>> Here are the latest revisions with the additions/changes since the last review, http://cr.openjdk.java.net/~lancea/7116445/webrev.03: Lance,
I'd suggest also including the attached changes [1] to your current webrev to remove the remaining warnings from java.sql.*. [1]: http://dl.dropbox.com/u/23832908/openjdk/7116445-additions.patch Thanks, Dave
# HG changeset patch # Parent e8ad82e077de465ef90b928868796006db38d2b5 diff --git a/src/share/classes/java/sql/CallableStatement.java b/src/share/classes/java/sql/CallableStatement.java --- a/src/share/classes/java/sql/CallableStatement.java +++ b/src/share/classes/java/sql/CallableStatement.java @@ -295,6 +295,7 @@ * or <code>getBigDecimal(String parameterName)</code> * @see #setBigDecimal */ + @Deprecated BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException; diff --git a/src/share/classes/java/sql/Date.java b/src/share/classes/java/sql/Date.java --- a/src/share/classes/java/sql/Date.java +++ b/src/share/classes/java/sql/Date.java @@ -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(); } diff --git a/src/share/classes/java/sql/DriverManager.java b/src/share/classes/java/sql/DriverManager.java --- a/src/share/classes/java/sql/DriverManager.java +++ b/src/share/classes/java/sql/DriverManager.java @@ -80,7 +80,7 @@ // List of registered JDBC drivers - private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>(); + private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<>(); private static volatile int loginTimeout = 0; private static volatile java.io.PrintWriter logWriter = null; private static volatile java.io.PrintStream logStream = null; @@ -357,7 +357,7 @@ * @return the list of JDBC Drivers loaded by the caller's class loader */ public static java.util.Enumeration<Driver> getDrivers() { - java.util.Vector<Driver> result = new java.util.Vector<Driver>(); + java.util.Vector<Driver> result = new java.util.Vector<>(); // Gets the classloader of the code that called this method, may // be null. @@ -418,6 +418,7 @@ * @see SecurityManager#checkPermission * @see #getLogStream */ + @Deprecated public static void setLogStream(java.io.PrintStream out) { SecurityManager sec = System.getSecurityManager(); @@ -440,6 +441,7 @@ * @deprecated * @see #setLogStream */ + @Deprecated public static java.io.PrintStream getLogStream() { return logStream; } @@ -484,6 +486,7 @@ String drivers; try { drivers = AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { return System.getProperty("jdbc.drivers"); } @@ -497,10 +500,11 @@ // ServiceLoader.load() replaces the sun.misc.Providers() AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class); - Iterator driversIterator = loadedDrivers.iterator(); + Iterator<Driver> driversIterator = loadedDrivers.iterator(); /* Load these drivers, so that they can be instantiated. * It may be the case that the driver class may not be there @@ -621,15 +625,18 @@ this.driver = driver; } + @Override public boolean equals(Object other) { return (other instanceof DriverInfo) && this.driver == ((DriverInfo) other).driver; } + @Override public int hashCode() { return driver.hashCode(); } + @Override public String toString() { return ("driver[className=" + driver + "]"); } diff --git a/src/share/classes/java/sql/PreparedStatement.java b/src/share/classes/java/sql/PreparedStatement.java --- a/src/share/classes/java/sql/PreparedStatement.java +++ b/src/share/classes/java/sql/PreparedStatement.java @@ -344,6 +344,7 @@ * this method * @deprecated */ + @Deprecated void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException; diff --git a/src/share/classes/java/sql/ResultSet.java b/src/share/classes/java/sql/ResultSet.java --- a/src/share/classes/java/sql/ResultSet.java +++ b/src/share/classes/java/sql/ResultSet.java @@ -358,6 +358,7 @@ * this method * @deprecated */ + @Deprecated BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException; /** @@ -477,6 +478,7 @@ * @deprecated use <code>getCharacterStream</code> in place of * <code>getUnicodeStream</code> */ + @Deprecated java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException; /** @@ -643,6 +645,7 @@ * this method * @deprecated */ + @Deprecated BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException; /** @@ -760,6 +763,7 @@ * this method * @deprecated use <code>getCharacterStream</code> instead */ + @Deprecated java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException; /**