OpenJDK / jdk8u / jdk8u / jdk
changeset 9023:46c8720ef36f
8022904: Enhance JDBC Parsers
Reviewed-by: alanb, skoivu
author | lancea |
---|---|
date | Wed, 21 Aug 2013 11:05:49 -0400 |
parents | 0dfcc99c6f5d |
children | 428288ee9c99 |
files | src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java src/share/classes/javax/sql/rowset/spi/SyncFactory.java |
diffstat | 2 files changed, 25 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java Fri Aug 16 17:57:27 2013 +0800 +++ b/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java Wed Aug 21 11:05:49 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, 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 @@ -660,7 +660,7 @@ //Added the handling for Class tags to take care of maps //Makes an entry into the map upon end of class tag try{ - typeMap.put(Key_map,Class.forName(Value_map)); + typeMap.put(Key_map,sun.reflect.misc.ReflectUtil.forName(Value_map)); }catch(ClassNotFoundException ex) { throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage()));
--- a/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Fri Aug 16 17:57:27 2013 +0800 +++ b/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Wed Aug 21 11:05:49 2013 -0400 @@ -35,6 +35,8 @@ import java.io.InputStream; import java.io.IOException; import java.io.FileNotFoundException; +import java.security.AccessController; +import java.security.PrivilegedAction; import javax.naming.*; @@ -348,7 +350,17 @@ /* * Dependent on application */ - String strRowsetProperties = System.getProperty("rowset.properties"); + String strRowsetProperties; + try { + strRowsetProperties = AccessController.doPrivileged(new PrivilegedAction<String>() { + public String run() { + return System.getProperty("rowset.properties"); + } + }, null, new PropertyPermission("rowset.properties","read")); + } catch (Exception ex) { + strRowsetProperties = null; + } + if (strRowsetProperties != null) { // Load user's implementation of SyncProvider // here. -Drowset.properties=/abc/def/pqr.txt @@ -393,7 +405,16 @@ * load additional properties from -D command line */ properties.clear(); - String providerImpls = System.getProperty(ROWSET_SYNC_PROVIDER); + String providerImpls; + try { + providerImpls = AccessController.doPrivileged(new PrivilegedAction<String>() { + public String run() { + return System.getProperty(ROWSET_SYNC_PROVIDER); + } + }, null, new PropertyPermission(ROWSET_SYNC_PROVIDER,"read")); + } catch (Exception ex) { + providerImpls = null; + } if (providerImpls != null) { int i = 0;