diff --git a/.hgtags b/.hgtags index 2e7fa07b9bc..6178c6775a6 100644 --- a/.hgtags +++ b/.hgtags @@ -207,3 +207,4 @@ e41d716405b209d3eddef8bd4240cec2bd34dcca jdk8-b81 bcebd3fdefc91abb9d7fa0c5af6211b3f8720da6 jdk8-b83 d7ad0dfaa41151bd3a9ae46725b0aec3730a9cd0 jdk8-b84 1872c12529090e1c1dbf567f02ad7ae6231b8f0c jdk8-b85 +da9a4c9312816451884aa6db6f18be51a07bff13 jdk8-b86 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 79dfea39159..ab78580039e 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -207,3 +207,4 @@ fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78 466685ba01bfb7bc1e1ac61490fd8c0f3cc18763 jdk8-b83 01f631f89fa392b4e484d0812c40ea8f9d2353aa jdk8-b84 7fc358f5943676b82f1dccd3152b1ac07d92e38b jdk8-b85 +df9b5240f0a76c91cfe1a5b39da4d08df56e05be jdk8-b86 diff --git a/corba/.hgtags b/corba/.hgtags index 9f302e595ef..3425d15c044 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -207,3 +207,4 @@ e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79 a45bb25a67c7517b45f00c9682e317f46fecbba9 jdk8-b83 928f8b888deb785cbd7bbd5f951cd6880f11f14e jdk8-b84 9583a6431596bac1959d2d8828f5ea217843dd12 jdk8-b85 +44a8ce4a759f2668ff434661a93ff462ea472478 jdk8-b86 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f22b56692f1..6a4db95d041 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -333,3 +333,4 @@ a947f40fb536e5b9e0aa210cf26abb430f80887a hs25-b26 42fe530cd478744a4d12a0cbf803f0fc804bab1a jdk8-b85 09b0d3e9ba6cdf7da07d4010d2d1df14596f6864 hs25-b27 6d88a566d369f6a1f86912cad7d0912686b2fda1 hs25-b28 +86db4847f195c0ecceea646431f1ff22d56282e8 jdk8-b86 diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 11ec37dc44d..9ed1efe7e2f 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -207,3 +207,4 @@ d5a58291f09a5081eaf22c2a6ab2f9ced4b78882 jdk8-b82 a46d69a1a8ec9652a48114823535372e1c980799 jdk8-b83 f5f40094ffcc1230e2a5f76ea4c968645369be6c jdk8-b84 41b50e2c5ea3f4aa1af729e1deb1678cb3e1ef9c jdk8-b85 +ca71ec37b2efc9c3f0971ebabb3a6eb1213d76de jdk8-b86 diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java b/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java index 1c0d54ebb75..4d28f2a92f5 100644 --- a/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java +++ b/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java @@ -63,6 +63,7 @@ import com.sun.org.apache.bcel.internal.util.SyntheticRepository; import com.sun.org.apache.bcel.internal.util.ClassVector; import com.sun.org.apache.bcel.internal.util.ClassQueue; import com.sun.org.apache.bcel.internal.generic.Type; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.*; import java.util.StringTokenizer; @@ -77,6 +78,7 @@ import java.util.StringTokenizer; * class file. Those interested in programatically generating classes * should see the ClassGen class. + * @version $Id: JavaClass.java,v 1.4 2007-07-19 04:34:42 ofung Exp $ * @see com.sun.org.apache.bcel.internal.generic.ClassGen * @author M. Dahm */ @@ -451,9 +453,9 @@ public class JavaClass extends AccessFlags implements Cloneable, Node { String debug = null, sep = null; try { - debug = System.getProperty("JavaClass.debug"); + debug = SecuritySupport.getSystemProperty("JavaClass.debug"); // Get path separator either / or \ usually - sep = System.getProperty("file.separator"); + sep = SecuritySupport.getSystemProperty("file.separator"); } catch (SecurityException e) { // falls through diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java index cb941bdc10e..5a9e094d460 100644 --- a/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java +++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java @@ -82,6 +82,7 @@ import com.sun.org.apache.bcel.internal.Constants; * method in the Method's frame will jump to the appropiate method in * the Code frame. * + * @version $Id: Class2HTML.java,v 1.3 2007-07-19 04:34:52 ofung Exp $ * @author M. Dahm */ public class Class2HTML implements Constants @@ -137,7 +138,7 @@ public class Class2HTML implements Constants ClassParser parser=null; JavaClass java_class=null; String zip_file = null; - char sep = System.getProperty("file.separator").toCharArray()[0]; + char sep = SecuritySupport.getSystemProperty("file.separator").toCharArray()[0]; String dir = "." + sep; // Where to store HTML files try { diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java index 41c27f8001e..0cd5021ddb1 100644 --- a/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java +++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java @@ -66,6 +66,7 @@ import java.io.*; * Responsible for loading (class) files from the CLASSPATH. Inspired by * sun.tools.ClassPath. * + * @version $Id: ClassPath.java,v 1.4 2007-07-19 04:34:52 ofung Exp $ * @author M. Dahm */ public class ClassPath implements Serializable { @@ -83,7 +84,7 @@ public class ClassPath implements Serializable { ArrayList vec = new ArrayList(); for(StringTokenizer tok=new StringTokenizer(class_path, - System.getProperty("path.separator")); + SecuritySupport.getSystemProperty("path.separator")); tok.hasMoreTokens();) { String path = tok.nextToken(); @@ -92,7 +93,7 @@ public class ClassPath implements Serializable { File file = new File(path); try { - if(file.exists()) { + if(SecuritySupport.getFileExists(file)) { if(file.isDirectory()) vec.add(new Dir(path)); else @@ -143,8 +144,9 @@ public class ClassPath implements Serializable { String name = tok.nextToken(); File file = new File(name); - if(file.exists()) + if(SecuritySupport.getFileExists(file)) { list.add(name); + } } } } @@ -159,9 +161,9 @@ public class ClassPath implements Serializable { String class_path, boot_path, ext_path; try { - class_path = System.getProperty("java.class.path"); - boot_path = System.getProperty("sun.boot.class.path"); - ext_path = System.getProperty("java.ext.dirs"); + class_path = SecuritySupport.getSystemProperty("java.class.path"); + boot_path = SecuritySupport.getSystemProperty("sun.boot.class.path"); + ext_path = SecuritySupport.getSystemProperty("java.ext.dirs"); } catch (SecurityException e) { return ""; @@ -176,8 +178,8 @@ public class ClassPath implements Serializable { getPathComponents(ext_path, dirs); for(Iterator e = dirs.iterator(); e.hasNext(); ) { - File ext_dir = new File((String)e.next()); - String[] extensions = ext_dir.list(new FilenameFilter() { + File ext_dir = new File((String)e.next()); + String[] extensions = SecuritySupport.getFileList(ext_dir, new FilenameFilter() { public boolean accept(File dir, String name) { name = name.toLowerCase(); return name.endsWith(".zip") || name.endsWith(".jar"); @@ -342,7 +344,7 @@ public class ClassPath implements Serializable { final File file = new File(dir + File.separatorChar + name.replace('.', File.separatorChar) + suffix); - return file.exists()? new ClassFile() { + return SecuritySupport.getFileExists(file)? new ClassFile() { public InputStream getInputStream() throws IOException { return new FileInputStream(file); } public String getPath() { try { diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java index e0d434ca2d0..1540f6d5c8b 100644 --- a/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java +++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java @@ -72,6 +72,7 @@ import java.lang.reflect.*; *
java com.sun.org.apache.bcel.internal.util.JavaWrapper -Dbcel.classloader=foo.MyLoader <real.class.name> [arguments]
*

* + * @version $Id: JavaWrapper.java,v 1.3 2007-07-19 04:34:52 ofung Exp $ * @author M. Dahm * @see ClassLoader */ @@ -79,7 +80,7 @@ public class JavaWrapper { private java.lang.ClassLoader loader; private static java.lang.ClassLoader getClassLoader() { - String s = System.getProperty("bcel.classloader"); + String s = SecuritySupport.getSystemProperty("bcel.classloader"); if((s == null) || "".equals(s)) s = "com.sun.org.apache.bcel.internal.util.ClassLoader"; diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java new file mode 100644 index 00000000000..22f8d39e124 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java @@ -0,0 +1,223 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/* + * Copyright 2002-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.sun.org.apache.bcel.internal.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FilenameFilter; +import java.io.InputStream; +import java.lang.ClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * This class is duplicated for each subpackage so keep it in sync. It is + * package private and therefore is not exposed as part of any API. + * + * @xerces.internal + */ +public final class SecuritySupport { + + private static final SecuritySupport securitySupport = new SecuritySupport(); + + /** + * Return an instance of this class. + */ + public static SecuritySupport getInstance() { + return securitySupport; + } + + static ClassLoader getContextClassLoader() { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); + } + + static ClassLoader getSystemClassLoader() { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + ClassLoader cl = null; + try { + cl = ClassLoader.getSystemClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); + } + + static ClassLoader getParentClassLoader(final ClassLoader cl) { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + ClassLoader parent = null; + try { + parent = cl.getParent(); + } catch (SecurityException ex) { + } + + // eliminate loops in case of the boot + // ClassLoader returning itself as a parent + return (parent == cl) ? null : parent; + } + }); + } + + public static String getSystemProperty(final String propName) { + return (String) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty(propName); + } + }); + } + + static FileInputStream getFileInputStream(final File file) + throws FileNotFoundException { + try { + return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws FileNotFoundException { + return new FileInputStream(file); + } + }); + } catch (PrivilegedActionException e) { + throw (FileNotFoundException) e.getException(); + } + } + + /** + * Return resource using the same classloader for the ObjectFactory by + * default or bootclassloader when Security Manager is in place + */ + public static InputStream getResourceAsStream(final String name) { + if (System.getSecurityManager() != null) { + return getResourceAsStream(null, name); + } else { + return getResourceAsStream(findClassLoader(), name); + } + } + + public static InputStream getResourceAsStream(final ClassLoader cl, + final String name) { + return (InputStream) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + InputStream ris; + if (cl == null) { + ris = Object.class.getResourceAsStream("/" + name); + } else { + ris = cl.getResourceAsStream(name); + } + return ris; + } + }); + } + + /** + * Gets a resource bundle using the specified base name, the default locale, + * and the caller's class loader. + * + * @param bundle the base name of the resource bundle, a fully qualified + * class name + * @return a resource bundle for the given base name and the default locale + */ + public static ListResourceBundle getResourceBundle(String bundle) { + return getResourceBundle(bundle, Locale.getDefault()); + } + + /** + * Gets a resource bundle using the specified base name and locale, and the + * caller's class loader. + * + * @param bundle the base name of the resource bundle, a fully qualified + * class name + * @param locale the locale for which a resource bundle is desired + * @return a resource bundle for the given base name and locale + */ + public static ListResourceBundle getResourceBundle(final String bundle, final Locale locale) { + return AccessController.doPrivileged(new PrivilegedAction() { + public ListResourceBundle run() { + try { + return (ListResourceBundle) ResourceBundle.getBundle(bundle, locale); + } catch (MissingResourceException e) { + try { + return (ListResourceBundle) ResourceBundle.getBundle(bundle, new Locale("en", "US")); + } catch (MissingResourceException e2) { + throw new MissingResourceException( + "Could not load any resource bundle by " + bundle, bundle, ""); + } + } + } + }); + } + + public static String[] getFileList(final File f, final FilenameFilter filter) { + return ((String[]) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return f.list(filter); + } + })); + } + + public static boolean getFileExists(final File f) { + return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return f.exists() ? Boolean.TRUE : Boolean.FALSE; + } + })).booleanValue(); + } + + static long getLastModified(final File f) { + return ((Long) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return new Long(f.lastModified()); + } + })).longValue(); + } + + + /** + * Figure out which ClassLoader to use. + */ + public static ClassLoader findClassLoader() + { + if (System.getSecurityManager()!=null) { + //this will ensure bootclassloader is used + return null; + } else { + return SecuritySupport.class.getClassLoader(); + } + } // findClassLoader():ClassLoader + + private SecuritySupport() { + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java index 2c2f3c1509c..00d11e97f51 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java @@ -22,68 +22,72 @@ */ package com.sun.org.apache.xalan.internal.res; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.util.ListResourceBundle; import com.sun.org.apache.xpath.internal.res.XPATHMessages; /** - * Sets things up for issuing error messages. This class is misnamed, and - * should be called XalanMessages, or some such. + * Sets things up for issuing error messages. This class is misnamed, and should + * be called XalanMessages, or some such. + * * @xsl.usage internal */ -public class XSLMessages extends XPATHMessages -{ +public class XSLMessages extends XPATHMessages { - /** The language specific resource object for Xalan messages. */ - private static ListResourceBundle XSLTBundle = null; + /** + * The language specific resource object for Xalan messages. + */ + private static ListResourceBundle XSLTBundle = null; + /** + * The class name of the Xalan error message string table. + */ + private static final String XSLT_ERROR_RESOURCES = + "com.sun.org.apache.xalan.internal.res.XSLTErrorResources"; - /** The class name of the Xalan error message string table. */ - private static final String XSLT_ERROR_RESOURCES = - "com.sun.org.apache.xalan.internal.res.XSLTErrorResources"; - - /** - * Creates a message from the specified key and replacement - * arguments, localized to the given locale. - * - * @param msgKey The key for the message text. - * @param args The arguments to be used as replacement text - * in the message created. - * - * @return The formatted message string. - */ - public static final String createMessage(String msgKey, Object args[]) //throws Exception - { - if (XSLTBundle == null) - XSLTBundle = loadResourceBundle(XSLT_ERROR_RESOURCES); - - if (XSLTBundle != null) + /** + * Creates a message from the specified key and replacement arguments, + * localized to the given locale. + * + * @param msgKey The key for the message text. + * @param args The arguments to be used as replacement text in the message + * created. + * + * @return The formatted message string. + */ + public static String createMessage(String msgKey, Object args[]) //throws Exception { - return createMsg(XSLTBundle, msgKey, args); + if (XSLTBundle == null) { + XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES); + } + + if (XSLTBundle != null) { + return createMsg(XSLTBundle, msgKey, args); + } else { + return "Could not load any resource bundles."; + } } - else - return "Could not load any resource bundles."; - } - /** - * Creates a message from the specified key and replacement - * arguments, localized to the given locale. - * - * @param msgKey The key for the message text. - * @param args The arguments to be used as replacement text - * in the message created. - * - * @return The formatted warning string. - */ - public static final String createWarning(String msgKey, Object args[]) //throws Exception - { - if (XSLTBundle == null) - XSLTBundle = loadResourceBundle(XSLT_ERROR_RESOURCES); - - if (XSLTBundle != null) + /** + * Creates a message from the specified key and replacement arguments, + * localized to the given locale. + * + * @param msgKey The key for the message text. + * @param args The arguments to be used as replacement text in the message + * created. + * + * @return The formatted warning string. + */ + public static String createWarning(String msgKey, Object args[]) //throws Exception { - return createMsg(XSLTBundle, msgKey, args); + if (XSLTBundle == null) { + XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES); + } + + if (XSLTBundle != null) { + return createMsg(XSLTBundle, msgKey, args); + } else { + return "Could not load any resource bundles."; + } } - else - return "Could not load any resource bundles."; - } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java index 65d4ae14f72..aea4fffa668 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java index 7700f049e85..d528a26f957 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_de extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java index f6031bf3d22..68fda6d4971 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_es extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java index 0b96e29db96..eb373095af1 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_fr extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java index fcddcebc84c..ff335021637 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_it extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java index 9556671f703..ed1a0243585 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_ja extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java index 49534e07009..9a57758af14 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_ko extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java index d4fafaf4524..62341a60b83 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java @@ -1449,68 +1449,5 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java index 12808a68aea..ee85426b0dc 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_sv extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java index e43497dcc48..1c3a0c7cc2c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java index 4e172c56f10..07ad5afa9c0 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java @@ -1448,68 +1448,4 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XSLTErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XSLTErrorResources) ResourceBundle.getBundle(className - + suffix, locale); } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XSLTErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - - -} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java index 8e489bb736d..ff9b1a6e6a5 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java @@ -54,6 +54,8 @@ public class ObjectFactory { // // Constants // + private static final String XALAN_INTERNAL = "com.sun.org.apache.xalan.internal"; + private static final String XERCES_INTERNAL = "com.sun.org.apache.xerces.internal"; // name of default properties file to look for in JDK's jre/lib directory private static final String DEFAULT_PROPERTIES_FILENAME = @@ -514,12 +516,17 @@ public class ObjectFactory { //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ - if (security != null){ + if (security != null){ + if (className.startsWith(XALAN_INTERNAL) || + className.startsWith(XERCES_INTERNAL)) { + cl = null; + } else { final int lastDot = className.lastIndexOf("."); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); - } + } + } }catch(SecurityException e){ throw e; } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java index 4437a488e6a..b813b4c0d28 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java @@ -32,10 +32,14 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; /** - * This class is duplicated for each subpackage so keep it in sync. - * It is package private and therefore is not exposed as part of any API. + * This class is duplicated for each subpackage so keep it in sync. It is + * package private and therefore is not exposed as part of any API. * * @xerces.internal */ @@ -51,39 +55,39 @@ public final class SecuritySupport { } static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { } + } catch (SecurityException ex) { + } return cl; } }); } static ClassLoader getSystemClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { ClassLoader cl = null; try { cl = ClassLoader.getSystemClassLoader(); - } catch (SecurityException ex) {} + } catch (SecurityException ex) { + } return cl; } }); } static ClassLoader getParentClassLoader(final ClassLoader cl) { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { + return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { ClassLoader parent = null; try { parent = cl.getParent(); - } catch (SecurityException ex) {} + } catch (SecurityException ex) { + } // eliminate loops in case of the boot // ClassLoader returning itself as a parent @@ -93,20 +97,25 @@ public final class SecuritySupport { } public static String getSystemProperty(final String propName) { - return (String) - AccessController.doPrivileged(new PrivilegedAction() { + return (String) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return System.getProperty(propName); } }); } + public static String getSystemProperty(final String propName, final String def) { + return (String) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty(propName, def); + } + }); + } + static FileInputStream getFileInputStream(final File file) - throws FileNotFoundException - { + throws FileNotFoundException { try { - return (FileInputStream) - AccessController.doPrivileged(new PrivilegedExceptionAction() { + return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } @@ -115,9 +124,10 @@ public final class SecuritySupport { throw (FileNotFoundException)e.getException(); } } + /** - * Return resource using the same classloader for the ObjectFactory by default - * or bootclassloader when Security Manager is in place + * Return resource using the same classloader for the ObjectFactory by + * default or bootclassloader when Security Manager is in place */ public static InputStream getResourceAsStream(final String name) { if (System.getSecurityManager()!=null) { @@ -128,10 +138,8 @@ public final class SecuritySupport { } public static InputStream getResourceAsStream(final ClassLoader cl, - final String name) - { - return (InputStream) - AccessController.doPrivileged(new PrivilegedAction() { + final String name) { + return (InputStream) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { InputStream ris; if (cl == null) { @@ -144,9 +152,40 @@ public final class SecuritySupport { }); } - static boolean getFileExists(final File f) { - return ((Boolean) - AccessController.doPrivileged(new PrivilegedAction() { + /** + * Gets a resource bundle using the specified base name, the default locale, and the caller's class loader. + * @param bundle the base name of the resource bundle, a fully qualified class name + * @return a resource bundle for the given base name and the default locale + */ + public static ListResourceBundle getResourceBundle(String bundle) { + return getResourceBundle(bundle, Locale.getDefault()); + } + + /** + * Gets a resource bundle using the specified base name and locale, and the caller's class loader. + * @param bundle the base name of the resource bundle, a fully qualified class name + * @param locale the locale for which a resource bundle is desired + * @return a resource bundle for the given base name and locale + */ + public static ListResourceBundle getResourceBundle(final String bundle, final Locale locale) { + return AccessController.doPrivileged(new PrivilegedAction() { + public ListResourceBundle run() { + try { + return (ListResourceBundle)ResourceBundle.getBundle(bundle, locale); + } catch (MissingResourceException e) { + try { + return (ListResourceBundle)ResourceBundle.getBundle(bundle, new Locale("en", "US")); + } catch (MissingResourceException e2) { + throw new MissingResourceException( + "Could not load any resource bundle by " + bundle, bundle, ""); + } + } + } + }); + } + + public static boolean getFileExists(final File f) { + return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return f.exists() ? Boolean.TRUE : Boolean.FALSE; } @@ -154,13 +193,14 @@ public final class SecuritySupport { } static long getLastModified(final File f) { - return ((Long) - AccessController.doPrivileged(new PrivilegedAction() { + return ((Long) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new Long(f.lastModified()); } })).longValue(); } - private SecuritySupport () {} + + private SecuritySupport() { + } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java index 11d2cdcdc46..928da3e9e9d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xslt; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.File; import java.io.FileWriter; @@ -574,7 +575,7 @@ public class EnvironmentCheck // Grab java version for later use try { - String javaVersion = System.getProperty("java.version"); + String javaVersion = SecuritySupport.getSystemProperty("java.version"); h.put("java.version", javaVersion); } @@ -593,7 +594,7 @@ public class EnvironmentCheck { // This is present in all JVM's - String cp = System.getProperty("java.class.path"); + String cp = SecuritySupport.getSystemProperty("java.class.path"); h.put("java.class.path", cp); @@ -603,7 +604,7 @@ public class EnvironmentCheck h.put(FOUNDCLASSES + "java.class.path", classpathJars); // Also check for JDK 1.2+ type classpaths - String othercp = System.getProperty("sun.boot.class.path"); + String othercp = SecuritySupport.getSystemProperty("sun.boot.class.path"); if (null != othercp) { @@ -617,7 +618,7 @@ public class EnvironmentCheck //@todo NOTE: We don't actually search java.ext.dirs for // *.jar files therein! This should be updated - othercp = System.getProperty("java.ext.dirs"); + othercp = SecuritySupport.getSystemProperty("java.ext.dirs"); if (null != othercp) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/Process.java b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/Process.java index 216c4cfee28..67aa7040834 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/Process.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/Process.java @@ -57,6 +57,7 @@ import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xalan.internal.res.XSLTErrorResources; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.ConfigurationError; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; //J2SE does not support Xalan interpretive /* @@ -180,7 +181,7 @@ public class Process java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true); java.io.PrintWriter dumpWriter = diagnosticsWriter; ResourceBundle resbundle = - (XSLMessages.loadResourceBundle( + (SecuritySupport.getResourceBundle( com.sun.org.apache.xml.internal.utils.res.XResourceBundle.ERROR_RESOURCES)); String flavor = "s2s"; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 3cf487aa4ef..80ce77bb8b8 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java @@ -410,7 +410,7 @@ public class Parser implements Constants, ContentHandler { } } catch (TypeCheckError e) { - reportError(ERROR, new ErrorMsg(e)); + reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } } @@ -430,7 +430,7 @@ public class Parser implements Constants, ContentHandler { } catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); - reportError(ERROR,new ErrorMsg(e)); + reportError(ERROR,new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } catch (SAXException e) { Throwable ex = e.getException(); @@ -438,15 +438,15 @@ public class Parser implements Constants, ContentHandler { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } - reportError(ERROR, new ErrorMsg(e)); + reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); - reportError(ERROR, new ErrorMsg(e)); + reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); - reportError(ERROR, new ErrorMsg(e)); + reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } return null; } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index e29915c0ecd..454027819b8 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -41,10 +41,12 @@ import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import com.sun.org.apache.bcel.internal.classfile.JavaClass; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; import com.sun.org.apache.xml.internal.dtm.DTM; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; @@ -278,7 +280,7 @@ public final class XSLTC { return compile(input, _className); } catch (IOException e) { - _parser.reportError(Constants.FATAL, new ErrorMsg(e)); + _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); return false; } } @@ -297,7 +299,7 @@ public final class XSLTC { return compile(input, name); } catch (IOException e) { - _parser.reportError(Constants.FATAL, new ErrorMsg(e)); + _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); return false; } } @@ -382,11 +384,11 @@ public final class XSLTC { } catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); - _parser.reportError(Constants.FATAL, new ErrorMsg(e)); + _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } catch (Error e) { if (_debug) e.printStackTrace(); - _parser.reportError(Constants.FATAL, new ErrorMsg(e)); + _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); } finally { _reader = null; // reset this here to be sure it is not re-used @@ -594,7 +596,7 @@ public final class XSLTC { */ public boolean setDestDirectory(String dstDirName) { final File dir = new File(dstDirName); - if (dir.exists() || dir.mkdirs()) { + if (SecuritySupport.getFileExists(dir) || dir.mkdirs()) { _destDir = dir; return true; } @@ -767,7 +769,7 @@ public final class XSLTC { String parentDir = outFile.getParent(); if (parentDir != null) { File parentFile = new File(parentDir); - if (!parentFile.exists()) + if (!SecuritySupport.getFileExists(parentFile)) parentFile.mkdirs(); } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java index d2e68d4c1f0..de3783997e2 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java @@ -997,7 +997,12 @@ public class ErrorMessages extends ListResourceBundle { "kilobytes. This is usually caused by templates in a stylesheet " + "that are very large. Try restructuring your stylesheet to use " + "smaller templates." - } + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "When Java security is enabled, " + + "support for deserializing TemplatesImpl is disabled." + + "This can be overridden by setting the jdk.xml.enableTemplatesImplDeserialization" + + " system property to true."} }; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java index 1b1a80d8eea..faa7e99c26a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; @@ -46,6 +47,8 @@ public final class ErrorMsg { Object[] _params = null; private boolean _isWarningError; + Throwable _cause; + // Compiler error messages public static final String MULTIPLE_STYLESHEET_ERR = "MULTIPLE_STYLESHEET_ERR"; public static final String TEMPLATE_REDEF_ERR = "TEMPLATE_REDEF_ERR"; @@ -165,6 +168,8 @@ public final class ErrorMsg { public static final String OUTLINE_ERR_METHOD_TOO_BIG = "OUTLINE_ERR_METHOD_TOO_BIG"; + public static final String DESERIALIZE_TRANSLET_ERR = "DESERIALIZE_TEMPLATES_ERR"; + // All error messages are localized and are stored in resource bundles. // This array and the following 4 strings are read from that bundle. private static ResourceBundle _bundle; @@ -175,7 +180,7 @@ public final class ErrorMsg { public final static String RUNTIME_ERROR_KEY = "RUNTIME_ERROR_KEY"; static { - _bundle = ResourceBundle.getBundle( + _bundle = SecuritySupport.getResourceBundle( "com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMessages", Locale.getDefault()); } @@ -185,10 +190,11 @@ public final class ErrorMsg { _line = 0; } - public ErrorMsg(Throwable e) { - _code = null; + public ErrorMsg(String code, Throwable e) { + _code = code; _message = e.getMessage(); _line = 0; + _cause = e; } public ErrorMsg(String message, int line) { @@ -240,6 +246,10 @@ public final class ErrorMsg { _params[1] = param2; } + public Throwable getCause() { + return _cause; + } + private String getFileName(SyntaxTreeNode node) { Stylesheet stylesheet = node.getStylesheet(); if (stylesheet != null) diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java index a7409cedae2..f1f92221072 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java @@ -26,6 +26,7 @@ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; import java.util.StringTokenizer; import com.sun.org.apache.bcel.internal.generic.Type; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants; import com.sun.org.apache.xml.internal.utils.XML11Char; @@ -37,7 +38,7 @@ public final class Util { private static char filesep; static { - String temp = System.getProperty("file.separator", "/"); + String temp = SecuritySupport.getSystemProperty("file.separator", "/"); filesep = temp.charAt(0); } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java index 7057a32ffe2..aaf997a726c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java @@ -33,6 +33,7 @@ import com.sun.org.apache.xalan.internal.xsltc.TransletException; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xml.internal.utils.StringComparable; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; /** * Base class for sort records containing application specific sort keys @@ -112,7 +113,7 @@ public abstract class NodeSortRecord { try { // -- W. Eliot Kimber (eliot@isogen.com) colFactClassname = - System.getProperty("com.sun.org.apache.xalan.internal.xsltc.COLLATOR_FACTORY"); + SecuritySupport.getSystemProperty("com.sun.org.apache.xalan.internal.xsltc.COLLATOR_FACTORY"); } catch (SecurityException e) { // If we can't read the propery, just use default collator diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java index fc388d92ea9..554e1fd998d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.runtime; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.FieldPosition; @@ -1583,7 +1584,7 @@ public final class BasisLibrary { static { String resource = "com.sun.org.apache.xalan.internal.xsltc.runtime.ErrorMessages"; - m_bundle = ResourceBundle.getBundle(resource); + m_bundle = SecuritySupport.getResourceBundle(resource); } /** diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java index 11e14f05cfa..2b04e01fea4 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.runtime.output; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.BufferedWriter; import java.io.IOException; import java.io.Writer; @@ -36,7 +37,7 @@ class WriterOutputBuffer implements OutputBuffer { static { // Set a larger buffer size for Solaris - final String osName = System.getProperty("os.name"); + final String osName = SecuritySupport.getSystemProperty("os.name"); if (osName.equalsIgnoreCase("solaris")) { BUFFER_SIZE = 32 * KB; } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java index 4ebf238565f..a3bd7f6d1ab 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java @@ -43,6 +43,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; /** * @author Morten Jorgensen @@ -52,6 +53,8 @@ import com.sun.org.apache.xalan.internal.utils.ObjectFactory; */ public final class TemplatesImpl implements Templates, Serializable { static final long serialVersionUID = 673094361519270707L; + public final static String DESERIALIZE_TRANSLET = "jdk.xml.enableTemplatesImplDeserialization"; + /** * Name of the superclass of all translets. This is needed to * determine which, among all classes comprising a translet, @@ -186,6 +189,15 @@ public final class TemplatesImpl implements Templates, Serializable { private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException { + SecurityManager security = System.getSecurityManager(); + if (security != null){ + String temp = SecuritySupport.getSystemProperty(DESERIALIZE_TRANSLET); + if (temp == null || !(temp.length()==0 || temp.equalsIgnoreCase("true"))) { + ErrorMsg err = new ErrorMsg(ErrorMsg.DESERIALIZE_TRANSLET_ERR); + throw new UnsupportedOperationException(err.toString()); + } + } + is.defaultReadObject(); if (is.readBoolean()) { _uriResolver = (URIResolver) is.readObject(); diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java index 26b2f56de86..78d96aa0479 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java @@ -73,7 +73,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; - +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import org.xml.sax.InputSource; import org.xml.sax.XMLFilter; @@ -881,8 +881,14 @@ public class TransformerFactoryImpl // Check that the transformation went well before returning if (bytecodes == null) { - ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); - TransformerConfigurationException exc = new TransformerConfigurationException(err.toString()); + Vector errs = xsltc.getErrors(); + ErrorMsg err = null; + if (errs != null) { + err = (ErrorMsg)errs.get(errs.size()-1); + } else { + err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); + } + TransformerConfigurationException exc = new TransformerConfigurationException(err.toString(), err.getCause()); // Pass compiler errors to the error listener if (_errorListener != null) { @@ -1229,7 +1235,7 @@ public class TransformerFactoryImpl // Find the parent directory of the translet. String transletParentDir = transletFile.getParent(); if (transletParentDir == null) - transletParentDir = System.getProperty("user.dir"); + transletParentDir = SecuritySupport.getSystemProperty("user.dir"); File transletParentFile = new File(transletParentDir); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java index 8747181b874..f7d131fdb9b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java @@ -20,10 +20,10 @@ package com.sun.org.apache.xerces.internal.dom; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; /** * Used to format DOM error messages, using the system locale. @@ -31,6 +31,7 @@ import java.util.PropertyResourceBundle; * @xerces.internal * * @author Sandy Gao, IBM + * @version $Id: DOMMessageFormatter.java,v 1.6 2010-11-01 04:39:38 joehw Exp $ */ public class DOMMessageFormatter { public static final String DOM_DOMAIN = "http://www.w3.org/dom/DOMTR"; @@ -122,13 +123,13 @@ public class DOMMessageFormatter { */ public static void init(){ if (locale != null) { - domResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages", locale); - serResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages", locale); - xmlResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + domResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages", locale); + serResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages", locale); + xmlResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); }else{ - domResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages"); - serResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages"); - xmlResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + domResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages"); + serResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages"); + xmlResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index 84e2c81634a..b761fc41974 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -51,6 +51,7 @@ import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.*; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import com.sun.xml.internal.stream.Entity; import com.sun.org.apache.xerces.internal.xni.Augmentations; @@ -1727,7 +1728,7 @@ protected static final String PARSER_SETTINGS = // get the user.dir property String userDir = ""; try { - userDir = System.getProperty("user.dir"); + userDir = SecuritySupport.getSystemProperty("user.dir"); } catch (SecurityException se) { } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java index 9a0e0db4338..f38b1d3797f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java @@ -20,6 +20,7 @@ package com.sun.org.apache.xerces.internal.impl.dv; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import java.util.MissingResourceException; @@ -34,6 +35,7 @@ import java.util.MissingResourceException; * * @author Sandy Gao, IBM * + * @version $Id: DatatypeException.java,v 1.6 2010-11-01 04:39:43 joehw Exp $ */ public class DatatypeException extends Exception { @@ -84,7 +86,7 @@ public class DatatypeException extends Exception { */ public String getMessage() { ResourceBundle resourceBundle = null; - resourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"); + resourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"); if (resourceBundle == null) throw new MissingResourceException("Property file not found!", "com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", key); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java index 98a8e87325f..adb8c44ab2e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java @@ -20,12 +20,11 @@ package com.sun.org.apache.xerces.internal.impl.msg; +import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; - -import com.sun.org.apache.xerces.internal.util.MessageFormatter; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +33,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter.java 3020 2011-02-28 23:51:33Z joehw $ + * @version $Id: XMLMessageFormatter.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter implements MessageFormatter { @@ -72,12 +71,12 @@ public class XMLMessageFormatter implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java index 686371c830a..1f9d2816165 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_de.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_de.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_de implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_de implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java index 437d33af1a5..164a2513a9e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_es.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_es.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_es implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_es implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java index 2acdd6632b7..e4e41292716 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_fr.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_fr.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_fr implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_fr implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java index cd288bda0dc..e2dd5132d21 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_it.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_it.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_it implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_it implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java index e232fe0801f..b3fb8563e67 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_ja.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_ja.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_ja implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_ja implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java index e874485128a..3de7757c5bc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_ko.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_ko.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_ko implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_ko implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java index 15957b71da6..59b3d1d30a7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_pt_BR.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_pt_BR.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_pt_BR implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_pt_BR implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java index 4c220a7779d..00217ae4f7b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_sv.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_sv.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_sv implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_sv implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java index bebf698d364..4cfa9686da0 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_zh_CN.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_zh_CN.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_zh_CN implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_zh_CN implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java index e594e853c86..4f34fa2adc5 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for @@ -34,7 +35,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Eric Ye, IBM - * @version $Id: XMLMessageFormatter_zh_TW.java 3021 2011-03-01 00:12:28Z joehw $ + * @version $Id: XMLMessageFormatter_zh_TW.java 3094 2012-03-21 05:50:01Z joehw $ * */ public class XMLMessageFormatter_zh_TW implements MessageFormatter { @@ -72,12 +73,12 @@ public class XMLMessageFormatter_zh_TW implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java index 089a7240770..ed1cda9ba3e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java @@ -20,6 +20,7 @@ package com.sun.org.apache.xerces.internal.impl.xpath.regex; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; @@ -95,10 +96,10 @@ class RegexParser { public void setLocale(Locale locale) { try { if (locale != null) { - this.resources = ResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message", locale); + this.resources = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message", locale); } else { - this.resources = ResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message"); + this.resources = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message"); } } catch (MissingResourceException mre) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java index 1f1c616d1b1..0a51a3c6b8f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java @@ -20,11 +20,11 @@ package com.sun.org.apache.xerces.internal.impl.xs; +import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; -import com.sun.org.apache.xerces.internal.util.MessageFormatter; /** @@ -34,6 +34,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * @xerces.internal * * @author Elena Litani, IBM + * @version $Id: XSMessageFormatter.java,v 1.6 2010-11-01 04:39:55 joehw Exp $ */ public class XSMessageFormatter implements MessageFormatter { /** @@ -66,12 +67,12 @@ public class XSMessageFormatter implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"); } String msg = fResourceBundle.getString(key); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java index ccf12a5ab0f..5c510533c98 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java @@ -20,15 +20,16 @@ package com.sun.org.apache.xerces.internal.jaxp.validation; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; /** *

Used to format JAXP Validation API error messages using a specified locale.

* * @author Michael Glavassevich, IBM + * @version $Id: JAXPValidationMessageFormatter.java,v 1.5 2010-11-01 04:40:08 joehw Exp $ */ final class JAXPValidationMessageFormatter { @@ -54,11 +55,11 @@ final class JAXPValidationMessageFormatter { ResourceBundle resourceBundle = null; if (locale != null) { resourceBundle = - PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages", locale); + SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages", locale); } else { resourceBundle = - PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages"); + SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java index 7c1c12b9891..b964a8fbfd8 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java @@ -20,15 +20,16 @@ package com.sun.org.apache.xerces.internal.util; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; -import java.util.PropertyResourceBundle; import java.util.ResourceBundle; /** *

Used to format JAXP 1.3 Datatype API error messages using a specified locale.

* * @author Neeraj Bajaj, Sun Microsystems + * @version $Id: DatatypeMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $ */ public class DatatypeMessageFormatter { @@ -56,11 +57,11 @@ public class DatatypeMessageFormatter { ResourceBundle resourceBundle = null; if (locale != null) { resourceBundle = - PropertyResourceBundle.getBundle(BASE_NAME, locale); + SecuritySupport.getResourceBundle(BASE_NAME, locale); } else { resourceBundle = - PropertyResourceBundle.getBundle(BASE_NAME); + SecuritySupport.getResourceBundle(BASE_NAME); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java index afcfec38d80..29648a629f9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java @@ -19,16 +19,17 @@ */ package com.sun.org.apache.xerces.internal.util; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; /** * Used to format SAX error messages using a specified locale. * * @author Michael Glavassevich, IBM * + * @version $Id: SAXMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $ */ public class SAXMessageFormatter { @@ -54,11 +55,11 @@ public class SAXMessageFormatter { ResourceBundle resourceBundle = null; if (locale != null) { resourceBundle = - PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages", locale); + SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages", locale); } else { resourceBundle = - PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages"); + SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages"); } // format message diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java index c405a22ec7e..dd510b622bc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java @@ -61,6 +61,8 @@ package com.sun.org.apache.xerces.internal.util; import com.sun.org.apache.xerces.internal.impl.Constants; +import java.security.AccessController; +import java.security.PrivilegedAction; /** * This class is a container for parser settings that relate to * security, or more specifically, it is intended to be used to prevent denial-of-service @@ -77,6 +79,7 @@ import com.sun.org.apache.xerces.internal.impl.Constants; * * @author Neil Graham, IBM * + * @version $Id: SecurityManager.java,v 1.5 2010-11-01 04:40:14 joehw Exp $ */ public final class SecurityManager { @@ -176,41 +179,48 @@ public final class SecurityManager { private void readSystemProperties(){ - //TODO: also read SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT - try { - String value = System.getProperty(Constants.ENTITY_EXPANSION_LIMIT); - if(value != null && !value.equals("")){ - entityExpansionLimit = Integer.parseInt(value); - if (entityExpansionLimit < 0) - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - } - else - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - }catch(Exception ex){} + //TODO: also read SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT + try { + String value = getSystemProperty(Constants.ENTITY_EXPANSION_LIMIT); + if(value != null && !value.equals("")){ + entityExpansionLimit = Integer.parseInt(value); + if (entityExpansionLimit < 0) + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + } + else + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + }catch(Exception ex){} - try { - String value = System.getProperty(Constants.MAX_OCCUR_LIMIT); - if(value != null && !value.equals("")){ - maxOccurLimit = Integer.parseInt(value); - if (maxOccurLimit < 0) - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - } - else - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - }catch(Exception ex){} + try { + String value = getSystemProperty(Constants.MAX_OCCUR_LIMIT); + if(value != null && !value.equals("")){ + maxOccurLimit = Integer.parseInt(value); + if (maxOccurLimit < 0) + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + } + else + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + }catch(Exception ex){} - try { - String value = System.getProperty(Constants.SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT); - if(value != null && !value.equals("")){ - fElementAttributeLimit = Integer.parseInt(value); - if ( fElementAttributeLimit < 0) - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; - } - else - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + try { + String value = getSystemProperty(Constants.SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT); + if(value != null && !value.equals("")){ + fElementAttributeLimit = Integer.parseInt(value); + if ( fElementAttributeLimit < 0) + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + } + else + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; }catch(Exception ex){} } + private String getSystemProperty(final String propName) { + return AccessController.doPrivileged(new PrivilegedAction() { + public String run() { + return System.getProperty(propName); + } + }); + } } // class SecurityManager diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java index afc0d45a5a1..63ce5e59b08 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java @@ -48,6 +48,7 @@ public final class ObjectFactory { // // Constants // + private static final String DEFAULT_INTERNAL_CLASSES = "com.sun.org.apache."; // name of default properties file to look for in JDK's jre/lib directory private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties"; @@ -305,10 +306,14 @@ public final class ObjectFactory { //restrict the access to package as speicified in java.security policy SecurityManager security = System.getSecurityManager(); if (security != null) { - final int lastDot = className.lastIndexOf("."); - String packageName = className; - if (lastDot != -1) packageName = className.substring(0, lastDot); - security.checkPackageAccess(packageName); + if (className.startsWith(DEFAULT_INTERNAL_CLASSES)) { + cl = null; + } else { + final int lastDot = className.lastIndexOf("."); + String packageName = className; + if (lastDot != -1) packageName = className.substring(0, lastDot); + security.checkPackageAccess(packageName); + } } Class providerClass; if (cl == null) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java index 42ca503a8cb..b1d9d870412 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java @@ -29,6 +29,10 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.PropertyResourceBundle; +import java.util.ResourceBundle; /** * This class is duplicated for each subpackage so keep it in sync. @@ -141,6 +145,38 @@ public final class SecuritySupport { }); } + /** + * Gets a resource bundle using the specified base name, the default locale, and the caller's class loader. + * @param bundle the base name of the resource bundle, a fully qualified class name + * @return a resource bundle for the given base name and the default locale + */ + public static ResourceBundle getResourceBundle(String bundle) { + return getResourceBundle(bundle, Locale.getDefault()); + } + + /** + * Gets a resource bundle using the specified base name and locale, and the caller's class loader. + * @param bundle the base name of the resource bundle, a fully qualified class name + * @param locale the locale for which a resource bundle is desired + * @return a resource bundle for the given base name and locale + */ + public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) { + return AccessController.doPrivileged(new PrivilegedAction() { + public ResourceBundle run() { + try { + return PropertyResourceBundle.getBundle(bundle, locale); + } catch (MissingResourceException e) { + try { + return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US")); + } catch (MissingResourceException e2) { + throw new MissingResourceException( + "Could not load any resource bundle by " + bundle, bundle, ""); + } + } + } + }); + } + static boolean getFileExists(final File f) { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java index 0e6adc175eb..0275615e2fc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java @@ -20,11 +20,11 @@ package com.sun.org.apache.xerces.internal.xinclude; +import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.PropertyResourceBundle; -import com.sun.org.apache.xerces.internal.util.MessageFormatter; // TODO: fix error messages in XIncludeMessages.properties /** @@ -32,6 +32,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * * @author Peter McCracken, IBM * + * @version $Id: XIncludeMessageFormatter.java,v 1.7 2010-11-01 04:40:18 joehw Exp $ */ public class XIncludeMessageFormatter implements MessageFormatter { @@ -61,12 +62,12 @@ public class XIncludeMessageFormatter implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", locale); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages"); + fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages"); } String msg = fResourceBundle.getString(key); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java index 069cebd6fcc..639bdef7784 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java @@ -24,6 +24,7 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.PropertyResourceBundle; import com.sun.org.apache.xerces.internal.util.MessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * XPointerMessageFormatter provides error messages for the XPointer Framework @@ -31,6 +32,7 @@ import com.sun.org.apache.xerces.internal.util.MessageFormatter; * * @xerces.internal * + * @version $Id: XPointerMessageFormatter.java,v 1.5 2010-11-01 04:40:26 joehw Exp $ */ class XPointerMessageFormatter implements MessageFormatter { @@ -64,14 +66,14 @@ class XPointerMessageFormatter implements MessageFormatter { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { - fResourceBundle = PropertyResourceBundle.getBundle( + fResourceBundle = SecuritySupport.getResourceBundle( "com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) - fResourceBundle = PropertyResourceBundle - .getBundle("com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages"); + fResourceBundle = SecuritySupport.getResourceBundle( + "com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages"); } String msg = fResourceBundle.getString(key); diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java index 0c5c0866dcb..711814e80e1 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java @@ -27,6 +27,7 @@ import com.sun.org.apache.xml.internal.res.XMLMessages; import com.sun.org.apache.xml.internal.utils.PrefixResolver; import com.sun.org.apache.xml.internal.utils.XMLStringFactory; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; /** * A DTMManager instance can be used to create DTM and @@ -383,7 +384,7 @@ public abstract class DTMManager { try { - debug = System.getProperty("dtm.debug") != null; + debug = SecuritySupport.getSystemProperty("dtm.debug") != null; } catch (SecurityException ex){} } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java index f3dc2eb27b1..8d1ab9b948d 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources extends ListResourceBundle return contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java index f7cb448f07f..5dcb27c62c5 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -443,67 +440,4 @@ public class XMLErrorResources_ca extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("ca", "ES")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java index c0594bb5ec0..f3e3c3ec756 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -443,67 +440,4 @@ public class XMLErrorResources_cs extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("cs", "CZ")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java index a53064e4bb2..ac19d0dbdd9 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_de extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java index 43ddf652392..f35db360989 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_es extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java index 7a617894d41..b5891d6cb7e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_fr extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java index 77179c4d3b8..c7d01ffc962 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_it extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java index 1ce4af03e9c..b1a811fb9c9 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_ja extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java index 5d1343ecd5f..97215695644 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_ko extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java index 8cf45bc8a60..593f8b8ff3f 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java @@ -25,9 +25,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -463,67 +460,4 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle return msgCopy; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java index cc86baa0492..1e4b293c59b 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -443,67 +440,4 @@ public class XMLErrorResources_sk extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java index 43c4778fb93..4fa6a340057 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -452,68 +449,4 @@ public class XMLErrorResources_sv extends ListResourceBundle protected Object[][] getContents() { return _contents; } - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java index 47730b4910c..58973c6af99 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -443,67 +440,4 @@ public class XMLErrorResources_tr extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("tr", "TR")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java index 261509bbcee..aa861e25a97 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_zh_CN extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java index f5fdad8b691..78df8fd081e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xml.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -453,67 +450,4 @@ public class XMLErrorResources_zh_TW extends ListResourceBundle return _contents; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XMLErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XMLErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XMLErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLMessages.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLMessages.java index f1ac0e14a2b..bb2f9bb4062 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLMessages.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLMessages.java @@ -22,10 +22,9 @@ */ package com.sun.org.apache.xml.internal.res; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.util.ListResourceBundle; import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * A utility class for issuing XML error messages. @@ -82,8 +81,9 @@ public class XMLMessages */ public static final String createXMLMessage(String msgKey, Object args[]) { - if (XMLBundle == null) - XMLBundle = loadResourceBundle(XML_ERROR_RESOURCES); + if (XMLBundle == null) { + XMLBundle = SecuritySupport.getResourceBundle(XML_ERROR_RESOURCES); + } if (XMLBundle != null) { @@ -156,61 +156,4 @@ public class XMLMessages return fmsg; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className The class name of the resource bundle. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static ListResourceBundle loadResourceBundle(String className) - throws MissingResourceException - { - Locale locale = Locale.getDefault(); - - try - { - return (ListResourceBundle)ResourceBundle.getBundle(className, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (ListResourceBundle)ResourceBundle.getBundle( - className, new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles." + className, className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which can be appended to a resource name - */ - protected static String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/Catalog.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/Catalog.java index 24a14b21f1d..a5c0e683825 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/Catalog.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/Catalog.java @@ -24,6 +24,7 @@ package com.sun.org.apache.xml.internal.resolver; import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.io.IOException; import java.io.FileNotFoundException; import java.io.InputStream; @@ -821,7 +822,7 @@ public class Catalog { // tack on a basename because URLs point to files not dirs catalogCwd = FileURL.makeURL("basename"); } catch (MalformedURLException e) { - String userdir = System.getProperty("user.dir"); + String userdir = SecuritySupport.getSystemProperty("user.dir"); userdir.replace('\\', '/'); catalogManager.debug.message(1, "Malformed URL on cwd", userdir); catalogCwd = null; @@ -1717,7 +1718,7 @@ public class Catalog { protected String resolveLocalSystem(String systemId) throws MalformedURLException, IOException { - String osname = System.getProperty("os.name"); + String osname = SecuritySupport.getSystemProperty("os.name"); boolean windows = (osname.indexOf("Windows") >= 0); Enumeration en = catalogEntries.elements(); while (en.hasMoreElements()) { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java index 166c0331a45..247bd40fdd0 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xml.internal.resolver; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.io.InputStream; import java.net.URL; @@ -142,8 +143,8 @@ public class CatalogManager { /** Flag to ignore missing property files and/or properties */ private boolean ignoreMissingProperties - = (System.getProperty(pIgnoreMissing) != null - || System.getProperty(pFiles) != null); + = (SecuritySupport.getSystemProperty(pIgnoreMissing) != null + || SecuritySupport.getSystemProperty(pFiles) != null); /** Holds the resources after they are loaded from the file. */ private ResourceBundle resources; @@ -338,7 +339,7 @@ public class CatalogManager { private int queryVerbosity () { String defaultVerbStr = Integer.toString(defaultVerbosity); - String verbStr = System.getProperty(pVerbosity); + String verbStr = SecuritySupport.getSystemProperty(pVerbosity); if (verbStr == null) { if (resources==null) readProperties(); @@ -473,7 +474,7 @@ public class CatalogManager { * @return A semicolon delimited list of catlog file URIs */ private String queryCatalogFiles () { - String catalogList = System.getProperty(pFiles); + String catalogList = SecuritySupport.getSystemProperty(pFiles); fromPropertiesFile = false; if (catalogList == null) { @@ -558,7 +559,7 @@ public class CatalogManager { * defaultPreferSetting. */ private boolean queryPreferPublic () { - String prefer = System.getProperty(pPrefer); + String prefer = SecuritySupport.getSystemProperty(pPrefer); if (prefer == null) { if (resources==null) readProperties(); @@ -617,7 +618,7 @@ public class CatalogManager { * defaultUseStaticCatalog. */ private boolean queryUseStaticCatalog () { - String staticCatalog = System.getProperty(pStatic); + String staticCatalog = SecuritySupport.getSystemProperty(pStatic); if (staticCatalog == null) { if (resources==null) readProperties(); @@ -748,7 +749,7 @@ public class CatalogManager { * defaultOasisXMLCatalogPI. */ public boolean queryAllowOasisXMLCatalogPI () { - String allow = System.getProperty(pAllowPI); + String allow = SecuritySupport.getSystemProperty(pAllowPI); if (allow == null) { if (resources==null) readProperties(); @@ -804,7 +805,7 @@ public class CatalogManager { * */ public String queryCatalogClassName () { - String className = System.getProperty(pClassname); + String className = SecuritySupport.getSystemProperty(pClassname); if (className == null) { if (resources==null) readProperties(); diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/Resolver.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/Resolver.java index 35a852fbf60..721d67c8d4e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/Resolver.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/Resolver.java @@ -33,6 +33,7 @@ import java.net.URLConnection; import java.net.MalformedURLException; import javax.xml.parsers.SAXParserFactory; import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader; import com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader; import com.sun.org.apache.xml.internal.resolver.readers.TR9401CatalogReader; @@ -524,7 +525,7 @@ public class Resolver extends Catalog { */ private Vector resolveAllLocalSystem(String systemId) { Vector map = new Vector(); - String osname = System.getProperty("os.name"); + String osname = SecuritySupport.getSystemProperty("os.name"); boolean windows = (osname.indexOf("Windows") >= 0); Enumeration en = catalogEntries.elements(); while (en.hasMoreElements()) { @@ -552,7 +553,7 @@ public class Resolver extends Catalog { */ private Vector resolveLocalSystemReverse(String systemId) { Vector map = new Vector(); - String osname = System.getProperty("os.name"); + String osname = SecuritySupport.getSystemProperty("os.name"); boolean windows = (osname.indexOf("Windows") >= 0); Enumeration en = catalogEntries.elements(); while (en.hasMoreElements()) { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java index 22bcad610cb..25da0c6517a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java @@ -22,6 +22,7 @@ package com.sun.org.apache.xml.internal.serialize; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.io.OutputStream; import java.io.Writer; import java.io.UnsupportedEncodingException; @@ -64,7 +65,7 @@ public abstract class SerializerFactory factory = new SerializerFactoryImpl( Method.TEXT ); registerSerializerFactory( factory ); - list = System.getProperty( FactoriesProperty ); + list = SecuritySupport.getSystemProperty( FactoriesProperty ); if ( list != null ) { token = new StringTokenizer( list, " ;,:" ); while ( token.hasMoreTokens() ) { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java index dcb6dc8e077..35845697a32 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java @@ -219,7 +219,7 @@ public final class Encodings extends Object // Get the default system character encoding. This may be // incorrect if they passed in a writer, but right now there // seems to be no way to get the encoding from a writer. - encoding = System.getProperty("file.encoding", "UTF8"); + encoding = SecuritySupport.getSystemProperty("file.encoding", "UTF8"); if (null != encoding) { @@ -313,7 +313,7 @@ public final class Encodings extends Object try { - urlString = System.getProperty(ENCODINGS_PROP, ""); + urlString = SecuritySupport.getSystemProperty(ENCODINGS_PROP, ""); } catch (SecurityException e) { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java index 3daff744064..0d91b7aeb3c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java @@ -22,6 +22,7 @@ */ package com.sun.org.apache.xml.internal.serializer; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; @@ -471,7 +472,7 @@ public final class OutputPropertiesFactory String value = null; try { - value = System.getProperty(key); + value = SecuritySupport.getSystemProperty(key); } catch (SecurityException se) { @@ -484,7 +485,7 @@ public final class OutputPropertiesFactory String newValue = null; try { - newValue = System.getProperty(newKey); + newValue = SecuritySupport.getSystemProperty(newKey); } catch (SecurityException se) { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java index 8c4c2ec8892..2301763c07c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java @@ -22,6 +22,7 @@ */ package com.sun.org.apache.xml.internal.serializer; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; @@ -140,7 +141,7 @@ abstract public class ToStream extends SerializerBase * extension attribute xalan:line-separator. */ protected char[] m_lineSep = - System.getProperty("line.separator").toCharArray(); + SecuritySupport.getSystemProperty("line.separator").toCharArray(); /** * True if the the system line separator is to be used. diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java index d77f48d520f..007e9c7b3d4 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java @@ -22,6 +22,7 @@ */ package com.sun.org.apache.xml.internal.serializer; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.File; import com.sun.org.apache.xml.internal.serializer.utils.AttList; @@ -104,7 +105,7 @@ public final class TreeWalker else { try { // Bug see Bugzilla 26741 - m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); + m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se) {// user.dir not accessible from applet } @@ -115,7 +116,7 @@ public final class TreeWalker m_contentHandler.setDocumentLocator(m_locator); try { // Bug see Bugzilla 26741 - m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); + m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se){// user.dir not accessible from applet diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java index 32393082107..84f4c9840bb 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java @@ -22,6 +22,7 @@ */ package com.sun.org.apache.xml.internal.serializer.utils; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.util.ListResourceBundle; import java.util.Locale; import java.util.MissingResourceException; @@ -87,9 +88,6 @@ import java.util.ResourceBundle; * can have the Message strings translated in an alternate language * in a errorResourceClass with a language suffix. * - * More sophisticated use of this class would be to pass null - * when contructing it, but then call loadResourceBundle() - * before creating any messages. * * This class is not a public API, it is only public because it is * used in com.sun.org.apache.xml.internal.serializer. @@ -126,18 +124,6 @@ public final class Messages m_resourceBundleName = resourceBundle; } - /* - * Set the Locale object to use. If this method is not called the - * default locale is used. This method needs to be called before - * loadResourceBundle(). - * - * @param locale non-null reference to Locale object. - * @xsl.usage internal - */ -// public void setLocale(Locale locale) -// { -// m_locale = locale; -// } /** * Get the Locale object that is being used. @@ -150,16 +136,6 @@ public final class Messages return m_locale; } - /** - * Get the ListResourceBundle being used by this Messages instance which was - * previously set by a call to loadResourceBundle(className) - * @xsl.usage internal - */ - private ListResourceBundle getResourceBundle() - { - return m_resourceBundle; - } - /** * Creates a message from the specified key and replacement * arguments, localized to the given locale. @@ -174,7 +150,7 @@ public final class Messages public final String createMessage(String msgKey, Object args[]) { if (m_resourceBundle == null) - m_resourceBundle = loadResourceBundle(m_resourceBundleName); + m_resourceBundle = SecuritySupport.getResourceBundle(m_resourceBundleName); if (m_resourceBundle != null) { @@ -293,76 +269,4 @@ public final class Messages return fmsg; } - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className the name of the class that implements ListResourceBundle, - * without language suffix. - * @return the ResourceBundle - * @throws MissingResourceException - * @xsl.usage internal - */ - private ListResourceBundle loadResourceBundle(String resourceBundle) - throws MissingResourceException - { - m_resourceBundleName = resourceBundle; - Locale locale = getLocale(); - - ListResourceBundle lrb; - - try - { - - ResourceBundle rb = - ResourceBundle.getBundle(m_resourceBundleName, locale); - lrb = (ListResourceBundle) rb; - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - lrb = - (ListResourceBundle) ResourceBundle.getBundle( - m_resourceBundleName, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles." + m_resourceBundleName, - m_resourceBundleName, - ""); - } - } - m_resourceBundle = lrb; - return lrb; - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which can be appended to a resource name - * @xsl.usage internal - */ - private static String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java index a26a00684ba..f7a3ddf65b8 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java @@ -22,6 +22,7 @@ */ package com.sun.org.apache.xml.internal.utils; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import java.io.File; import org.w3c.dom.Comment; @@ -93,7 +94,7 @@ public class TreeWalker else { try { // Bug see Bugzilla 26741 - m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); + m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se) {// user.dir not accessible from applet } @@ -112,7 +113,7 @@ public class TreeWalker m_contentHandler.setDocumentLocator(m_locator); try { // Bug see Bugzilla 26741 - m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); + m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se){// user.dir not accessible from applet } @@ -131,7 +132,7 @@ public class TreeWalker m_contentHandler.setDocumentLocator(m_locator); try { // Bug see Bugzilla 26741 - m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); + m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se){// user.dir not accessible from applet diff --git a/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java index b2beed7262f..708fbb47400 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java @@ -22,6 +22,8 @@ */ package com.sun.org.apache.xml.internal.utils.res; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ListResourceBundle; import java.util.Locale; import java.util.MissingResourceException; @@ -29,114 +31,45 @@ import java.util.ResourceBundle; /** * The default (english) resource bundle. + * * @xsl.usage internal */ -public class XResourceBundle extends ListResourceBundle -{ +public class XResourceBundle extends ListResourceBundle { - /** Error resource constants */ - public static final String ERROR_RESOURCES = - "com.sun.org.apache.xalan.internal.res.XSLTErrorResources", XSLT_RESOURCE = - "com.sun.org.apache.xml.internal.utils.res.XResourceBundle", LANG_BUNDLE_NAME = - "com.sun.org.apache.xml.internal.utils.res.XResources", MULT_ORDER = - "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS = - "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT = - "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING = - "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD = - "multiplicative-additive", LANG_MULTIPLIER = - "multiplier", LANG_MULTIPLIER_CHAR = - "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES = - "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet"; + /** + * Error resource constants + */ + public static final String ERROR_RESOURCES = + "com.sun.org.apache.xalan.internal.res.XSLTErrorResources", XSLT_RESOURCE = + "com.sun.org.apache.xml.internal.utils.res.XResourceBundle", LANG_BUNDLE_NAME = + "com.sun.org.apache.xml.internal.utils.res.XResources", MULT_ORDER = + "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS = + "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT = + "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING = + "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD = + "multiplicative-additive", LANG_MULTIPLIER = + "multiplier", LANG_MULTIPLIER_CHAR = + "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES = + "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet"; - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @param locale the locale to prefer when searching for the bundle - */ - public static final XResourceBundle loadResourceBundle( - String className, Locale locale) throws MissingResourceException - { - String suffix = getResourceSuffix(locale); - - //System.out.println("resource " + className + suffix); - try - { - - // first try with the given locale - String resourceName = className + suffix; - return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale); + /** + * Get the association list. + * + * @return The association list. + */ + public Object[][] getContents() { + return new Object[][]{ + {"ui_language", "en"}, {"help_language", "en"}, {"language", "en"}, + {"alphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z'})}, + {"tradAlphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F', + 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', 'W', 'X', 'Y', 'Z'})}, + //language orientation + {"orientation", "LeftToRight"}, + //language numbering + {"numbering", "additive"},}; } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XResourceBundle) ResourceBundle.getBundle( - XSLT_RESOURCE, new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String lang = locale.getLanguage(); - String country = locale.getCountry(); - String variant = locale.getVariant(); - String suffix = "_" + locale.getLanguage(); - - if (lang.equals("zh")) - suffix += "_" + country; - - if (country.equals("JP")) - suffix += "_" + country + "_" + variant; - - return suffix; - } - - /** - * Get the association list. - * - * @return The association list. - */ - public Object[][] getContents() - { - return new Object[][] - { - { "ui_language", "en" }, { "help_language", "en" }, { "language", "en" }, - { "alphabet", new CharArrayWrapper(new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z' })}, - { "tradAlphabet", new CharArrayWrapper(new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', - 'U', 'V', 'W', 'X', 'Y', 'Z' }) }, - - //language orientation - { "orientation", "LeftToRight" }, - - //language numbering - { "numbering", "additive" }, - }; - } } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java index 1fbcc878c6a..4f9a9684960 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java @@ -102,7 +102,7 @@ public class FuncSystemProperty extends FunctionOneArg try { - result = System.getProperty(propName); + result = SecuritySupport.getSystemProperty(propName); if (null == result) { @@ -124,7 +124,7 @@ public class FuncSystemProperty extends FunctionOneArg { try { - result = System.getProperty(fullName); + result = SecuritySupport.getSystemProperty(fullName); if (null == result) { @@ -165,12 +165,11 @@ public class FuncSystemProperty extends FunctionOneArg * should already be fully qualified as path/filename * @param target The target property bag the file will be placed into. */ - private void loadPropertyFile(String file, Properties target) + public void loadPropertyFile(String file, Properties target) { try { // Use SecuritySupport class to provide priveleged access to property file - InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(), file); diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java index 1bacf25d242..68b4853f3d9 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java index db0051dce36..2b1389ac5ef 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java index 6200908cb08..034531e1242 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java index 41be11f7b56..3526941fdae 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java index 356bffc64ff..0000b182da8 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java index 5427da5219f..256b88c190d 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java index de70b6a2fc5..6e1f37e8e80 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java index 54bb5387e2d..85504928969 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java @@ -24,9 +24,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -940,68 +937,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java index 6afe36fe42b..f9152568fa1 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java index f781e6ba411..2618e5991eb 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java index dfafed8d09e..8fdd1e50ca8 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java @@ -23,9 +23,6 @@ package com.sun.org.apache.xpath.internal.res; import java.util.ListResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** * Set up error messages. @@ -939,68 +936,4 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; - - /** - * Return a named ResourceBundle for a particular locale. This method mimics the behavior - * of ResourceBundle.getBundle(). - * - * @param className Name of local-specific subclass. - * @return the ResourceBundle - * @throws MissingResourceException - */ - public static final XPATHErrorResources loadResourceBundle(String className) - throws MissingResourceException - { - - Locale locale = Locale.getDefault(); - String suffix = getResourceSuffix(locale); - - try - { - - // first try with the given locale - return (XPATHErrorResources) ResourceBundle.getBundle(className - + suffix, locale); - } - catch (MissingResourceException e) - { - try // try to fall back to en_US if we can't load - { - - // Since we can't find the localized property file, - // fall back to en_US. - return (XPATHErrorResources) ResourceBundle.getBundle(className, - new Locale("en", "US")); - } - catch (MissingResourceException e2) - { - - // Now we are really in trouble. - // very bad, definitely very bad...not going to get very far - throw new MissingResourceException( - "Could not load any resource bundles.", className, ""); - } - } - } - - /** - * Return the resource file suffic for the indicated locale - * For most locales, this will be based the language code. However - * for Chinese, we do distinguish between Taiwan and PRC - * - * @param locale the locale - * @return an String suffix which canbe appended to a resource name - */ - private static final String getResourceSuffix(Locale locale) - { - - String suffix = "_" + locale.getLanguage(); - String country = locale.getCountry(); - - if (country.equals("TW")) - suffix += "_" + country; - - return suffix; - } - } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java index 3bcf1da48f2..1d0fe6ff49c 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java @@ -22,130 +22,128 @@ */ package com.sun.org.apache.xpath.internal.res; -import java.util.ListResourceBundle; - +import com.sun.org.apache.bcel.internal.util.SecuritySupport; import com.sun.org.apache.xml.internal.res.XMLMessages; +import java.util.ListResourceBundle; /** * A utility class for issuing XPath error messages. + * * @xsl.usage internal */ -public class XPATHMessages extends XMLMessages -{ - /** The language specific resource object for XPath messages. */ - private static ListResourceBundle XPATHBundle = null; +public class XPATHMessages extends XMLMessages { - /** The class name of the XPath error message string table. */ - private static final String XPATH_ERROR_RESOURCES = - "com.sun.org.apache.xpath.internal.res.XPATHErrorResources"; + /** + * The language specific resource object for XPath messages. + */ + private static ListResourceBundle XPATHBundle = null; + /** + * The class name of the XPath error message string table. + */ + private static final String XPATH_ERROR_RESOURCES = + "com.sun.org.apache.xpath.internal.res.XPATHErrorResources"; - /** - * Creates a message from the specified key and replacement - * arguments, localized to the given locale. - * - * @param msgKey The key for the message text. - * @param args The arguments to be used as replacement text - * in the message created. - * - * @return The formatted message string. - */ - public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception - { - if (XPATHBundle == null) - XPATHBundle = loadResourceBundle(XPATH_ERROR_RESOURCES); - - if (XPATHBundle != null) + /** + * Creates a message from the specified key and replacement arguments, + * localized to the given locale. + * + * @param msgKey The key for the message text. + * @param args The arguments to be used as replacement text in the message + * created. + * + * @return The formatted message string. + */ + public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception { - return createXPATHMsg(XPATHBundle, msgKey, args); - } - else - return "Could not load any resource bundles."; - } - - /** - * Creates a message from the specified key and replacement - * arguments, localized to the given locale. - * - * @param msgKey The key for the message text. - * @param args The arguments to be used as replacement text - * in the message created. - * - * @return The formatted warning string. - */ - public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception - { - if (XPATHBundle == null) - XPATHBundle = loadResourceBundle(XPATH_ERROR_RESOURCES); - - if (XPATHBundle != null) - { - return createXPATHMsg(XPATHBundle, msgKey, args); - } - else - return "Could not load any resource bundles."; - } - - /** - * Creates a message from the specified key and replacement - * arguments, localized to the given locale. - * - * @param fResourceBundle The resource bundle to use. - * @param msgKey The message key to use. - * @param args The arguments to be used as replacement text - * in the message created. - * - * @return The formatted message string. - */ - public static final String createXPATHMsg(ListResourceBundle fResourceBundle, - String msgKey, Object args[]) //throws Exception - { - - String fmsg = null; - boolean throwex = false; - String msg = null; - - if (msgKey != null) - msg = fResourceBundle.getString(msgKey); - - if (msg == null) - { - msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE); - throwex = true; - } - - if (args != null) - { - try - { - - // Do this to keep format from crying. - // This is better than making a bunch of conditional - // code all over the place. - int n = args.length; - - for (int i = 0; i < n; i++) - { - if (null == args[i]) - args[i] = ""; + if (XPATHBundle == null) { + XPATHBundle = SecuritySupport.getResourceBundle(XPATH_ERROR_RESOURCES); } - fmsg = java.text.MessageFormat.format(msg, args); - } - catch (Exception e) - { - fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); - fmsg += " " + msg; - } + if (XPATHBundle != null) { + return createXPATHMsg(XPATHBundle, msgKey, args); + } else { + return "Could not load any resource bundles."; + } } - else - fmsg = msg; - if (throwex) + /** + * Creates a message from the specified key and replacement arguments, + * localized to the given locale. + * + * @param msgKey The key for the message text. + * @param args The arguments to be used as replacement text in the message + * created. + * + * @return The formatted warning string. + */ + public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { - throw new RuntimeException(fmsg); + if (XPATHBundle == null) { + XPATHBundle = SecuritySupport.getResourceBundle(XPATH_ERROR_RESOURCES); + } + + if (XPATHBundle != null) { + return createXPATHMsg(XPATHBundle, msgKey, args); + } else { + return "Could not load any resource bundles."; + } } - return fmsg; - } + /** + * Creates a message from the specified key and replacement arguments, + * localized to the given locale. + * + * @param fResourceBundle The resource bundle to use. + * @param msgKey The message key to use. + * @param args The arguments to be used as replacement text in the message + * created. + * + * @return The formatted message string. + */ + public static final String createXPATHMsg(ListResourceBundle fResourceBundle, + String msgKey, Object args[]) //throws Exception + { + String fmsg = null; + boolean throwex = false; + String msg = null; + + if (msgKey != null) { + msg = fResourceBundle.getString(msgKey); + } + + if (msg == null) { + msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE); + throwex = true; + } + + if (args != null) { + try { + + // Do this to keep format from crying. + // This is better than making a bunch of conditional + // code all over the place. + int n = args.length; + + for (int i = 0; i < n; i++) { + if (null == args[i]) { + args[i] = ""; + } + } + + fmsg = java.text.MessageFormat.format(msg, args); + } catch (Exception e) { + fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); + fmsg += " " + msg; + } + } else { + fmsg = msg; + } + + if (throwex) { + throw new RuntimeException(fmsg); + } + + return fmsg; + } } diff --git a/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java b/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java index 8343d9bba85..2a8183bbe8c 100644 --- a/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java +++ b/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java @@ -36,6 +36,7 @@ import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.PropertyManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.util.Enumeration; /** @@ -414,7 +415,7 @@ public class XMLEntityStorage { // get the user.dir property String userDir = ""; try { - userDir = System.getProperty("user.dir"); + userDir = SecuritySupport.getSystemProperty("user.dir"); } catch (SecurityException se) { } diff --git a/jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java b/jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java index e266c9e3b40..6ec4201996b 100644 --- a/jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java +++ b/jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java @@ -32,6 +32,7 @@ import java.io.Writer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import com.sun.org.apache.xerces.internal.util.XMLChar; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** * Implements common xml writer functions. @@ -240,7 +241,7 @@ public class WriterUtility { private CharsetEncoder getDefaultEncoder(){ try{ - String encoding = System.getProperty("file.encoding"); + String encoding = SecuritySupport.getSystemProperty("file.encoding"); if(encoding != null){ return Charset.forName(encoding).newEncoder(); } diff --git a/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java index 30bee23582c..832fa6ddfbb 100644 --- a/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java +++ b/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java @@ -53,6 +53,7 @@ import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.PropertyManager; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.xml.internal.stream.util.ReadOnlyIterator; @@ -340,7 +341,7 @@ public final class XMLStreamWriterImpl extends AbstractMap implements XMLStreamW fEncoder = Charset.forName(encoding).newEncoder(); } } else { - encoding = System.getProperty("file.encoding"); + encoding = SecuritySupport.getSystemProperty("file.encoding"); if (encoding != null && encoding.equalsIgnoreCase("utf-8")) { fWriter = new UTF8OutputStreamWriter(os); } else { diff --git a/jaxp/src/javax/xml/datatype/FactoryFinder.java b/jaxp/src/javax/xml/datatype/FactoryFinder.java index 37811e6fad9..deb47eaa11c 100644 --- a/jaxp/src/javax/xml/datatype/FactoryFinder.java +++ b/jaxp/src/javax/xml/datatype/FactoryFinder.java @@ -44,6 +44,7 @@ import java.net.URL; * @author Santiago.PericasGeertsen@sun.com */ class FactoryFinder { + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal"; /** * Internal debug flag. @@ -95,18 +96,24 @@ class FactoryFinder { * If the class loader supplied is null, first try using the * context class loader followed by the current (i.e. bootstrap) class * loader. + * + * Use bootstrap classLoader if cl = null and useBSClsLoader is true */ static private Class getProviderClass(String className, ClassLoader cl, - boolean doFallback) throws ClassNotFoundException + boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException { try { if (cl == null) { - cl = ss.getContextClassLoader(); - if (cl == null) { - throw new ClassNotFoundException(); - } - else { - return cl.loadClass(className); + if (useBSClsLoader) { + return Class.forName(className, true, FactoryFinder.class.getClassLoader()); + } else { + cl = ss.getContextClassLoader(); + if (cl == null) { + throw new ClassNotFoundException(); + } + else { + return cl.loadClass(className); + } } } else { @@ -131,8 +138,8 @@ class FactoryFinder { * @param className Name of the concrete class corresponding to the * service provider * - * @param cl ClassLoader to use to load the class, null means to use - * the bootstrap ClassLoader + * @param cl ClassLoader used to load the factory class. If null + * current Thread's context classLoader is used to load the factory class. * * @param doFallback True if the current ClassLoader should be tried as * a fallback if the class is not found using cl @@ -140,8 +147,38 @@ class FactoryFinder { static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { + return newInstance(className, cl, doFallback, false); + } + + /** + * Create an instance of a class. Delegates to method + * getProviderClass() in order to load the class. + * + * @param className Name of the concrete class corresponding to the + * service provider + * + * @param cl ClassLoader to use to load the class, null means to use + * the bootstrap ClassLoader + * + * @param doFallback True if the current ClassLoader should be tried as + * a fallback if the class is not found using cl + * + * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter + * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader. + */ + static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader) + throws ConfigurationError + { + // make sure we have access to restricted packages + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + cl = null; + useBSClsLoader = true; + } + } + try { - Class providerClass = getProviderClass(className, cl, doFallback); + Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader); Object instance = providerClass.newInstance(); if (debug) { // Extra check to avoid computing cl strings dPrint("created new instance of " + providerClass + @@ -244,6 +281,7 @@ class FactoryFinder { // First try the Context ClassLoader ClassLoader cl = ss.getContextClassLoader(); + boolean useBSClsLoader = false; if (cl != null) { is = ss.getResourceAsStream(cl, serviceId); @@ -251,11 +289,13 @@ class FactoryFinder { if (is == null) { cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); + useBSClsLoader = true; } } else { // No Context ClassLoader, try the current ClassLoader cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); + useBSClsLoader = true; } if (is == null) { @@ -293,7 +333,7 @@ class FactoryFinder { // ClassLoader because we want to avoid the case where the // resource file was found using one ClassLoader and the // provider class was instantiated using a different one. - return newInstance(factoryClassName, cl, false); + return newInstance(factoryClassName, cl, false, useBSClsLoader); } // No provider found diff --git a/jaxp/src/javax/xml/parsers/FactoryFinder.java b/jaxp/src/javax/xml/parsers/FactoryFinder.java index 43a6e020ac7..214f87f2239 100644 --- a/jaxp/src/javax/xml/parsers/FactoryFinder.java +++ b/jaxp/src/javax/xml/parsers/FactoryFinder.java @@ -42,7 +42,7 @@ import java.util.Properties; * @author Huizhe.Wang@oracle.com */ class FactoryFinder { - + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal"; /** * Internal debug flag. */ @@ -166,6 +166,14 @@ class FactoryFinder { static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader) throws ConfigurationError { + // make sure we have access to restricted packages + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + cl = null; + useBSClsLoader = true; + } + } + try { Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader); Object instance = providerClass.newInstance(); diff --git a/jaxp/src/javax/xml/stream/FactoryFinder.java b/jaxp/src/javax/xml/stream/FactoryFinder.java index a2491ac8c59..bcfeba10e04 100644 --- a/jaxp/src/javax/xml/stream/FactoryFinder.java +++ b/jaxp/src/javax/xml/stream/FactoryFinder.java @@ -25,14 +25,12 @@ package javax.xml.stream; -import java.io.InputStream; -import java.io.IOException; -import java.io.File; -import java.io.FileInputStream; - -import java.util.Properties; import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; +import java.util.Properties; /** *

Implements pluggable Datatypes.

@@ -43,6 +41,8 @@ import java.io.InputStreamReader; * @author Santiago.PericasGeertsen@sun.com */ class FactoryFinder { + // Check we have access to package. + private static final String DEFAULT_PACKAGE = "com.sun.xml.internal."; /** * Internal debug flag. @@ -94,18 +94,24 @@ class FactoryFinder { * If the class loader supplied is null, first try using the * context class loader followed by the current (i.e. bootstrap) class * loader. + * + * Use bootstrap classLoader if cl = null and useBSClsLoader is true */ static private Class getProviderClass(String className, ClassLoader cl, - boolean doFallback) throws ClassNotFoundException + boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException { try { if (cl == null) { - cl = ss.getContextClassLoader(); - if (cl == null) { - throw new ClassNotFoundException(); - } - else { - return cl.loadClass(className); + if (useBSClsLoader) { + return Class.forName(className, true, FactoryFinder.class.getClassLoader()); + } else { + cl = ss.getContextClassLoader(); + if (cl == null) { + throw new ClassNotFoundException(); + } + else { + return cl.loadClass(className); + } } } else { @@ -130,8 +136,8 @@ class FactoryFinder { * @param className Name of the concrete class corresponding to the * service provider * - * @param cl ClassLoader to use to load the class, null means to use - * the bootstrap ClassLoader + * @param cl ClassLoader used to load the factory class. If null + * current Thread's context classLoader is used to load the factory class. * * @param doFallback True if the current ClassLoader should be tried as * a fallback if the class is not found using cl @@ -139,8 +145,38 @@ class FactoryFinder { static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { + return newInstance(className, cl, doFallback, false); + } + + /** + * Create an instance of a class. Delegates to method + * getProviderClass() in order to load the class. + * + * @param className Name of the concrete class corresponding to the + * service provider + * + * @param cl ClassLoader used to load the factory class. If null + * current Thread's context classLoader is used to load the factory class. + * + * @param doFallback True if the current ClassLoader should be tried as + * a fallback if the class is not found using cl + * + * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter + * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader. + */ + static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader) + throws ConfigurationError + { + // make sure we have access to restricted packages + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + cl = null; + useBSClsLoader = true; + } + } + try { - Class providerClass = getProviderClass(className, cl, doFallback); + Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader); Object instance = providerClass.newInstance(); if (debug) { // Extra check to avoid computing cl strings dPrint("created new instance of " + providerClass + @@ -233,10 +269,10 @@ class FactoryFinder { if (ss.doesFileExist(f)) { dPrint("Read properties file "+f); cacheProps.load(ss.getFileInputStream(f)); - } - } } } + } + } } factoryClassName = cacheProps.getProperty(factoryId); @@ -276,6 +312,7 @@ class FactoryFinder { // First try the Context ClassLoader ClassLoader cl = ss.getContextClassLoader(); + boolean useBSClsLoader = false; if (cl != null) { is = ss.getResourceAsStream(cl, serviceId); @@ -283,11 +320,13 @@ class FactoryFinder { if (is == null) { cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); + useBSClsLoader = true; } } else { // No Context ClassLoader, try the current ClassLoader cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); + useBSClsLoader = true; } if (is == null) { @@ -325,7 +364,7 @@ class FactoryFinder { // ClassLoader because we want to avoid the case where the // resource file was found using one ClassLoader and the // provider class was instantiated using a different one. - return newInstance(factoryClassName, cl, false); + return newInstance(factoryClassName, cl, false, useBSClsLoader); } // No provider found diff --git a/jaxp/src/javax/xml/transform/FactoryFinder.java b/jaxp/src/javax/xml/transform/FactoryFinder.java index 9ded4fb61e4..63cc8cd3f22 100644 --- a/jaxp/src/javax/xml/transform/FactoryFinder.java +++ b/jaxp/src/javax/xml/transform/FactoryFinder.java @@ -43,6 +43,7 @@ import java.util.Properties; * @author Huizhe.Wang@oracle.com */ class FactoryFinder { + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xalan.internal."; /** * Internal debug flag. @@ -169,6 +170,14 @@ class FactoryFinder { static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader, boolean useServicesMechanism) throws ConfigurationError { + // make sure we have access to restricted packages + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + cl = null; + useBSClsLoader = true; + } + } + try { Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader); Object instance = null; diff --git a/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java index abd0a7ca0af..6ae593a105c 100644 --- a/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java +++ b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java @@ -54,6 +54,7 @@ class SchemaFactoryFinder { *

Take care of restrictions imposed by java security model

*/ private static SecuritySupport ss = new SecuritySupport(); + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal"; /** *

Cache properties for performance.

*/ @@ -213,28 +214,6 @@ class SchemaFactoryFinder { } } - /** - // try to read from $java.home/lib/jaxp.properties - try { - String javah = ss.getSystemProperty( "java.home" ); - String configFile = javah + File.separator + - "lib" + File.separator + "jaxp.properties"; - File f = new File( configFile ); - if( ss.doesFileExist(f)) { - sf = loadFromProperty( - propertyName,f.getAbsolutePath(), new FileInputStream(f)); - if(sf!=null) return sf; - } else { - debugPrintln("Tried to read "+ f.getAbsolutePath()+", but it doesn't exist."); - } - } catch(Throwable e) { - if( debug ) { - debugPrintln("failed to read $java.home/lib/jaxp.properties"); - e.printStackTrace(); - } - } - */ - // try META-INF/services files Iterator sitr = createServiceFileIterator(); while(sitr.hasNext()) { @@ -269,14 +248,20 @@ class SchemaFactoryFinder { */ private Class createClass(String className) { Class clazz; + // make sure we have access to restricted packages + boolean internal = false; + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + internal = true; + } + } - // use approprite ClassLoader try { - if (classLoader != null) { - clazz = classLoader.loadClass(className); - } else { - clazz = Class.forName(className); - } + if (classLoader != null && !internal) { + clazz = classLoader.loadClass(className); + } else { + clazz = Class.forName(className); + } } catch (Throwable t) { if(debug) t.printStackTrace(); return null; diff --git a/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java b/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java index b22120da26a..797b9556a0a 100644 --- a/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java +++ b/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java @@ -48,6 +48,7 @@ import java.util.Properties; * @since 1.5 */ class XPathFactoryFinder { + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xpath.internal"; private static SecuritySupport ss = new SecuritySupport() ; /** debug support code. */ @@ -246,18 +247,25 @@ class XPathFactoryFinder { */ private Class createClass(String className) { Class clazz; - - // use approprite ClassLoader - try { - if (classLoader != null) { - clazz = classLoader.loadClass(className); - } else { - clazz = Class.forName(className); - } - } catch (Throwable t) { - if(debug) t.printStackTrace(); - return null; + // make sure we have access to restricted packages + boolean internal = false; + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + internal = true; } + } + + // use approprite ClassLoader + try { + if (classLoader != null && !internal) { + clazz = classLoader.loadClass(className); + } else { + clazz = Class.forName(className); + } + } catch (Throwable t) { + if(debug) t.printStackTrace(); + return null; + } return clazz; } diff --git a/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java b/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java index c15cff1dc2f..cfeeeea4907 100644 --- a/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java +++ b/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java @@ -104,6 +104,8 @@ public final class DOMImplementationRegistry { */ private static final String FALLBACK_CLASS = "com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl"; + private static final String DEFAULT_PACKAGE = + "com.sun.org.apache.xerces.internal.dom"; /** * Private constructor. * @param srcs Vector List of DOMImplementationSources @@ -168,10 +170,15 @@ public final class DOMImplementationRegistry { StringTokenizer st = new StringTokenizer(p); while (st.hasMoreTokens()) { String sourceName = st.nextToken(); - // Use context class loader, falling back to Class.forName - // if and only if this fails... + // make sure we have access to restricted packages + boolean internal = false; + if (System.getSecurityManager() != null) { + if (sourceName != null && sourceName.startsWith(DEFAULT_PACKAGE)) { + internal = true; + } + } Class sourceClass = null; - if (classLoader != null) { + if (classLoader != null && !internal) { sourceClass = classLoader.loadClass(sourceName); } else { sourceClass = Class.forName(sourceName); diff --git a/jaxp/src/org/xml/sax/helpers/NewInstance.java b/jaxp/src/org/xml/sax/helpers/NewInstance.java index 398f8dce8ea..449e62df1d4 100644 --- a/jaxp/src/org/xml/sax/helpers/NewInstance.java +++ b/jaxp/src/org/xml/sax/helpers/NewInstance.java @@ -54,9 +54,10 @@ import java.lang.reflect.InvocationTargetException; * including versions of Java 2.

* * @author Edwin Goei, David Brownell + * @version 2.0.1 (sax2r2) */ class NewInstance { - + private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal"; /** * Creates a new instance of the specified class name * @@ -66,8 +67,16 @@ class NewInstance { throws ClassNotFoundException, IllegalAccessException, InstantiationException { + // make sure we have access to restricted packages + boolean internal = false; + if (System.getSecurityManager() != null) { + if (className != null && className.startsWith(DEFAULT_PACKAGE)) { + internal = true; + } + } + Class driverClass; - if (classLoader == null) { + if (classLoader == null || internal) { driverClass = Class.forName(className); } else { driverClass = classLoader.loadClass(className); @@ -75,29 +84,4 @@ class NewInstance { return driverClass.newInstance(); } - /** - * Figure out which ClassLoader to use. For JDK 1.2 and later use - * the context ClassLoader. - */ - static ClassLoader getClassLoader () - { - Method m = null; - - try { - m = Thread.class.getMethod("getContextClassLoader", (Class[]) null); - } catch (NoSuchMethodException e) { - // Assume that we are running JDK 1.1, use the current ClassLoader - return NewInstance.class.getClassLoader(); - } - - try { - return (ClassLoader) m.invoke(Thread.currentThread(), (Object[]) null); - } catch (IllegalAccessException e) { - // assert(false) - throw new UnknownError(e.getMessage()); - } catch (InvocationTargetException e) { - // assert(e.getTargetException() instanceof SecurityException) - throw new UnknownError(e.getMessage()); - } - } } diff --git a/jaxp/src/org/xml/sax/helpers/ParserAdapter.java b/jaxp/src/org/xml/sax/helpers/ParserAdapter.java index b2f2adc7475..73f10c243d9 100644 --- a/jaxp/src/org/xml/sax/helpers/ParserAdapter.java +++ b/jaxp/src/org/xml/sax/helpers/ParserAdapter.java @@ -74,13 +74,14 @@ import org.xml.sax.SAXNotSupportedException; * * @since SAX 2.0 * @author David Megginson + * @version 2.0.1 (sax2r2) * @see org.xml.sax.helpers.XMLReaderAdapter * @see org.xml.sax.XMLReader * @see org.xml.sax.Parser */ public class ParserAdapter implements XMLReader, DocumentHandler { - + private static SecuritySupport ss = new SecuritySupport(); //////////////////////////////////////////////////////////////////// // Constructors. @@ -102,7 +103,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler { super(); - String driver = System.getProperty("org.xml.sax.parser"); + String driver = ss.getSystemProperty("org.xml.sax.parser"); try { setup(ParserFactory.makeParser()); diff --git a/jaxp/src/org/xml/sax/helpers/ParserFactory.java b/jaxp/src/org/xml/sax/helpers/ParserFactory.java index 8709a3ce9e4..e716be932a8 100644 --- a/jaxp/src/org/xml/sax/helpers/ParserFactory.java +++ b/jaxp/src/org/xml/sax/helpers/ParserFactory.java @@ -30,12 +30,6 @@ package org.xml.sax.helpers; -import java.lang.ClassNotFoundException; -import java.lang.IllegalAccessException; -import java.lang.InstantiationException; -import java.lang.SecurityException; -import java.lang.ClassCastException; - import org.xml.sax.Parser; @@ -69,9 +63,10 @@ import org.xml.sax.Parser; * interface. * @since SAX 1.0 * @author David Megginson + * @version 2.0.1 (sax2r2) */ public class ParserFactory { - + private static SecuritySupport ss = new SecuritySupport(); /** * Private null constructor. @@ -109,7 +104,7 @@ public class ParserFactory { NullPointerException, ClassCastException { - String className = System.getProperty("org.xml.sax.parser"); + String className = ss.getSystemProperty("org.xml.sax.parser"); if (className == null) { throw new NullPointerException("No value for sax.parser property"); } else { @@ -146,7 +141,7 @@ public class ParserFactory { ClassCastException { return (Parser) NewInstance.newInstance ( - NewInstance.getClassLoader (), className); + ss.getContextClassLoader(), className); } } diff --git a/jaxp/src/org/xml/sax/helpers/SecuritySupport.java b/jaxp/src/org/xml/sax/helpers/SecuritySupport.java new file mode 100644 index 00000000000..cf03afbf618 --- /dev/null +++ b/jaxp/src/org/xml/sax/helpers/SecuritySupport.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2004, 2006, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax.helpers; + +import java.io.*; +import java.security.*; + +/** + * This class is duplicated for each JAXP subpackage so keep it in sync. + * It is package private and therefore is not exposed as part of the JAXP + * API. + * + * Security related methods that only work on J2SE 1.2 and newer. + */ +class SecuritySupport { + + + ClassLoader getContextClassLoader() throws SecurityException{ + return (ClassLoader) + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + ClassLoader cl = null; + //try { + cl = Thread.currentThread().getContextClassLoader(); + //} catch (SecurityException ex) { } + + if (cl == null) + cl = ClassLoader.getSystemClassLoader(); + + return cl; + } + }); + } + + String getSystemProperty(final String propName) { + return (String) + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty(propName); + } + }); + } + + FileInputStream getFileInputStream(final File file) + throws FileNotFoundException + { + try { + return (FileInputStream) + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws FileNotFoundException { + return new FileInputStream(file); + } + }); + } catch (PrivilegedActionException e) { + throw (FileNotFoundException)e.getException(); + } + } + + InputStream getResourceAsStream(final ClassLoader cl, + final String name) + { + return (InputStream) + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + InputStream ris; + if (cl == null) { + ris = Object.class.getResourceAsStream(name); + } else { + ris = cl.getResourceAsStream(name); + } + return ris; + } + }); + } + + boolean doesFileExist(final File f) { + return ((Boolean) + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return new Boolean(f.exists()); + } + })).booleanValue(); + } + +} diff --git a/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java b/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java index 0d5ea4b7539..81ca862b1cf 100644 --- a/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java +++ b/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java @@ -34,8 +34,6 @@ package org.xml.sax.helpers; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; -import java.security.AccessController; -import java.security.PrivilegedAction; import org.xml.sax.XMLReader; import org.xml.sax.SAXException; @@ -85,8 +83,8 @@ final public class XMLReaderFactory } private static final String property = "org.xml.sax.driver"; + private static SecuritySupport ss = new SecuritySupport(); - private static String _clsFromJar = null; private static boolean _jarread = false; /** * Attempt to create an XMLReader from system defaults. @@ -134,43 +132,45 @@ final public class XMLReaderFactory throws SAXException { String className = null; - ClassLoader loader = NewInstance.getClassLoader (); + ClassLoader cl = ss.getContextClassLoader(); // 1. try the JVM-instance-wide system property - try { className = System.getProperty (property); } - catch (RuntimeException e) { /* normally fails for applets */ } + try { + className = ss.getSystemProperty(property); + } + catch (RuntimeException e) { /* continue searching */ } // 2. if that fails, try META-INF/services/ if (className == null) { if (!_jarread) { - final ClassLoader loader1 = loader; _jarread = true; - _clsFromJar = (String) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - String clsName = null; - try { - String service = "META-INF/services/" + property; - InputStream in; - BufferedReader reader; - if (loader1 == null) - in = ClassLoader.getSystemResourceAsStream (service); - else - in = loader1.getResourceAsStream (service); + String service = "META-INF/services/" + property; + InputStream in; + BufferedReader reader; - if (in != null) { - reader = new BufferedReader ( - new InputStreamReader (in, "UTF8")); - clsName = reader.readLine (); - in.close (); - } - } catch (Exception e) { + try { + if (cl != null) { + in = ss.getResourceAsStream(cl, service); + + // If no provider found then try the current ClassLoader + if (in == null) { + cl = null; + in = ss.getResourceAsStream(cl, service); } - return clsName; + } else { + // No Context ClassLoader, try the current ClassLoader + in = ss.getResourceAsStream(cl, service); } - }); + + if (in != null) { + reader = new BufferedReader ( + new InputStreamReader (in, "UTF8")); + className = reader.readLine (); + in.close (); + } + } catch (Exception e) { + } } - className = _clsFromJar; } // 3. Distro-specific fallback @@ -187,7 +187,7 @@ final public class XMLReaderFactory // do we know the XMLReader implementation class yet? if (className != null) - return loadClass (loader, className); + return loadClass (cl, className); // 4. panic -- adapt any SAX1 parser try { @@ -217,7 +217,7 @@ final public class XMLReaderFactory public static XMLReader createXMLReader (String className) throws SAXException { - return loadClass (NewInstance.getClassLoader (), className); + return loadClass (ss.getContextClassLoader(), className); } private static XMLReader loadClass (ClassLoader loader, String className) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 31171394564..a5716c58186 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -207,3 +207,4 @@ d8d8032d02d77fbf5f9b3bb8df73663f42fd4dd0 jdk8-b82 a1dcc0d83da1e07f3ada60ef110dd105d95d3554 jdk8-b83 5773e3fc83803f392234ba54c3a437ba176f1ead jdk8-b84 8c0b6bccfe474576d6b30d1582c4329029330150 jdk8-b85 +a5e7c2f093c9996ab3419db1565094a07b059e9c jdk8-b86 diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyle.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyle.java index 66c4d3afeb5..b56816d88b7 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyle.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyle.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyleFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyleFeature.java index 5b41eef5d6b..07aa92d6bd6 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyleFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyleFeature.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/Databinding.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/Databinding.java index 45422a4b4bf..5f015061119 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/Databinding.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/Databinding.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingFactory.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingFactory.java index 351eb9f82ad..6b2a3e11b30 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingFactory.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingFactory.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingMode.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingMode.java index 45f00f92a36..af18221fc59 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingMode.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingMode.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java index f24a09e3ce3..c4cf116b0e0 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java index 776225028a2..d0c0d87a7fb 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/JavaCallInfo.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/JavaCallInfo.java index 07c4f383e65..db9a9f2f5f2 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/JavaCallInfo.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/JavaCallInfo.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLGenerator.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLGenerator.java index 70ff4e76276..5bda62b8674 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLGenerator.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLGenerator.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLResolver.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLResolver.java index 1cfb1b3a540..fba41f73d90 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLResolver.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/WSDLResolver.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java index 7d69c5fd7e9..ab53f0574c1 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java @@ -1,43 +1,27 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ - package com.oracle.webservices.internal.api.message; import com.sun.istack.internal.NotNull; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BasePropertySet.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BasePropertySet.java index 7baf5c9a58f..4c3ca54ef62 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BasePropertySet.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BasePropertySet.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ContentType.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ContentType.java index c6f0c1ec49d..afdb887f9b9 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ContentType.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ContentType.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java index 76eaaa04e62..60566d92e3d 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContext.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContext.java index 9ae9a03a3da..f918f387ad2 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContext.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContext.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContextFactory.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContextFactory.java index 39baadbd25f..c2fbad56171 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContextFactory.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/MessageContextFactory.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/PropertySet.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/PropertySet.java index 6a765a4f3ff..64c14bfaf4b 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/PropertySet.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/PropertySet.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ReadOnlyPropertyException.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ReadOnlyPropertyException.java index 0bf45691db3..5cf99e2f159 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ReadOnlyPropertyException.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/ReadOnlyPropertyException.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.api.message; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java index 198f19e3b34..28b3502cfdb 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java @@ -1,43 +1,27 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ - package com.oracle.webservices.internal.impl.encoding; import java.io.IOException; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/internalspi/encoding/StreamDecoder.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/internalspi/encoding/StreamDecoder.java index 5e1ddea28b4..a04ba43d948 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/internalspi/encoding/StreamDecoder.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/internalspi/encoding/StreamDecoder.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.webservices.internal.impl.internalspi.encoding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ExistingAnnotationsType.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ExistingAnnotationsType.java index f0a6d6489e8..58cb4715a85 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ExistingAnnotationsType.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ExistingAnnotationsType.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaMethod.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaMethod.java index d668bb8cf87..e2a1bdeecc6 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaMethod.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaMethod.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaParam.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaParam.java index e08ba7304a1..f1e49e3025b 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaParam.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaParam.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import org.w3c.dom.Element; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaWsdlMappingType.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaWsdlMappingType.java index c352bb8f8d4..b5f28909531 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaWsdlMappingType.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/JavaWsdlMappingType.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import org.w3c.dom.Element; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ObjectFactory.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ObjectFactory.java index 5e8de6b7515..24f59bc81d5 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ObjectFactory.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/ObjectFactory.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingParameterStyle.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingParameterStyle.java index 67c13ab4f6e..f68e0cacfec 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingParameterStyle.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingParameterStyle.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingStyle.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingStyle.java index 8c042d66bf5..ff0f711c7cd 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingStyle.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingStyle.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingUse.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingUse.java index ebf08de9837..a4957b56a10 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingUse.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/SoapBindingUse.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/Util.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/Util.java index d49cfe39b91..e7028f0582f 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/Util.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/Util.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/WebParamMode.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/WebParamMode.java index 83f533cb009..f84eac833a4 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/WebParamMode.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/WebParamMode.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAction.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAction.java index bd88a42ea36..08db8694f32 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAction.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAction.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAddressing.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAddressing.java index 1ab48c5bbd9..408671992b8 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAddressing.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlAddressing.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlBindingType.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlBindingType.java index 16839d231a8..10e94d5bd63 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlBindingType.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlBindingType.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlFaultAction.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlFaultAction.java index 70b31c0bcec..b83cfbc35ab 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlFaultAction.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlFaultAction.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlHandlerChain.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlHandlerChain.java index 70c6bff0e57..4914cb4c956 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlHandlerChain.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlHandlerChain.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlMTOM.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlMTOM.java index 1f5684a20a5..923a6d3a35a 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlMTOM.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlMTOM.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlOneway.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlOneway.java index 48eaa3d5d46..93c39ae8b64 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlOneway.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlOneway.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlRequestWrapper.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlRequestWrapper.java index d8ce81ad841..ed80c9965e9 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlRequestWrapper.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlRequestWrapper.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlResponseWrapper.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlResponseWrapper.java index 4eae7611476..0f2ef0622d1 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlResponseWrapper.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlResponseWrapper.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlSOAPBinding.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlSOAPBinding.java index 0756ae9b93e..be8eaa9daed 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlSOAPBinding.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlSOAPBinding.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlServiceMode.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlServiceMode.java index 2d10bfb5c22..95803fc5afd 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlServiceMode.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlServiceMode.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebEndpoint.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebEndpoint.java index 8e1453fdf1a..7a23836d95c 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebEndpoint.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebEndpoint.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebFault.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebFault.java index 48ff756e3e2..acae5314f1c 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebFault.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebFault.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebMethod.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebMethod.java index c7c250f5b41..201f04d8c6e 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebMethod.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebMethod.java @@ -1,41 +1,26 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package com.oracle.xmlns.internal.webservices.jaxws_databinding; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebParam.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebParam.java index 6abc7f55d45..0e662d82bf4 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebParam.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebParam.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebResult.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebResult.java index fcea0052d85..4eabd9e8701 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebResult.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebResult.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebService.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebService.java index 5cc9d4fe3c3..06324c6f9d8 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebService.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebService.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceClient.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceClient.java index 379b301c994..548649a1e64 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceClient.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceClient.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceProvider.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceProvider.java index 31d6c324350..c152ad50fe2 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceProvider.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceProvider.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceRef.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceRef.java index 97fb67e5681..ebda7053730 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceRef.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/XmlWebServiceRef.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.oracle.xmlns.internal.webservices.jaxws_databinding; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java index f9a486561d1..457f7e76b38 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java @@ -1,43 +1,29 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6-SNAPSHOT // See http://java.sun.com/xml/jaxb diff --git a/jdk/.hgtags b/jdk/.hgtags index ef6e16f2fe3..cc1dd780285 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -207,3 +207,4 @@ c0f8022eba536dcdc8aae659005b33f3982b9368 jdk8-b81 ac519af51769e92c51b597a730974e8607357709 jdk8-b83 7b4721e4edb4e1c65e9c839a70d7cc67f81c7632 jdk8-b84 296676d534c52888c36e305a2bf7f345c4ca70f8 jdk8-b85 +7989cd0cc3a9149864589438ee2c949015d8aa9a jdk8-b86 diff --git a/jdk/make/java/java/FILES_c.gmk b/jdk/make/java/java/FILES_c.gmk index 617780a42af..d01b0c29563 100644 --- a/jdk/make/java/java/FILES_c.gmk +++ b/jdk/make/java/java/FILES_c.gmk @@ -48,7 +48,6 @@ FILES_c = \ Proxy.c \ RandomAccessFile.c \ RandomAccessFile_md.c \ - ResourceBundle.c \ Runtime.c \ SecurityManager.c \ Shutdown.c \ diff --git a/jdk/make/java/java/Makefile b/jdk/make/java/java/Makefile index 54f4dbdebfa..2fe764112fe 100644 --- a/jdk/make/java/java/Makefile +++ b/jdk/make/java/java/Makefile @@ -312,6 +312,12 @@ PROPS = content-types.properties # CAL_PROPS = calendars.properties +# +# Rule to copy Hijrah-umalqura calendar properties file. +# +HIJRAH_UMALQURA_PROPS = hijrah-config-umalqura.properties + + # # Rule to copy tzmappings file on Windows # @@ -324,7 +330,7 @@ $(TZMAP): $(TZMAPFILE) $(call chmod-file, 444) endif -build: $(LIBDIR)/$(PROPS) $(LIBDIR)/$(CAL_PROPS) $(TZMAP) +build: $(LIBDIR)/$(PROPS) $(LIBDIR)/$(CAL_PROPS) $(LIBDIR)/$(HIJRAH_UMALQURA_PROPS) $(TZMAP) $(LIBDIR)/$(PROPS): $(PLATFORM_SRC)/lib/$(PROPS) $(install-file) @@ -332,6 +338,9 @@ $(LIBDIR)/$(PROPS): $(PLATFORM_SRC)/lib/$(PROPS) $(LIBDIR)/$(CAL_PROPS): $(SHARE_SRC)/lib/$(CAL_PROPS) $(install-file) +$(LIBDIR)/$(HIJRAH_UMALQURA_PROPS): $(SHARE_SRC)/lib/$(HIJRAH_UMALQURA_PROPS) + $(install-file) + clean:: $(RM) -r $(LIBDIR)/$(PROPS) $(TZMAP) diff --git a/jdk/make/java/java/mapfile-vers b/jdk/make/java/java/mapfile-vers index 60f0f864607..ca33582de6b 100644 --- a/jdk/make/java/java/mapfile-vers +++ b/jdk/make/java/java/mapfile-vers @@ -134,7 +134,6 @@ SUNWprivate_1.1 { Java_java_lang_ClassLoader_00024NativeLibrary_load; Java_java_lang_ClassLoader_00024NativeLibrary_unload; Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib; - Java_java_lang_ClassLoader_getCaller; Java_java_lang_ClassLoader_registerNatives; Java_java_lang_Compiler_registerNatives; Java_java_lang_Double_longBitsToDouble; @@ -217,7 +216,7 @@ SUNWprivate_1.1 { Java_java_lang_Throwable_fillInStackTrace; Java_java_lang_Throwable_getStackTraceDepth; Java_java_lang_Throwable_getStackTraceElement; - Java_java_lang_UNIXProcess_initIDs; + Java_java_lang_UNIXProcess_init; Java_java_lang_UNIXProcess_waitForProcessExit; Java_java_lang_UNIXProcess_forkAndExec; Java_java_lang_UNIXProcess_destroyProcess; @@ -233,7 +232,6 @@ SUNWprivate_1.1 { Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2; Java_java_security_AccessController_getStackAccessControlContext; Java_java_security_AccessController_getInheritedAccessControlContext; - Java_java_util_ResourceBundle_getClassContext; Java_java_util_TimeZone_getSystemTimeZoneID; Java_java_util_TimeZone_getSystemGMTOffsetID; Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8; diff --git a/jdk/make/java/java/reorder-i586 b/jdk/make/java/java/reorder-i586 index fc3202a8439..86fd4a53c3e 100644 --- a/jdk/make/java/java/reorder-i586 +++ b/jdk/make/java/java/reorder-i586 @@ -73,7 +73,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/make/java/java/reorder-sparc b/jdk/make/java/java/reorder-sparc index 090f0001da2..6293ec799a7 100644 --- a/jdk/make/java/java/reorder-sparc +++ b/jdk/make/java/java/reorder-sparc @@ -78,7 +78,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/make/java/java/reorder-sparcv9 b/jdk/make/java/java/reorder-sparcv9 index b20b45ab960..29a530d8096 100644 --- a/jdk/make/java/java/reorder-sparcv9 +++ b/jdk/make/java/java/reorder-sparcv9 @@ -74,7 +74,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/make/java/text/base/FILES_java.gmk b/jdk/make/java/text/base/FILES_java.gmk index dc1d9df0b45..c2e0f479c6b 100644 --- a/jdk/make/java/text/base/FILES_java.gmk +++ b/jdk/make/java/text/base/FILES_java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 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 @@ -105,5 +105,7 @@ FILES_java = \ sun/text/resources/CollationData.java \ \ sun/text/resources/FormatData.java \ + sun/text/resources/JavaTimeSupplementary.java \ sun/text/resources/en/FormatData_en.java \ - sun/text/resources/en/FormatData_en_US.java + sun/text/resources/en/FormatData_en_US.java \ + sun/text/resources/en/JavaTimeSupplementary_en.java \ diff --git a/jdk/make/java/util/FILES_java.gmk b/jdk/make/java/util/FILES_java.gmk index 9b0209a80db..677a97c52cb 100644 --- a/jdk/make/java/util/FILES_java.gmk +++ b/jdk/make/java/util/FILES_java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 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 @@ -26,6 +26,7 @@ FILES_java = \ sun/util/resources/LocaleData.java \ sun/util/resources/OpenListResourceBundle.java \ + sun/util/resources/ParallelListResourceBundle.java \ sun/util/resources/LocaleNamesBundle.java \ sun/util/resources/TimeZoneNamesBundle.java \ sun/util/resources/TimeZoneNames.java \ diff --git a/jdk/make/sun/cmm/Makefile b/jdk/make/sun/cmm/Makefile index 4b7710faab7..137b8d3d765 100644 --- a/jdk/make/sun/cmm/Makefile +++ b/jdk/make/sun/cmm/Makefile @@ -27,8 +27,9 @@ BUILDDIR = ../.. PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk +SUBDIRS += lcms + ifdef OPENJDK - SUBDIRS += lcms ICCPROFILE_SRC_DIR = $(SHARE_SRC)/lib/cmm/lcms else # !OPENJDK SUBDIRS += kcms diff --git a/jdk/make/sun/cmm/kcms/Makefile b/jdk/make/sun/cmm/kcms/Makefile index 50b525671c5..65372af5d96 100644 --- a/jdk/make/sun/cmm/kcms/Makefile +++ b/jdk/make/sun/cmm/kcms/Makefile @@ -57,7 +57,7 @@ include $(BUILDDIR)/common/Library.gmk SERVICEDIR = $(CLASSBINDIR)/META-INF/services FILES_copy = \ - $(SERVICEDIR)/sun.java2d.cmm.PCMM + $(SERVICEDIR)/sun.java2d.cmm.CMMServiceProvider build: copy-files diff --git a/jdk/make/sun/cmm/lcms/Makefile b/jdk/make/sun/cmm/lcms/Makefile index 85b02e4960e..15afe61c3d8 100644 --- a/jdk/make/sun/cmm/lcms/Makefile +++ b/jdk/make/sun/cmm/lcms/Makefile @@ -58,7 +58,7 @@ include $(BUILDDIR)/common/Library.gmk SERVICEDIR = $(CLASSBINDIR)/META-INF/services FILES_copy = \ - $(SERVICEDIR)/sun.java2d.cmm.PCMM + $(SERVICEDIR)/sun.java2d.cmm.CMMServiceProvider build: copy-files diff --git a/jdk/make/sun/font/FILES_c.gmk b/jdk/make/sun/font/FILES_c.gmk index c9437064216..b1895c50f16 100644 --- a/jdk/make/sun/font/FILES_c.gmk +++ b/jdk/make/sun/font/FILES_c.gmk @@ -106,7 +106,21 @@ FILES_cpp_shared = \ OpenTypeLayoutEngine.cpp \ ThaiLayoutEngine.cpp \ ScriptAndLanguageTags.cpp \ - FontInstanceAdapter.cpp + FontInstanceAdapter.cpp \ + ContextualGlyphInsertionProc2.cpp \ + ContextualGlyphSubstProc2.cpp \ + GXLayoutEngine2.cpp \ + IndicRearrangementProcessor2.cpp \ + LigatureSubstProc2.cpp \ + MorphTables2.cpp \ + NonContextualGlyphSubstProc2.cpp \ + SegmentArrayProcessor2.cpp \ + SegmentSingleProcessor2.cpp \ + SimpleArrayProcessor2.cpp \ + SingleTableProcessor2.cpp \ + StateTableProcessor2.cpp \ + SubtableProcessor2.cpp \ + TrimmedArrayProcessor2.cpp ifeq ($(PLATFORM),windows) diff --git a/jdk/make/sun/splashscreen/Makefile b/jdk/make/sun/splashscreen/Makefile index 301f56838ae..207ffb2ab6a 100644 --- a/jdk/make/sun/splashscreen/Makefile +++ b/jdk/make/sun/splashscreen/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 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 @@ -83,21 +83,17 @@ ifeq ($(PLATFORM), macosx) -framework JavaNativeFoundation else ifneq ($(PLATFORM), windows) CFLAGS += -DWITH_X11 - ifeq ($(PLATFORM), macosx)) - OTHER_LDLIBS += -liconv - CPPFLAGS += -I$(OPENWIN_HOME)/include \ - -I$(OPENWIN_HOME)/include/X11/extensions - OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -pthread - else - CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions - OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread - endif + CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions + OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread else # PLATFORM CFLAGS += -DWITH_WIN32 OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll #$(JVMLIB) $(OBJDIR)/../../jpeg/$(OBJDIRNAME)/jpeg$(SUFFIX).lib endif # PLATFORM +# Add giflib include path for all platforms +CPPFLAGS += -I$(SHARE_SRC)/native/sun/awt/giflib + # # Add to ambient vpath to get files in a subdirectory # diff --git a/jdk/make/sun/text/FILES_java.gmk b/jdk/make/sun/text/FILES_java.gmk index 7f2623188a4..2f15ec33612 100644 --- a/jdk/make/sun/text/FILES_java.gmk +++ b/jdk/make/sun/text/FILES_java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 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 @@ -227,5 +227,54 @@ FILES_java = \ sun/util/resources/sv/TimeZoneNames_sv.java \ sun/util/resources/zh/TimeZoneNames_zh_CN.java \ sun/util/resources/zh/TimeZoneNames_zh_TW.java \ - sun/util/resources/zh/TimeZoneNames_zh_HK.java + sun/util/resources/zh/TimeZoneNames_zh_HK.java \ + \ + sun/text/resources/ar/JavaTimeSupplementary_ar.java \ + sun/text/resources/be/JavaTimeSupplementary_be.java \ + sun/text/resources/bg/JavaTimeSupplementary_bg.java \ + sun/text/resources/ca/JavaTimeSupplementary_ca.java \ + sun/text/resources/cs/JavaTimeSupplementary_cs.java \ + sun/text/resources/da/JavaTimeSupplementary_da.java \ + sun/text/resources/de/JavaTimeSupplementary_de.java \ + sun/text/resources/el/JavaTimeSupplementary_el.java \ + sun/text/resources/en/JavaTimeSupplementary_en_GB.java \ + sun/text/resources/en/JavaTimeSupplementary_en_SG.java \ + sun/text/resources/es/JavaTimeSupplementary_es.java \ + sun/text/resources/et/JavaTimeSupplementary_et.java \ + sun/text/resources/fi/JavaTimeSupplementary_fi.java \ + sun/text/resources/fr/JavaTimeSupplementary_fr.java \ + sun/text/resources/ga/JavaTimeSupplementary_ga.java \ + sun/text/resources/hi/JavaTimeSupplementary_hi_IN.java \ + sun/text/resources/hr/JavaTimeSupplementary_hr.java \ + sun/text/resources/hu/JavaTimeSupplementary_hu.java \ + sun/text/resources/is/JavaTimeSupplementary_is.java \ + sun/text/resources/it/JavaTimeSupplementary_it.java \ + sun/text/resources/iw/JavaTimeSupplementary_iw.java \ + sun/text/resources/iw/JavaTimeSupplementary_iw_IL.java \ + sun/text/resources/ja/JavaTimeSupplementary_ja.java \ + sun/text/resources/ko/JavaTimeSupplementary_ko.java \ + sun/text/resources/lt/JavaTimeSupplementary_lt.java \ + sun/text/resources/lv/JavaTimeSupplementary_lv.java \ + sun/text/resources/mk/JavaTimeSupplementary_mk.java \ + sun/text/resources/ms/JavaTimeSupplementary_ms.java \ + sun/text/resources/mt/JavaTimeSupplementary_mt.java \ + sun/text/resources/nl/JavaTimeSupplementary_nl.java \ + sun/text/resources/no/JavaTimeSupplementary_no.java \ + sun/text/resources/pl/JavaTimeSupplementary_pl.java \ + sun/text/resources/pt/JavaTimeSupplementary_pt.java \ + sun/text/resources/pt/JavaTimeSupplementary_pt_PT.java \ + sun/text/resources/ro/JavaTimeSupplementary_ro.java \ + sun/text/resources/ru/JavaTimeSupplementary_ru.java \ + sun/text/resources/sk/JavaTimeSupplementary_sk.java \ + sun/text/resources/sl/JavaTimeSupplementary_sl.java \ + sun/text/resources/sq/JavaTimeSupplementary_sq.java \ + sun/text/resources/sr/JavaTimeSupplementary_sr.java \ + sun/text/resources/sr/JavaTimeSupplementary_sr_Latn.java \ + sun/text/resources/sv/JavaTimeSupplementary_sv.java \ + sun/text/resources/th/JavaTimeSupplementary_th.java \ + sun/text/resources/tr/JavaTimeSupplementary_tr.java \ + sun/text/resources/uk/JavaTimeSupplementary_uk.java \ + sun/text/resources/vi/JavaTimeSupplementary_vi.java \ + sun/text/resources/zh/JavaTimeSupplementary_zh.java \ + sun/text/resources/zh/JavaTimeSupplementary_zh_TW.java diff --git a/jdk/make/sun/tzdb/Makefile b/jdk/make/sun/tzdb/Makefile index 14fd87a5e69..03e904818cf 100644 --- a/jdk/make/sun/tzdb/Makefile +++ b/jdk/make/sun/tzdb/Makefile @@ -42,7 +42,6 @@ BUILD_MANIFEST=true # Time zone data file creation # TZDATA_DIR := ../javazic/tzdata -TZDATA_VER := $(subst tzdata,,$(shell $(GREP) '^tzdata' $(TZDATA_DIR)/VERSION)) TZFILE := \ africa antarctica asia australasia europe northamerica \ pacificnew southamerica backward etcetera \ @@ -50,9 +49,7 @@ TZFILE := \ TZFILES := $(addprefix $(TZDATA_DIR)/,$(TZFILE)) - - -TZDB_JAR = tzdb.jar +TZDB_DAT = $(LIBDIR)/tzdb.dat # # Rules @@ -62,13 +59,12 @@ include $(BUILDDIR)/common/Classes.gmk # # Add to the build rule # -build: $(LIBDIR)/$(TZDB_JAR) +build: $(TZDB_DAT) -$(LIBDIR)/$(TZDB_JAR): $(TZFILES) +$(TZDB_DAT): $(TZFILES) $(prep-target) - echo build tzdb from version $(TZDATA_VER) $(BOOT_JAVA_CMD) -jar $(BUILDTOOLJARDIR)/tzdb.jar \ - -version $(TZDATA_VER) -srcdir $(TZDATA_DIR) -dstdir $(LIBDIR) $(TZFILE) + -srcdir $(TZDATA_DIR) -dstfile $(TZDB_DAT) $(TZFILE) clean clobber:: - $(RM) $(LIBDIR)/$(TZDB_JAR) + $(RM) $(TZDB_DAT) diff --git a/jdk/make/tools/src/build/tools/cldrconverter/AbstractLDMLHandler.java b/jdk/make/tools/src/build/tools/cldrconverter/AbstractLDMLHandler.java index 43c7bd8f11a..fd974809fa9 100644 --- a/jdk/make/tools/src/build/tools/cldrconverter/AbstractLDMLHandler.java +++ b/jdk/make/tools/src/build/tools/cldrconverter/AbstractLDMLHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -25,6 +25,7 @@ package build.tools.cldrconverter; +import build.tools.cldrconverter.CLDRConverter.DraftType; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -88,7 +89,7 @@ abstract class AbstractLDMLHandler extends DefaultHandler { } String draftValue = attributes.getValue("draft"); if (draftValue != null) { - return CLDRConverter.draftType > CLDRConverter.DRAFT_MAP.get(draftValue); + return DraftType.getDefault().ordinal() > DraftType.forKeyword(draftValue).ordinal(); } return false; } diff --git a/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java b/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java index fbd95f32226..4bb55d0687c 100644 --- a/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java +++ b/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java @@ -266,6 +266,9 @@ class Bundle { handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayNarrows"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "AmPmMarkers"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "narrow.AmPmMarkers"); + handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNames"); + handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterAbbreviations"); + handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNarrows"); adjustEraNames(myMap, calendarType); @@ -484,25 +487,33 @@ class Bundle { for (String k : patternKeys) { if (myMap.containsKey(calendarPrefix + k)) { int len = patternKeys.length; - List rawPatterns = new ArrayList<>(); - List patterns = new ArrayList<>(); + List rawPatterns = new ArrayList<>(len); + List patterns = new ArrayList<>(len); for (int i = 0; i < len; i++) { String key = calendarPrefix + patternKeys[i]; String pattern = (String) myMap.remove(key); if (pattern == null) { pattern = (String) parentsMap.remove(key); } + rawPatterns.add(i, pattern); if (pattern != null) { - rawPatterns.add(i, pattern); patterns.add(i, translateDateFormatLetters(calendarType, pattern)); + } else { + patterns.add(i, null); } } + // If patterns is empty or has any nulls, discard patterns. if (patterns.isEmpty()) { return; } + for (String p : patterns) { + if (p == null) { + return; + } + } String key = calendarPrefix + name; if (!rawPatterns.equals(patterns)) { - myMap.put("cldr." + key, rawPatterns.toArray(new String[len])); + myMap.put("java.time." + key, rawPatterns.toArray(new String[len])); } myMap.put(key, patterns.toArray(new String[len])); break; diff --git a/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java b/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java index 069afb84d1f..f1185f18978 100644 --- a/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java +++ b/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java @@ -68,25 +68,43 @@ public class CLDRConverter { static MetaZonesParseHandler handlerMetaZones; private static BundleGenerator bundleGenerator; - static int draftType; - private static final String DRAFT_UNCONFIRMED = "unconfirmed"; - private static final String DRAFT_PROVISIONAL = "provisional"; - private static final String DRAFT_CONTRIBUTED = "contributed"; - private static final String DRAFT_APPROVED = "approved"; - private static final String DRAFT_TRUE = "true"; - private static final String DRAFT_FALSE = "false"; - private static final String DRAFT_DEFAULT = DRAFT_APPROVED; - static final Map DRAFT_MAP = new HashMap<>(); + static enum DraftType { + UNCONFIRMED, + PROVISIONAL, + CONTRIBUTED, + APPROVED; - static { - DRAFT_MAP.put(DRAFT_UNCONFIRMED, 0); - DRAFT_MAP.put(DRAFT_PROVISIONAL, 1); - DRAFT_MAP.put(DRAFT_CONTRIBUTED, 2); - DRAFT_MAP.put(DRAFT_APPROVED, 3); - DRAFT_MAP.put(DRAFT_TRUE, 0); - DRAFT_MAP.put(DRAFT_FALSE, 2); - draftType = DRAFT_MAP.get(DRAFT_DEFAULT); - }; + private static final Map map = new HashMap<>(); + static { + for (DraftType dt : values()) { + map.put(dt.getKeyword(), dt); + } + } + static private DraftType defaultType = CONTRIBUTED; + + private final String keyword; + + private DraftType() { + keyword = this.name().toLowerCase(Locale.ROOT); + + } + + static DraftType forKeyword(String keyword) { + return map.get(keyword); + } + + static DraftType getDefault() { + return defaultType; + } + + static void setDefault(String keyword) { + defaultType = Objects.requireNonNull(forKeyword(keyword)); + } + + String getKeyword() { + return keyword; + } + } static boolean USE_UTF8 = false; private static boolean verbose; @@ -106,7 +124,7 @@ public class CLDRConverter { case "-draft": String draftDataType = args[++i]; try { - draftType = DRAFT_MAP.get(draftDataType); + DraftType.setDefault(draftDataType); } catch (NullPointerException e) { severe("Error: incorrect draft value: %s%n", draftDataType); System.exit(1); @@ -525,7 +543,7 @@ public class CLDRConverter { "standalone.MonthNames", "MonthAbbreviations", "standalone.MonthAbbreviations", - "MonthNarrow", + "MonthNarrows", "standalone.MonthNarrows", "DayNames", "standalone.DayNames", @@ -533,6 +551,12 @@ public class CLDRConverter { "standalone.DayAbbreviations", "DayNarrows", "standalone.DayNarrows", + "QuarterNames", + "standalone.QuarterNames", + "QuarterAbbreviations", + "standalone.QuarterAbbreviations", + "QuarterNarrows", + "standalone.QuarterNarrows", "AmPmMarkers", "narrow.AmPmMarkers", "long.Eras", @@ -560,7 +584,7 @@ public class CLDRConverter { String prefix = calendarType.keyElementName(); for (String element : FORMAT_DATA_ELEMENTS) { String key = prefix + element; - copyIfPresent(map, "cldr." + key, formatData); + copyIfPresent(map, "java.time." + key, formatData); copyIfPresent(map, key, formatData); } } diff --git a/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java b/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java index 695312408f8..7deae4e6845 100644 --- a/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java +++ b/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java @@ -356,6 +356,44 @@ class LDMLParseHandler extends AbstractLDMLHandler { } } break; + case "quarterContext": + { + // for FormatData + // need to keep stand-alone and format, to allow for inheritance in CLDR + String type = attributes.getValue("type"); + if ("stand-alone".equals(type) || "format".equals(type)) { + pushKeyContainer(qName, attributes, type); + } else { + pushIgnoredContainer(qName); + } + } + break; + case "quarterWidth": + { + // for FormatData + // keep info about the context type so we can sort out inheritance later + String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); + switch (attributes.getValue("type")) { + case "wide": + pushStringArrayEntry(qName, attributes, prefix + "QuarterNames/" + getContainerKey(), 4); + break; + case "abbreviated": + pushStringArrayEntry(qName, attributes, prefix + "QuarterAbbreviations/" + getContainerKey(), 4); + break; + case "narrow": + pushStringArrayEntry(qName, attributes, prefix + "QuarterNarrows/" + getContainerKey(), 4); + break; + default: + pushIgnoredContainer(qName); + break; + } + } + break; + case "quarter": + // for FormatData + // add to string array entry of quarterWidth element + pushStringArrayElement(qName, attributes, Integer.parseInt(attributes.getValue("type")) - 1); + break; // // Time zone names diff --git a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java index 6f42dd9f600..be0204eeeef 100644 --- a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java +++ b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java @@ -58,12 +58,12 @@ package build.tools.tzdb; import static build.tools.tzdb.Utils.*; -import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.text.ParsePosition; import java.util.ArrayList; import java.util.Arrays; @@ -71,132 +71,131 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.NoSuchElementException; +import java.util.Scanner; import java.util.SortedMap; -import java.util.StringTokenizer; import java.util.TreeMap; -import java.util.TreeSet; -import java.util.jar.JarOutputStream; -import java.util.zip.ZipEntry; import java.util.regex.Matcher; +import java.util.regex.MatchResult; import java.util.regex.Pattern; /** - * A builder that can read the TZDB time-zone files and build {@code ZoneRules} instances. + * A compiler that reads a set of TZDB time-zone files and builds a single + * combined TZDB data file. * * @since 1.8 */ public final class TzdbZoneRulesCompiler { - private static final Matcher YEAR = Pattern.compile("(?i)(?min)|(?max)|(?only)|(?[0-9]+)").matcher(""); - private static final Matcher MONTH = Pattern.compile("(?i)(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)").matcher(""); - private static final Matcher DOW = Pattern.compile("(?i)(mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun)").matcher(""); - private static final Matcher TIME = Pattern.compile("(?-)?+(?[0-9]{1,2})(:(?[0-5][0-9]))?+(:(?[0-5][0-9]))?+").matcher(""); - - /** - * Constant for MJD 1972-01-01. - */ - private static final long MJD_1972_01_01 = 41317L; - - /** - * Reads a set of TZDB files and builds a single combined data file. - * - * @param args the arguments - */ public static void main(String[] args) { + new TzdbZoneRulesCompiler().compile(args); + } + + private void compile(String[] args) { if (args.length < 2) { outputHelp(); return; } - - // parse args + Path srcDir = null; + Path dstFile = null; String version = null; - File baseSrcDir = null; - File dstDir = null; - boolean verbose = false; - - // parse options + // parse args/options int i; for (i = 0; i < args.length; i++) { String arg = args[i]; - if (arg.startsWith("-") == false) { + if (!arg.startsWith("-")) { break; } if ("-srcdir".equals(arg)) { - if (baseSrcDir == null && ++i < args.length) { - baseSrcDir = new File(args[i]); + if (srcDir == null && ++i < args.length) { + srcDir = Paths.get(args[i]); continue; } - } else if ("-dstdir".equals(arg)) { - if (dstDir == null && ++i < args.length) { - dstDir = new File(args[i]); - continue; - } - } else if ("-version".equals(arg)) { - if (version == null && ++i < args.length) { - version = args[i]; + } else if ("-dstfile".equals(arg)) { + if (dstFile == null && ++i < args.length) { + dstFile = Paths.get(args[i]); continue; } } else if ("-verbose".equals(arg)) { - if (verbose == false) { + if (!verbose) { verbose = true; continue; } - } else if ("-help".equals(arg) == false) { + } else if (!"-help".equals(arg)) { System.out.println("Unrecognised option: " + arg); } outputHelp(); return; } - // check source directory - if (baseSrcDir == null) { - System.out.println("Source directory must be specified using -srcdir: " + baseSrcDir); - return; + if (srcDir == null) { + System.err.println("Source directory must be specified using -srcdir"); + System.exit(1); } - if (baseSrcDir.isDirectory() == false) { - System.out.println("Source does not exist or is not a directory: " + baseSrcDir); - return; + if (!Files.isDirectory(srcDir)) { + System.err.println("Source does not exist or is not a directory: " + srcDir); + System.exit(1); } - dstDir = (dstDir != null ? dstDir : baseSrcDir); - // parse source file names - List srcFileNames = Arrays.asList(Arrays.copyOfRange(args, i, args.length)); - if (srcFileNames.isEmpty()) { - System.out.println("Source filenames not specified, using default set"); - System.out.println("(africa antarctica asia australasia backward etcetera europe northamerica southamerica)"); - srcFileNames = Arrays.asList("africa", "antarctica", "asia", "australasia", "backward", - "etcetera", "europe", "northamerica", "southamerica"); + if (i == args.length) { + i = 0; + args = new String[] {"africa", "antarctica", "asia", "australasia", "europe", + "northamerica","southamerica", "backward", "etcetera" }; + System.out.println("Source filenames not specified, using default set ( "); + for (String name : args) { + System.out.printf(name + " "); + } + System.out.println(")"); } - - // find source directories to process - List srcDirs = new ArrayList<>(); - if (version != null) { - // if the "version" specified, as in jdk repo, the "baseSrcDir" is - // the "srcDir" that contains the tzdb data. - srcDirs.add(baseSrcDir); - } else { - File[] dirs = baseSrcDir.listFiles(); - for (File dir : dirs) { - if (dir.isDirectory() && dir.getName().matches("[12][0-9]{3}[A-Za-z0-9._-]+")) { - srcDirs.add(dir); - } + // source files in this directory + List srcFiles = new ArrayList<>(); + for (; i < args.length; i++) { + Path file = srcDir.resolve(args[i]); + if (Files.exists(file)) { + srcFiles.add(file); + } else { + System.err.println("Source directory does not contain source file: " + args[i]); + System.exit(1); } } - if (srcDirs.isEmpty()) { - System.out.println("Source directory contains no valid source folders: " + baseSrcDir); - return; + // check destination file + if (dstFile == null) { + dstFile = srcDir.resolve("tzdb.dat"); + } else { + Path parent = dstFile.getParent(); + if (parent != null && !Files.exists(parent)) { + System.err.println("Destination directory does not exist: " + parent); + System.exit(1); + } } - // check destination directory - if (dstDir.exists() == false && dstDir.mkdirs() == false) { - System.out.println("Destination directory could not be created: " + dstDir); - return; + try { + // get tzdb source version + Matcher m = Pattern.compile("tzdata(?[0-9]{4}[A-z])") + .matcher(new String(Files.readAllBytes(srcDir.resolve("VERSION")), + "ISO-8859-1")); + if (m.find()) { + version = m.group("ver"); + } else { + System.exit(1); + System.err.println("Source directory does not contain file: VERSION"); + } + printVerbose("Compiling TZDB version " + version); + // parse source files + for (Path file : srcFiles) { + printVerbose("Parsing file: " + file); + parseFile(file); + } + // build zone rules + printVerbose("Building rules"); + buildZoneRules(); + // output to file + printVerbose("Outputting tzdb file: " + dstFile); + outputFile(dstFile, version, builtZones, links); + } catch (Exception ex) { + System.out.println("Failed: " + ex.toString()); + ex.printStackTrace(); + System.exit(1); } - if (dstDir.isDirectory() == false) { - System.out.println("Destination is not a directory: " + dstDir); - return; - } - process(srcDirs, srcFileNames, dstDir, version, verbose); System.exit(0); } @@ -206,145 +205,35 @@ public final class TzdbZoneRulesCompiler { private static void outputHelp() { System.out.println("Usage: TzdbZoneRulesCompiler "); System.out.println("where options include:"); - System.out.println(" -srcdir Where to find source directories (required)"); - System.out.println(" -dstdir Where to output generated files (default srcdir)"); - System.out.println(" -version Specify the version, such as 2009a (optional)"); + System.out.println(" -srcdir Where to find tzdb source directory (required)"); + System.out.println(" -dstfile Where to output generated file (default srcdir/tzdb.dat)"); System.out.println(" -help Print this usage message"); System.out.println(" -verbose Output verbose information during compilation"); - System.out.println(" There must be one directory for each version in srcdir"); - System.out.println(" Each directory must have the name of the version, such as 2009a"); - System.out.println(" Each directory must contain the unpacked tzdb files, such as asia or europe"); - System.out.println(" Directories must match the regex [12][0-9][0-9][0-9][A-Za-z0-9._-]+"); - System.out.println(" There will be one jar file for each version and one combined jar in dstdir"); - System.out.println(" If the version is specified, only that version is processed"); - } - - /** - * Process to create the jar files. - */ - private static void process(List srcDirs, List srcFileNames, File dstDir, String version, boolean verbose) { - // build actual jar files - Map> allBuiltZones = new TreeMap<>(); - Set allRegionIds = new TreeSet(); - Set allRules = new HashSet(); - Map> allLinks = new TreeMap<>(); - - for (File srcDir : srcDirs) { - // source files in this directory - List srcFiles = new ArrayList<>(); - for (String srcFileName : srcFileNames) { - File file = new File(srcDir, srcFileName); - if (file.exists()) { - srcFiles.add(file); - } - } - if (srcFiles.isEmpty()) { - continue; // nothing to process - } - - // compile - String loopVersion = (srcDirs.size() == 1 && version != null) - ? version : srcDir.getName(); - TzdbZoneRulesCompiler compiler = new TzdbZoneRulesCompiler(loopVersion, srcFiles, verbose); - try { - // compile - compiler.compile(); - SortedMap builtZones = compiler.getZones(); - - // output version-specific file - File dstFile = version == null ? new File(dstDir, "tzdb" + loopVersion + ".jar") - : new File(dstDir, "tzdb.jar"); - if (verbose) { - System.out.println("Outputting file: " + dstFile); - } - outputFile(dstFile, loopVersion, builtZones, compiler.links); - - // create totals - allBuiltZones.put(loopVersion, builtZones); - allRegionIds.addAll(builtZones.keySet()); - allRules.addAll(builtZones.values()); - allLinks.put(loopVersion, compiler.links); - } catch (Exception ex) { - System.out.println("Failed: " + ex.toString()); - ex.printStackTrace(); - System.exit(1); - } - } - - // output merged file - if (version == null) { - File dstFile = new File(dstDir, "tzdb-all.jar"); - if (verbose) { - System.out.println("Outputting combined file: " + dstFile); - } - outputFile(dstFile, allBuiltZones, allRegionIds, allRules, allLinks); - } + System.out.println(" The source directory must contain the unpacked tzdb files, such as asia or europe"); } /** * Outputs the file. */ - private static void outputFile(File dstFile, - String version, - SortedMap builtZones, - Map links) { - Map> loopAllBuiltZones = new TreeMap<>(); - loopAllBuiltZones.put(version, builtZones); - Set loopAllRegionIds = new TreeSet(builtZones.keySet()); - Set loopAllRules = new HashSet(builtZones.values()); - Map> loopAllLinks = new TreeMap<>(); - loopAllLinks.put(version, links); - outputFile(dstFile, loopAllBuiltZones, loopAllRegionIds, loopAllRules, loopAllLinks); - } - - /** - * Outputs the file. - */ - private static void outputFile(File dstFile, - Map> allBuiltZones, - Set allRegionIds, - Set allRules, - Map> allLinks) { - try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(dstFile))) { - outputTZEntry(jos, allBuiltZones, allRegionIds, allRules, allLinks); - } catch (Exception ex) { - System.out.println("Failed: " + ex.toString()); - ex.printStackTrace(); - System.exit(1); - } - } - - /** - * Outputs the timezone entry in the JAR file. - */ - private static void outputTZEntry(JarOutputStream jos, - Map> allBuiltZones, - Set allRegionIds, - Set allRules, - Map> allLinks) { - // this format is not publicly specified - try { - jos.putNextEntry(new ZipEntry("TZDB.dat")); - DataOutputStream out = new DataOutputStream(jos); - + private void outputFile(Path dstFile, String version, + SortedMap builtZones, + Map links) { + try (DataOutputStream out = new DataOutputStream(Files.newOutputStream(dstFile))) { // file version out.writeByte(1); // group out.writeUTF("TZDB"); // versions - String[] versionArray = allBuiltZones.keySet().toArray(new String[allBuiltZones.size()]); - out.writeShort(versionArray.length); - for (String version : versionArray) { - out.writeUTF(version); - } + out.writeShort(1); + out.writeUTF(version); // regions - String[] regionArray = allRegionIds.toArray(new String[allRegionIds.size()]); + String[] regionArray = builtZones.keySet().toArray(new String[builtZones.size()]); out.writeShort(regionArray.length); for (String regionId : regionArray) { out.writeUTF(regionId); } - // rules - List rulesList = new ArrayList<>(allRules); + // rules -- hashset -> remove the dup + List rulesList = new ArrayList<>(new HashSet<>(builtZones.values())); out.writeShort(rulesList.size()); ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); for (ZoneRules rules : rulesList) { @@ -357,27 +246,22 @@ public final class TzdbZoneRulesCompiler { out.write(bytes); } // link version-region-rules - for (String version : allBuiltZones.keySet()) { - out.writeShort(allBuiltZones.get(version).size()); - for (Map.Entry entry : allBuiltZones.get(version).entrySet()) { - int regionIndex = Arrays.binarySearch(regionArray, entry.getKey()); - int rulesIndex = rulesList.indexOf(entry.getValue()); - out.writeShort(regionIndex); - out.writeShort(rulesIndex); - } + out.writeShort(builtZones.size()); + for (Map.Entry entry : builtZones.entrySet()) { + int regionIndex = Arrays.binarySearch(regionArray, entry.getKey()); + int rulesIndex = rulesList.indexOf(entry.getValue()); + out.writeShort(regionIndex); + out.writeShort(rulesIndex); } // alias-region - for (String version : allLinks.keySet()) { - out.writeShort(allLinks.get(version).size()); - for (Map.Entry entry : allLinks.get(version).entrySet()) { - int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey()); - int regionIndex = Arrays.binarySearch(regionArray, entry.getValue()); - out.writeShort(aliasIndex); - out.writeShort(regionIndex); - } + out.writeShort(links.size()); + for (Map.Entry entry : links.entrySet()) { + int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey()); + int regionIndex = Arrays.binarySearch(regionArray, entry.getValue()); + out.writeShort(aliasIndex); + out.writeShort(regionIndex); } out.flush(); - jos.closeEntry(); } catch (Exception ex) { System.out.println("Failed: " + ex.toString()); ex.printStackTrace(); @@ -385,76 +269,30 @@ public final class TzdbZoneRulesCompiler { } } - //----------------------------------------------------------------------- + private static final Pattern YEAR = Pattern.compile("(?i)(?min)|(?max)|(?only)|(?[0-9]+)"); + private static final Pattern MONTH = Pattern.compile("(?i)(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)"); + private static final Matcher DOW = Pattern.compile("(?i)(mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun)").matcher(""); + private static final Matcher TIME = Pattern.compile("(?-)?+(?[0-9]{1,2})(:(?[0-5][0-9]))?+(:(?[0-5][0-9]))?+").matcher(""); + /** The TZDB rules. */ private final Map> rules = new HashMap<>(); /** The TZDB zones. */ private final Map> zones = new HashMap<>(); - /** The TZDB links. */ + /** The TZDB links. */ private final Map links = new HashMap<>(); /** The built zones. */ private final SortedMap builtZones = new TreeMap<>(); - - /** The version to produce. */ - private final String version; - - /** The source files. */ - - private final List sourceFiles; - - /** The version to produce. */ - private final boolean verbose; + /** Whether to output verbose messages. */ + private boolean verbose; /** - * Creates an instance if you want to invoke the compiler manually. - * - * @param version the version, such as 2009a, not null - * @param sourceFiles the list of source files, not empty, not null - * @param verbose whether to output verbose messages + * private contructor */ - public TzdbZoneRulesCompiler(String version, List sourceFiles, boolean verbose) { - this.version = version; - this.sourceFiles = sourceFiles; - this.verbose = verbose; - } - - /** - * Compile the rules file. - *

- * Use {@link #getZones()} to retrieve the parsed data. - * - * @throws Exception if an error occurs - */ - public void compile() throws Exception { - printVerbose("Compiling TZDB version " + version); - parseFiles(); - buildZoneRules(); - printVerbose("Compiled TZDB version " + version); - } - - /** - * Gets the parsed zone rules. - * - * @return the parsed zone rules, not null - */ - public SortedMap getZones() { - return builtZones; - } - - /** - * Parses the source files. - * - * @throws Exception if an error occurs - */ - private void parseFiles() throws Exception { - for (File file : sourceFiles) { - printVerbose("Parsing file: " + file); - parseFile(file); - } + private TzdbZoneRulesCompiler() { } /** @@ -463,14 +301,14 @@ public final class TzdbZoneRulesCompiler { * @param file the file being read, not null * @throws Exception if an error occurs */ - private void parseFile(File file) throws Exception { + private void parseFile(Path file) throws Exception { int lineNumber = 1; String line = null; - BufferedReader in = null; try { - in = new BufferedReader(new FileReader(file)); + List lines = Files.readAllLines(file, StandardCharsets.ISO_8859_1); List openZone = null; - for ( ; (line = in.readLine()) != null; lineNumber++) { + for (; lineNumber < lines.size(); lineNumber++) { + line = lines.get(lineNumber); int index = line.indexOf('#'); // remove comments (doesn't handle # in quotes) if (index >= 0) { line = line.substring(0, index); @@ -478,41 +316,43 @@ public final class TzdbZoneRulesCompiler { if (line.trim().length() == 0) { // ignore blank lines continue; } - StringTokenizer st = new StringTokenizer(line, " \t"); - if (openZone != null && Character.isWhitespace(line.charAt(0)) && st.hasMoreTokens()) { - if (parseZoneLine(st, openZone)) { + Scanner s = new Scanner(line); + if (openZone != null && Character.isWhitespace(line.charAt(0)) && s.hasNext()) { + if (parseZoneLine(s, openZone)) { openZone = null; } } else { - if (st.hasMoreTokens()) { - String first = st.nextToken(); + if (s.hasNext()) { + String first = s.next(); if (first.equals("Zone")) { - if (st.countTokens() < 3) { + openZone = new ArrayList<>(); + try { + zones.put(s.next(), openZone); + if (parseZoneLine(s, openZone)) { + openZone = null; + } + } catch (NoSuchElementException x) { printVerbose("Invalid Zone line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Zone line"); } - openZone = new ArrayList<>(); - zones.put(st.nextToken(), openZone); - if (parseZoneLine(st, openZone)) { - openZone = null; - } } else { openZone = null; if (first.equals("Rule")) { - if (st.countTokens() < 9) { + try { + parseRuleLine(s); + } catch (NoSuchElementException x) { printVerbose("Invalid Rule line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Rule line"); } - parseRuleLine(st); - } else if (first.equals("Link")) { - if (st.countTokens() < 2) { + try { + String realId = s.next(); + String aliasId = s.next(); + links.put(aliasId, realId); + } catch (NoSuchElementException x) { printVerbose("Invalid Link line in file: " + file + ", line: " + line); throw new IllegalArgumentException("Invalid Link line"); } - String realId = st.nextToken(); - String aliasId = st.nextToken(); - links.put(aliasId, realId); } else { throw new IllegalArgumentException("Unknown line"); @@ -522,52 +362,44 @@ public final class TzdbZoneRulesCompiler { } } } catch (Exception ex) { - throw new Exception("Failed while processing file '" + file + "' on line " + lineNumber + " '" + line + "'", ex); - } finally { - try { - if (in != null) { - in.close(); - } - } catch (Exception ex) { - // ignore NPE and IOE - } + throw new Exception("Failed while parsing file '" + file + "' on line " + lineNumber + " '" + line + "'", ex); } } /** * Parses a Rule line. * - * @param st the tokenizer, not null + * @param s the line scanner, not null */ - private void parseRuleLine(StringTokenizer st) { + private void parseRuleLine(Scanner s) { TZDBRule rule = new TZDBRule(); - String name = st.nextToken(); + String name = s.next(); if (rules.containsKey(name) == false) { rules.put(name, new ArrayList()); } rules.get(name).add(rule); - rule.startYear = parseYear(st.nextToken(), 0); - rule.endYear = parseYear(st.nextToken(), rule.startYear); + rule.startYear = parseYear(s, 0); + rule.endYear = parseYear(s, rule.startYear); if (rule.startYear > rule.endYear) { throw new IllegalArgumentException("Year order invalid: " + rule.startYear + " > " + rule.endYear); } - parseOptional(st.nextToken()); // type is unused - parseMonthDayTime(st, rule); - rule.savingsAmount = parsePeriod(st.nextToken()); - rule.text = parseOptional(st.nextToken()); + parseOptional(s.next()); // type is unused + parseMonthDayTime(s, rule); + rule.savingsAmount = parsePeriod(s.next()); + rule.text = parseOptional(s.next()); } /** * Parses a Zone line. * - * @param st the tokenizer, not null + * @param s the line scanner, not null * @return true if the zone is complete */ - private boolean parseZoneLine(StringTokenizer st, List zoneList) { + private boolean parseZoneLine(Scanner s, List zoneList) { TZDBZone zone = new TZDBZone(); zoneList.add(zone); - zone.standardOffset = parseOffset(st.nextToken()); - String savingsRule = parseOptional(st.nextToken()); + zone.standardOffset = parseOffset(s.next()); + String savingsRule = parseOptional(s.next()); if (savingsRule == null) { zone.fixedSavingsSecs = 0; zone.savingsRule = null; @@ -580,11 +412,11 @@ public final class TzdbZoneRulesCompiler { zone.savingsRule = savingsRule; } } - zone.text = st.nextToken(); - if (st.hasMoreTokens()) { - zone.year = Integer.parseInt(st.nextToken()); - if (st.hasMoreTokens()) { - parseMonthDayTime(st, zone); + zone.text = s.next(); + if (s.hasNext()) { + zone.year = Integer.parseInt(s.next()); + if (s.hasNext()) { + parseMonthDayTime(s, zone); } return false; } else { @@ -595,13 +427,13 @@ public final class TzdbZoneRulesCompiler { /** * Parses a Rule line. * - * @param st the tokenizer, not null + * @param s the line scanner, not null * @param mdt the object to parse into, not null */ - private void parseMonthDayTime(StringTokenizer st, TZDBMonthDayTime mdt) { - mdt.month = parseMonth(st.nextToken()); - if (st.hasMoreTokens()) { - String dayRule = st.nextToken(); + private void parseMonthDayTime(Scanner s, TZDBMonthDayTime mdt) { + mdt.month = parseMonth(s); + if (s.hasNext()) { + String dayRule = s.next(); if (dayRule.startsWith("last")) { mdt.dayOfMonth = -1; mdt.dayOfWeek = parseDayOfWeek(dayRule.substring(4)); @@ -621,8 +453,8 @@ public final class TzdbZoneRulesCompiler { } mdt.dayOfMonth = Integer.parseInt(dayRule); } - if (st.hasMoreTokens()) { - String timeStr = st.nextToken(); + if (s.hasNext()) { + String timeStr = s.next(); int secsOfDay = parseSecs(timeStr); if (secsOfDay == 86400) { mdt.endOfDay = true; @@ -635,30 +467,43 @@ public final class TzdbZoneRulesCompiler { } } - private int parseYear(String str, int defaultYear) { - if (YEAR.reset(str).matches()) { - if (YEAR.group("min") != null) { - //return YEAR_MIN_VALUE; + private int parseYear(Scanner s, int defaultYear) { + if (s.hasNext(YEAR)) { + s.next(YEAR); + MatchResult mr = s.match(); + if (mr.group(1) != null) { return 1900; // systemv has min - } else if (YEAR.group("max") != null) { + } else if (mr.group(2) != null) { return YEAR_MAX_VALUE; - } else if (YEAR.group("only") != null) { + } else if (mr.group(3) != null) { return defaultYear; } - return Integer.parseInt(YEAR.group("year")); + return Integer.parseInt(mr.group(4)); + /* + if (mr.group("min") != null) { + //return YEAR_MIN_VALUE; + return 1900; // systemv has min + } else if (mr.group("max") != null) { + return YEAR_MAX_VALUE; + } else if (mr.group("only") != null) { + return defaultYear; + } + return Integer.parseInt(mr.group("year")); + */ } - throw new IllegalArgumentException("Unknown year: " + str); + throw new IllegalArgumentException("Unknown year: " + s.next()); } - private int parseMonth(String str) { - if (MONTH.reset(str).matches()) { + private int parseMonth(Scanner s) { + if (s.hasNext(MONTH)) { + s.next(MONTH); for (int moy = 1; moy < 13; moy++) { - if (MONTH.group(moy) != null) { + if (s.match().group(moy) != null) { return moy; } } } - throw new IllegalArgumentException("Unknown month: " + str); + throw new IllegalArgumentException("Unknown month: " + s.next()); } private int parseDayOfWeek(String str) { @@ -729,7 +574,6 @@ public final class TzdbZoneRulesCompiler { } } - //----------------------------------------------------------------------- /** * Build the rules, zones and links into real zones. * @@ -744,8 +588,7 @@ public final class TzdbZoneRulesCompiler { for (TZDBZone tzdbZone : tzdbZones) { bld = tzdbZone.addToBuilder(bld, rules); } - ZoneRules buildRules = bld.toRules(zoneId); - builtZones.put(zoneId, buildRules); + builtZones.put(zoneId, bld.toRules(zoneId)); } // build aliases @@ -758,25 +601,25 @@ public final class TzdbZoneRulesCompiler { printVerbose("Relinking alias " + aliasId + " to " + realId); realRules = builtZones.get(realId); if (realRules == null) { - throw new IllegalArgumentException("Alias '" + aliasId + "' links to invalid zone '" + realId + "' for '" + version + "'"); + throw new IllegalArgumentException("Alias '" + aliasId + "' links to invalid zone '" + realId); } links.put(aliasId, realId); - } builtZones.put(aliasId, realRules); } - // remove UTC and GMT - //builtZones.remove("UTC"); - //builtZones.remove("GMT"); - //builtZones.remove("GMT0"); + // builtZones.remove("UTC"); + // builtZones.remove("GMT"); + // builtZones.remove("GMT0"); builtZones.remove("GMT+0"); builtZones.remove("GMT-0"); links.remove("GMT+0"); links.remove("GMT-0"); + // remove ROC, which is not supported in j.u.tz + builtZones.remove("ROC"); + links.remove("ROC"); } - //----------------------------------------------------------------------- /** * Prints a verbose message. * @@ -788,7 +631,6 @@ public final class TzdbZoneRulesCompiler { } } - //----------------------------------------------------------------------- /** * Class representing a month-day-time in the TZDB file. */ @@ -893,5 +735,4 @@ public final class TzdbZoneRulesCompiler { return ldt; } } - } diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk index 0158000c130..cff563a8112 100644 --- a/jdk/makefiles/CompileNativeLibraries.gmk +++ b/jdk/makefiles/CompileNativeLibraries.gmk @@ -1213,7 +1213,6 @@ BUILD_LIBRARIES += $(BUILD_LIBJSDT) ########################################################################################## -ifdef OPENJDK # TODO: Update awt lib path when awt is converted $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\ LIBRARY:=lcms,\ @@ -1246,7 +1245,6 @@ ifdef OPENJDK BUILD_LIBRARIES += $(BUILD_LIBLCMS) $(BUILD_LIBLCMS) : $(BUILD_LIBAWT) -endif ########################################################################################## diff --git a/jdk/makefiles/CopyFiles.gmk b/jdk/makefiles/CopyFiles.gmk index 6b15e677b32..9ed6da26987 100644 --- a/jdk/makefiles/CopyFiles.gmk +++ b/jdk/makefiles/CopyFiles.gmk @@ -174,6 +174,13 @@ $(LIBDIR)/calendars.properties: $(CALENDARS_SRC)/calendars.properties COPY_FILES += $(LIBDIR)/calendars.properties +$(LIBDIR)/hijrah-config-umalqura.properties: $(CALENDARS_SRC)/hijrah-config-umalqura.properties + $(MKDIR) -p $(@D) + $(RM) $@ + $(CP) $< $@ + +COPY_FILES += $(LIBDIR)/hijrah-config-umalqura.properties + ########################################################################################## ifeq ($(OPENJDK_TARGET_OS),windows) diff --git a/jdk/makefiles/CopyIntoClasses.gmk b/jdk/makefiles/CopyIntoClasses.gmk index d4df3424b6e..8b5a1cd0a3f 100644 --- a/jdk/makefiles/CopyIntoClasses.gmk +++ b/jdk/makefiles/CopyIntoClasses.gmk @@ -185,10 +185,10 @@ SRC_SERVICES_FILES:=$(wildcard $(addsuffix /services/*,$(ALL_META-INF_DIRS))) ifdef OPENJDK SRC_SERVICES_FILES:=$(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) - SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) + SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider,$(SRC_SERVICES_FILES)) else SRC_SERVICES_FILES:=$(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) - SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) + SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider,$(SRC_SERVICES_FILES)) endif # The number of services files are relatively few. If the increase in numbers, then diff --git a/jdk/makefiles/CreateJars.gmk b/jdk/makefiles/CreateJars.gmk index 523af3dc90f..8127b054459 100644 --- a/jdk/makefiles/CreateJars.gmk +++ b/jdk/makefiles/CreateJars.gmk @@ -73,11 +73,6 @@ $(eval $(call SetupArchive,BUILD_DNS_JAR,,\ ########################################################################################## -$(IMAGES_OUTPUTDIR)/lib/tzdb.jar: $(JDK_OUTPUTDIR)/lib/tzdb.jar - $(install-file) - -########################################################################################## - LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \ iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \ th tr uk vi zh diff --git a/jdk/makefiles/GendataTZDB.gmk b/jdk/makefiles/GendataTZDB.gmk index 51289dd1b6c..802b3e5b30a 100644 --- a/jdk/makefiles/GendataTZDB.gmk +++ b/jdk/makefiles/GendataTZDB.gmk @@ -29,16 +29,13 @@ GENDATA_TZDB := # Time zone data file creation # TZDATA_DIR := $(JDK_TOPDIR)/make/sun/javazic/tzdata -TZDATA_VER := $(subst tzdata,,$(shell $(GREP) '^tzdata' $(TZDATA_DIR)/VERSION)) TZDATA_TZFILE := africa antarctica asia australasia europe northamerica pacificnew southamerica backward etcetera gmt jdk11_backward TZDATA_TZFILES := $(addprefix $(TZDATA_DIR)/,$(TZDATA_TZFILE)) -GENDATA_TZDB_DST := $(JDK_OUTPUTDIR)/lib -GENDATA_TZDB_JAR := tzdb.jar +GENDATA_TZDB_DAT := $(JDK_OUTPUTDIR)/lib/tzdb.dat -$(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR) : $(TZDATA_TZFILES) - $(RM) $(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR) - echo building tzdb from version $(TZDATA_VER) - $(TOOL_TZDB) -version $(TZDATA_VER) -srcdir $(TZDATA_DIR) -dstdir $(GENDATA_TZDB_DST) $(TZDATA_TZFILE) +$(GENDATA_TZDB_DAT) : $(TZDATA_TZFILES) + $(RM) $(GENDATA_TZDB_DAT) + $(TOOL_TZDB) -srcdir $(TZDATA_DIR) -dstfile $(GENDATA_TZDB_DAT) $(TZDATA_TZFILE) -GENDATA_TZDB += $(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR) +GENDATA_TZDB += $(GENDATA_TZDB_DAT) diff --git a/jdk/makefiles/mapfiles/libjava/mapfile-vers b/jdk/makefiles/mapfiles/libjava/mapfile-vers index 60f0f864607..ca33582de6b 100644 --- a/jdk/makefiles/mapfiles/libjava/mapfile-vers +++ b/jdk/makefiles/mapfiles/libjava/mapfile-vers @@ -134,7 +134,6 @@ SUNWprivate_1.1 { Java_java_lang_ClassLoader_00024NativeLibrary_load; Java_java_lang_ClassLoader_00024NativeLibrary_unload; Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib; - Java_java_lang_ClassLoader_getCaller; Java_java_lang_ClassLoader_registerNatives; Java_java_lang_Compiler_registerNatives; Java_java_lang_Double_longBitsToDouble; @@ -217,7 +216,7 @@ SUNWprivate_1.1 { Java_java_lang_Throwable_fillInStackTrace; Java_java_lang_Throwable_getStackTraceDepth; Java_java_lang_Throwable_getStackTraceElement; - Java_java_lang_UNIXProcess_initIDs; + Java_java_lang_UNIXProcess_init; Java_java_lang_UNIXProcess_waitForProcessExit; Java_java_lang_UNIXProcess_forkAndExec; Java_java_lang_UNIXProcess_destroyProcess; @@ -233,7 +232,6 @@ SUNWprivate_1.1 { Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2; Java_java_security_AccessController_getStackAccessControlContext; Java_java_security_AccessController_getInheritedAccessControlContext; - Java_java_util_ResourceBundle_getClassContext; Java_java_util_TimeZone_getSystemTimeZoneID; Java_java_util_TimeZone_getSystemGMTOffsetID; Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparc b/jdk/makefiles/mapfiles/libjava/reorder-sparc index 32f9aaf2d8e..b64537e3edd 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparc +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparc @@ -78,7 +78,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 index d64cb957793..8e6d249a440 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 @@ -74,7 +74,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-x86 b/jdk/makefiles/mapfiles/libjava/reorder-x86 index deb78fb9799..ff4836f4612 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-x86 +++ b/jdk/makefiles/mapfiles/libjava/reorder-x86 @@ -73,7 +73,6 @@ text: .text%writeBytes; # Test Sleep # Test IntToString # Test LoadToolkit -text: .text%Java_java_util_ResourceBundle_getClassContext; text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; diff --git a/jdk/makefiles/profile-includes.txt b/jdk/makefiles/profile-includes.txt index 17e554f4223..e9672714031 100644 --- a/jdk/makefiles/profile-includes.txt +++ b/jdk/makefiles/profile-includes.txt @@ -66,6 +66,7 @@ PROFILE_1_JRE_LIB_FILES := \ ext/sunec.jar \ ext/sunjce_provider.jar \ ext/sunpkcs11.jar \ + hijrah-config-umalqura.properties \ jce.jar \ jsse.jar \ logging.properties \ @@ -80,7 +81,7 @@ PROFILE_1_JRE_LIB_FILES := \ security/java.security \ security/local_policy.jar \ security/trusted.libraries \ - tzdb.jar + tzdb.dat PROFILE_1_JRE_OTHER_FILES := \ COPYRIGHT \ @@ -100,9 +101,7 @@ PROFILE_1_JRE_JAR_FILES := \ resources.jar \ rt.jar \ security/US_export_policy.jar \ - security/local_policy.jar \ - tzdb.jar - + security/local_policy.jar PROFILE_2_JRE_BIN_FILES := \ rmid$(EXE_SUFFIX) \ diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java b/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java index 303938d5988..dc34b694ecd 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -41,15 +41,15 @@ import apple.laf.JRSUIUtils.NineSliceMetricsProvider; abstract class AquaPainter { static AquaPainter create(final T state) { - return new AquaSingleImagePainter(state); + return new AquaSingleImagePainter<>(state); } static AquaPainter create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut) { - return AquaPainter.create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, true); + return create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, true); } static AquaPainter create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle) { - return AquaPainter.create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, true, true); + return create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, true, true); } static AquaPainter create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle, final boolean stretchHorizontally, final boolean stretchVertically) { @@ -65,7 +65,7 @@ abstract class AquaPainter { return new AquaNineSlicingImagePainter<>(state, metricsProvider); } - abstract void paint(final Graphics2D g, final T stateToPaint, final Component c); + abstract void paint(Graphics2D g, T stateToPaint); final Rectangle boundsRect = new Rectangle(); final JRSUIControl control; @@ -75,23 +75,26 @@ abstract class AquaPainter { this.state = state; } - JRSUIControl getControl() { - control.set(state = (T)state.derive()); + final JRSUIControl getControl() { + control.set(state = state.derive()); return control; } - void paint(final Graphics g, final Component c, final int x, final int y, final int w, final int h) { + final void paint(final Graphics g, final Component c, final int x, + final int y, final int w, final int h) { boundsRect.setBounds(x, y, w, h); - final T nextState = (T)state.derive(); + final T nextState = state.derive(); final Graphics2D g2d = getGraphics2D(g); - if (g2d != null) paint(g2d, nextState, c); + if (g2d != null) paint(g2d, nextState); state = nextState; } - static class AquaNineSlicingImagePainter extends AquaPainter { - protected final HashMap slicedControlImages; - protected final NineSliceMetricsProvider metricsProvider; + private static class AquaNineSlicingImagePainter + extends AquaPainter { + + private final HashMap slicedControlImages; + private final NineSliceMetricsProvider metricsProvider; AquaNineSlicingImagePainter(final T state) { this(state, null); @@ -104,9 +107,9 @@ abstract class AquaPainter { } @Override - void paint(final Graphics2D g, final T stateToPaint, final Component c) { + void paint(final Graphics2D g, final T stateToPaint) { if (metricsProvider == null) { - AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect); + AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect); return; } @@ -114,7 +117,7 @@ abstract class AquaPainter { if (slicesRef == null) { final NineSliceMetrics metrics = metricsProvider.getNineSliceMetricsForState(stateToPaint); if (metrics == null) { - AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect); + AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect); return; } slicesRef = new RecyclableJRSUISlicedImageControl(control, stateToPaint, metrics); @@ -125,47 +128,55 @@ abstract class AquaPainter { } } - static class AquaSingleImagePainter extends AquaPainter { + private static final class AquaSingleImagePainter + extends AquaPainter { + AquaSingleImagePainter(final T state) { super(new JRSUIControl(false), state); } @Override - void paint(Graphics2D g, T stateToPaint, Component c) { - paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect); + void paint(final Graphics2D g, final T stateToPaint) { + paintFromSingleCachedImage(g, control, stateToPaint, boundsRect); } - static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) { - final Rectangle clipRect = g.getClipBounds(); - final Rectangle intersection = boundsRect.intersection(clipRect); - if (intersection.width <= 0 || intersection.height <= 0) return; - - final int imgX1 = intersection.x - boundsRect.x; - final int imgY1 = intersection.y - boundsRect.y; + static void paintFromSingleCachedImage(final Graphics2D g, + final JRSUIControl control, final JRSUIState controlState, + final Rectangle bounds) { + if (bounds.width <= 0 || bounds.height <= 0) { + return; + } + int scale = 1; + if (g instanceof SunGraphics2D) { + scale = ((SunGraphics2D) g).surfaceData.getDefaultScale(); + } final GraphicsConfiguration config = g.getDeviceConfiguration(); final ImageCache cache = ImageCache.getInstance(); - BufferedImage image = (BufferedImage)cache.getImage(config, boundsRect.width, boundsRect.height, controlState); - if (image == null) { - image = new BufferedImage(boundsRect.width, boundsRect.height, BufferedImage.TYPE_INT_ARGB_PRE); - cache.setImage(image, config, boundsRect.width, boundsRect.height, controlState); - final WritableRaster raster = image.getRaster(); - final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer(); + final int imgW = bounds.width * scale; + final int imgH = bounds.height * scale; + BufferedImage img = (BufferedImage) cache.getImage(config, imgW, imgH, scale, controlState); + if (img == null) { + img = new BufferedImage(imgW, imgH, BufferedImage.TYPE_INT_ARGB_PRE); + cache.setImage(img, config, imgW, imgH, scale, controlState); + final WritableRaster raster = img.getRaster(); + final DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer(); control.set(controlState); control.paint(SunWritableRaster.stealData(buffer, 0), - image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height); + imgW, imgH, 0, 0, bounds.width, bounds.height); SunWritableRaster.markDirty(buffer); } - g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height, - imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null); + g.drawImage(img, bounds.x, bounds.y, bounds.width, bounds.height, null); } } - static class RecyclableJRSUISlicedImageControl extends RecyclableSlicedImageControl { - final JRSUIControl control; - final JRSUIState state; + private static class RecyclableJRSUISlicedImageControl + extends RecyclableSlicedImageControl { + + private final JRSUIControl control; + private final JRSUIState state; RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) { super(metrics); @@ -189,17 +200,19 @@ abstract class AquaPainter { } } - protected Graphics2D getGraphics2D(final Graphics g) { + private Graphics2D getGraphics2D(final Graphics g) { try { return (SunGraphics2D)g; // doing a blind try is faster than checking instanceof - } catch (Exception e) { + } catch (Exception ignored) { if (g instanceof PeekGraphics) { // if it is a peek just dirty the region g.fillRect(boundsRect.x, boundsRect.y, boundsRect.width, boundsRect.height); } else if (g instanceof ProxyGraphics2D) { final ProxyGraphics2D pg = (ProxyGraphics2D)g; final Graphics2D g2d = pg.getDelegate(); - if (g2d instanceof SunGraphics2D) { return (SunGraphics2D)g2d; } + if (g2d instanceof SunGraphics2D) { + return g2d; + } } else if (g instanceof Graphics2D) { return (Graphics2D) g; } diff --git a/jdk/src/macosx/classes/com/apple/laf/ImageCache.java b/jdk/src/macosx/classes/com/apple/laf/ImageCache.java index f9af5c06161..442b9742f01 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ImageCache.java +++ b/jdk/src/macosx/classes/com/apple/laf/ImageCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -81,16 +81,23 @@ final class ImageCache { } } - public Image getImage(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { + public Image getImage(final GraphicsConfiguration config, final int w, + final int h, final int scale, + final JRSUIState state) { + final int hash = hash(config, w, h, scale, state); + final PixelCountSoftReference ref; lock.readLock().lock(); try { - final PixelCountSoftReference ref = map.get(hash(config, w, h, state)); - // check reference has not been lost and the key truly matches, in case of false positive hash match - if (ref != null && ref.equals(config, w, h, state)) return ref.get(); - return null; + ref = map.get(hash); } finally { lock.readLock().unlock(); } + // check reference has not been lost and the key truly matches, + // in case of false positive hash match + if (ref != null && ref.equals(config, w, h, scale, state)) { + return ref.get(); + } + return null; } /** @@ -100,14 +107,17 @@ final class ImageCache { * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key * @param w The image width, used as part of cache key * @param h The image height, used as part of cache key + * @param scale The image scale factor, used as part of cache key * @return true if the image could be cached, false otherwise. */ - public boolean setImage(final Image image, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { + public boolean setImage(final Image image, + final GraphicsConfiguration config, final int w, final int h, + final int scale, final JRSUIState state) { if (state.is(JRSUIConstants.Animating.YES)) { return false; } - final int hash = hash(config, w, h, state); + final int hash = hash(config, w, h, scale, state); lock.writeLock().lock(); try { @@ -145,44 +155,60 @@ final class ImageCache { } } // finally put new in map - map.put(hash, new PixelCountSoftReference(image, referenceQueue, newPixelCount, hash, config, w, h, state)); + map.put(hash, new PixelCountSoftReference(image, referenceQueue, newPixelCount, hash, config, w, h, scale, state)); return true; } finally { lock.writeLock().unlock(); } } - private int hash(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { - int hash = (config != null ? config.hashCode() : 0); + private static int hash(final GraphicsConfiguration config, final int w, + final int h, final int scale, + final JRSUIState state) { + int hash = config != null ? config.hashCode() : 0; hash = 31 * hash + w; hash = 31 * hash + h; + hash = 31 * hash + scale; hash = 31 * hash + state.hashCode(); return hash; } - /** Extended SoftReference that stores the pixel count even after the image is lost */ + /** + * Extended SoftReference that stores the pixel count even after the image + * is lost. + */ private static class PixelCountSoftReference extends SoftReference { - private final int pixelCount; - private final int hash; + + // default access, because access to these fields shouldn't be emulated + // by a synthetic accessor. + final int pixelCount; + final int hash; // key parts private final GraphicsConfiguration config; private final int w; private final int h; + private final int scale; private final JRSUIState state; - PixelCountSoftReference(final Image referent, final ReferenceQueue q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { + PixelCountSoftReference(final Image referent, + final ReferenceQueue q, final int pixelCount, + final int hash, final GraphicsConfiguration config, final int w, + final int h, final int scale, final JRSUIState state) { super(referent, q); this.pixelCount = pixelCount; this.hash = hash; this.config = config; this.w = w; this.h = h; + this.scale = scale; this.state = state; } - public boolean equals(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { - return config == this.config && w == this.w && h == this.h && state.equals(this.state); + boolean equals(final GraphicsConfiguration config, final int w, + final int h, final int scale, final JRSUIState state) { + return config == this.config && w == this.w && h == this.h + && scale == this.scale && state.equals(this.state); } } diff --git a/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java b/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java index 1a5e22af582..16ae8a82dbb 100644 --- a/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java +++ b/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java @@ -219,6 +219,12 @@ public final class CGraphicsDevice extends GraphicsDevice { return nativeGetDisplayModes(displayID); } + public int getScaleFactor() { + return (int) nativeGetScaleFactor(displayID); + } + + private static native double nativeGetScaleFactor(int displayID); + private static native void nativeSetDisplayMode(int displayID, int w, int h, int bpp, int refrate); private static native DisplayMode nativeGetDisplayMode(int displayID); diff --git a/jdk/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java b/jdk/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java index c8539a8e3f6..637cd3a8a71 100644 --- a/jdk/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java +++ b/jdk/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java @@ -441,29 +441,37 @@ public final class CGLGraphicsConfig extends CGraphicsConfig @Override public int getMaxTextureWidth() { - int width; + //Temporary disable this logic and use some magic constrain. + /* + int width; - synchronized (totalDisplayBounds) { - if (totalDisplayBounds.width == 0) { - updateTotalDisplayBounds(); - } - width = totalDisplayBounds.width; - } + synchronized (totalDisplayBounds) { + if (totalDisplayBounds.width == 0) { + updateTotalDisplayBounds(); + } + width = totalDisplayBounds.width; + } - return Math.min(width, getMaxTextureSize()); + return Math.min(width, getMaxTextureSize()); + */ + return getMaxTextureSize() / (getDevice().getScaleFactor() * 2); } @Override public int getMaxTextureHeight() { - int height; + //Temporary disable this logic and use some magic constrain. + /* + int height; - synchronized (totalDisplayBounds) { - if (totalDisplayBounds.height == 0) { - updateTotalDisplayBounds(); - } - height = totalDisplayBounds.height; - } + synchronized (totalDisplayBounds) { + if (totalDisplayBounds.height == 0) { + updateTotalDisplayBounds(); + } + height = totalDisplayBounds.height; + } - return Math.min(height, getMaxTextureSize()); + return Math.min(height, getMaxTextureSize()); + */ + return getMaxTextureSize() / (getDevice().getScaleFactor() * 2); } } diff --git a/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java b/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java index 674b97951af..05977810614 100644 --- a/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java +++ b/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java @@ -40,11 +40,12 @@ import java.awt.Transparency; public class CGLLayer extends CFRetainedResource { private native long nativeCreateLayer(); - + private static native void nativeSetScale(long layerPtr, double scale); private static native void validate(long layerPtr, CGLSurfaceData cglsd); private static native void blitTexture(long layerPtr); private LWWindowPeer peer; + private int scale = 1; private SurfaceData surfaceData; // represents intermediate buffer (texture) @@ -90,7 +91,7 @@ public class CGLLayer extends CFRetainedResource { // and blits the buffer to the layer surface (in drawInCGLContext callback) CGraphicsConfig gc = (CGraphicsConfig)peer.getGraphicsConfiguration(); surfaceData = gc.createSurfaceData(this); - + setScale(gc.getDevice().getScaleFactor()); // the layer holds a reference to the buffer, which in // turn has a reference back to this layer if (surfaceData instanceof CGLSurfaceData) { @@ -121,6 +122,13 @@ public class CGLLayer extends CFRetainedResource { super.dispose(); } + private void setScale(final int _scale) { + if (scale != _scale) { + scale = _scale; + nativeSetScale(getPointer(), scale); + } + } + // ---------------------------------------------------------------------- // NATIVE CALLBACKS // ---------------------------------------------------------------------- diff --git a/jdk/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java b/jdk/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java index 98ec47bd121..70b7ff9fe95 100644 --- a/jdk/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java +++ b/jdk/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java @@ -30,7 +30,6 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.Image; -import java.awt.Insets; import java.awt.Rectangle; import java.awt.image.ColorModel; @@ -41,6 +40,9 @@ import sun.lwawt.macosx.CPlatformView; public abstract class CGLSurfaceData extends OGLSurfaceData { + protected final int scale; + protected final int width; + protected final int height; protected CPlatformView pView; private CGLGraphicsConfig graphicsConfig; @@ -52,10 +54,19 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { protected native boolean initPbuffer(long pData, long pConfigInfo, boolean isOpaque, int width, int height); - protected CGLSurfaceData(CPlatformView pView, CGLGraphicsConfig gc, - ColorModel cm, int type) - { + protected CGLSurfaceData(CGLGraphicsConfig gc, ColorModel cm, int type, + int width, int height) { super(gc, cm, type); + // TEXTURE shouldn't be scaled, it is used for managed BufferedImages. + scale = type == TEXTURE ? 1 : gc.getDevice().getScaleFactor(); + this.width = width * scale; + this.height = height * scale; + } + + protected CGLSurfaceData(CPlatformView pView, CGLGraphicsConfig gc, + ColorModel cm, int type,int width, int height) + { + this(gc, cm, type, width, height); this.pView = pView; this.graphicsConfig = gc; @@ -70,9 +81,9 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { } protected CGLSurfaceData(CGLLayer layer, CGLGraphicsConfig gc, - ColorModel cm, int type) + ColorModel cm, int type,int width, int height) { - super(gc, cm, type); + this(gc, cm, type, width, height); this.graphicsConfig = gc; long pConfigInfo = gc.getNativeConfigInfo(); @@ -157,13 +168,43 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { // Overridden in CGLWindowSurfaceData below } + @Override + public int getDefaultScale() { + return scale; + } + + @Override + public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, + int dx, int dy) { + final int state = sg2d.transformState; + if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE + || sg2d.compositeState >= SunGraphics2D.COMP_XOR) { + return false; + } + if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) { + x += sg2d.transX; + y += sg2d.transY; + } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) { + final double[] coords = {x, y, x + w, y + h, x + dx, y + dy}; + sg2d.transform.transform(coords, 0, coords, 0, 3); + x = (int) Math.ceil(coords[0] - 0.5); + y = (int) Math.ceil(coords[1] - 0.5); + w = ((int) Math.ceil(coords[2] - 0.5)) - x; + h = ((int) Math.ceil(coords[3] - 0.5)) - y; + dx = ((int) Math.ceil(coords[4] - 0.5)) - x; + dy = ((int) Math.ceil(coords[5] - 0.5)) - y; + } + oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy); + return true; + } + protected native void clearWindow(); public static class CGLWindowSurfaceData extends CGLSurfaceData { public CGLWindowSurfaceData(CPlatformView pView, CGLGraphicsConfig gc) { - super(pView, gc, gc.getColorModel(), WINDOW); + super(pView, gc, gc.getColorModel(), WINDOW, 0, 0); } @Override @@ -217,17 +258,12 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { public static class CGLLayerSurfaceData extends CGLSurfaceData { private CGLLayer layer; - private int width, height; public CGLLayerSurfaceData(CGLLayer layer, CGLGraphicsConfig gc, int width, int height) { - super(layer, gc, gc.getColorModel(), FBOBJECT); - - this.width = width; - this.height = height; + super(layer, gc, gc.getColorModel(), FBOBJECT, width, height); this.layer = layer; - - initSurface(width, height); + initSurface(this.width, this.height); } @Override @@ -296,18 +332,13 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { public static class CGLOffScreenSurfaceData extends CGLSurfaceData { private Image offscreenImage; - private int width, height; public CGLOffScreenSurfaceData(CPlatformView pView, CGLGraphicsConfig gc, int width, int height, Image image, ColorModel cm, int type) { - super(pView, gc, cm, type); - - this.width = width; - this.height = height; + super(pView, gc, cm, type, width, height); offscreenImage = image; - - initSurface(width, height); + initSurface(this.width, this.height); } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index c907804c96a..3347514421c 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -463,35 +463,8 @@ public abstract class LWComponentPeer private void applyConstrain(final Graphics g) { final SunGraphics2D sg2d = (SunGraphics2D) g; - final Rectangle constr = localToWindow(getSize()); - // translate and set rectangle constrain. - sg2d.constrain(constr.x, constr.y, constr.width, constr.height); - // set region constrain. - //sg2d.constrain(getVisibleRegion()); - SG2DConstraint(sg2d, getVisibleRegion()); - } - - //TODO Move this method to SG2D? - void SG2DConstraint(final SunGraphics2D sg2d, Region r) { - sg2d.constrainX = sg2d.transX; - sg2d.constrainY = sg2d.transY; - - Region c = sg2d.constrainClip; - if ((sg2d.constrainX | sg2d.constrainY) != 0) { - r = r.getTranslatedRegion(sg2d.constrainX, sg2d.constrainY); - } - if (c == null) { - c = r; - } else { - c = c.getIntersection(r); - if (c == sg2d.constrainClip) { - // Common case to ignore - return; - } - } - sg2d.constrainClip = c; - //validateCompClip() forced call. - sg2d.setDevClip(r.getLoX(), r.getLoY(), r.getWidth(), r.getHeight()); + final Rectangle size = localToWindow(getSize()); + sg2d.constrain(size.x, size.y, size.width, size.height, getVisibleRegion()); } public Region getVisibleRegion() { diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index d50335f7cd5..2774f055728 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -170,7 +170,7 @@ public class LWWindowPeer setTitle(((Dialog) getTarget()).getTitle()); } - setAlwaysOnTop(getTarget().isAlwaysOnTop()); + updateAlwaysOnTopState(); updateMinimumSize(); final Shape shape = getTarget().getShape(); @@ -357,8 +357,8 @@ public class LWWindowPeer } @Override - public void setAlwaysOnTop(boolean value) { - platformWindow.setAlwaysOnTop(value); + public void updateAlwaysOnTopState() { + platformWindow.setAlwaysOnTop(getTarget().isAlwaysOnTop()); } @Override @@ -580,17 +580,16 @@ public class LWWindowPeer setBounds(x, y, w, h, SET_BOUNDS, false, false); // Second, update the graphics config and surface data - checkIfOnNewScreen(); - if (resized) { + final boolean isNewDevice = updateGraphicsDevice(); + if (resized || isNewDevice) { replaceSurfaceData(); - flushOnscreenGraphics(); } // Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events if (moved || invalid) { handleMove(x, y, true); } - if (resized || invalid) { + if (resized || invalid || isNewDevice) { handleResize(w, h, true); repaintPeer(); } @@ -610,7 +609,7 @@ public class LWWindowPeer } if (!isTextured()) { if (g instanceof SunGraphics2D) { - SG2DConstraint((SunGraphics2D) g, getRegion()); + ((SunGraphics2D) g).constrain(0, 0, w, h, getRegion()); } g.setColor(getBackground()); g.fillRect(0, 0, w, h); @@ -922,7 +921,7 @@ public class LWWindowPeer } // If window's graphics config is changed from the app code, the // config correspond to the same device as before; when the window - // is moved by user, graphicsDevice is updated in checkIfOnNewScreen(). + // is moved by user, graphicsDevice is updated in notifyReshape(). // In either case, there's nothing to do with screenOn here graphicsConfig = gc; } @@ -930,11 +929,14 @@ public class LWWindowPeer return true; } - private void checkIfOnNewScreen() { + /** + * Returns true if the GraphicsDevice has been changed, false otherwise. + */ + public boolean updateGraphicsDevice() { GraphicsDevice newGraphicsDevice = platformWindow.getGraphicsDevice(); synchronized (getStateLock()) { if (graphicsDevice == newGraphicsDevice) { - return; + return false; } graphicsDevice = newGraphicsDevice; } @@ -942,13 +944,14 @@ public class LWWindowPeer // TODO: DisplayChangedListener stuff final GraphicsConfiguration newGC = newGraphicsDevice.getDefaultConfiguration(); - if (!setGraphicsConfig(newGC)) return; + if (!setGraphicsConfig(newGC)) return false; SunToolkit.executeOnEventHandlerThread(getTarget(), new Runnable() { public void run() { AWTAccessor.getComponentAccessor().setGraphicsConfiguration(getTarget(), newGC); } }); + return true; } /* @@ -983,6 +986,7 @@ public class LWWindowPeer oldData.flush(); } } + flushOnscreenGraphics(); } private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) { @@ -990,14 +994,15 @@ public class LWWindowPeer if (src != dst && src != null && dst != null && !(dst instanceof NullSurfaceData) && !(src instanceof NullSurfaceData) - && src.getSurfaceType().equals(dst.getSurfaceType())) { - final Rectangle size = getSize(); + && src.getSurfaceType().equals(dst.getSurfaceType()) + && src.getDefaultScale() == dst.getDefaultScale()) { + final Rectangle size = src.getBounds(); final Blit blit = Blit.locate(src.getSurfaceType(), CompositeType.Src, dst.getSurfaceType()); if (blit != null) { - blit.Blit(src, dst, AlphaComposite.Src, - getRegion(), 0, 0, 0, 0, size.width, size.height); + blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0, + size.width, size.height); } } } @@ -1152,7 +1157,9 @@ public class LWWindowPeer if (!becomesFocused && (isGrabbing() || getOwnerFrameDialog(grabbingWindow) == this)) { - focusLog.fine("ungrabbing on " + grabbingWindow); + if (focusLog.isLoggable(PlatformLogger.FINE)) { + focusLog.fine("ungrabbing on " + grabbingWindow); + } // ungrab a simple window if its owner looses activation. grabbingWindow.ungrab(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java index 427e1a3a692..9e0377cdc25 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java @@ -97,13 +97,7 @@ public class CEmbeddedFrame extends EmbeddedFrame { public void handleKeyEvent(int eventType, int modifierFlags, String characters, String charsIgnoringMods, boolean isRepeat, short keyCode, boolean needsKeyTyped) { - responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped); - } - - // REMIND: delete this method once 'deploy' changes for 7156194 is pushed - public void handleKeyEvent(int eventType, int modifierFlags, String characters, - String charsIgnoringMods, boolean isRepeat, short keyCode) { - handleKeyEvent(eventType, modifierFlags, characters, charsIgnoringMods, isRepeat, keyCode, true); + responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped, isRepeat); } public void handleInputEvent(String text) { diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java index 359f6066364..29129394a37 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -180,7 +180,7 @@ class CFileDialog implements FileDialogPeer { } @Override - public void setAlwaysOnTop(boolean alwaysOnTop) { + public void updateAlwaysOnTopState() { } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java index c47a5f73dba..70885a828ca 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java @@ -41,6 +41,7 @@ final class CPlatformResponder { private final LWWindowPeer peer; private final boolean isNpapiCallback; + private int lastKeyPressCode = KeyEvent.VK_UNDEFINED; CPlatformResponder(final LWWindowPeer peer, final boolean isNpapiCallback) { this.peer = peer; @@ -123,7 +124,7 @@ final class CPlatformResponder { * Handles key events. */ void handleKeyEvent(int eventType, int modifierFlags, String chars, - short keyCode, boolean needsKeyTyped) { + short keyCode, boolean needsKeyTyped, boolean needsKeyReleased) { boolean isFlagsChangedEvent = isNpapiCallback ? (eventType == CocoaConstants.NPCocoaEventFlagsChanged) : (eventType == CocoaConstants.NSFlagsChanged); @@ -183,6 +184,9 @@ final class CPlatformResponder { int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags); long when = System.currentTimeMillis(); + if (jeventType == KeyEvent.KEY_PRESSED) { + lastKeyPressCode = jkeyCode; + } peer.dispatchKeyEvent(jeventType, when, jmodifiers, jkeyCode, javaChar, jkeyLocation); @@ -195,26 +199,41 @@ final class CPlatformResponder { // Modifier keys (shift, etc) don't want to send TYPED events. // On the other hand we don't want to generate keyTyped events // for clipboard related shortcuts like Meta + [CVX] - boolean isMetaDown = (jmodifiers & KeyEvent.META_DOWN_MASK) != 0; - if (jeventType == KeyEvent.KEY_PRESSED && postsTyped && !isMetaDown) { + if (jeventType == KeyEvent.KEY_PRESSED && postsTyped && + (jmodifiers & KeyEvent.META_DOWN_MASK) == 0) { + // Enter and Space keys finish the input method processing, + // KEY_TYPED and KEY_RELEASED events for them are synthesized in handleInputEvent. + if (needsKeyReleased && (jkeyCode == KeyEvent.VK_ENTER || jkeyCode == KeyEvent.VK_SPACE)) { + return; + } peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, when, jmodifiers, KeyEvent.VK_UNDEFINED, javaChar, KeyEvent.KEY_LOCATION_UNKNOWN); + //If events come from Firefox, released events should also be generated. + if (needsKeyReleased) { + peer.dispatchKeyEvent(KeyEvent.KEY_RELEASED, when, jmodifiers, + jkeyCode, javaChar, + KeyEvent.KEY_LOCATION_UNKNOWN); + } } } void handleInputEvent(String text) { if (text != null) { int index = 0, length = text.length(); - char c; + char c = 0; while (index < length) { c = text.charAt(index); peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, - System.currentTimeMillis(), - 0, KeyEvent.VK_UNDEFINED, c, - KeyEvent.KEY_LOCATION_UNKNOWN); + System.currentTimeMillis(), + 0, KeyEvent.VK_UNDEFINED, c, + KeyEvent.KEY_LOCATION_UNKNOWN); index++; } + peer.dispatchKeyEvent(KeyEvent.KEY_RELEASED, + System.currentTimeMillis(), + 0, lastKeyPressCode, c, + KeyEvent.KEY_LOCATION_UNKNOWN); } } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java index 3a0bec48629..e11312e7b41 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java @@ -202,7 +202,7 @@ public class CPlatformView extends CFRetainedResource { private void deliverKeyEvent(NSEvent event) { responder.handleKeyEvent(event.getType(), event.getModifierFlags(), - event.getCharactersIgnoringModifiers(), event.getKeyCode(), true); + event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false); } /** diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 8854efde770..a8062c7899d 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -860,8 +860,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } } - private void flushBuffers() { - if (isVisible() && !nativeBounds.isEmpty()) { + void flushBuffers() { + if (isVisible() && !nativeBounds.isEmpty() && !isFullScreenMode) { try { LWCToolkit.invokeAndWait(new Runnable() { @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java index 1ca65e7faae..8dfe7e1e51e 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -87,7 +87,7 @@ public class CPrinterDialogPeer extends LWWindowPeer { } // 1.6 peer method - public void setAlwaysOnTop(boolean value) { + public void updateAlwaysOnTopState() { // no-op, since we just show the native print dialog } diff --git a/jdk/src/macosx/native/com/apple/laf/JRSUIController.m b/jdk/src/macosx/native/com/apple/laf/JRSUIController.m index c2128d820b9..ab6c50ac442 100644 --- a/jdk/src/macosx/native/com/apple/laf/JRSUIController.m +++ b/jdk/src/macosx/native/com/apple/laf/JRSUIController.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -199,6 +199,7 @@ static inline jint doPaintImage CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef cgRef = CGBitmapContextCreate(rawPixelData, imgW, imgH, 8, imgW * 4, colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); CGColorSpaceRelease(colorspace); + CGContextScaleCTM(cgRef, imgW/w , imgH/h); jint status = doPaintCGContext(cgRef, controlPtr, oldProperties, newProperties, x, y, w, h); CGContextRelease(cgRef); diff --git a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m index 230569dbafd..9b94b82abbc 100644 --- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m +++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m @@ -315,3 +315,34 @@ Java_sun_awt_CGraphicsDevice_nativeGetDisplayModes return jreturnArray; } + +/* + * Class: sun_awt_CGraphicsDevice + * Method: nativeGetScaleFactor + * Signature: (I)D + */ +JNIEXPORT jdouble JNICALL +Java_sun_awt_CGraphicsDevice_nativeGetScaleFactor +(JNIEnv *env, jclass class, jint displayID) +{ + __block jdouble ret = 1.0f; + +JNF_COCOA_ENTER(env); + + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + NSArray *screens = [NSScreen screens]; + for (NSScreen *screen in screens) { + NSDictionary *screenInfo = [screen deviceDescription]; + NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; + if ([screenID pointerValue] == displayID){ + if ([screen respondsToSelector:@selector(backingScaleFactor)]) { + ret = [screen backingScaleFactor]; + } + break; + } + } + }]; + +JNF_COCOA_EXIT(env); + return ret; +} diff --git a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m index 66838984aba..000684ee9cb 100644 --- a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m +++ b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m @@ -61,6 +61,19 @@ AWT_ASSERT_APPKIT_THREAD; //Layer backed view //self.needsDisplayOnBoundsChange = YES; //self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; + + //Disable CALayer's default animation + NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + [NSNull null], @"bounds", + [NSNull null], @"contents", + [NSNull null], @"contentsScale", + [NSNull null], @"onOrderIn", + [NSNull null], @"onOrderOut", + [NSNull null], @"sublayers", + nil]; + self.actions = actions; + [actions release]; + textureID = 0; // texture will be created by rendering pipe target = 0; @@ -121,8 +134,12 @@ AWT_ASSERT_APPKIT_THREAD; // Set the current context to the one given to us. CGLSetCurrentContext(glContext); - glViewport(0, 0, textureWidth, textureHeight); + // Should clear the whole CALayer, because it can be larger than our texture. + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + glViewport(0, 0, textureWidth, textureHeight); + JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_CLASS_CACHE(jc_JavaLayer, "sun/java2d/opengl/CGLLayer"); static JNF_MEMBER_CACHE(jm_drawInCGLContext, jc_JavaLayer, "drawInCGLContext", "()V"); @@ -168,7 +185,7 @@ JNF_COCOA_EXIT(env); // Must be called under the RQ lock. JNIEXPORT void JNICALL Java_sun_java2d_opengl_CGLLayer_validate -(JNIEnv *env, jobject obj, jlong layerPtr, jobject surfaceData) +(JNIEnv *env, jclass cls, jlong layerPtr, jobject surfaceData) { CGLLayer *layer = OBJC(layerPtr); @@ -186,9 +203,21 @@ Java_sun_java2d_opengl_CGLLayer_validate // Must be called on the AppKit thread and under the RQ lock. JNIEXPORT void JNICALL Java_sun_java2d_opengl_CGLLayer_blitTexture -(JNIEnv *env, jobject obj, jlong layerPtr) +(JNIEnv *env, jclass cls, jlong layerPtr) { CGLLayer *layer = jlong_to_ptr(layerPtr); [layer blitTexture]; } + +JNIEXPORT void JNICALL +Java_sun_java2d_opengl_CGLLayer_nativeSetScale +(JNIEnv *env, jclass cls, jlong layerPtr, jdouble scale) +{ + JNF_COCOA_ENTER(env); + CGLLayer *layer = jlong_to_ptr(layerPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + layer.contentsScale = scale; + }]; + JNF_COCOA_EXIT(env); +} diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java index 5c35c038915..7548612242a 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java @@ -426,17 +426,13 @@ final class CipherCore { } } try { - params = AlgorithmParameters.getInstance(algName, "SunJCE"); + params = AlgorithmParameters.getInstance(algName, + SunJCE.getInstance()); + params.init(spec); } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("Cannot find " + algName + " AlgorithmParameters implementation in SunJCE provider"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("Cannot find SunJCE provider"); - } - try { - params.init(spec); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException(spec.getClass() + " not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherWithWrappingSpi.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherWithWrappingSpi.java index fb30e600cdb..34ccdbbbcab 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherWithWrappingSpi.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherWithWrappingSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -169,7 +169,8 @@ public abstract class CipherWithWrappingSpi extends CipherSpi { try { KeyFactory keyFactory = - KeyFactory.getInstance(encodedKeyAlgorithm, "SunJCE"); + KeyFactory.getInstance(encodedKeyAlgorithm, + SunJCE.getInstance()); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedKey); key = keyFactory.generatePublic(keySpec); } catch (NoSuchAlgorithmException nsae) { @@ -191,8 +192,6 @@ public abstract class CipherWithWrappingSpi extends CipherSpi { } } catch (InvalidKeySpecException ikse) { // Should never happen. - } catch (NoSuchProviderException nspe) { - // Should never happen. } return key; @@ -215,7 +214,8 @@ public abstract class CipherWithWrappingSpi extends CipherSpi { try { KeyFactory keyFactory = - KeyFactory.getInstance(encodedKeyAlgorithm, "SunJCE"); + KeyFactory.getInstance(encodedKeyAlgorithm, + SunJCE.getInstance()); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encodedKey); return keyFactory.generatePrivate(keySpec); } catch (NoSuchAlgorithmException nsae) { @@ -237,8 +237,6 @@ public abstract class CipherWithWrappingSpi extends CipherSpi { } } catch (InvalidKeySpecException ikse) { // Should never happen. - } catch (NoSuchProviderException nspe) { - // Should never happen. } return key; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/ConstructKeys.java b/jdk/src/share/classes/com/sun/crypto/provider/ConstructKeys.java index cd39604228d..ffeb914bae6 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/ConstructKeys.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/ConstructKeys.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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,7 +30,6 @@ import java.security.PublicKey; import java.security.PrivateKey; import java.security.KeyFactory; import java.security.InvalidKeyException; -import java.security.NoSuchProviderException; import java.security.NoSuchAlgorithmException; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; @@ -66,7 +65,8 @@ final class ConstructKeys { try { KeyFactory keyFactory = - KeyFactory.getInstance(encodedKeyAlgorithm, "SunJCE"); + KeyFactory.getInstance(encodedKeyAlgorithm, + SunJCE.getInstance()); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedKey); key = keyFactory.generatePublic(keySpec); } catch (NoSuchAlgorithmException nsae) { @@ -94,8 +94,6 @@ final class ConstructKeys { new InvalidKeyException("Cannot construct public key"); ike.initCause(ikse); throw ike; - } catch (NoSuchProviderException nspe) { - // Should never happen. } return key; @@ -118,7 +116,8 @@ final class ConstructKeys { try { KeyFactory keyFactory = - KeyFactory.getInstance(encodedKeyAlgorithm, "SunJCE"); + KeyFactory.getInstance(encodedKeyAlgorithm, + SunJCE.getInstance()); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encodedKey); return keyFactory.generatePrivate(keySpec); } catch (NoSuchAlgorithmException nsae) { @@ -146,8 +145,6 @@ final class ConstructKeys { new InvalidKeyException("Cannot construct private key"); ike.initCause(ikse); throw ike; - } catch (NoSuchProviderException nspe) { - // Should never happen. } return key; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java index 4a87b5b1fae..d4e27528d44 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java @@ -389,17 +389,13 @@ public final class DESedeWrapCipher extends CipherSpi { if (iv != null) { String algo = cipherKey.getAlgorithm(); try { - params = AlgorithmParameters.getInstance(algo, "SunJCE"); + params = AlgorithmParameters.getInstance(algo, + SunJCE.getInstance()); + params.init(new IvParameterSpec(iv)); } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("Cannot find " + algo + " AlgorithmParameters implementation in SunJCE provider"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("Cannot find SunJCE provider"); - } - try { - params.init(new IvParameterSpec(iv)); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("IvParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java index a976da099fb..00baf133ae6 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java @@ -151,7 +151,8 @@ extends AlgorithmParameterGeneratorSpi { dhParamSpec = new DHParameterSpec(dsaParamSpec.getP(), dsaParamSpec.getG()); } - algParams = AlgorithmParameters.getInstance("DH", "SunJCE"); + algParams = AlgorithmParameters.getInstance("DH", + SunJCE.getInstance()); algParams.init(dhParamSpec); } catch (InvalidParameterSpecException e) { // this should never happen @@ -159,11 +160,7 @@ extends AlgorithmParameterGeneratorSpi { } catch (NoSuchAlgorithmException e) { // this should never happen, because we provide it throw new RuntimeException(e.getMessage()); - } catch (NoSuchProviderException e) { - // this should never happen, because we provide it - throw new RuntimeException(e.getMessage()); } - return algParams; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java b/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java index 0129d3d3f10..53fea3053cc 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java @@ -81,8 +81,6 @@ final class KeyProtector { // key protector private char[] password; - private static final Provider PROV = Security.getProvider("SunJCE"); - KeyProtector(char[] password) { if (password == null) { throw new IllegalArgumentException("password can't be null"); @@ -119,7 +117,7 @@ final class KeyProtector { // wrap encrypted private key in EncryptedPrivateKeyInfo // (as defined in PKCS#8) AlgorithmParameters pbeParams = - AlgorithmParameters.getInstance("PBE", PROV); + AlgorithmParameters.getInstance("PBE", SunJCE.getInstance()); pbeParams.init(pbeSpec); AlgorithmId encrAlg = new AlgorithmId @@ -299,7 +297,7 @@ final class KeyProtector { PBEWithMD5AndTripleDESCipher cipherSpi; cipherSpi = new PBEWithMD5AndTripleDESCipher(); - cipher = new CipherForKeyProtector(cipherSpi, PROV, + cipher = new CipherForKeyProtector(cipherSpi, SunJCE.getInstance(), "PBEWithMD5AndTripleDES"); cipher.init(Cipher.ENCRYPT_MODE, sKey, pbeSpec); return new SealedObjectForKeyProtector(key, cipher); @@ -330,8 +328,9 @@ final class KeyProtector { } PBEWithMD5AndTripleDESCipher cipherSpi; cipherSpi = new PBEWithMD5AndTripleDESCipher(); - Cipher cipher = new CipherForKeyProtector(cipherSpi, PROV, - "PBEWithMD5AndTripleDES"); + Cipher cipher = new CipherForKeyProtector(cipherSpi, + SunJCE.getInstance(), + "PBEWithMD5AndTripleDES"); cipher.init(Cipher.DECRYPT_MODE, skey, params); return (Key)soForKeyProtector.getObject(cipher); } catch (NoSuchAlgorithmException ex) { diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java index c1fb9ccb7f8..2d06c901942 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java @@ -169,16 +169,12 @@ final class PBECipherCore { PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount); try { params = AlgorithmParameters.getInstance("PBEWithMD5And" + - (algo.equalsIgnoreCase("DES")? "DES":"TripleDES"), "SunJCE"); + (algo.equalsIgnoreCase("DES")? "DES":"TripleDES"), + SunJCE.getInstance()); + params.init(pbeSpec); } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("SunJCE called, but not configured"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("SunJCE called, but not configured"); - } - try { - params.init(pbeSpec); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("PBEParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java index 4199173b9f0..88296c857d1 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java @@ -169,16 +169,12 @@ final class PBES1Core { PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount); try { params = AlgorithmParameters.getInstance("PBEWithMD5And" + - (algo.equalsIgnoreCase("DES")? "DES":"TripleDES"), "SunJCE"); + (algo.equalsIgnoreCase("DES")? "DES":"TripleDES"), + SunJCE.getInstance()); + params.init(pbeSpec); } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("SunJCE called, but not configured"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("SunJCE called, but not configured"); - } - try { - params.init(pbeSpec); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("PBEParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBES2Core.java b/jdk/src/share/classes/com/sun/crypto/provider/PBES2Core.java index 4e61e1fae8d..51c49b500ab 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBES2Core.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES2Core.java @@ -25,11 +25,9 @@ package com.sun.crypto.provider; -import java.io.UnsupportedEncodingException; import java.security.*; import java.security.spec.*; import javax.crypto.*; -import javax.crypto.interfaces.*; import javax.crypto.spec.*; /** @@ -145,16 +143,12 @@ abstract class PBES2Core extends CipherSpi { } PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount, ivSpec); try { - params = AlgorithmParameters.getInstance(pbeAlgo, "SunJCE"); + params = AlgorithmParameters.getInstance(pbeAlgo, + SunJCE.getInstance()); + params.init(pbeSpec); } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("SunJCE called, but not configured"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("SunJCE called, but not configured"); - } - try { - params.init(pbeSpec); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("PBEParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java index ec73014b627..ec3bd3e7992 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -33,7 +33,6 @@ import java.util.Arrays; import java.security.KeyRep; import java.security.GeneralSecurityException; import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; import java.security.spec.InvalidKeySpecException; import javax.crypto.Mac; import javax.crypto.SecretKey; @@ -102,21 +101,16 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { int keyLength = keySpec.getKeyLength(); if (keyLength == 0) { throw new InvalidKeySpecException("Key length not found"); - } else if (keyLength == 0) { + } else if (keyLength < 0) { throw new InvalidKeySpecException("Key length is negative"); } try { - this.prf = Mac.getInstance(prfAlgo, "SunJCE"); + this.prf = Mac.getInstance(prfAlgo, SunJCE.getInstance()); } catch (NoSuchAlgorithmException nsae) { // not gonna happen; re-throw just in case InvalidKeySpecException ike = new InvalidKeySpecException(); ike.initCause(nsae); throw ike; - } catch (NoSuchProviderException nspe) { - // Again, not gonna happen; re-throw just in case - InvalidKeySpecException ike = new InvalidKeySpecException(); - ike.initCause(nspe); - throw ike; } this.key = deriveKey(prf, passwdBytes, salt, iterCount, keyLength); } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java index c76603a95de..a02aa4bd175 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java @@ -25,7 +25,6 @@ package com.sun.crypto.provider; -import java.io.UnsupportedEncodingException; import java.math.BigInteger; import java.security.*; import java.security.spec.*; @@ -232,14 +231,13 @@ final class PKCS12PBECipherCore { } PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount); try { - params = AlgorithmParameters.getInstance(pbeAlgo, "SunJCE"); - } catch (GeneralSecurityException gse) { + params = AlgorithmParameters.getInstance(pbeAlgo, + SunJCE.getInstance()); + params.init(pbeSpec); + } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException( "SunJCE provider is not configured properly"); - } - try { - params.init(pbeSpec); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("PBEParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java index d63641490dc..6902d4b8b31 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java @@ -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 @@ -178,16 +178,14 @@ public final class RSACipher extends CipherSpi { if (spec != null) { try { AlgorithmParameters params = - AlgorithmParameters.getInstance("OAEP", "SunJCE"); + AlgorithmParameters.getInstance("OAEP", + SunJCE.getInstance()); params.init(spec); return params; } catch (NoSuchAlgorithmException nsae) { // should never happen throw new RuntimeException("Cannot find OAEP " + " AlgorithmParameters implementation in SunJCE provider"); - } catch (NoSuchProviderException nspe) { - // should never happen - throw new RuntimeException("Cannot find SunJCE provider"); } catch (InvalidParameterSpecException ipse) { // should never happen throw new RuntimeException("OAEPParameterSpec not supported"); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java b/jdk/src/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java index 33f7b9a2b5e..d88e7668c20 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -46,14 +46,15 @@ final class SealedObjectForKeyProtector extends SealedObject { AlgorithmParameters params = null; if (super.encodedParams != null) { try { - params = AlgorithmParameters.getInstance("PBE", "SunJCE"); + params = AlgorithmParameters.getInstance("PBE", + SunJCE.getInstance()); params.init(super.encodedParams); - } catch (NoSuchProviderException nspe) { - // eat. } catch (NoSuchAlgorithmException nsae) { - //eat. - } catch (IOException ioe) { - //eat. + throw new RuntimeException( + "SunJCE provider is not configured properly"); + } catch (IOException io) { + throw new RuntimeException("Parameter failure: "+ + io.getMessage()); } } return params; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java index 99a2a30ab52..7be5416d390 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java @@ -91,6 +91,10 @@ public final class SunJCE extends Provider { /* Are we debugging? -- for developers */ static final boolean debug = false; + // Instance of this provider, so we don't have to call the provider list + // to find ourselves or run the risk of not being in the list. + private static volatile SunJCE instance = null; + // lazy initialize SecureRandom to avoid potential recursion if Sun // provider has not been installed yet private static class SecureRandomHolder { @@ -770,5 +774,17 @@ public final class SunJCE extends Provider { return null; } }); + + if (instance == null) { + instance = this; + } + } + + // Return the instance of this class or create one if needed. + static SunJCE getInstance() { + if (instance == null) { + return new SunJCE(); + } + return instance; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java index 4146f190875..61990d3bf2b 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -165,16 +165,18 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi { // partition keyblock into individual secrets int ofs = 0; - byte[] tmp = new byte[macLength]; + if (macLength != 0) { + byte[] tmp = new byte[macLength]; - // mac keys - System.arraycopy(keyBlock, ofs, tmp, 0, macLength); - ofs += macLength; - clientMacKey = new SecretKeySpec(tmp, "Mac"); + // mac keys + System.arraycopy(keyBlock, ofs, tmp, 0, macLength); + ofs += macLength; + clientMacKey = new SecretKeySpec(tmp, "Mac"); - System.arraycopy(keyBlock, ofs, tmp, 0, macLength); - ofs += macLength; - serverMacKey = new SecretKeySpec(tmp, "Mac"); + System.arraycopy(keyBlock, ofs, tmp, 0, macLength); + ofs += macLength; + serverMacKey = new SecretKeySpec(tmp, "Mac"); + } if (keyLength == 0) { // SSL_RSA_WITH_NULL_* ciphersuites return new TlsKeyMaterialSpec(clientMacKey, serverMacKey); @@ -198,7 +200,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi { // IV keys if needed. if (ivLength != 0) { - tmp = new byte[ivLength]; + byte[] tmp = new byte[ivLength]; System.arraycopy(keyBlock, ofs, tmp, 0, ivLength); ofs += ivLength; @@ -220,8 +222,8 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi { // TLS 1.0 byte[] seed = concat(clientRandom, serverRandom); - tmp = doTLS10PRF(clientKeyBytes, LABEL_CLIENT_WRITE_KEY, seed, - expandedKeyLength, md5, sha); + byte[] tmp = doTLS10PRF(clientKeyBytes, + LABEL_CLIENT_WRITE_KEY, seed, expandedKeyLength, md5, sha); clientCipherKey = new SecretKeySpec(tmp, alg); tmp = doTLS10PRF(serverKeyBytes, LABEL_SERVER_WRITE_KEY, seed, @@ -239,7 +241,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi { } } else { // SSLv3 - tmp = new byte[expandedKeyLength]; + byte[] tmp = new byte[expandedKeyLength]; md5.update(clientKeyBytes); md5.update(clientRandom); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index 219f5bf5873..d69200c1408 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -243,12 +243,17 @@ public class JPEGImageReader extends ImageReader { * sending warnings to listeners. */ protected void warningOccurred(int code) { - if ((code < 0) || (code > MAX_WARNING)){ - throw new InternalError("Invalid warning index"); + cbLock.lock(); + try { + if ((code < 0) || (code > MAX_WARNING)){ + throw new InternalError("Invalid warning index"); + } + processWarningOccurred + ("com.sun.imageio.plugins.jpeg.JPEGImageReaderResources", + Integer.toString(code)); + } finally { + cbLock.unlock(); } - processWarningOccurred - ("com.sun.imageio.plugins.jpeg.JPEGImageReaderResources", - Integer.toString(code)); } /** @@ -265,7 +270,12 @@ public class JPEGImageReader extends ImageReader { * library warnings from being printed to stderr. */ protected void warningWithMessage(String msg) { - processWarningOccurred(msg); + cbLock.lock(); + try { + processWarningOccurred(msg); + } finally { + cbLock.unlock(); + } } public void setInput(Object input, @@ -274,18 +284,55 @@ public class JPEGImageReader extends ImageReader { { setThreadLock(); try { + cbLock.check(); + super.setInput(input, seekForwardOnly, ignoreMetadata); this.ignoreMetadata = ignoreMetadata; resetInternalState(); iis = (ImageInputStream) input; // Always works - setSource(structPointer, iis); + setSource(structPointer); } finally { clearThreadLock(); } } - private native void setSource(long structPointer, - ImageInputStream source); + /** + * This method is called from native code in order to fill + * native input buffer. + * + * We block any attempt to change the reading state during this + * method, in order to prevent a corruption of the native decoder + * state. + * + * @return number of bytes read from the stream. + */ + private int readInputData(byte[] buf, int off, int len) throws IOException { + cbLock.lock(); + try { + return iis.read(buf, off, len); + } finally { + cbLock.unlock(); + } + } + + /** + * This method is called from the native code in order to + * skip requested number of bytes in the input stream. + * + * @param n + * @return + * @throws IOException + */ + private long skipInputBytes(long n) throws IOException { + cbLock.lock(); + try { + return iis.skipBytes(n); + } finally { + cbLock.unlock(); + } + } + + private native void setSource(long structPointer); private void checkTablesOnly() throws IOException { if (debug) { @@ -337,6 +384,8 @@ public class JPEGImageReader extends ImageReader { public int getNumImages(boolean allowSearch) throws IOException { setThreadLock(); try { // locked thread + cbLock.check(); + return getNumImagesOnThread(allowSearch); } finally { clearThreadLock(); @@ -536,8 +585,13 @@ public class JPEGImageReader extends ImageReader { if (debug) { System.out.println("pushing back " + num + " bytes"); } - iis.seek(iis.getStreamPosition()-num); - // The buffer is clear after this, so no need to set haveSeeked. + cbLock.lock(); + try { + iis.seek(iis.getStreamPosition()-num); + // The buffer is clear after this, so no need to set haveSeeked. + } finally { + cbLock.unlock(); + } } /** @@ -644,7 +698,12 @@ public class JPEGImageReader extends ImageReader { * Ignore this profile. */ iccCS = null; - warningOccurred(WARNING_IGNORE_INVALID_ICC); + cbLock.lock(); + try { + warningOccurred(WARNING_IGNORE_INVALID_ICC); + } finally { + cbLock.unlock(); + } } } } @@ -653,6 +712,7 @@ public class JPEGImageReader extends ImageReader { setThreadLock(); try { if (currentImage != imageIndex) { + cbLock.check(); readHeader(imageIndex, true); } return width; @@ -665,6 +725,7 @@ public class JPEGImageReader extends ImageReader { setThreadLock(); try { if (currentImage != imageIndex) { + cbLock.check(); readHeader(imageIndex, true); } return height; @@ -693,6 +754,8 @@ public class JPEGImageReader extends ImageReader { setThreadLock(); try { if (currentImage != imageIndex) { + cbLock.check(); + readHeader(imageIndex, true); } @@ -716,6 +779,7 @@ public class JPEGImageReader extends ImageReader { private Iterator getImageTypesOnThread(int imageIndex) throws IOException { if (currentImage != imageIndex) { + cbLock.check(); readHeader(imageIndex, true); } @@ -931,6 +995,7 @@ public class JPEGImageReader extends ImageReader { setThreadLock(); try { if (!tablesOnlyChecked) { + cbLock.check(); checkTablesOnly(); } return streamMetadata; @@ -951,6 +1016,8 @@ public class JPEGImageReader extends ImageReader { return imageMetadata; } + cbLock.check(); + gotoImage(imageIndex); imageMetadata = new JPEGMetadata(false, false, iis, this); @@ -967,6 +1034,7 @@ public class JPEGImageReader extends ImageReader { throws IOException { setThreadLock(); try { + cbLock.check(); try { readInternal(imageIndex, param, false); } catch (RuntimeException e) { @@ -1196,58 +1264,63 @@ public class JPEGImageReader extends ImageReader { } target.setRect(destROI.x, destROI.y + y, raster); - processImageUpdate(image, - destROI.x, destROI.y+y, - raster.getWidth(), 1, - 1, 1, - destinationBands); - if ((y > 0) && (y%progInterval == 0)) { - int height = target.getHeight()-1; - float percentOfPass = ((float)y)/height; - if (progressive) { - if (knownPassCount != UNKNOWN) { - processImageProgress((pass + percentOfPass)*100.0F - / knownPassCount); - } else if (maxProgressivePass != Integer.MAX_VALUE) { - // Use the range of allowed progressive passes - processImageProgress((pass + percentOfPass)*100.0F - / (maxProgressivePass - minProgressivePass + 1)); - } else { - // Assume there are a minimum of MIN_ESTIMATED_PASSES - // and that there is always one more pass - // Compute the percentage as the percentage at the end - // of the previous pass, plus the percentage of this - // pass scaled to be the percentage of the total remaining, - // assuming a minimum of MIN_ESTIMATED_PASSES passes and - // that there is always one more pass. This is monotonic - // and asymptotic to 1.0, which is what we need. - int remainingPasses = // including this one - Math.max(2, MIN_ESTIMATED_PASSES-pass); - int totalPasses = pass + remainingPasses-1; - progInterval = Math.max(height/20*totalPasses, - totalPasses); - if (y%progInterval == 0) { - percentToDate = previousPassPercentage + - (1.0F - previousPassPercentage) - * (percentOfPass)/remainingPasses; - if (debug) { - System.out.print("pass= " + pass); - System.out.print(", y= " + y); - System.out.print(", progInt= " + progInterval); - System.out.print(", % of pass: " + percentOfPass); - System.out.print(", rem. passes: " - + remainingPasses); - System.out.print(", prev%: " - + previousPassPercentage); - System.out.print(", %ToDate: " + percentToDate); - System.out.print(" "); + cbLock.lock(); + try { + processImageUpdate(image, + destROI.x, destROI.y+y, + raster.getWidth(), 1, + 1, 1, + destinationBands); + if ((y > 0) && (y%progInterval == 0)) { + int height = target.getHeight()-1; + float percentOfPass = ((float)y)/height; + if (progressive) { + if (knownPassCount != UNKNOWN) { + processImageProgress((pass + percentOfPass)*100.0F + / knownPassCount); + } else if (maxProgressivePass != Integer.MAX_VALUE) { + // Use the range of allowed progressive passes + processImageProgress((pass + percentOfPass)*100.0F + / (maxProgressivePass - minProgressivePass + 1)); + } else { + // Assume there are a minimum of MIN_ESTIMATED_PASSES + // and that there is always one more pass + // Compute the percentage as the percentage at the end + // of the previous pass, plus the percentage of this + // pass scaled to be the percentage of the total remaining, + // assuming a minimum of MIN_ESTIMATED_PASSES passes and + // that there is always one more pass. This is monotonic + // and asymptotic to 1.0, which is what we need. + int remainingPasses = // including this one + Math.max(2, MIN_ESTIMATED_PASSES-pass); + int totalPasses = pass + remainingPasses-1; + progInterval = Math.max(height/20*totalPasses, + totalPasses); + if (y%progInterval == 0) { + percentToDate = previousPassPercentage + + (1.0F - previousPassPercentage) + * (percentOfPass)/remainingPasses; + if (debug) { + System.out.print("pass= " + pass); + System.out.print(", y= " + y); + System.out.print(", progInt= " + progInterval); + System.out.print(", % of pass: " + percentOfPass); + System.out.print(", rem. passes: " + + remainingPasses); + System.out.print(", prev%: " + + previousPassPercentage); + System.out.print(", %ToDate: " + percentToDate); + System.out.print(" "); + } + processImageProgress(percentToDate*100.0F); } - processImageProgress(percentToDate*100.0F); } + } else { + processImageProgress(percentOfPass * 100.0F); } - } else { - processImageProgress(percentOfPass * 100.0F); } + } finally { + cbLock.unlock(); } } @@ -1260,33 +1333,58 @@ public class JPEGImageReader extends ImageReader { } private void passStarted (int pass) { - this.pass = pass; - previousPassPercentage = percentToDate; - processPassStarted(image, - pass, - minProgressivePass, - maxProgressivePass, - 0, 0, - 1,1, - destinationBands); + cbLock.lock(); + try { + this.pass = pass; + previousPassPercentage = percentToDate; + processPassStarted(image, + pass, + minProgressivePass, + maxProgressivePass, + 0, 0, + 1,1, + destinationBands); + } finally { + cbLock.unlock(); + } } private void passComplete () { - processPassComplete(image); + cbLock.lock(); + try { + processPassComplete(image); + } finally { + cbLock.unlock(); + } } void thumbnailStarted(int thumbnailIndex) { - processThumbnailStarted(currentImage, thumbnailIndex); + cbLock.lock(); + try { + processThumbnailStarted(currentImage, thumbnailIndex); + } finally { + cbLock.unlock(); + } } // Provide access to protected superclass method void thumbnailProgress(float percentageDone) { - processThumbnailProgress(percentageDone); + cbLock.lock(); + try { + processThumbnailProgress(percentageDone); + } finally { + cbLock.unlock(); + } } // Provide access to protected superclass method void thumbnailComplete() { - processThumbnailComplete(); + cbLock.lock(); + try { + processThumbnailComplete(); + } finally { + cbLock.unlock(); + } } /** @@ -1310,6 +1408,11 @@ public class JPEGImageReader extends ImageReader { public void abort() { setThreadLock(); try { + /** + * NB: we do not check the call back lock here, + * we allow to abort the reader any time. + */ + super.abort(); abortRead(structPointer); } finally { @@ -1332,6 +1435,7 @@ public class JPEGImageReader extends ImageReader { setThreadLock(); Raster retval = null; try { + cbLock.check(); /* * This could be further optimized by not resetting the dest. * offset and creating a translated raster in readInternal() @@ -1371,6 +1475,8 @@ public class JPEGImageReader extends ImageReader { public int getNumThumbnails(int imageIndex) throws IOException { setThreadLock(); try { + cbLock.check(); + getImageMetadata(imageIndex); // checks iis state for us // Now check the jfif segments JFIFMarkerSegment jfif = @@ -1391,6 +1497,8 @@ public class JPEGImageReader extends ImageReader { throws IOException { setThreadLock(); try { + cbLock.check(); + if ((thumbnailIndex < 0) || (thumbnailIndex >= getNumThumbnails(imageIndex))) { throw new IndexOutOfBoundsException("No such thumbnail"); @@ -1409,6 +1517,8 @@ public class JPEGImageReader extends ImageReader { throws IOException { setThreadLock(); try { + cbLock.check(); + if ((thumbnailIndex < 0) || (thumbnailIndex >= getNumThumbnails(imageIndex))) { throw new IndexOutOfBoundsException("No such thumbnail"); @@ -1428,6 +1538,8 @@ public class JPEGImageReader extends ImageReader { throws IOException { setThreadLock(); try { + cbLock.check(); + if ((thumbnailIndex < 0) || (thumbnailIndex >= getNumThumbnails(imageIndex))) { throw new IndexOutOfBoundsException("No such thumbnail"); @@ -1468,6 +1580,7 @@ public class JPEGImageReader extends ImageReader { public void reset() { setThreadLock(); try { + cbLock.check(); super.reset(); } finally { clearThreadLock(); @@ -1479,6 +1592,8 @@ public class JPEGImageReader extends ImageReader { public void dispose() { setThreadLock(); try { + cbLock.check(); + if (structPointer != 0) { disposerRecord.dispose(); structPointer = 0; @@ -1540,6 +1655,36 @@ public class JPEGImageReader extends ImageReader { theThread = null; } } + + private CallBackLock cbLock = new CallBackLock(); + + private static class CallBackLock { + + private State lockState; + + CallBackLock() { + lockState = State.Unlocked; + } + + void check() { + if (lockState != State.Unlocked) { + throw new IllegalStateException("Access to the reader is not allowed"); + } + } + + private void lock() { + lockState = State.Locked; + } + + private void unlock() { + lockState = State.Unlocked; + } + + private static enum State { + Unlocked, + Locked + } + } } /** diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index bc8d435d464..b8564176df8 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -183,8 +183,7 @@ public class JPEGImageWriter extends ImageWriter { return null; } }); - initWriterIDs(ImageOutputStream.class, - JPEGQTable.class, + initWriterIDs(JPEGQTable.class, JPEGHuffmanTable.class); } @@ -200,11 +199,13 @@ public class JPEGImageWriter extends ImageWriter { public void setOutput(Object output) { setThreadLock(); try { + cbLock.check(); + super.setOutput(output); // validates output resetInternalState(); ios = (ImageOutputStream) output; // so this will always work // Set the native destination - setDest(structPointer, ios); + setDest(structPointer); } finally { clearThreadLock(); } @@ -359,6 +360,8 @@ public class JPEGImageWriter extends ImageWriter { ImageWriteParam param) throws IOException { setThreadLock(); try { + cbLock.check(); + writeOnThread(streamMetadata, image, param); } finally { clearThreadLock(); @@ -1082,13 +1085,18 @@ public class JPEGImageWriter extends ImageWriter { haveMetadata, restartInterval); - if (aborted) { - processWriteAborted(); - } else { - processImageComplete(); - } + cbLock.lock(); + try { + if (aborted) { + processWriteAborted(); + } else { + processImageComplete(); + } - ios.flush(); + ios.flush(); + } finally { + cbLock.unlock(); + } currentImage++; // After a successful write } @@ -1096,6 +1104,8 @@ public class JPEGImageWriter extends ImageWriter { throws IOException { setThreadLock(); try { + cbLock.check(); + prepareWriteSequenceOnThread(streamMetadata); } finally { clearThreadLock(); @@ -1175,6 +1185,8 @@ public class JPEGImageWriter extends ImageWriter { throws IOException { setThreadLock(); try { + cbLock.check(); + if (sequencePrepared == false) { throw new IllegalStateException("sequencePrepared not called!"); } @@ -1188,6 +1200,8 @@ public class JPEGImageWriter extends ImageWriter { public void endWriteSequence() throws IOException { setThreadLock(); try { + cbLock.check(); + if (sequencePrepared == false) { throw new IllegalStateException("sequencePrepared not called!"); } @@ -1200,6 +1214,10 @@ public class JPEGImageWriter extends ImageWriter { public synchronized void abort() { setThreadLock(); try { + /** + * NB: we do not check the call back lock here, we allow to abort + * the reader any time. + */ super.abort(); abortWrite(structPointer); } finally { @@ -1223,6 +1241,8 @@ public class JPEGImageWriter extends ImageWriter { public void reset() { setThreadLock(); try { + cbLock.check(); + super.reset(); } finally { clearThreadLock(); @@ -1232,6 +1252,8 @@ public class JPEGImageWriter extends ImageWriter { public void dispose() { setThreadLock(); try { + cbLock.check(); + if (structPointer != 0) { disposerRecord.dispose(); structPointer = 0; @@ -1251,13 +1273,18 @@ public class JPEGImageWriter extends ImageWriter { * sending warnings to listeners. */ void warningOccurred(int code) { - if ((code < 0) || (code > MAX_WARNING)){ - throw new InternalError("Invalid warning index"); + cbLock.lock(); + try { + if ((code < 0) || (code > MAX_WARNING)){ + throw new InternalError("Invalid warning index"); + } + processWarningOccurred + (currentImage, + "com.sun.imageio.plugins.jpeg.JPEGImageWriterResources", + Integer.toString(code)); + } finally { + cbLock.unlock(); } - processWarningOccurred - (currentImage, - "com.sun.imageio.plugins.jpeg.JPEGImageWriterResources", - Integer.toString(code)); } /** @@ -1274,21 +1301,41 @@ public class JPEGImageWriter extends ImageWriter { * library warnings from being printed to stderr. */ void warningWithMessage(String msg) { - processWarningOccurred(currentImage, msg); + cbLock.lock(); + try { + processWarningOccurred(currentImage, msg); + } finally { + cbLock.unlock(); + } } void thumbnailStarted(int thumbnailIndex) { - processThumbnailStarted(currentImage, thumbnailIndex); + cbLock.lock(); + try { + processThumbnailStarted(currentImage, thumbnailIndex); + } finally { + cbLock.unlock(); + } } // Provide access to protected superclass method void thumbnailProgress(float percentageDone) { - processThumbnailProgress(percentageDone); + cbLock.lock(); + try { + processThumbnailProgress(percentageDone); + } finally { + cbLock.unlock(); + } } // Provide access to protected superclass method void thumbnailComplete() { - processThumbnailComplete(); + cbLock.lock(); + try { + processThumbnailComplete(); + } finally { + cbLock.unlock(); + } } ///////// End of Package-access API @@ -1615,16 +1662,14 @@ public class JPEGImageWriter extends ImageWriter { ////////////// Native methods and callbacks /** Sets up static native structures. */ - private static native void initWriterIDs(Class iosClass, - Class qTableClass, + private static native void initWriterIDs(Class qTableClass, Class huffClass); /** Sets up per-writer native structure and returns a pointer to it. */ private native long initJPEGImageWriter(); /** Sets up native structures for output stream */ - private native void setDest(long structPointer, - ImageOutputStream ios); + private native void setDest(long structPointer); /** * Returns true if the write was aborted. @@ -1749,7 +1794,12 @@ public class JPEGImageWriter extends ImageWriter { } raster.setRect(sourceLine); if ((y > 7) && (y%8 == 0)) { // Every 8 scanlines - processImageProgress((float) y / (float) sourceHeight * 100.0F); + cbLock.lock(); + try { + processImageProgress((float) y / (float) sourceHeight * 100.0F); + } finally { + cbLock.unlock(); + } } } @@ -1777,6 +1827,25 @@ public class JPEGImageWriter extends ImageWriter { } } + /** + * This method is called from native code in order to write encoder + * output to the destination. + * + * We block any attempt to change the writer state during this + * method, in order to prevent a corruption of the native encoder + * state. + */ + private void writeOutputData(byte[] data, int offset, int len) + throws IOException + { + cbLock.lock(); + try { + ios.write(data, offset, len); + } finally { + cbLock.unlock(); + } + } + private Thread theThread = null; private int theLockCount = 0; @@ -1811,4 +1880,34 @@ public class JPEGImageWriter extends ImageWriter { theThread = null; } } + + private CallBackLock cbLock = new CallBackLock(); + + private static class CallBackLock { + + private State lockState; + + CallBackLock() { + lockState = State.Unlocked; + } + + void check() { + if (lockState != State.Unlocked) { + throw new IllegalStateException("Access to the writer is not allowed"); + } + } + + private void lock() { + lockState = State.Locked; + } + + private void unlock() { + lockState = State.Unlocked; + } + + private static enum State { + Unlocked, + Locked + } + } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java index ab62660be49..1adb4dd9373 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Modifier; import java.security.Permission; import java.util.Map; import java.util.logging.Level; @@ -213,7 +214,6 @@ public class MBeanInstantiator { Object moi; - // ------------------------------ // ------------------------------ Constructor cons = findConstructor(theClass, null); @@ -224,6 +224,7 @@ public class MBeanInstantiator { // Instantiate the new object try { ReflectUtil.checkPackageAccess(theClass); + ensureClassAccess(theClass); moi= cons.newInstance(); } catch (InvocationTargetException e) { // Wrap the exception. @@ -270,7 +271,6 @@ public class MBeanInstantiator { checkMBeanPermission(theClass, null, null, "instantiate"); // Instantiate the new object - // ------------------------------ // ------------------------------ final Class[] tab; @@ -300,6 +300,7 @@ public class MBeanInstantiator { } try { ReflectUtil.checkPackageAccess(theClass); + ensureClassAccess(theClass); moi = cons.newInstance(params); } catch (NoSuchMethodError error) { @@ -741,4 +742,13 @@ public class MBeanInstantiator { sm.checkPermission(perm); } } + + private static void ensureClassAccess(Class clazz) + throws IllegalAccessException + { + int mod = clazz.getModifiers(); + if (!Modifier.isPublic(mod)) { + throw new IllegalAccessException("Class is not public and can't be instantiated"); + } + } } diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java index a0f06c3ed07..dacefba8f49 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -56,7 +56,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice // from simultaneous creation and destruction // reduces possibility of deadlock, compared to // synchronizing to the class instance - private Object traRecLock = new Object(); + private final Object traRecLock = new Object(); // DEVICE ATTRIBUTES @@ -474,7 +474,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice This is necessary for Receivers retrieved via MidiSystem.getReceiver() (which opens the device implicitely). */ - protected abstract class AbstractReceiver implements MidiDeviceReceiver { + abstract class AbstractReceiver implements MidiDeviceReceiver { private boolean open = true; @@ -483,24 +483,24 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice Receiver. Therefore, subclasses should not override this method. Instead, they should implement implSend(). */ - public synchronized void send(MidiMessage message, long timeStamp) { - if (open) { - implSend(message, timeStamp); - } else { + @Override + public final synchronized void send(final MidiMessage message, + final long timeStamp) { + if (!open) { throw new IllegalStateException("Receiver is not open"); } + implSend(message, timeStamp); } - - protected abstract void implSend(MidiMessage message, long timeStamp); - + abstract void implSend(MidiMessage message, long timeStamp); /** Close the Receiver. * Here, the call to the magic method closeInternal() takes place. * Therefore, subclasses that override this method must call * 'super.close()'. */ - public void close() { + @Override + public final void close() { open = false; synchronized (AbstractMidiDevice.this.traRecLock) { AbstractMidiDevice.this.getReceiverList().remove(this); @@ -508,11 +508,12 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice AbstractMidiDevice.this.closeInternal(this); } - public MidiDevice getMidiDevice() { + @Override + public final MidiDevice getMidiDevice() { return AbstractMidiDevice.this; } - protected boolean isOpen() { + final boolean isOpen() { return open; } diff --git a/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java b/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java index b4ca9c82ce8..39f85da154c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java +++ b/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java @@ -32,7 +32,7 @@ import javax.sound.midi.*; * * @author Florian Bomers */ -class FastShortMessage extends ShortMessage { +final class FastShortMessage extends ShortMessage { private int packedMsg; public FastShortMessage(int packedMsg) throws InvalidMidiDataException { diff --git a/jdk/src/share/classes/com/sun/media/sound/FastSysexMessage.java b/jdk/src/share/classes/com/sun/media/sound/FastSysexMessage.java index d00ec68aa63..7f2e2def2ee 100644 --- a/jdk/src/share/classes/com/sun/media/sound/FastSysexMessage.java +++ b/jdk/src/share/classes/com/sun/media/sound/FastSysexMessage.java @@ -32,7 +32,7 @@ import javax.sound.midi.*; * * @author Florian Bomers */ -class FastSysexMessage extends SysexMessage { +final class FastSysexMessage extends SysexMessage { FastSysexMessage(byte[] data) throws InvalidMidiDataException { super(data); diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java b/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java index e1ada68a80e..a9193005e5f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java @@ -103,9 +103,9 @@ class MidiOutDevice extends AbstractMidiDevice { class MidiOutReceiver extends AbstractReceiver { - protected void implSend(MidiMessage message, long timeStamp) { - int length = message.getLength(); - int status = message.getStatus(); + void implSend(final MidiMessage message, final long timeStamp) { + final int length = message.getLength(); + final int status = message.getStatus(); if (length <= 3 && status != 0xF0 && status != 0xF7) { int packedMsg; if (message instanceof ShortMessage) { @@ -140,11 +140,15 @@ class MidiOutDevice extends AbstractMidiDevice { } nSendShortMessage(id, packedMsg, timeStamp); } else { + final byte[] data; if (message instanceof FastSysexMessage) { - nSendLongMessage(id, ((FastSysexMessage) message).getReadOnlyMessage(), - length, timeStamp); + data = ((FastSysexMessage) message).getReadOnlyMessage(); } else { - nSendLongMessage(id, message.getMessage(), length, timeStamp); + data = message.getMessage(); + } + final int dataLength = Math.min(length, data.length); + if (dataLength > 0) { + nSendLongMessage(id, data, dataLength, timeStamp); } } } diff --git a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java index 8b4ae6e7ad1..93b7b0612eb 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java +++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java @@ -1026,7 +1026,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon class SequencerReceiver extends AbstractReceiver { - protected void implSend(MidiMessage message, long timeStamp) { + void implSend(MidiMessage message, long timeStamp) { if (recording) { long tickPos = 0; diff --git a/jdk/src/share/classes/com/sun/tools/jdi/EventSetImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/EventSetImpl.java index eb5f9a3ef09..946478081db 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/EventSetImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/EventSetImpl.java @@ -851,6 +851,11 @@ public class EventSetImpl extends ArrayList implements EventSet { } } + @Override + public Spliterator spliterator() { + return Spliterators.spliterator(this, Spliterator.DISTINCT); + } + /* below make this unmodifiable */ public boolean add(Event o){ diff --git a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index 468faf2edc7..e2b846285eb 100644 --- a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -208,7 +208,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * aComponent is null */ public Component getComponentAfter(Container aContainer, Component aComponent) { - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Searching in " + aContainer + " for component after " + aComponent); + } if (aContainer == null || aComponent == null) { throw new IllegalArgumentException("aContainer and aComponent cannot be null"); @@ -247,7 +249,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (afterComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### FTP returned " + afterComp); + } return afterComp; } aComponent = provider; @@ -255,7 +259,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is " + cycle + ", component is " + aComponent); + } int index = getComponentIndex(cycle, aComponent); @@ -336,7 +342,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (beforeComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### FTP returned " + beforeComp); + } return beforeComp; } aComponent = provider; @@ -349,7 +357,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is " + cycle + ", component is " + aComponent); + } int index = getComponentIndex(cycle, aComponent); @@ -401,7 +411,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy public Component getFirstComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Getting first component in " + aContainer); + } if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); @@ -420,10 +432,14 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty"); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is empty"); + } return null; } - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is " + cycle); + } for (Component comp : cycle) { if (accept(comp)) { @@ -451,7 +467,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy */ public Component getLastComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Getting last component in " + aContainer); + } if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); @@ -470,10 +488,14 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty"); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is empty"); + } return null; } - if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("### Cycle is " + cycle); + } for (int i= cycle.size() - 1; i >= 0; i--) { Component comp = cycle.get(i); diff --git a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java index d2d6bf3175f..68e1f52a221 100644 --- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -310,7 +310,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * false otherwise */ public boolean dispatchEvent(AWTEvent e) { - if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e); + if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) { + focusLog.fine("" + e); + } switch (e.getID()) { case WindowEvent.WINDOW_GAINED_FOCUS: { if (repostIfFollowsKeyEvents((WindowEvent)e)) { @@ -871,7 +873,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } } if (ke != null) { - focusLog.finer("Pumping approved event {0}", ke); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Pumping approved event {0}", ke); + } enqueuedKeyEvents.removeFirst(); } } @@ -920,7 +924,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { // The fix is rolled out. if (ke.getWhen() > marker.after) { - focusLog.finer("Storing event {0} because of marker {1}", ke, marker); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Storing event {0} because of marker {1}", ke, marker); + } enqueuedKeyEvents.addLast(ke); return true; } @@ -932,7 +938,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } case FocusEvent.FOCUS_GAINED: - focusLog.finest("Markers before FOCUS_GAINED on {0}", target); + if (focusLog.isLoggable(PlatformLogger.FINEST)) { + focusLog.finest("Markers before FOCUS_GAINED on {0}", target); + } dumpMarkers(); // Search the marker list for the first marker tied to // the Component which just gained focus. Then remove @@ -959,7 +967,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } } else { // Exception condition - event without marker - focusLog.finer("Event without marker {0}", e); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Event without marker {0}", e); + } } } focusLog.finest("Markers after FOCUS_GAINED"); @@ -1198,8 +1208,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { return; } - focusLog.finer("Enqueue at {0} for {1}", + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Enqueue at {0} for {1}", after, untilFocused); + } int insertionIndex = 0, i = typeAheadMarkers.size(); @@ -1238,8 +1250,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { return; } - focusLog.finer("Dequeue at {0} for {1}", + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Dequeue at {0} for {1}", after, untilFocused); + } TypeAheadMarker marker; ListIterator iter = typeAheadMarkers.listIterator diff --git a/jdk/src/share/classes/java/awt/EventDispatchThread.java b/jdk/src/share/classes/java/awt/EventDispatchThread.java index c707f02abdb..3260e37859e 100644 --- a/jdk/src/share/classes/java/awt/EventDispatchThread.java +++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java @@ -138,7 +138,9 @@ class EventDispatchThread extends Thread { } void addEventFilter(EventFilter filter) { - eventLog.finest("adding the event filter: " + filter); + if (eventLog.isLoggable(PlatformLogger.FINEST)) { + eventLog.finest("adding the event filter: " + filter); + } synchronized (eventFilters) { if (!eventFilters.contains(filter)) { if (filter instanceof ModalEventFilter) { @@ -162,7 +164,9 @@ class EventDispatchThread extends Thread { } void removeEventFilter(EventFilter filter) { - eventLog.finest("removing the event filter: " + filter); + if (eventLog.isLoggable(PlatformLogger.FINEST)) { + eventLog.finest("removing the event filter: " + filter); + } synchronized (eventFilters) { eventFilters.remove(filter); } diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index af9dcb1b2c2..1d1b78c6e10 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -2410,7 +2410,7 @@ public abstract class KeyboardFocusManager Window nativeFocusedWindow = thisManager.getNativeFocusedWindow(); if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("SNFH for {0} in {1}", - String.valueOf(descendant), String.valueOf(heavyweight)); + String.valueOf(descendant), String.valueOf(heavyweight)); } if (focusLog.isLoggable(PlatformLogger.FINEST)) { focusLog.finest("0. Current focus owner {0}", @@ -2478,9 +2478,10 @@ public abstract class KeyboardFocusManager manager.enqueueKeyEvents(time, descendant); } - if (focusLog.isLoggable(PlatformLogger.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) { focusLog.finest("3. SNFH_HANDLED for lightweight" + descendant + " in " + heavyweight); + } return SNFH_SUCCESS_HANDLED; } else { if (!focusedWindowChangeAllowed) { @@ -2501,8 +2502,9 @@ public abstract class KeyboardFocusManager (hwFocusRequest != null) ? hwFocusRequest.heavyweight : nativeFocusedWindow)) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) { focusLog.finest("4. SNFH_FAILURE for " + descendant); + } return SNFH_FAILURE; } } @@ -2511,8 +2513,9 @@ public abstract class KeyboardFocusManager heavyweightRequests.add (new HeavyweightFocusRequest(heavyweight, descendant, temporary, cause)); - if (focusLog.isLoggable(PlatformLogger.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) { focusLog.finest("5. SNFH_PROCEED for " + descendant); + } return SNFH_SUCCESS_PROCEED; } } diff --git a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java index bf77fa73a62..a93c50a19e2 100644 --- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java +++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java @@ -165,8 +165,10 @@ class WaitDispatchSupport implements SecondaryLoop { */ @Override public boolean enter() { - log.fine("enter(): blockingEDT=" + keepBlockingEDT.get() + - ", blockingCT=" + keepBlockingCT.get()); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("enter(): blockingEDT=" + keepBlockingEDT.get() + + ", blockingCT=" + keepBlockingCT.get()); + } if (!keepBlockingEDT.compareAndSet(false, true)) { log.fine("The secondary loop is already running, aborting"); @@ -190,9 +192,13 @@ class WaitDispatchSupport implements SecondaryLoop { Thread currentThread = Thread.currentThread(); if (currentThread == dispatchThread) { - log.finest("On dispatch thread: " + dispatchThread); + if (log.isLoggable(PlatformLogger.FINEST)) { + log.finest("On dispatch thread: " + dispatchThread); + } if (interval != 0) { - log.finest("scheduling the timer for " + interval + " ms"); + if (log.isLoggable(PlatformLogger.FINEST)) { + log.finest("scheduling the timer for " + interval + " ms"); + } timer.schedule(timerTask = new TimerTask() { @Override public void run() { @@ -207,7 +213,9 @@ class WaitDispatchSupport implements SecondaryLoop { SequencedEvent currentSE = KeyboardFocusManager. getCurrentKeyboardFocusManager().getCurrentSequencedEvent(); if (currentSE != null) { - log.fine("Dispose current SequencedEvent: " + currentSE); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("Dispose current SequencedEvent: " + currentSE); + } currentSE.dispose(); } // In case the exit() method is called before starting @@ -223,7 +231,9 @@ class WaitDispatchSupport implements SecondaryLoop { } }); } else { - log.finest("On non-dispatch thread: " + currentThread); + if (log.isLoggable(PlatformLogger.FINEST)) { + log.finest("On non-dispatch thread: " + currentThread); + } synchronized (getTreeLock()) { if (filter != null) { dispatchThread.addEventFilter(filter); @@ -247,9 +257,13 @@ class WaitDispatchSupport implements SecondaryLoop { getTreeLock().wait(); } } - log.fine("waitDone " + keepBlockingEDT.get() + " " + keepBlockingCT.get()); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("waitDone " + keepBlockingEDT.get() + " " + keepBlockingCT.get()); + } } catch (InterruptedException e) { - log.fine("Exception caught while waiting: " + e); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("Exception caught while waiting: " + e); + } } finally { if (filter != null) { dispatchThread.removeEventFilter(filter); @@ -270,8 +284,10 @@ class WaitDispatchSupport implements SecondaryLoop { * @inheritDoc */ public boolean exit() { - log.fine("exit(): blockingEDT=" + keepBlockingEDT.get() + - ", blockingCT=" + keepBlockingCT.get()); + if (log.isLoggable(PlatformLogger.FINE)) { + log.fine("exit(): blockingEDT=" + keepBlockingEDT.get() + + ", blockingCT=" + keepBlockingCT.get()); + } if (keepBlockingEDT.compareAndSet(true, false)) { wakeupEDT(); return true; @@ -295,7 +311,9 @@ class WaitDispatchSupport implements SecondaryLoop { }; private void wakeupEDT() { - log.finest("wakeupEDT(): EDT == " + dispatchThread); + if (log.isLoggable(PlatformLogger.FINEST)) { + log.finest("wakeupEDT(): EDT == " + dispatchThread); + } EventQueue eq = dispatchThread.getEventQueue(); eq.postEvent(new PeerEvent(this, wakingRunnable, PeerEvent.PRIORITY_EVENT)); } diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 68b9af95a96..89270e27df1 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -2234,7 +2234,7 @@ public class Window extends Container implements Accessible { WindowPeer peer = (WindowPeer)this.peer; synchronized(getTreeLock()) { if (peer != null) { - peer.setAlwaysOnTop(alwaysOnTop); + peer.updateAlwaysOnTopState(); } } } diff --git a/jdk/src/share/classes/java/awt/peer/WindowPeer.java b/jdk/src/share/classes/java/awt/peer/WindowPeer.java index fca78b7eed4..b44bfa00da9 100644 --- a/jdk/src/share/classes/java/awt/peer/WindowPeer.java +++ b/jdk/src/share/classes/java/awt/peer/WindowPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -53,15 +53,14 @@ public interface WindowPeer extends ContainerPeer { void toBack(); /** - * Sets if the window should always stay on top of all other windows or - * not. - * - * @param alwaysOnTop if the window should always stay on top of all other - * windows or not + * Updates the window's always-on-top state. + * Sets if the window should always stay + * on top of all other windows or not. * + * @see Window#getAlwaysOnTop() * @see Window#setAlwaysOnTop(boolean) */ - void setAlwaysOnTop(boolean alwaysOnTop); + void updateAlwaysOnTopState(); /** * Updates the window's focusable state. diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java index 48e7e3be4a1..65d95eb4e80 100644 --- a/jdk/src/share/classes/java/beans/Introspector.java +++ b/jdk/src/share/classes/java/beans/Introspector.java @@ -28,6 +28,7 @@ package java.beans; import com.sun.beans.TypeResolver; import com.sun.beans.WeakCache; import com.sun.beans.finder.ClassFinder; +import com.sun.beans.finder.MethodFinder; import java.awt.Component; @@ -1281,7 +1282,20 @@ public class Introspector { for (int i = 0; i < result.length; i++) { Method method = result[i]; if (!method.getDeclaringClass().equals(clz)) { - result[i] = null; + result[i] = null; // ignore methods declared elsewhere + } + else { + try { + method = MethodFinder.findAccessibleMethod(method); + Class type = method.getDeclaringClass(); + result[i] = type.equals(clz) || type.isInterface() + ? method + : null; // ignore methods from superclasses + } + catch (NoSuchMethodException exception) { + // commented out because of 6976577 + // result[i] = null; // ignore inaccessible methods + } } } declaredMethodCache.put(clz, result); diff --git a/jdk/src/share/classes/java/beans/ThreadGroupContext.java b/jdk/src/share/classes/java/beans/ThreadGroupContext.java index dc1d38a1457..6236ec2b38c 100644 --- a/jdk/src/share/classes/java/beans/ThreadGroupContext.java +++ b/jdk/src/share/classes/java/beans/ThreadGroupContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -29,7 +29,6 @@ import com.sun.beans.finder.BeanInfoFinder; import com.sun.beans.finder.PropertyEditorFinder; import java.awt.GraphicsEnvironment; -import java.util.HashMap; import java.util.Map; import java.util.WeakHashMap; @@ -42,7 +41,7 @@ import java.util.WeakHashMap; */ final class ThreadGroupContext { - private static final Map contexts = new WeakHashMap<>(); + private static final WeakIdentityMap contexts = new WeakIdentityMap<>(); /** * Returns the appropriate {@code AppContext} for the caller, @@ -69,6 +68,8 @@ final class ThreadGroupContext { private BeanInfoFinder beanInfoFinder; private PropertyEditorFinder propertyEditorFinder; + private ThreadGroupContext() { + } boolean isDesignTime() { return this.isDesignTime; diff --git a/jdk/src/share/classes/java/beans/WeakIdentityMap.java b/jdk/src/share/classes/java/beans/WeakIdentityMap.java new file mode 100644 index 00000000000..42ac821a392 --- /dev/null +++ b/jdk/src/share/classes/java/beans/WeakIdentityMap.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.beans; + +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +/** + * Hash table based mapping, which uses weak references to store keys + * and reference-equality in place of object-equality to compare them. + * An entry will automatically be removed when its key is no longer + * in ordinary use. Both null values and the null key are supported. + * + * @see java.util.IdentityHashMap + * @see java.util.WeakHashMap + */ +final class WeakIdentityMap { + + private static final int MAXIMUM_CAPACITY = 1 << 30; // it MUST be a power of two + private static final Object NULL = new Object(); // special object for null key + + private final ReferenceQueue queue = new ReferenceQueue(); + + private Entry[] table = newTable(1<<3); // table's length MUST be a power of two + private int threshold = 6; // the next size value at which to resize + private int size = 0; // the number of key-value mappings + + public T get(Object key) { + removeStaleEntries(); + if (key == null) { + key = NULL; + } + int hash = key.hashCode(); + int index = getIndex(this.table, hash); + for (Entry entry = this.table[index]; entry != null; entry = entry.next) { + if (entry.isMatched(key, hash)) { + return entry.value; + } + } + return null; + } + + public T put(Object key, T value) { + removeStaleEntries(); + if (key == null) { + key = NULL; + } + int hash = key.hashCode(); + int index = getIndex(this.table, hash); + for (Entry entry = this.table[index]; entry != null; entry = entry.next) { + if (entry.isMatched(key, hash)) { + T oldValue = entry.value; + entry.value = value; + return oldValue; + } + } + this.table[index] = new Entry(key, hash, value, this.queue, this.table[index]); + if (++this.size >= this.threshold) { + if (this.table.length == MAXIMUM_CAPACITY) { + this.threshold = Integer.MAX_VALUE; + } + else { + removeStaleEntries(); + Entry[] table = newTable(this.table.length * 2); + transfer(this.table, table); + + // If ignoring null elements and processing ref queue caused massive + // shrinkage, then restore old table. This should be rare, but avoids + // unbounded expansion of garbage-filled tables. + if (this.size >= this.threshold / 2) { + this.table = table; + this.threshold *= 2; + } + else { + transfer(table, this.table); + } + } + } + return null; + } + + private void removeStaleEntries() { + for (Object ref = this.queue.poll(); ref != null; ref = this.queue.poll()) { + @SuppressWarnings("unchecked") + Entry entry = (Entry) ref; + int index = getIndex(this.table, entry.hash); + + Entry prev = this.table[index]; + Entry current = prev; + while (current != null) { + Entry next = current.next; + if (current == entry) { + if (prev == entry) { + this.table[index] = next; + } + else { + prev.next = next; + } + entry.value = null; // Help GC + entry.next = null; // Help GC + this.size--; + break; + } + prev = current; + current = next; + } + } + } + + private void transfer(Entry[] oldTable, Entry[] newTable) { + for (int i = 0; i < oldTable.length; i++) { + Entry entry = oldTable[i]; + oldTable[i] = null; + while (entry != null) { + Entry next = entry.next; + Object key = entry.get(); + if (key == null) { + entry.value = null; // Help GC + entry.next = null; // Help GC + this.size--; + } + else { + int index = getIndex(newTable, entry.hash); + entry.next = newTable[index]; + newTable[index] = entry; + } + entry = next; + } + } + } + + + @SuppressWarnings("unchecked") + private Entry[] newTable(int length) { + return (Entry[]) new Entry[length]; + } + + private static int getIndex(Entry[] table, int hash) { + return hash & (table.length - 1); + } + + private static class Entry extends WeakReference { + private final int hash; + private T value; + private Entry next; + + Entry(Object key, int hash, T value, ReferenceQueue queue, Entry next) { + super(key, queue); + this.hash = hash; + this.value = value; + this.next = next; + } + + boolean isMatched(Object key, int hash) { + return (this.hash == hash) && (key == get()); + } + } +} diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index 0a530dd6db6..ca0400539f9 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; import static java.io.ObjectStreamClass.processQueue; +import sun.reflect.misc.ReflectUtil; /** * An ObjectInputStream deserializes primitive data and objects previously @@ -1519,6 +1520,12 @@ public class ObjectInputStream } } + private boolean isCustomSubclass() { + // Return true if this class is a custom subclass of ObjectInputStream + return getClass().getClassLoader() + != ObjectInputStream.class.getClassLoader(); + } + /** * Reads in and returns class descriptor for a dynamic proxy class. Sets * passHandle to proxy class descriptor's assigned handle. If proxy class @@ -1548,6 +1555,15 @@ public class ObjectInputStream try { if ((cl = resolveProxyClass(ifaces)) == null) { resolveEx = new ClassNotFoundException("null class"); + } else if (!Proxy.isProxyClass(cl)) { + throw new InvalidClassException("Not a proxy"); + } else { + // ReflectUtil.checkProxyPackageAccess makes a test + // equivalent to isCustomSubclass so there's no need + // to condition this call to isCustomSubclass == true here. + ReflectUtil.checkProxyPackageAccess( + getClass().getClassLoader(), + cl.getInterfaces()); } } catch (ClassNotFoundException ex) { resolveEx = ex; @@ -1589,9 +1605,12 @@ public class ObjectInputStream Class cl = null; ClassNotFoundException resolveEx = null; bin.setBlockDataMode(true); + final boolean checksRequired = isCustomSubclass(); try { if ((cl = resolveClass(readDesc)) == null) { resolveEx = new ClassNotFoundException("null class"); + } else if (checksRequired) { + ReflectUtil.checkPackageAccess(cl); } } catch (ClassNotFoundException ex) { resolveEx = ex; diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index 5fd388d657d..5593f2b4898 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -53,6 +53,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Objects; import sun.misc.Unsafe; +import sun.reflect.CallerSensitive; import sun.reflect.ConstantPool; import sun.reflect.Reflection; import sun.reflect.ReflectionFactory; @@ -250,9 +251,11 @@ public final class Class implements java.io.Serializable, * by this method fails * @exception ClassNotFoundException if the class cannot be located */ + @CallerSensitive public static Class forName(String className) throws ClassNotFoundException { - return forName0(className, true, ClassLoader.getCallerClassLoader()); + return forName0(className, true, + ClassLoader.getClassLoader(Reflection.getCallerClass())); } @@ -317,6 +320,7 @@ public final class Class implements java.io.Serializable, * @see java.lang.ClassLoader * @since 1.2 */ + @CallerSensitive public static Class forName(String name, boolean initialize, ClassLoader loader) throws ClassNotFoundException @@ -324,7 +328,7 @@ public final class Class implements java.io.Serializable, if (sun.misc.VM.isSystemDomainLoader(loader)) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ClassLoader ccl = ClassLoader.getCallerClassLoader(); + ClassLoader ccl = ClassLoader.getClassLoader(Reflection.getCallerClass()); if (!sun.misc.VM.isSystemDomainLoader(ccl)) { sm.checkPermission( SecurityConstants.GET_CLASSLOADER_PERMISSION); @@ -386,18 +390,14 @@ public final class Class implements java.io.Serializable, * * */ + @CallerSensitive public T newInstance() throws InstantiationException, IllegalAccessException { if (System.getSecurityManager() != null) { - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), false); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), false); } - return newInstance0(); - } - private T newInstance0() - throws InstantiationException, IllegalAccessException - { // NOTE: the following code may not be strictly correct under // the current Java memory model. @@ -432,7 +432,7 @@ public final class Class implements java.io.Serializable, // Security check (same as in java.lang.reflect.Constructor) int modifiers = tmpConstructor.getModifiers(); if (!Reflection.quickCheckMemberAccess(this, modifiers)) { - Class caller = Reflection.getCallerClass(3); + Class caller = Reflection.getCallerClass(); if (newInstanceCallerCache != caller) { Reflection.ensureMemberAccess(caller, this, null, modifiers); newInstanceCallerCache = caller; @@ -674,16 +674,14 @@ public final class Class implements java.io.Serializable, * @see SecurityManager#checkPermission * @see java.lang.RuntimePermission */ + @CallerSensitive public ClassLoader getClassLoader() { ClassLoader cl = getClassLoader0(); if (cl == null) return null; SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ClassLoader ccl = ClassLoader.getCallerClassLoader(); - if (ClassLoader.needsClassLoaderPermissionCheck(ccl, cl)) { - sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); - } + ClassLoader.checkClassLoaderPermission(cl, Reflection.getCallerClass()); } return cl; } @@ -1392,11 +1390,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Class[] getClasses() { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), false); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), false); // Privileged so this implementation can look at DECLARED classes, // something the caller might not have privilege to do. The code here @@ -1467,11 +1463,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Field[] getFields() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); return copyFields(privateGetPublicFields(null)); } @@ -1518,11 +1512,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Method[] getMethods() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); return copyMethods(privateGetPublicMethods()); } @@ -1567,11 +1559,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Constructor[] getConstructors() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); return copyConstructors(privateGetDeclaredConstructors(true)); } @@ -1625,12 +1615,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Field getField(String name) throws NoSuchFieldException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); Field field = getField0(name); if (field == null) { throw new NoSuchFieldException(name); @@ -1710,12 +1698,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Method getMethod(String name, Class... parameterTypes) throws NoSuchMethodException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); Method method = getMethod0(name, parameterTypes); if (method == null) { throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes)); @@ -1764,12 +1750,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Constructor getConstructor(Class... parameterTypes) throws NoSuchMethodException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); return getConstructor0(parameterTypes, Member.PUBLIC); } @@ -1807,11 +1791,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Class[] getDeclaredClasses() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), false); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), false); return getDeclaredClasses0(); } @@ -1851,11 +1833,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Field[] getDeclaredFields() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); return copyFields(privateGetDeclaredFields(false)); } @@ -1899,11 +1879,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Method[] getDeclaredMethods() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); return copyMethods(privateGetDeclaredMethods(false)); } @@ -1944,11 +1922,9 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Constructor[] getDeclaredConstructors() throws SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); return copyConstructors(privateGetDeclaredConstructors(false)); } @@ -1987,12 +1963,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Field getDeclaredField(String name) throws NoSuchFieldException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); Field field = searchFields(privateGetDeclaredFields(false), name); if (field == null) { throw new NoSuchFieldException(name); @@ -2042,12 +2016,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Method getDeclaredMethod(String name, Class... parameterTypes) throws NoSuchMethodException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); Method method = searchMethods(privateGetDeclaredMethods(false), name, parameterTypes); if (method == null) { throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes)); @@ -2092,12 +2064,10 @@ public final class Class implements java.io.Serializable, * * @since JDK1.1 */ + @CallerSensitive public Constructor getDeclaredConstructor(Class... parameterTypes) throws NoSuchMethodException, SecurityException { - // be very careful not to change the stack depth of this - // checkMemberAccess call for security reasons - // see java.lang.SecurityManager.checkMemberAccess - checkMemberAccess(Member.DECLARED, ClassLoader.getCallerClassLoader(), true); + checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true); return getConstructor0(parameterTypes, Member.DECLARED); } @@ -2255,23 +2225,40 @@ public final class Class implements java.io.Serializable, */ static native Class getPrimitiveClass(String name); + private static boolean isCheckMemberAccessOverridden(SecurityManager smgr) { + if (smgr.getClass() == SecurityManager.class) return false; + + Class[] paramTypes = new Class[] {Class.class, int.class}; + return smgr.getClass().getMethod0("checkMemberAccess", paramTypes). + getDeclaringClass() != SecurityManager.class; + } /* * Check if client is allowed to access members. If access is denied, * throw a SecurityException. * - * Be very careful not to change the stack depth of this checkMemberAccess - * call for security reasons. - * See java.lang.SecurityManager.checkMemberAccess. - * *

Default policy: allow all clients access with normal Java access * control. */ - private void checkMemberAccess(int which, ClassLoader ccl, boolean checkProxyInterfaces) { - SecurityManager s = System.getSecurityManager(); + private void checkMemberAccess(int which, Class caller, boolean checkProxyInterfaces) { + final SecurityManager s = System.getSecurityManager(); if (s != null) { - s.checkMemberAccess(this, which); - ClassLoader cl = getClassLoader0(); + final ClassLoader ccl = ClassLoader.getClassLoader(caller); + final ClassLoader cl = getClassLoader0(); + if (!isCheckMemberAccessOverridden(s)) { + // Inlined SecurityManager.checkMemberAccess + if (which != Member.PUBLIC) { + if (ccl != cl) { + s.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION); + } + } + } else { + // Don't refactor; otherwise break the stack depth for + // checkMemberAccess of subclasses of SecurityManager as specified. + s.checkMemberAccess(this, which); + } + + if (ReflectUtil.needsPackageAccessCheck(ccl, cl)) { String name = this.getName(); int i = name.lastIndexOf('.'); diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index c41280d3c79..8d0205f54f1 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -55,6 +55,7 @@ import sun.misc.CompoundEnumeration; import sun.misc.Resource; import sun.misc.URLClassPath; import sun.misc.VM; +import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.security.util.SecurityConstants; @@ -1159,11 +1160,6 @@ public abstract class ClassLoader { return java.util.Collections.emptyEnumeration(); } - // index 0: java.lang.ClassLoader.class - // index 1: the immediate caller of index 0. - // index 2: the immediate caller of index 1. - private static native Class getCaller(int index); - /** * Registers the caller as parallel capable.

* The registration succeeds if and only if all of the following @@ -1179,8 +1175,11 @@ public abstract class ClassLoader { * * @since 1.7 */ + @CallerSensitive protected static boolean registerAsParallelCapable() { - return ParallelLoaders.register(getCaller(1)); + Class callerClass = + Reflection.getCallerClass().asSubclass(ClassLoader.class); + return ParallelLoaders.register(callerClass); } /** @@ -1340,15 +1339,13 @@ public abstract class ClassLoader { * * @since 1.2 */ + @CallerSensitive public final ClassLoader getParent() { if (parent == null) return null; SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ClassLoader ccl = getCallerClassLoader(); - if (needsClassLoaderPermissionCheck(ccl, this)) { - sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); - } + checkClassLoaderPermission(this, Reflection.getCallerClass()); } return parent; } @@ -1408,6 +1405,7 @@ public abstract class ClassLoader { * * @revised 1.4 */ + @CallerSensitive public static ClassLoader getSystemClassLoader() { initSystemClassLoader(); if (scl == null) { @@ -1415,10 +1413,7 @@ public abstract class ClassLoader { } SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ClassLoader ccl = getCallerClassLoader(); - if (needsClassLoaderPermissionCheck(ccl, scl)) { - sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); - } + checkClassLoaderPermission(scl, Reflection.getCallerClass()); } return scl; } @@ -1471,8 +1466,8 @@ public abstract class ClassLoader { // class loader 'from' is same as class loader 'to' or an ancestor // of 'to'. The class loader in a system domain can access // any class loader. - static boolean needsClassLoaderPermissionCheck(ClassLoader from, - ClassLoader to) + private static boolean needsClassLoaderPermissionCheck(ClassLoader from, + ClassLoader to) { if (from == to) return false; @@ -1483,13 +1478,8 @@ public abstract class ClassLoader { return !to.isAncestor(from); } - // Returns the invoker's class loader, or null if none. - // NOTE: This must always be invoked when there is exactly one intervening - // frame from the core libraries on the stack between this method's - // invocation and the desired invoker. - static ClassLoader getCallerClassLoader() { - // NOTE use of more generic Reflection.getCallerClass() - Class caller = Reflection.getCallerClass(3); + // Returns the class's class loader, or null if none. + static ClassLoader getClassLoader(Class caller) { // This can be null if the VM is requesting it if (caller == null) { return null; @@ -1498,6 +1488,17 @@ public abstract class ClassLoader { return caller.getClassLoader0(); } + static void checkClassLoaderPermission(ClassLoader cl, Class caller) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + // caller can be null if the VM is requesting it + ClassLoader ccl = getClassLoader(caller); + if (needsClassLoaderPermissionCheck(ccl, cl)) { + sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); + } + } + } + // The class loader for the system // @GuardedBy("ClassLoader.class") private static ClassLoader scl; diff --git a/jdk/src/share/classes/java/lang/Iterable.java b/jdk/src/share/classes/java/lang/Iterable.java index a47319243f0..8d46dbfe5ff 100644 --- a/jdk/src/share/classes/java/lang/Iterable.java +++ b/jdk/src/share/classes/java/lang/Iterable.java @@ -22,26 +22,55 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - package java.lang; import java.util.Iterator; +import java.util.Objects; +import java.util.function.Consumer; /** * Implementing this interface allows an object to be the target of - * the "foreach" statement. + * the "for-each loop" statement. See + * + * For-each Loop + * * * @param the type of elements returned by the iterator * * @since 1.5 + * @jls 14.14.2 The enhanced for statement */ @FunctionalInterface public interface Iterable { - /** - * Returns an iterator over a set of elements of type T. + * Returns an iterator over elements of type {@code T}. * * @return an Iterator. */ Iterator iterator(); + + /** + * Performs the given action on the contents of the {@code Iterable}, in the + * order elements occur when iterating, until all elements have been + * processed or the action throws an exception. Errors or runtime + * exceptions thrown by the action are relayed to the caller. + * + * @implSpec + *

The default implementation behaves as if: + *

{@code
+     *     for (T t : this)
+     *         action.accept(t);
+     * }
+ * + * @param action The action to be performed for each element + * @throws NullPointerException if the specified action is null + * @since 1.8 + */ + default void forEach(Consumer action) { + Objects.requireNonNull(action); + for (T t : this) { + action.accept(t); + } + } } + diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java index b67c8520547..76dbfc38a7b 100644 --- a/jdk/src/share/classes/java/lang/Long.java +++ b/jdk/src/share/classes/java/lang/Long.java @@ -479,7 +479,7 @@ public final class Long extends Number implements Comparable { * of the string as a type indicator, as would be permitted in * Java programming language source code - except that either * {@code L} or {@code l} may appear as a digit for a - * radix greater than 22. + * radix greater than or equal to 22. * *

An exception of type {@code NumberFormatException} is * thrown if any of the following situations occurs: diff --git a/jdk/src/share/classes/java/lang/Package.java b/jdk/src/share/classes/java/lang/Package.java index 7d1d38db64d..d22e3ece462 100644 --- a/jdk/src/share/classes/java/lang/Package.java +++ b/jdk/src/share/classes/java/lang/Package.java @@ -49,6 +49,8 @@ import java.util.HashMap; import java.util.Iterator; import sun.net.www.ParseUtil; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; import java.lang.annotation.Annotation; @@ -273,8 +275,9 @@ public class Package implements java.lang.reflect.AnnotatedElement { * @return the package of the requested name. It may be null if no package * information is available from the archive or codebase. */ + @CallerSensitive public static Package getPackage(String name) { - ClassLoader l = ClassLoader.getCallerClassLoader(); + ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass()); if (l != null) { return l.getPackage(name); } else { @@ -294,8 +297,9 @@ public class Package implements java.lang.reflect.AnnotatedElement { * @return a new array of packages known to the callers {@code ClassLoader} * instance. An zero length array is returned if none are known. */ + @CallerSensitive public static Package[] getPackages() { - ClassLoader l = ClassLoader.getCallerClassLoader(); + ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass()); if (l != null) { return l.getPackages(); } else { diff --git a/jdk/src/share/classes/java/lang/ProcessBuilder.java b/jdk/src/share/classes/java/lang/ProcessBuilder.java index 4af24b6430b..64f56d77829 100644 --- a/jdk/src/share/classes/java/lang/ProcessBuilder.java +++ b/jdk/src/share/classes/java/lang/ProcessBuilder.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.FileOutputStream; +import java.security.AccessControlException; import java.util.Arrays; import java.util.ArrayList; import java.util.List; @@ -1024,13 +1025,24 @@ public final class ProcessBuilder redirects, redirectErrorStream); } catch (IOException e) { + String exceptionInfo = ": " + e.getMessage(); + Throwable cause = e; + if (security != null) { + // Can not disclose the fail reason for read-protected files. + try { + security.checkRead(prog); + } catch (AccessControlException ace) { + exceptionInfo = ""; + cause = ace; + } + } // It's much easier for us to create a high-quality error // message than the low-level C code which found the problem. throw new IOException( "Cannot run program \"" + prog + "\"" + (dir == null ? "" : " (in directory \"" + dir + "\")") - + ": " + e.getMessage(), - e); + + exceptionInfo, + cause); } } } diff --git a/jdk/src/share/classes/java/lang/Runtime.java b/jdk/src/share/classes/java/lang/Runtime.java index ada915dbb60..6275e2859d0 100644 --- a/jdk/src/share/classes/java/lang/Runtime.java +++ b/jdk/src/share/classes/java/lang/Runtime.java @@ -27,6 +27,8 @@ package java.lang; import java.io.*; import java.util.StringTokenizer; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; /** * Every Java application has a single instance of class @@ -790,8 +792,9 @@ public class Runtime { * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkLink(java.lang.String) */ + @CallerSensitive public void load(String filename) { - load0(System.getCallerClass(), filename); + load0(Reflection.getCallerClass(), filename); } synchronized void load0(Class fromClass, String filename) { @@ -850,8 +853,9 @@ public class Runtime { * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkLink(java.lang.String) */ + @CallerSensitive public void loadLibrary(String libname) { - loadLibrary0(System.getCallerClass(), libname); + loadLibrary0(Reflection.getCallerClass(), libname); } synchronized void loadLibrary0(Class fromClass, String libname) { diff --git a/jdk/src/share/classes/java/lang/SecurityManager.java b/jdk/src/share/classes/java/lang/SecurityManager.java index 31664dc6cb2..ca187630528 100644 --- a/jdk/src/share/classes/java/lang/SecurityManager.java +++ b/jdk/src/share/classes/java/lang/SecurityManager.java @@ -36,10 +36,10 @@ import java.net.SocketPermission; import java.net.NetPermission; import java.util.Hashtable; import java.net.InetAddress; -import java.lang.reflect.Member; import java.lang.reflect.*; import java.net.URL; +import sun.reflect.CallerSensitive; import sun.security.util.SecurityConstants; /** @@ -1679,6 +1679,7 @@ class SecurityManager { * @since JDK1.1 * @see #checkPermission(java.security.Permission) checkPermission */ + @CallerSensitive public void checkMemberAccess(Class clazz, int which) { if (clazz == null) { throw new NullPointerException("class can't be null"); diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index 9d1663ae819..c7f69f5e496 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -35,6 +35,7 @@ import java.security.AllPermission; import java.nio.channels.Channel; import java.nio.channels.spi.SelectorProvider; import sun.nio.ch.Interruptible; +import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.security.util.SecurityConstants; import sun.reflect.annotation.AnnotationType; @@ -1072,8 +1073,9 @@ public final class System { * @see java.lang.Runtime#load(java.lang.String) * @see java.lang.SecurityManager#checkLink(java.lang.String) */ + @CallerSensitive public static void load(String filename) { - Runtime.getRuntime().load0(getCallerClass(), filename); + Runtime.getRuntime().load0(Reflection.getCallerClass(), filename); } /** @@ -1107,8 +1109,9 @@ public final class System { * @see java.lang.Runtime#loadLibrary(java.lang.String) * @see java.lang.SecurityManager#checkLink(java.lang.String) */ + @CallerSensitive public static void loadLibrary(String libname) { - Runtime.getRuntime().loadLibrary0(getCallerClass(), libname); + Runtime.getRuntime().loadLibrary0(Reflection.getCallerClass(), libname); } /** @@ -1245,10 +1248,4 @@ public final class System { } }); } - - /* returns the class of the caller. */ - static Class getCallerClass() { - // NOTE use of more generic Reflection.getCallerClass() - return Reflection.getCallerClass(3); - } } diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index 8aab573ded7..e418f1f9a93 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -37,6 +37,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.locks.LockSupport; import sun.nio.ch.Interruptible; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; import sun.security.util.SecurityConstants; @@ -1443,15 +1445,14 @@ class Thread implements Runnable { * * @since 1.2 */ + @CallerSensitive public ClassLoader getContextClassLoader() { if (contextClassLoader == null) return null; SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ClassLoader ccl = ClassLoader.getCallerClassLoader(); - if (ClassLoader.needsClassLoaderPermissionCheck(ccl, contextClassLoader)) { - sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); - } + ClassLoader.checkClassLoaderPermission(contextClassLoader, + Reflection.getCallerClass()); } return contextClassLoader; } diff --git a/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java b/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java index 9bbc09c32ce..846920a59a9 100644 --- a/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java +++ b/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java @@ -709,7 +709,9 @@ import jdk.internal.org.objectweb.asm.Type; InvokerBytecodeGenerator.maybeDump(className, classFile); Class bmhClass = //UNSAFE.defineAnonymousClass(BoundMethodHandle.class, classFile, null).asSubclass(BoundMethodHandle.class); - UNSAFE.defineClass(className, classFile, 0, classFile.length).asSubclass(BoundMethodHandle.class); + UNSAFE.defineClass(className, classFile, 0, classFile.length, + BoundMethodHandle.class.getClassLoader(), null) + .asSubclass(BoundMethodHandle.class); UNSAFE.ensureClassInitialized(bmhClass); return bmhClass; diff --git a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index f7191f7679f..16703fc0917 100644 --- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -184,7 +184,7 @@ import java.security.PrivilegedAction; for (int i=0; i lookupClass) { diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java index a18a7a484a8..8efbda80614 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -34,6 +34,8 @@ import sun.invoke.empty.Empty; import sun.invoke.util.ValueConversions; import sun.invoke.util.VerifyType; import sun.invoke.util.Wrapper; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; import static java.lang.invoke.LambdaForm.*; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; @@ -891,9 +893,11 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; } } + @CallerSensitive private static boolean checkCallerClass(Class expected, Class expected2) { - final int FRAME_COUNT_ARG = 2; // [0] Reflection [1] BindCaller [2] Expected - Class actual = sun.reflect.Reflection.getCallerClass(FRAME_COUNT_ARG); + // This method is called via MH_checkCallerClass and so it's + // correct to ask for the immediate caller here. + Class actual = Reflection.getCallerClass(); if (actual != expected && actual != expected2) throw new InternalError("found "+actual.getName()+", expected "+expected.getName() +(expected == expected2 ? "" : ", or else "+expected2.getName())); diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java index db072126e1f..06e61a7dd8b 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -26,7 +26,6 @@ package java.lang.invoke; import java.lang.invoke.MethodHandles.Lookup; -import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import static java.lang.invoke.MethodHandleNatives.Constants.*; import static java.lang.invoke.MethodHandleStatics.*; @@ -34,7 +33,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; /** * The JVM interface for the method handles package is all here. - * This is an interface internal and private to an implemetantion of JSR 292. + * This is an interface internal and private to an implementation of JSR 292. * This class is not part of the JSR 292 standard. * @author jrose */ @@ -101,6 +100,7 @@ class MethodHandleNatives { MN_IS_CONSTRUCTOR = 0x00020000, // constructor MN_IS_FIELD = 0x00040000, // field MN_IS_TYPE = 0x00080000, // nested type + MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected MN_REFERENCE_KIND_SHIFT = 24, // refKind MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT, // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers: @@ -391,129 +391,24 @@ class MethodHandleNatives { * I.e., does it call Reflection.getCallerClass or a similer method * to ask about the identity of its caller? */ - // FIXME: Replace this pattern match by an annotation @sun.reflect.CallerSensitive. static boolean isCallerSensitive(MemberName mem) { if (!mem.isInvocable()) return false; // fields are not caller sensitive + + return mem.isCallerSensitive() || canBeCalledVirtual(mem); + } + + static boolean canBeCalledVirtual(MemberName mem) { + assert(mem.isInvocable()); Class defc = mem.getDeclaringClass(); switch (mem.getName()) { - case "doPrivileged": - case "doPrivilegedWithCombiner": - return defc == java.security.AccessController.class; case "checkMemberAccess": return canBeCalledVirtual(mem, java.lang.SecurityManager.class); - case "getUnsafe": - return defc == sun.misc.Unsafe.class; - case "lookup": - return defc == java.lang.invoke.MethodHandles.class; - case "findStatic": - case "findVirtual": - case "findConstructor": - case "findSpecial": - case "findGetter": - case "findSetter": - case "findStaticGetter": - case "findStaticSetter": - case "bind": - case "unreflect": - case "unreflectSpecial": - case "unreflectConstructor": - case "unreflectGetter": - case "unreflectSetter": - return defc == java.lang.invoke.MethodHandles.Lookup.class; - case "invoke": - return defc == java.lang.reflect.Method.class; - case "get": - case "getBoolean": - case "getByte": - case "getChar": - case "getShort": - case "getInt": - case "getLong": - case "getFloat": - case "getDouble": - case "set": - case "setBoolean": - case "setByte": - case "setChar": - case "setShort": - case "setInt": - case "setLong": - case "setFloat": - case "setDouble": - return defc == java.lang.reflect.Field.class; - case "newInstance": - if (defc == java.lang.reflect.Constructor.class) return true; - if (defc == java.lang.Class.class) return true; - break; - case "forName": - case "getClassLoader": - case "getClasses": - case "getFields": - case "getMethods": - case "getConstructors": - case "getDeclaredClasses": - case "getDeclaredFields": - case "getDeclaredMethods": - case "getDeclaredConstructors": - case "getField": - case "getMethod": - case "getConstructor": - case "getDeclaredField": - case "getDeclaredMethod": - case "getDeclaredConstructor": - return defc == java.lang.Class.class; - case "getConnection": - case "getDriver": - case "getDrivers": - case "deregisterDriver": - return defc == getClass("java.sql.DriverManager"); - case "newUpdater": - if (defc == java.util.concurrent.atomic.AtomicIntegerFieldUpdater.class) return true; - if (defc == java.util.concurrent.atomic.AtomicLongFieldUpdater.class) return true; - if (defc == java.util.concurrent.atomic.AtomicReferenceFieldUpdater.class) return true; - break; case "getContextClassLoader": return canBeCalledVirtual(mem, java.lang.Thread.class); - case "getPackage": - case "getPackages": - return defc == java.lang.Package.class; - case "getParent": - case "getSystemClassLoader": - return defc == java.lang.ClassLoader.class; - case "load": - case "loadLibrary": - if (defc == java.lang.Runtime.class) return true; - if (defc == java.lang.System.class) return true; - break; - case "getCallerClass": - if (defc == sun.reflect.Reflection.class) return true; - if (defc == java.lang.System.class) return true; - break; - case "getCallerClassLoader": - return defc == java.lang.ClassLoader.class; - case "registerAsParallelCapable": - return canBeCalledVirtual(mem, java.lang.ClassLoader.class); - case "getProxyClass": - case "newProxyInstance": - return defc == java.lang.reflect.Proxy.class; - case "asInterfaceInstance": - return defc == java.lang.invoke.MethodHandleProxies.class; - case "getBundle": - case "clearCache": - return defc == java.util.ResourceBundle.class; } return false; } - // avoid static dependency to a class in other modules - private static Class getClass(String cn) { - try { - return Class.forName(cn, false, - MethodHandleNatives.class.getClassLoader()); - } catch (ClassNotFoundException e) { - throw new InternalError(e); - } - } static boolean canBeCalledVirtual(MemberName symbolicRef, Class definingClass) { Class symbolicRefClass = symbolicRef.getDeclaringClass(); if (symbolicRefClass == definingClass) return true; diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java b/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java index ade1630dcfb..641f2eeea51 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java @@ -30,6 +30,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import sun.invoke.WrapperInstance; import java.util.ArrayList; +import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.reflect.misc.ReflectUtil; @@ -137,14 +138,14 @@ public class MethodHandleProxies { // entry points, must be covered by hand-written or automatically // generated adapter classes. // + @CallerSensitive public static T asInterfaceInstance(final Class intfc, final MethodHandle target) { if (!intfc.isInterface() || !Modifier.isPublic(intfc.getModifiers())) throw new IllegalArgumentException("not a public interface: "+intfc.getName()); final MethodHandle mh; if (System.getSecurityManager() != null) { - final int CALLER_FRAME = 2; // 0: Reflection, 1: asInterfaceInstance, 2: caller - final Class caller = Reflection.getCallerClass(CALLER_FRAME); + final Class caller = Reflection.getCallerClass(); final ClassLoader ccl = caller != null ? caller.getClassLoader() : null; ReflectUtil.checkProxyPackageAccess(ccl, intfc); mh = ccl != null ? bindCaller(target, caller) : target; diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index f4cad4deaa8..fa3cb607855 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -26,13 +26,17 @@ package java.lang.invoke; import java.lang.reflect.*; -import sun.invoke.util.ValueConversions; -import sun.invoke.util.VerifyAccess; -import sun.invoke.util.Wrapper; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.List; import java.util.ArrayList; import java.util.Arrays; +import sun.invoke.util.ValueConversions; +import sun.invoke.util.VerifyAccess; +import sun.invoke.util.Wrapper; +import sun.reflect.CallerSensitive; import sun.reflect.Reflection; +import sun.security.util.SecurityConstants; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandleNatives.Constants.*; @@ -65,8 +69,9 @@ public class MethodHandles { * This lookup object is a capability which may be delegated to trusted agents. * Do not store it in place where untrusted code can access it. */ + @CallerSensitive public static Lookup lookup() { - return new Lookup(); + return new Lookup(Reflection.getCallerClass()); } /** @@ -416,18 +421,11 @@ public class MethodHandles { * for method handle creation. * Must be called by from a method in this package, * which in turn is called by a method not in this package. - *

- * Also, don't make it private, lest javac interpose - * an access$N method. */ - Lookup() { - this(getCallerClassAtEntryPoint(false), ALL_MODES); - // make sure we haven't accidentally picked up a privileged class: - checkUnprivilegedlookupClass(lookupClass); - } - Lookup(Class lookupClass) { this(lookupClass, ALL_MODES); + // make sure we haven't accidentally picked up a privileged class: + checkUnprivilegedlookupClass(lookupClass); } private Lookup(Class lookupClass, int allowedModes) { @@ -554,20 +552,6 @@ public class MethodHandles { } } - /* Obtain the external caller class, when called from Lookup. or a first-level subroutine. */ - private static Class getCallerClassAtEntryPoint(boolean inSubroutine) { - final int CALLER_DEPTH = 4; - // Stack for the constructor entry point (inSubroutine=false): - // 0: Reflection.getCC, 1: getCallerClassAtEntryPoint, - // 2: Lookup., 3: MethodHandles.*, 4: caller - // The stack is slightly different for a subroutine of a Lookup.find* method: - // 2: Lookup.*, 3: Lookup.find*.*, 4: caller - // Note: This should be the only use of getCallerClass in this file. - assert(Reflection.getCallerClass(CALLER_DEPTH-2) == Lookup.class); - assert(Reflection.getCallerClass(CALLER_DEPTH-1) == (inSubroutine ? Lookup.class : MethodHandles.class)); - return Reflection.getCallerClass(CALLER_DEPTH); - } - /** * Produces a method handle for a static method. * The type of the method handle will be that of the method. @@ -594,12 +578,14 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findStatic(Class refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { MemberName method = resolveOrFail(REF_invokeStatic, refc, name, type); - checkSecurityManager(refc, method); // stack walk magic: do not refactor - Class callerClass = findBoundCallerClass(method); // stack walk magic: do not refactor - return getDirectMethod(REF_invokeStatic, refc, method, callerClass); + Class callerClass = Reflection.getCallerClass(); + checkSecurityManager(refc, method, callerClass); + return getDirectMethod(REF_invokeStatic, refc, method, + findBoundCallerClass(method, callerClass)); } /** @@ -645,6 +631,7 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findVirtual(Class refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { if (refc == MethodHandle.class) { MethodHandle mh = findVirtualForMH(name, type); @@ -652,9 +639,10 @@ public class MethodHandles { } byte refKind = (refc.isInterface() ? REF_invokeInterface : REF_invokeVirtual); MemberName method = resolveOrFail(refKind, refc, name, type); - checkSecurityManager(refc, method); // stack walk magic: do not refactor - Class callerClass = findBoundCallerClass(method); - return getDirectMethod(refKind, refc, method, callerClass); + Class callerClass = Reflection.getCallerClass(); + checkSecurityManager(refc, method, callerClass); + return getDirectMethod(refKind, refc, method, + findBoundCallerClass(method, callerClass)); } private MethodHandle findVirtualForMH(String name, MethodType type) { // these names require special lookups because of the implicit MethodType argument @@ -691,10 +679,11 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findConstructor(Class refc, MethodType type) throws NoSuchMethodException, IllegalAccessException { String name = ""; MemberName ctor = resolveOrFail(REF_newInvokeSpecial, refc, name, type); - checkSecurityManager(refc, ctor); // stack walk magic: do not refactor + checkSecurityManager(refc, ctor, Reflection.getCallerClass()); return getDirectConstructor(refc, ctor); } @@ -732,14 +721,16 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findSpecial(Class refc, String name, MethodType type, Class specialCaller) throws NoSuchMethodException, IllegalAccessException { checkSpecialCaller(specialCaller); Lookup specialLookup = this.in(specialCaller); MemberName method = specialLookup.resolveOrFail(REF_invokeSpecial, refc, name, type); - checkSecurityManager(refc, method); // stack walk magic: do not refactor - Class callerClass = findBoundCallerClass(method); - return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, callerClass); + Class callerClass = Reflection.getCallerClass(); + checkSecurityManager(refc, method, callerClass); + return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, + findBoundCallerClass(method, callerClass)); } /** @@ -759,9 +750,10 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findGetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_getField, refc, name, type); - checkSecurityManager(refc, field); // stack walk magic: do not refactor + checkSecurityManager(refc, field, Reflection.getCallerClass()); return getDirectField(REF_getField, refc, field); } @@ -782,9 +774,10 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findSetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_putField, refc, name, type); - checkSecurityManager(refc, field); // stack walk magic: do not refactor + checkSecurityManager(refc, field, Reflection.getCallerClass()); return getDirectField(REF_putField, refc, field); } @@ -804,9 +797,10 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findStaticGetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_getStatic, refc, name, type); - checkSecurityManager(refc, field); // stack walk magic: do not refactor + checkSecurityManager(refc, field, Reflection.getCallerClass()); return getDirectField(REF_getStatic, refc, field); } @@ -826,9 +820,10 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle findStaticSetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_putStatic, refc, name, type); - checkSecurityManager(refc, field); // stack walk magic: do not refactor + checkSecurityManager(refc, field, Reflection.getCallerClass()); return getDirectField(REF_putStatic, refc, field); } @@ -878,12 +873,14 @@ return mh1; * refuses access * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { Class refc = receiver.getClass(); // may get NPE MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type); - checkSecurityManager(refc, method); // stack walk magic: do not refactor - Class callerClass = findBoundCallerClass(method); // stack walk magic: do not refactor - MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, callerClass); + Class callerClass = Reflection.getCallerClass(); + checkSecurityManager(refc, method, callerClass); + MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, + findBoundCallerClass(method, callerClass)); return mh.bindReceiver(receiver).setVarargs(method); } @@ -908,13 +905,14 @@ return mh1; * is set and {@code asVarargsCollector} fails * @throws NullPointerException if the argument is null */ + @CallerSensitive public MethodHandle unreflect(Method m) throws IllegalAccessException { MemberName method = new MemberName(m); byte refKind = method.getReferenceKind(); if (refKind == REF_invokeSpecial) refKind = REF_invokeVirtual; assert(method.isMethod()); - Class callerClass = findBoundCallerClass(method); // stack walk magic: do not refactor + Class callerClass = findBoundCallerClass(method, Reflection.getCallerClass()); Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this; return lookup.getDirectMethod(refKind, method.getDeclaringClass(), method, callerClass); } @@ -940,12 +938,13 @@ return mh1; * is set and {@code asVarargsCollector} fails * @throws NullPointerException if any argument is null */ + @CallerSensitive public MethodHandle unreflectSpecial(Method m, Class specialCaller) throws IllegalAccessException { checkSpecialCaller(specialCaller); Lookup specialLookup = this.in(specialCaller); MemberName method = new MemberName(m, true); assert(method.isMethod()); - Class callerClass = findBoundCallerClass(method); // stack walk magic: do not refactor + Class callerClass = findBoundCallerClass(method, Reflection.getCallerClass()); // ignore m.isAccessible: this is a new kind of access return specialLookup.getDirectMethod(REF_invokeSpecial, method.getDeclaringClass(), method, callerClass); } @@ -1050,20 +1049,35 @@ return mh1; * If this lookup object has private access, then the caller class is the lookupClass. * Otherwise, it is the caller of the currently executing public API method (e.g., findVirtual). * This is the same caller class as is used by checkSecurityManager. - * This function performs stack walk magic: do not refactor it. */ - Class findBoundCallerClass(MemberName m) { + Class findBoundCallerClass(MemberName m, Class callerAtEntryPoint) { Class callerClass = null; if (MethodHandleNatives.isCallerSensitive(m)) { // Do not refactor this to a more "logical" place, since it is stack walk magic. // Note that this is the same expression as in Step 2 below in checkSecurityManager. callerClass = ((allowedModes & PRIVATE) != 0 ? lookupClass // for strong access modes, no extra check - // next line does stack walk magic; do not refactor: - : getCallerClassAtEntryPoint(true)); + : callerAtEntryPoint); } return callerClass; } + + /** + * Determine whether a security manager has an overridden + * SecurityManager.checkMemberAccess method. + */ + private boolean isCheckMemberAccessOverridden(SecurityManager sm) { + final Class cls = sm.getClass(); + if (cls == SecurityManager.class) return false; + + try { + return cls.getMethod("checkMemberAccess", Class.class, int.class). + getDeclaringClass() != SecurityManager.class; + } catch (NoSuchMethodException e) { + throw new InternalError("should not reach here"); + } + } + /** * Perform necessary access checks. * Determines a trustable caller class to compare with refc, the symbolic reference class. @@ -1071,46 +1085,55 @@ return mh1; * Otherwise, it is the caller of the currently executing public API method (e.g., findVirtual). * This function performs stack walk magic: do not refactor it. */ - void checkSecurityManager(Class refc, MemberName m) { + void checkSecurityManager(Class refc, MemberName m, Class caller) { SecurityManager smgr = System.getSecurityManager(); if (smgr == null) return; if (allowedModes == TRUSTED) return; + + final boolean overridden = isCheckMemberAccessOverridden(smgr); // Step 1: - smgr.checkMemberAccess(refc, Member.PUBLIC); + { + // Default policy is to allow Member.PUBLIC; no need to check + // permission if SecurityManager is the default implementation + final int which = Member.PUBLIC; + final Class clazz = refc; + if (overridden) { + // Don't refactor; otherwise break the stack depth for + // checkMemberAccess of subclasses of SecurityManager as specified. + smgr.checkMemberAccess(clazz, which); + } + } + // Step 2: Class callerClass = ((allowedModes & PRIVATE) != 0 ? lookupClass // for strong access modes, no extra check - // next line does stack walk magic; do not refactor: - : getCallerClassAtEntryPoint(true)); + : caller); if (!VerifyAccess.classLoaderIsAncestor(lookupClass, refc) || (callerClass != lookupClass && !VerifyAccess.classLoaderIsAncestor(callerClass, refc))) smgr.checkPackageAccess(VerifyAccess.getPackageName(refc)); + // Step 3: if (m.isPublic()) return; Class defc = m.getDeclaringClass(); - smgr.checkMemberAccess(defc, Member.DECLARED); // STACK WALK HERE + { + // Inline SecurityManager.checkMemberAccess + final int which = Member.DECLARED; + final Class clazz = defc; + if (!overridden) { + if (caller.getClassLoader() != clazz.getClassLoader()) { + smgr.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION); + } + } else { + // Don't refactor; otherwise break the stack depth for + // checkMemberAccess of subclasses of SecurityManager as specified. + smgr.checkMemberAccess(clazz, which); + } + } + // Step 4: if (defc != refc) smgr.checkPackageAccess(VerifyAccess.getPackageName(defc)); - - // Comment from SM.checkMemberAccess, where which=DECLARED: - /* - * stack depth of 4 should be the caller of one of the - * methods in java.lang.Class that invoke checkMember - * access. The stack should look like: - * - * someCaller [3] - * java.lang.Class.someReflectionAPI [2] - * java.lang.Class.checkMemberAccess [1] - * SecurityManager.checkMemberAccess [0] - * - */ - // For us it is this stack: - // someCaller [3] - // Lookup.findSomeMember [2] - // Lookup.checkSecurityManager [1] - // SecurityManager.checkMemberAccess [0] } void checkMethod(byte refKind, Class refc, MemberName m) throws IllegalAccessException { @@ -1237,6 +1260,30 @@ return mh1; checkMethod(refKind, refc, method); if (method.isMethodHandleInvoke()) return fakeMethodHandleInvoke(method); + + Class refcAsSuper; + if (refKind == REF_invokeSpecial && + refc != lookupClass() && + refc != (refcAsSuper = lookupClass().getSuperclass()) && + refc.isAssignableFrom(lookupClass())) { + assert(!method.getName().equals("")); // not this code path + // Per JVMS 6.5, desc. of invokespecial instruction: + // If the method is in a superclass of the LC, + // and if our original search was above LC.super, + // repeat the search (symbolic lookup) from LC.super. + // FIXME: MemberName.resolve should handle this instead. + MemberName m2 = new MemberName(refcAsSuper, + method.getName(), + method.getMethodType(), + REF_invokeSpecial); + m2 = IMPL_NAMES.resolveOrNull(refKind, m2, lookupClassOrNull()); + if (m2 == null) throw new InternalError(method.toString()); + method = m2; + refc = refcAsSuper; + // redo basic checks + checkMethod(refKind, refc, method); + } + MethodHandle mh = DirectMethodHandle.make(refKind, refc, method); mh = maybeBindCaller(method, mh, callerClass); mh = mh.setVarargs(method); diff --git a/jdk/src/share/classes/java/lang/ref/Finalizer.java b/jdk/src/share/classes/java/lang/ref/Finalizer.java index 4e148c28fdc..cdba65e4820 100644 --- a/jdk/src/share/classes/java/lang/ref/Finalizer.java +++ b/jdk/src/share/classes/java/lang/ref/Finalizer.java @@ -38,9 +38,9 @@ final class Finalizer extends FinalReference { /* Package-private; must be in */ static native void invokeFinalizeMethod(Object o) throws Throwable; - static private ReferenceQueue queue = new ReferenceQueue(); - static private Finalizer unfinalized = null; - static private Object lock = new Object(); + private static ReferenceQueue queue = new ReferenceQueue(); + private static Finalizer unfinalized = null; + private static final Object lock = new Object(); private Finalizer next = null, @@ -142,7 +142,11 @@ final class Finalizer extends FinalReference { /* Package-private; must be in /* Called by Runtime.runFinalization() */ static void runFinalization() { forkSecondaryFinalizer(new Runnable() { + private volatile boolean running; public void run() { + if (running) + return; + running = true; for (;;) { Finalizer f = (Finalizer)queue.poll(); if (f == null) break; @@ -155,7 +159,11 @@ final class Finalizer extends FinalReference { /* Package-private; must be in /* Invoked by java.lang.Shutdown */ static void runAllFinalizers() { forkSecondaryFinalizer(new Runnable() { + private volatile boolean running; public void run() { + if (running) + return; + running = true; for (;;) { Finalizer f; synchronized (lock) { @@ -168,10 +176,14 @@ final class Finalizer extends FinalReference { /* Package-private; must be in } private static class FinalizerThread extends Thread { + private volatile boolean running; FinalizerThread(ThreadGroup g) { super(g, "Finalizer"); } public void run() { + if (running) + return; + running = true; for (;;) { try { Finalizer f = (Finalizer)queue.remove(); diff --git a/jdk/src/share/classes/java/lang/reflect/Constructor.java b/jdk/src/share/classes/java/lang/reflect/Constructor.java index 14a515fe949..0ed60dc375b 100644 --- a/jdk/src/share/classes/java/lang/reflect/Constructor.java +++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java @@ -25,6 +25,7 @@ package java.lang.reflect; +import sun.reflect.CallerSensitive; import sun.reflect.ConstructorAccessor; import sun.reflect.Reflection; import sun.reflect.generics.repository.ConstructorRepository; @@ -392,14 +393,14 @@ public final class Constructor extends Executable { * @exception ExceptionInInitializerError if the initialization provoked * by this method fails. */ + @CallerSensitive public T newInstance(Object ... initargs) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!override) { if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { - Class caller = Reflection.getCallerClass(2); - + Class caller = Reflection.getCallerClass(); checkAccess(caller, clazz, null, modifiers); } } diff --git a/jdk/src/share/classes/java/lang/reflect/Field.java b/jdk/src/share/classes/java/lang/reflect/Field.java index bd2b9ef929f..a25223f68c1 100644 --- a/jdk/src/share/classes/java/lang/reflect/Field.java +++ b/jdk/src/share/classes/java/lang/reflect/Field.java @@ -25,6 +25,7 @@ package java.lang.reflect; +import sun.reflect.CallerSensitive; import sun.reflect.FieldAccessor; import sun.reflect.Reflection; import sun.reflect.generics.repository.FieldRepository; @@ -376,9 +377,16 @@ class Field extends AccessibleObject implements Member { * @exception ExceptionInInitializerError if the initialization provoked * by this method fails. */ + @CallerSensitive public Object get(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).get(obj); } @@ -404,9 +412,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public boolean getBoolean(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getBoolean(obj); } @@ -432,9 +447,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public byte getByte(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getByte(obj); } @@ -462,9 +484,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public char getChar(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getChar(obj); } @@ -492,9 +521,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public short getShort(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getShort(obj); } @@ -522,9 +558,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public int getInt(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getInt(obj); } @@ -552,9 +595,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public long getLong(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getLong(obj); } @@ -582,9 +632,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public float getFloat(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getFloat(obj); } @@ -612,9 +669,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#get */ + @CallerSensitive public double getDouble(Object obj) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } return getFieldAccessor(obj).getDouble(obj); } @@ -684,9 +748,16 @@ class Field extends AccessibleObject implements Member { * @exception ExceptionInInitializerError if the initialization provoked * by this method fails. */ + @CallerSensitive public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).set(obj, value); } @@ -714,9 +785,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setBoolean(Object obj, boolean z) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setBoolean(obj, z); } @@ -744,9 +822,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setByte(Object obj, byte b) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setByte(obj, b); } @@ -774,9 +859,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setChar(Object obj, char c) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setChar(obj, c); } @@ -804,9 +896,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setShort(Object obj, short s) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setShort(obj, s); } @@ -834,9 +933,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setInt(Object obj, int i) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setInt(obj, i); } @@ -864,9 +970,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setLong(Object obj, long l) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setLong(obj, l); } @@ -894,9 +1007,16 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setFloat(Object obj, float f) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setFloat(obj, f); } @@ -924,20 +1044,26 @@ class Field extends AccessibleObject implements Member { * by this method fails. * @see Field#set */ + @CallerSensitive public void setDouble(Object obj, double d) throws IllegalArgumentException, IllegalAccessException { + if (!override) { + if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { + Class caller = Reflection.getCallerClass(); + checkAccess(caller, clazz, obj, modifiers); + } + } getFieldAccessor(obj).setDouble(obj, d); } - // Convenience routine which performs security checks + // security check is done before calling this method private FieldAccessor getFieldAccessor(Object obj) throws IllegalAccessException { - doSecurityCheck(obj); boolean ov = override; - FieldAccessor a = (ov)? overrideFieldAccessor : fieldAccessor; - return (a != null)? a : acquireFieldAccessor(ov); + FieldAccessor a = (ov) ? overrideFieldAccessor : fieldAccessor; + return (a != null) ? a : acquireFieldAccessor(ov); } // NOTE that there is no synchronization used here. It is correct @@ -982,19 +1108,6 @@ class Field extends AccessibleObject implements Member { } } - // NOTE: be very careful if you change the stack depth of this - // routine. The depth of the "getCallerClass" call is hardwired so - // that the compiler can have an easier time if this gets inlined. - private void doSecurityCheck(Object obj) throws IllegalAccessException { - if (!override) { - if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { - Class caller = Reflection.getCallerClass(4); - - checkAccess(caller, clazz, obj, modifiers); - } - } - } - /** * @throws NullPointerException {@inheritDoc} * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/reflect/Method.java b/jdk/src/share/classes/java/lang/reflect/Method.java index 1caddd6f522..7c7abe43dff 100644 --- a/jdk/src/share/classes/java/lang/reflect/Method.java +++ b/jdk/src/share/classes/java/lang/reflect/Method.java @@ -25,6 +25,7 @@ package java.lang.reflect; +import sun.reflect.CallerSensitive; import sun.reflect.MethodAccessor; import sun.reflect.Reflection; import sun.reflect.generics.repository.MethodRepository; @@ -472,14 +473,14 @@ public final class Method extends Executable { * @exception ExceptionInInitializerError if the initialization * provoked by this method fails. */ + @CallerSensitive public Object invoke(Object obj, Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!override) { if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { - Class caller = Reflection.getCallerClass(1); - + Class caller = Reflection.getCallerClass(); checkAccess(caller, clazz, obj, modifiers); } } diff --git a/jdk/src/share/classes/java/lang/reflect/Proxy.java b/jdk/src/share/classes/java/lang/reflect/Proxy.java index e946ba3226d..e6de8b77956 100644 --- a/jdk/src/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java @@ -28,7 +28,6 @@ package java.lang.reflect; import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.security.AccessController; -import java.security.Permission; import java.security.PrivilegedAction; import java.util.Arrays; import java.util.Collections; @@ -39,6 +38,8 @@ import java.util.Set; import java.util.List; import java.util.WeakHashMap; import sun.misc.ProxyGenerator; +import sun.misc.VM; +import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.reflect.misc.ReflectUtil; import sun.security.util.SecurityConstants; @@ -51,16 +52,14 @@ import sun.security.util.SecurityConstants; *

To create a proxy for some interface {@code Foo}: *

  *     InvocationHandler handler = new MyInvocationHandler(...);
- *     Class proxyClass = Proxy.getProxyClass(
- *         Foo.class.getClassLoader(), new Class[] { Foo.class });
- *     Foo f = (Foo) proxyClass.
- *         getConstructor(new Class[] { InvocationHandler.class }).
- *         newInstance(new Object[] { handler });
+ *     Class<?> proxyClass = Proxy.getProxyClass(Foo.class.getClassLoader(), Foo.class);
+ *     Foo f = (Foo) proxyClass.getConstructor(InvocationHandler.class).
+ *                     newInstance(handler);
  * 
* or more simply: *
  *     Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
- *                                          new Class[] { Foo.class },
+ *                                          new Class<?>[] { Foo.class },
  *                                          handler);
  * 
* @@ -89,7 +88,11 @@ import sun.security.util.SecurityConstants; *

A proxy class has the following properties: * *