changeset 7237:add74b5b0d9f

8028385: Enhance RowSet Factory Reviewed-by: alanb, skoivu
author lancea
date Fri, 15 Nov 2013 11:19:36 -0500
parents ae3923aa13d3
children e0855171fee3
files src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java	Wed Nov 13 13:19:42 2013 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java	Fri Nov 15 11:19:36 2013 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -30,6 +30,7 @@
 import java.io.*;
 import java.math.*;
 import java.util.Map;
+import sun.reflect.misc.ReflectUtil;
 
 /**
  * An input stream used for custom mapping user-defined types (UDTs).
@@ -606,13 +607,9 @@
                     // 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);