Mercurial > hg > release > icedtea7-forest-2.4 > jdk
changeset 7229:0ba8fdfc5660
Merge
author | asaha |
---|---|
date | Wed, 30 Oct 2013 12:40:26 -0700 |
parents | 348f5dd4bce0 (current diff) 64443e2a6000 (diff) |
children | 933fa343a0bc |
files | |
diffstat | 12 files changed, 88 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Wed Oct 30 12:40:26 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, 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 @@ -37,6 +37,7 @@ import javax.sql.rowset.serial.*; import com.sun.rowset.internal.*; import com.sun.rowset.providers.*; +import sun.reflect.misc.ReflectUtil; /** * The standard implementation of the <code>CachedRowSet</code> interface. @@ -2963,13 +2964,9 @@ // create new instance of the class SQLData obj = null; try { - obj = (SQLData)c.newInstance(); - } catch (java.lang.InstantiationException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - ex.getMessage())); - } catch (java.lang.IllegalAccessException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - 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); @@ -5714,13 +5711,9 @@ // create new instance of the class SQLData obj = null; try { - obj = (SQLData)c.newInstance(); - } catch (java.lang.InstantiationException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - ex.getMessage())); - } catch (java.lang.IllegalAccessException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - 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);
--- a/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java Wed Oct 30 12:40:26 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -39,6 +39,7 @@ import javax.sql.rowset.serial.SerialClob; import javax.sql.rowset.serial.SerialStruct; import javax.sql.rowset.spi.*; +import sun.reflect.misc.ReflectUtil; /** @@ -578,13 +579,9 @@ // create new instance of the class SQLData obj = null; try { - obj = (SQLData)c.newInstance(); - } catch (java.lang.InstantiationException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - ex.getMessage())); - } catch (java.lang.IllegalAccessException ex) { - throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(), - 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);
--- a/src/share/classes/javax/sql/rowset/RowSetProvider.java Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/classes/javax/sql/rowset/RowSetProvider.java Wed Oct 30 12:40:26 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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.sql.SQLException; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; +import sun.reflect.misc.ReflectUtil; /** * A factory API that enables applications to obtain a @@ -127,15 +128,11 @@ factoryClassName = getSystemProperty(ROWSET_FACTORY_NAME); if (factoryClassName != null) { trace("Found system property, value=" + factoryClassName); - factory = (RowSetFactory) getFactoryClass(factoryClassName, null, true).newInstance(); + factory = (RowSetFactory) ReflectUtil.newInstance(getFactoryClass(factoryClassName, null, true)); } - } catch (ClassNotFoundException e) { - throw new SQLException( - "RowSetFactory: " + factoryClassName + " not found", e); - } catch (Exception e) { - throw new SQLException( - "RowSetFactory: " + factoryClassName + " could not be instantiated: " + e, - e); + } catch (Exception e) { + throw new SQLException( "RowSetFactory: " + factoryClassName + + " could not be instantiated: ", e); } // Check to see if we found the RowSetFactory via a System property @@ -180,6 +177,16 @@ throws SQLException { trace("***In newInstance()"); + + if(factoryClassName == null) { + throw new SQLException("Error: factoryClassName cannot be null"); + } + try { + ReflectUtil.checkPackageAccess(factoryClassName); + } catch (java.security.AccessControlException e) { + throw new SQLException("Access Exception",e); + } + try { Class providerClass = getFactoryClass(factoryClassName, cl, false); RowSetFactory instance = (RowSetFactory) providerClass.newInstance(); @@ -292,6 +299,7 @@ }); } catch (SecurityException se) { if (debug) { + trace("error getting " + propName + ": "+ se); se.printStackTrace(); } }
--- a/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Wed Oct 30 12:40:26 2013 -0700 @@ -37,8 +37,11 @@ import java.io.FileNotFoundException; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import javax.naming.*; +import sun.reflect.misc.ReflectUtil; /** * The Service Provider Interface (SPI) mechanism that generates <code>SyncProvider</code> @@ -343,7 +346,7 @@ // Local implementation class names and keys from Properties // file, translate names into Class objects using Class.forName // and store mappings - Properties properties = new Properties(); + final Properties properties = new Properties(); if (implementations == null) { implementations = new Hashtable(); @@ -372,6 +375,7 @@ } }); } catch (Exception ex) { + System.out.println("errorget rowset.properties: " + ex); strRowsetProperties = null; } if (strRowsetProperties != null) { @@ -391,16 +395,33 @@ strFileSep + "rowset" + strFileSep + "rowset.properties"; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); + final ClassLoader cl = Thread.currentThread().getContextClassLoader(); - try (InputStream stream = - (cl == null) ? ClassLoader.getSystemResourceAsStream(ROWSET_PROPERTIES) - : cl.getResourceAsStream(ROWSET_PROPERTIES)) { - if (stream == null) { - throw new SyncFactoryException( - "Resource " + ROWSET_PROPERTIES + " not found"); + try { + AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override + public Void run() throws SyncFactoryException, IOException, FileNotFoundException { + try (InputStream stream = (cl == null) ? + ClassLoader.getSystemResourceAsStream(ROWSET_PROPERTIES) + : cl.getResourceAsStream(ROWSET_PROPERTIES)) { + if (stream == null) { + throw new SyncFactoryException("Resource " + ROWSET_PROPERTIES + " not found"); + } + properties.load(stream); + } + return null; + } + + }); + } catch (PrivilegedActionException ex) { + Throwable e = ex.getException(); + if (e instanceof SyncFactoryException) { + throw (SyncFactoryException) e; + } else { + SyncFactoryException sfe = new SyncFactoryException(); + sfe.initCause(ex.getException()); + throw sfe; } - properties.load(stream); } parseProperties(properties); @@ -560,6 +581,13 @@ return new com.sun.rowset.providers.RIOptimisticProvider(); } + try { + ReflectUtil.checkPackageAccess(providerID); + } catch (java.security.AccessControlException e) { + SyncFactoryException sfe = new SyncFactoryException(); + sfe.initCause(e); + throw sfe; + } // Attempt to invoke classname from registered SyncProvider list Class c = null; try { @@ -568,7 +596,7 @@ /** * The SyncProvider implementation of the user will be in * the classpath. We need to find the ClassLoader which loads - * this SyncFactory and try to laod the SyncProvider class from + * this SyncFactory and try to load the SyncProvider class from * there. **/ c = Class.forName(providerID, true, cl);
--- a/src/share/lib/security/java.security-linux Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/lib/security/java.security-linux Wed Oct 30 12:40:26 2013 -0700 @@ -130,6 +130,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -169,6 +170,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\
--- a/src/share/lib/security/java.security-macosx Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/lib/security/java.security-macosx Wed Oct 30 12:40:26 2013 -0700 @@ -131,6 +131,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -172,6 +173,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\
--- a/src/share/lib/security/java.security-solaris Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/lib/security/java.security-solaris Wed Oct 30 12:40:26 2013 -0700 @@ -132,6 +132,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -172,6 +173,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\
--- a/src/share/lib/security/java.security-windows Tue Oct 29 09:54:21 2013 -0700 +++ b/src/share/lib/security/java.security-windows Wed Oct 30 12:40:26 2013 -0700 @@ -131,6 +131,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -172,6 +173,7 @@ com.sun.jmx.,\ com.sun.naming.internal.,\ com.sun.proxy.,\ + com.sun.corba.se.,\ com.sun.script.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html Tue Oct 29 09:54:21 2013 -0700 +++ b/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html Wed Oct 30 12:40:26 2013 -0700 @@ -1,6 +1,5 @@ <html> -<!-- - +<!-- @test @bug 8005932 @summary Java 7 on mac os x only provides text clipboard formats @@ -9,10 +8,9 @@ @library ../../regtesthelpers/process @build Util @build ProcessResults ProcessCommunicator - + @run applet/othervm MissedHtmlAndRtfBug.html +--> - @run applet/othervm MissedHtmlAndRtfBug.html -*/> <head> <title>Java 7 on mac os x only provides text clipboard formats</title> </head>
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java Tue Oct 29 09:54:21 2013 -0700 +++ b/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java Wed Oct 30 12:40:26 2013 -0700 @@ -22,17 +22,10 @@ */ /* - @test - @bug 8005932 - @summary Java 7 on mac os x only provides text clipboard formats - @author mikhail.cherkasov@oracle.com - @library ../../regtesthelpers - @library ../../regtesthelpers/process - @build Util - @build ProcessResults ProcessCommunicator - - - @run applet/othervm MissedHtmlAndRtfBug.html + This is a part of MissedHtmlAndRtfBug.html test. Do not add any JTREG tags here + bug 8005932 + summary Java 7 on mac os x only provides text clipboard formats + author mikhail.cherkasov@oracle.com */ import java.awt.*; import java.awt.datatransfer.DataFlavor;
--- a/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java Tue Oct 29 09:54:21 2013 -0700 +++ b/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java Wed Oct 30 12:40:26 2013 -0700 @@ -39,13 +39,10 @@ import java.util.Hashtable; /* -@test -@bug 8010009 -@summary [macosx] Unable type into online word games on MacOSX -@author petr.pchelko : area=awt.keyboard -@run clean * -@run build TestApplet -@run applet/manual=yesno KeyReleasedInAppletTest.html + This is a part of test KeyReleasedInAppletTest.html. Do not add any JTREG tags here + bug 8010009 + summary [macosx] Unable type into online word games on MacOSX + author petr.pchelko : area=awt.keyboard */ public class KeyReleasedInAppletTest extends JApplet {
--- a/test/java/lang/SecurityManager/CheckPackageAccess.java Tue Oct 29 09:54:21 2013 -0700 +++ b/test/java/lang/SecurityManager/CheckPackageAccess.java Wed Oct 30 12:40:26 2013 -0700 @@ -56,6 +56,7 @@ "com.sun.jmx.", "com.sun.naming.internal.", "com.sun.proxy.", + "com.sun.corba.se.", "com.sun.org.apache.bcel.internal.", "com.sun.org.apache.regexp.internal.", "com.sun.org.apache.xerces.internal.",