From 88c53b88411c455080271dcb6ed5d1072d26afed Mon Sep 17 00:00:00 2001 From: lancea Date: Fri, 15 Nov 2013 11:07:04 -0500 Subject: [PATCH] 8028385: Enhance RowSet Factory Reviewed-by: alanb, skoivu --- .../classes/javax/sql/rowset/serial/SQLInputImpl.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java b/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java index 95a9938a0..27a7d2003 100644 --- a/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java +++ b/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java @@ -27,6 +27,7 @@ package javax.sql.rowset.serial; import java.sql.*; import java.util.Arrays; import java.util.Map; +import sun.reflect.misc.ReflectUtil; /** * An input stream used for custom mapping user-defined types (UDTs). @@ -476,13 +477,9 @@ public class SQLInputImpl implements SQLInput { // create new instance of the class SQLData obj = null; try { - obj = (SQLData)c.newInstance(); - } catch (java.lang.InstantiationException ex) { - throw new SQLException("Unable to instantiate: " + - ex.getMessage()); - } catch (java.lang.IllegalAccessException ex) { - throw new SQLException("Unable to instantiate: " + - ex.getMessage()); + obj = (SQLData)ReflectUtil.newInstance(c); + } catch (Exception ex) { + throw new SQLException("Unable to Instantiate: ", ex); } // get the attributes from the struct Object attribs[] = s.getAttributes(map); -- GitLab