();
}
public void startDocument() throws SAXException {
@@ -549,14 +549,14 @@
case PROPERTIES:
tempCommand = "";
- tag = ((Integer)propMap.get(name)).intValue();
+ tag = propMap.get(name);
if (tag == PropNullTag)
setNullValue(true);
else
setTag(tag);
break;
case METADATA:
- tag = ((Integer)colDefMap.get(name)).intValue();
+ tag = colDefMap.get(name);
if (tag == MetaNullTag)
setNullValue(true);
@@ -573,10 +573,10 @@
tempUpdate = "";
if(dataMap.get(name) == null) {
tag = NullTag;
- } else if(((Integer)dataMap.get(name)).intValue() == EmptyStringTag) {
+ } else if(dataMap.get(name) == EmptyStringTag) {
tag = EmptyStringTag;
} else {
- tag = ((Integer)dataMap.get(name)).intValue();
+ tag = dataMap.get(name);
}
if (tag == NullTag) {
@@ -630,6 +630,7 @@
*
* @exception SAXException if a general SAX error occurs
*/
+ @SuppressWarnings("fallthrough")
public void endElement(String uri, String lName, String qName) throws SAXException {
int tag;
@@ -644,13 +645,13 @@
}
try {
- tag = ((Integer)propMap.get(name)).intValue();
+ tag = propMap.get(name);
switch (tag) {
case KeycolsTag:
if (keyCols != null) {
int i[] = new int[keyCols.size()];
for (int j = 0; j < i.length; j++)
- i[j] = Integer.parseInt((String)keyCols.elementAt(j));
+ i[j] = Integer.parseInt(keyCols.elementAt(j));
rs.setKeyColumns(i);
}
break;
@@ -723,7 +724,7 @@
if(dataMap.get(name) == null) {
tag = NullTag;
} else {
- tag = ((Integer)dataMap.get(name)).intValue();
+ tag = dataMap.get(name);
}
switch (tag) {
case ColTag:
@@ -820,7 +821,7 @@
if (updates.size() > 0) {
try {
Object upd[];
- Iterator i = updates.iterator();
+ Iterator> i = updates.iterator();
while (i.hasNext()) {
upd = (Object [])i.next();
idx = ((Integer)upd[0]).intValue();
@@ -1075,7 +1076,7 @@
break;
case PropColumnTag:
if (keyCols == null)
- keyCols = new Vector();
+ keyCols = new Vector<>();
keyCols.add(s);
break;
case MapTag:
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/java/sql/Date.java
--- a/jdk/src/share/classes/java/sql/Date.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/java/sql/Date.java Fri Dec 02 19:33:54 2011 -0500
@@ -150,6 +150,7 @@
*
* @return a String in yyyy-mm-dd format
*/
+ @SuppressWarnings("deprecation")
public String toString () {
int year = super.getYear() + 1900;
int month = super.getMonth() + 1;
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/java/sql/DriverManager.java
--- a/jdk/src/share/classes/java/sql/DriverManager.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/java/sql/DriverManager.java Fri Dec 02 19:33:54 2011 -0500
@@ -80,7 +80,7 @@
// List of registered JDBC drivers
- private final static CopyOnWriteArrayList registeredDrivers = new CopyOnWriteArrayList();
+ private final static CopyOnWriteArrayList 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 getDrivers() {
- java.util.Vector result = new java.util.Vector();
+ java.util.Vector result = new java.util.Vector<>();
// Gets the classloader of the code that called this method, may
// be null.
@@ -621,15 +621,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 -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/java/sql/Time.java
--- a/jdk/src/share/classes/java/sql/Time.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/java/sql/Time.java Fri Dec 02 19:33:54 2011 -0500
@@ -115,6 +115,7 @@
*
* @return a String
in hh:mm:ss format
*/
+ @SuppressWarnings("deprecation")
public String toString () {
int hour = super.getHours();
int minute = super.getMinutes();
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/java/sql/Timestamp.java
--- a/jdk/src/share/classes/java/sql/Timestamp.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/java/sql/Timestamp.java Fri Dec 02 19:33:54 2011 -0500
@@ -271,6 +271,7 @@
* @return a String
object in
* yyyy-mm-dd hh:mm:ss.fffffffff
format
*/
+ @SuppressWarnings("deprecation")
public String toString () {
int year = super.getYear() + 1900;
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/StatementEvent.java
--- a/jdk/src/share/classes/javax/sql/StatementEvent.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/StatementEvent.java Fri Dec 02 19:33:54 2011 -0500
@@ -42,6 +42,7 @@
*/
public class StatementEvent extends EventObject {
+ static final long serialVersionUID = -8089573731826608315L;
private SQLException exception;
private PreparedStatement statement;
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
--- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Fri Dec 02 19:33:54 2011 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -619,8 +619,8 @@
checkforRowSetInterface();
if (listeners.isEmpty() == false) {
RowSetEvent event = new RowSetEvent((RowSet)this);
- for (Iterator i = listeners.iterator(); i.hasNext(); ) {
- ((RowSetListener)i.next()).cursorMoved(event);
+ for (RowSetListener rsl : listeners) {
+ rsl.cursorMoved(event);
}
}
}
@@ -644,8 +644,8 @@
checkforRowSetInterface();
if (listeners.isEmpty() == false) {
RowSetEvent event = new RowSetEvent((RowSet)this);
- for (Iterator i = listeners.iterator(); i.hasNext(); ) {
- ((RowSetListener)i.next()).rowChanged(event);
+ for (RowSetListener rsl : listeners) {
+ rsl.rowChanged(event);
}
}
}
@@ -669,8 +669,8 @@
checkforRowSetInterface();
if (listeners.isEmpty() == false) {
RowSetEvent event = new RowSetEvent((RowSet)this);
- for (Iterator i = listeners.iterator(); i.hasNext(); ) {
- ((RowSetListener)i.next()).rowSetChanged(event);
+ for (RowSetListener rsl : listeners) {
+ rsl.rowSetChanged(event);
}
}
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
--- a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Fri Dec 02 19:33:54 2011 -0500
@@ -97,7 +97,7 @@
*/
private void checkColType(int SQLType) throws SQLException {
try {
- Class c = java.sql.Types.class;
+ Class> c = java.sql.Types.class;
Field[] publicFields = c.getFields();
int fieldValue = 0;
for (int i = 0; i < publicFields.length; i++) {
@@ -1091,5 +1091,7 @@
*@serial
*/
public boolean writable = true;
+
+ static final long serialVersionUID = 5490834817919311283L;
}
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java
--- a/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java Fri Dec 02 19:33:54 2011 -0500
@@ -181,7 +181,7 @@
trace("***In newInstance()");
try {
- Class providerClass = getFactoryClass(factoryClassName, cl, false);
+ Class> providerClass = getFactoryClass(factoryClassName, cl, false);
RowSetFactory instance = (RowSetFactory) providerClass.newInstance();
if (debug) {
trace("Created new instance of " + providerClass +
@@ -229,7 +229,7 @@
* context class loader followed by the current class loader.
* @return The class which was loaded
*/
- static private Class getFactoryClass(String factoryClassName, ClassLoader cl,
+ static private Class> getFactoryClass(String factoryClassName, ClassLoader cl,
boolean doFallback) throws ClassNotFoundException {
try {
if (cl == null) {
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java Fri Dec 02 19:33:54 2011 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,9 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-
package javax.sql.rowset.serial;
import java.sql.*;
-import javax.sql.*;
-import java.io.*;
-import java.math.*;
import java.util.Map;
/**
@@ -91,7 +87,7 @@
* SQLData
(the Java class that defines how the UDT
* will be mapped).
*/
- private Map map;
+ private Map> map;
/**
@@ -279,7 +275,7 @@
if (attrib == null) {
lastValueWasNull = true;
- return (int)0;
+ return 0;
} else {
lastValueWasNull = false;
return attrib.intValue();
@@ -591,7 +587,7 @@
* position; or if there are no further values in the stream.
*/
public Object readObject() throws SQLException {
- Object attrib = (Object)getNextAttribute();
+ Object attrib = getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
@@ -601,7 +597,7 @@
if (attrib instanceof Struct) {
Struct s = (Struct)attrib;
// look up the class in the map
- Class c = (Class)map.get(s.getSQLTypeName());
+ Class> c = map.get(s.getSQLTypeName());
if (c != null) {
// create new instance of the class
SQLData obj = null;
@@ -620,10 +616,10 @@
SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
// read the values...
obj.readSQL(sqlInput, s.getSQLTypeName());
- return (Object)obj;
+ return obj;
}
}
- return (Object)attrib;
+ return attrib;
}
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java Fri Dec 02 19:33:54 2011 -0500
@@ -60,6 +60,7 @@
* A reference to an existing vector that
* contains the attributes of a Struct
object.
*/
+ @SuppressWarnings("rawtypes")
private Vector attribs;
/**
@@ -70,6 +71,7 @@
* method will in turn call the appropriate
* SQLOutputImpl
writer methods.
*/
+ @SuppressWarnings("rawtypes")
private Map map;
/**
@@ -121,6 +123,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeString(String x) throws SQLException {
//System.out.println("Adding :"+x);
attribs.add(x);
@@ -136,6 +139,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeBoolean(boolean x) throws SQLException {
attribs.add(Boolean.valueOf(x));
}
@@ -150,6 +154,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeByte(byte x) throws SQLException {
attribs.add(Byte.valueOf(x));
}
@@ -164,6 +169,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeShort(short x) throws SQLException {
attribs.add(Short.valueOf(x));
}
@@ -178,6 +184,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeInt(int x) throws SQLException {
attribs.add(Integer.valueOf(x));
}
@@ -192,6 +199,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeLong(long x) throws SQLException {
attribs.add(Long.valueOf(x));
}
@@ -206,6 +214,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeFloat(float x) throws SQLException {
attribs.add(new Float(x));
}
@@ -220,6 +229,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeDouble(double x) throws SQLException{
attribs.add(new Double(x));
}
@@ -234,6 +244,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeBigDecimal(java.math.BigDecimal x) throws SQLException{
attribs.add(x);
}
@@ -249,6 +260,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeBytes(byte[] x) throws SQLException {
attribs.add(x);
}
@@ -263,6 +275,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeDate(java.sql.Date x) throws SQLException {
attribs.add(x);
}
@@ -277,6 +290,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeTime(java.sql.Time x) throws SQLException {
attribs.add(x);
}
@@ -291,6 +305,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeTimestamp(java.sql.Timestamp x) throws SQLException {
attribs.add(x);
}
@@ -305,6 +320,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeCharacterStream(java.io.Reader x) throws SQLException {
BufferedReader bufReader = new BufferedReader(x);
try {
@@ -334,6 +350,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeAsciiStream(java.io.InputStream x) throws SQLException {
BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
try {
@@ -363,6 +380,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeBinaryStream(java.io.InputStream x) throws SQLException {
BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
try {
@@ -414,6 +432,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeObject(SQLData x) throws SQLException {
/*
@@ -434,7 +453,7 @@
* the name of this class otherwise we don't know
* what to re-instantiate during readSQL()
*/
- attribs.add(new SerialStruct((SQLData)x, map));
+ attribs.add(new SerialStruct(x, map));
}
/**
@@ -448,6 +467,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeRef(Ref x) throws SQLException {
if (x == null) {
attribs.add(x);
@@ -467,6 +487,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeBlob(Blob x) throws SQLException {
if (x == null) {
attribs.add(x);
@@ -486,6 +507,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeClob(Clob x) throws SQLException {
if (x == null) {
attribs.add(x);
@@ -511,6 +533,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeStruct(Struct x) throws SQLException {
SerialStruct s = new SerialStruct(x,map);;
attribs.add(s);
@@ -528,6 +551,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeArray(Array x) throws SQLException {
if (x == null) {
attribs.add(x);
@@ -547,6 +571,7 @@
* use by a SQLData
object attempting to write the attribute
* values of a UDT to the database.
*/
+ @SuppressWarnings("unchecked")
public void writeURL(java.net.URL url) throws SQLException {
if (url == null) {
attribs.add(url);
@@ -570,6 +595,7 @@
* @exception SQLException if a database access error occurs
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public void writeNString(String x) throws SQLException {
throw new UnsupportedOperationException("Operation not supported");
}
@@ -583,6 +609,7 @@
* @exception SQLException if a database access error occurs
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public void writeNClob(NClob x) throws SQLException {
throw new UnsupportedOperationException("Operation not supported");
}
@@ -597,6 +624,7 @@
* @exception SQLException if a database access error occurs
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public void writeRowId(RowId x) throws SQLException {
throw new UnsupportedOperationException("Operation not supported");
}
@@ -611,6 +639,7 @@
* @exception SQLException if a database access error occurs
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public void writeSQLXML(SQLXML x) throws SQLException {
throw new UnsupportedOperationException("Operation not supported");
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java Fri Dec 02 19:33:54 2011 -0500
@@ -186,10 +186,8 @@
case java.sql.Types.JAVA_OBJECT:
for (int i = 0; i < len; i++) {
- elements[i] = new SerialJavaObject((Object)elements[i]);
+ elements[i] = new SerialJavaObject(elements[i]);
}
- default:
- ;
}
}
@@ -285,11 +283,10 @@
case java.sql.Types.JAVA_OBJECT:
for (int i = 0; i < len; i++) {
- elements[i] = new SerialJavaObject((Object)elements[i]);
+ elements[i] = new SerialJavaObject(elements[i]);
}
+ break;
- default:
- ;
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Fri Dec 02 19:33:54 2011 -0500
@@ -207,7 +207,7 @@
*/
public java.io.InputStream getBinaryStream() throws SerialException {
InputStream stream = new ByteArrayInputStream(buf);
- return (java.io.InputStream)stream;
+ return stream;
}
/**
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java Fri Dec 02 19:33:54 2011 -0500
@@ -142,14 +142,14 @@
* object. When there are multiple warnings, each warning is chained to the
* previous warning.
*/
- java.util.Vector chain;
+ java.util.Vector chain;
/**
* Registers the given warning.
*/
private void setWarning(RowSetWarning e) {
if (chain == null) {
- chain = new java.util.Vector();
+ chain = new java.util.Vector<>();
}
chain.add(e);
}
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java Fri Dec 02 19:33:54 2011 -0500
@@ -109,7 +109,7 @@
public Object getObject(java.util.Map> map)
throws SerialException
{
- map = new Hashtable(map);
+ map = new Hashtable>(map);
if (object != null) {
return map.get(object);
} else {
diff -r ffb869e392cf -r f9ad1aadf3fa jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java Fri Dec 02 16:29:19 2011 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java Fri Dec 02 19:33:54 2011 -0500
@@ -139,7 +139,7 @@
//set the type name
SQLTypeName = in.getSQLTypeName();
- Vector tmp = new Vector();
+ Vector