--- old/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetWarning.java 2014-10-14 14:35:48.000000000 -0400 +++ new/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetWarning.java 2014-10-14 14:35:48.000000000 -0400 @@ -56,11 +56,6 @@ public class RowSetWarning extends SQLException { /** - * RowSetWarning object handle. - */ - private RowSetWarning rwarning; - - /** * Constructs a RowSetWarning object * with the given value for the reason; SQLState defaults to null, * and vendorCode defaults to 0. @@ -127,8 +122,16 @@ * null is returned (default value) * @see #setNextWarning */ - public RowSetWarning getNextWarning() { - return rwarning; + public RowSetWarning getNextWarning() { + try { + return RowSetWarning.class.cast(getNextException()); + } catch (ClassCastException ex) { + // The chained value isn't a RowSetWarning. + // This is a programming error by whoever added it to + // the RowSetWarning chain. We throw a Java "Error". + throw new Error("RowSetWarning chain holds value that is not a RowSetWarning"); + } + } /** @@ -141,7 +144,7 @@ * @see #getNextWarning */ public void setNextWarning(RowSetWarning warning) { - rwarning = warning; + setNextException(warning); } static final long serialVersionUID = 6678332766434564774L;