From 8b12f5abcc74f1ac1eeebf8c67020eda02464e13 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 18 Feb 2013 11:33:35 -0800 Subject: [PATCH 01/37] 6657673: Issues with JAXP Reviewed-by: alanb, lancea, ahgross, mullan --- .../bcel/internal/classfile/JavaClass.java | 6 +- .../apache/bcel/internal/util/Class2HTML.java | 3 +- .../apache/bcel/internal/util/ClassPath.java | 20 +- .../bcel/internal/util/JavaWrapper.java | 3 +- .../bcel/internal/util/SecuritySupport.java | 223 ++++++++++++++++++ .../xalan/internal/res/XSLMessages.java | 104 ++++---- .../internal/res/XSLTErrorResources.java | 64 ----- .../internal/res/XSLTErrorResources_de.java | 64 ----- .../internal/res/XSLTErrorResources_es.java | 64 ----- .../internal/res/XSLTErrorResources_fr.java | 64 ----- .../internal/res/XSLTErrorResources_it.java | 64 ----- .../internal/res/XSLTErrorResources_ja.java | 64 ----- .../internal/res/XSLTErrorResources_ko.java | 64 ----- .../res/XSLTErrorResources_pt_BR.java | 63 ----- .../internal/res/XSLTErrorResources_sv.java | 64 ----- .../res/XSLTErrorResources_zh_CN.java | 64 ----- .../res/XSLTErrorResources_zh_TW.java | 64 ----- .../xalan/internal/utils/ObjectFactory.java | 11 +- .../xalan/internal/utils/SecuritySupport.java | 98 +++++--- .../xalan/internal/xslt/EnvironmentCheck.java | 9 +- .../apache/xalan/internal/xslt/Process.java | 3 +- .../xalan/internal/xsltc/compiler/Parser.java | 10 +- .../xalan/internal/xsltc/compiler/XSLTC.java | 14 +- .../xsltc/compiler/util/ErrorMessages.java | 7 +- .../xsltc/compiler/util/ErrorMsg.java | 16 +- .../internal/xsltc/compiler/util/Util.java | 3 +- .../internal/xsltc/dom/NodeSortRecord.java | 3 +- .../internal/xsltc/runtime/BasisLibrary.java | 3 +- .../runtime/output/WriterOutputBuffer.java | 3 +- .../internal/xsltc/trax/TemplatesImpl.java | 12 + .../xsltc/trax/TransformerFactoryImpl.java | 14 +- .../internal/dom/DOMMessageFormatter.java | 15 +- .../internal/impl/XMLEntityManager.java | 3 +- .../internal/impl/dv/DatatypeException.java | 4 +- .../impl/msg/XMLMessageFormatter.java | 11 +- .../impl/msg/XMLMessageFormatter_de.java | 7 +- .../impl/msg/XMLMessageFormatter_es.java | 7 +- .../impl/msg/XMLMessageFormatter_fr.java | 7 +- .../impl/msg/XMLMessageFormatter_it.java | 7 +- .../impl/msg/XMLMessageFormatter_ja.java | 7 +- .../impl/msg/XMLMessageFormatter_ko.java | 7 +- .../impl/msg/XMLMessageFormatter_pt_BR.java | 7 +- .../impl/msg/XMLMessageFormatter_sv.java | 7 +- .../impl/msg/XMLMessageFormatter_zh_CN.java | 7 +- .../impl/msg/XMLMessageFormatter_zh_TW.java | 7 +- .../impl/xpath/regex/RegexParser.java | 5 +- .../internal/impl/xs/XSMessageFormatter.java | 9 +- .../JAXPValidationMessageFormatter.java | 7 +- .../util/DatatypeMessageFormatter.java | 7 +- .../internal/util/SAXMessageFormatter.java | 7 +- .../xerces/internal/util/SecurityManager.java | 70 +++--- .../xerces/internal/utils/ObjectFactory.java | 13 +- .../internal/utils/SecuritySupport.java | 36 +++ .../xinclude/XIncludeMessageFormatter.java | 9 +- .../xpointer/XPointerMessageFormatter.java | 8 +- .../apache/xml/internal/dtm/DTMManager.java | 3 +- .../xml/internal/res/XMLErrorResources.java | 66 ------ .../internal/res/XMLErrorResources_ca.java | 66 ------ .../internal/res/XMLErrorResources_cs.java | 66 ------ .../internal/res/XMLErrorResources_de.java | 66 ------ .../internal/res/XMLErrorResources_es.java | 66 ------ .../internal/res/XMLErrorResources_fr.java | 66 ------ .../internal/res/XMLErrorResources_it.java | 66 ------ .../internal/res/XMLErrorResources_ja.java | 66 ------ .../internal/res/XMLErrorResources_ko.java | 66 ------ .../internal/res/XMLErrorResources_pt_BR.java | 66 ------ .../internal/res/XMLErrorResources_sk.java | 66 ------ .../internal/res/XMLErrorResources_sv.java | 67 ------ .../internal/res/XMLErrorResources_tr.java | 66 ------ .../internal/res/XMLErrorResources_zh_CN.java | 66 ------ .../internal/res/XMLErrorResources_zh_TW.java | 66 ------ .../apache/xml/internal/res/XMLMessages.java | 65 +---- .../apache/xml/internal/resolver/Catalog.java | 5 +- .../xml/internal/resolver/CatalogManager.java | 17 +- .../xml/internal/resolver/Resolver.java | 5 +- .../internal/serialize/SerializerFactory.java | 3 +- .../xml/internal/serializer/Encodings.java | 4 +- .../serializer/OutputPropertiesFactory.java | 5 +- .../xml/internal/serializer/ToStream.java | 3 +- .../xml/internal/serializer/TreeWalker.java | 5 +- .../internal/serializer/utils/Messages.java | 100 +------- .../apache/xml/internal/utils/TreeWalker.java | 7 +- .../internal/utils/res/XResourceBundle.java | 141 +++-------- .../functions/FuncSystemProperty.java | 7 +- .../internal/res/XPATHErrorResources.java | 67 ------ .../internal/res/XPATHErrorResources_de.java | 67 ------ .../internal/res/XPATHErrorResources_es.java | 67 ------ .../internal/res/XPATHErrorResources_fr.java | 67 ------ .../internal/res/XPATHErrorResources_it.java | 67 ------ .../internal/res/XPATHErrorResources_ja.java | 67 ------ .../internal/res/XPATHErrorResources_ko.java | 67 ------ .../res/XPATHErrorResources_pt_BR.java | 67 ------ .../internal/res/XPATHErrorResources_sv.java | 67 ------ .../res/XPATHErrorResources_zh_CN.java | 67 ------ .../res/XPATHErrorResources_zh_TW.java | 67 ------ .../xpath/internal/res/XPATHMessages.java | 216 +++++++++-------- .../xml/internal/stream/XMLEntityStorage.java | 3 +- .../stream/writers/WriterUtility.java | 3 +- .../stream/writers/XMLStreamWriterImpl.java | 3 +- .../src/javax/xml/datatype/FactoryFinder.java | 62 ++++- jaxp/src/javax/xml/parsers/FactoryFinder.java | 10 +- jaxp/src/javax/xml/stream/FactoryFinder.java | 77 ++++-- .../javax/xml/transform/FactoryFinder.java | 9 + .../xml/validation/SchemaFactoryFinder.java | 41 +--- .../javax/xml/xpath/XPathFactoryFinder.java | 30 ++- .../bootstrap/DOMImplementationRegistry.java | 13 +- jaxp/src/org/xml/sax/helpers/NewInstance.java | 38 +-- .../org/xml/sax/helpers/ParserAdapter.java | 5 +- .../org/xml/sax/helpers/ParserFactory.java | 13 +- .../org/xml/sax/helpers/SecuritySupport.java | 108 +++++++++ .../org/xml/sax/helpers/XMLReaderFactory.java | 62 ++--- 111 files changed, 1134 insertions(+), 3199 deletions(-) create mode 100644 jaxp/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java create mode 100644 jaxp/src/org/xml/sax/helpers/SecuritySupport.java 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) From e95e6b90701a0b9d396be8aa4cb7f3facf6bf71c Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Tue, 26 Feb 2013 16:16:54 -0800 Subject: [PATCH 02/37] 8004336: Better handling of method handle intrinsic frames Reviewed-by: kvn, jrose, ahgross --- hotspot/src/share/vm/opto/library_call.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index cdcb9417760..fd5027eaad2 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -4005,8 +4005,9 @@ bool LibraryCallKit::is_method_invoke_or_aux_frame(JVMState* jvms) { } } } - else if (method->is_method_handle_intrinsic() || - method->is_compiled_lambda_form()) { + + if (method->is_method_handle_intrinsic() || + method->is_compiled_lambda_form()) { // This is an internal adapter frame from the MethodHandleCompiler -- skip it return true; } From b82442a565f15854092cbd48e124ac90a38c3425 Mon Sep 17 00:00:00 2001 From: Bhavesh Patel Date: Tue, 9 Apr 2013 14:18:22 -0700 Subject: [PATCH 03/37] 8005091: javadoc should be able to return the receiver type Reviewed-by: jjg --- .../com/sun/javadoc/ExecutableMemberDoc.java | 8 + .../html/AbstractExecutableMemberWriter.java | 34 ++- .../formats/html/ConstructorWriterImpl.java | 1 - .../formats/html/HtmlDocletWriter.java | 9 +- .../formats/html/MethodWriterImpl.java | 1 - .../javadoc/ExecutableMemberDocImpl.java | 11 + .../TestTypeAnnotations.java | 259 ++++++++++++++++++ .../typeannos/ClassExtends.java | 45 +++ .../typeannos/ClassParameters.java | 60 ++++ .../testTypeAnnotations/typeannos/Fields.java | 76 +++++ .../typeannos/MethodReturnType.java | 78 ++++++ .../typeannos/MethodTypeParameters.java | 52 ++++ .../typeannos/Parameters.java | 54 ++++ .../typeannos/Receivers.java | 131 +++++++++ .../testTypeAnnotations/typeannos/Throws.java | 51 ++++ .../typeannos/TypeParameters.java | 60 ++++ .../typeannos/Varargs.java | 42 +++ .../typeannos/Wildcards.java | 74 +++++ 18 files changed, 1036 insertions(+), 10 deletions(-) create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java create mode 100644 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java diff --git a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java index f1dea97678e..6f3e16c6ba7 100644 --- a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java +++ b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java @@ -87,6 +87,14 @@ public interface ExecutableMemberDoc extends MemberDoc { */ Parameter[] parameters(); + /** + * Get the receiver type of this executable element. + * + * @return the receiver type of this executable element. + * @since 1.8 + */ + Type receiverType(); + /** * Get the receiver annotations of this executable element. * Return an empty array if there are none. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java index 107204282b1..4ec8af0c426 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java @@ -139,12 +139,24 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite } } - protected void addReceiverAnnotations(ExecutableMemberDoc member, - Content tree) { - if (member.receiverAnnotations().length > 0) { - tree.addContent(writer.getSpace()); - writer.addReceiverAnnotationInfo(member, tree); - } + /** + * Add the receiver annotations information. + * + * @param member the member to write receiver annotations for. + * @param rcvrType the receiver type. + * @param descList list of annotation description. + * @param tree the content tree to which the information will be added. + */ + protected void addReceiverAnnotations(ExecutableMemberDoc member, Type rcvrType, + AnnotationDesc[] descList, Content tree) { + writer.addReceiverAnnotationInfo(member, descList, tree); + tree.addContent(writer.getSpace()); + tree.addContent(rcvrType.typeName()); + LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, rcvrType); + tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo))); + tree.addContent(writer.getSpace()); + tree.addContent("this"); } @@ -168,14 +180,24 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite protected void addParameters(ExecutableMemberDoc member, boolean includeAnnotations, Content htmltree) { htmltree.addContent("("); + String sep = ""; Parameter[] params = member.parameters(); String indent = makeSpace(writer.displayLength); if (configuration.linksource) { //add spaces to offset indentation changes caused by link. indent+= makeSpace(member.name().length()); } + Type rcvrType = member.receiverType(); + if (includeAnnotations && rcvrType instanceof AnnotatedType) { + AnnotationDesc[] descList = rcvrType.asAnnotatedType().annotations(); + if (descList.length > 0) { + addReceiverAnnotations(member, rcvrType, descList, htmltree); + sep = "," + DocletConstants.NL + indent; + } + } int paramstart; for (paramstart = 0; paramstart < params.length; paramstart++) { + htmltree.addContent(sep); Parameter param = params[paramstart]; if (!param.name().startsWith("this$")) { if (includeAnnotations) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java index d49fd9ea5bb..85cd1c5beca 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java @@ -137,7 +137,6 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter addName(constructor.name(), pre); } addParameters(constructor, pre); - writer.addReceiverAnnotationInfo(constructor, pre); addExceptions(constructor, pre); return pre; } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index 8a9b107dca5..d30e8044c75 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -1860,11 +1860,13 @@ public class HtmlDocletWriter extends HtmlDocWriter { * Add the annotation types of the executable receiver. * * @param method the executable to write the receiver annotations for. + * @param descList list of annotation description. * @param htmltree the documentation tree to which the annotation info will be * added */ - public void addReceiverAnnotationInfo(ExecutableMemberDoc method, Content htmltree) { - addAnnotationInfo(method, method.receiverAnnotations(), htmltree); + public void addReceiverAnnotationInfo(ExecutableMemberDoc method, AnnotationDesc[] descList, + Content htmltree) { + addAnnotationInfo(0, method, descList, false, htmltree); } /** @@ -1915,13 +1917,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { private boolean addAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak, Content htmltree) { List annotations = getAnnotations(indent, descList, lineBreak); + String sep =""; if (annotations.size() == 0) { return false; } Content annotationContent; for (Iterator iter = annotations.iterator(); iter.hasNext();) { + htmltree.addContent(sep); annotationContent = new RawHtml(iter.next()); htmltree.addContent(annotationContent); + sep = " "; } return true; } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java index 33fc47fb7ba..0585a9ea7f4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java @@ -130,7 +130,6 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter addName(method.name(), pre); } addParameters(method, pre); - addReceiverAnnotations(method, pre); addExceptions(method, pre); return pre; } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java index 2182a832725..943c3a26855 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java @@ -199,6 +199,17 @@ public abstract class ExecutableMemberDocImpl return result; } + /** + * Get the receiver type of this executable element. + * + * @return the receiver type of this executable element. + * @since 1.8 + */ + public com.sun.javadoc.Type receiverType() { + Type recvtype = sym.type.asMethodType().recvtype; + return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null; + } + public AnnotationDesc[] receiverAnnotations() { // TODO: change how receiver annotations are output! Type recvtype = sym.type.asMethodType().recvtype; diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java new file mode 100644 index 00000000000..0c795d94274 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java @@ -0,0 +1,259 @@ +/* + * 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. + * + * 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. + */ + +/* + * @test + * @bug 8005091 + * @summary Make sure that type annotations are displayed correctly + * @author Bhavesh Patel + * @library ../lib/ + * @build JavadocTester TestTypeAnnotations + * @run main TestTypeAnnotations + */ + +public class TestTypeAnnotations extends JavadocTester { + + //Test information. + private static final String BUG_ID = "8005091"; + + //Javadoc arguments. + private static final String[] ARGS = new String[] { + "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "typeannos" + }; + + //Input for string search tests. + private static final String[][] NEGATED_TEST = NO_TEST; + private static final String[][] TEST = { + // Test for type annotations on Class Extends (ClassExtends.java). + {BUG_ID + FS + "typeannos" + FS + "MyClass.html", + "implements @ClassExtB java.lang.CharSequence, " + + "ParameterizedInterface<java.lang.String>" + }, + {BUG_ID + FS + "typeannos" + FS + "MyInterface.html", + "extends ParameterizedInterface<java." + + "lang.String>, @ClassExtB java.lang.CharSequence" + }, + + // Test for type annotations on Class Parameters (ClassParameters.java). + {BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html", + "class ExtendsBound<K extends @ClassParamA java.lang.String>" + }, + {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html", + "class TwoBounds<K extends " + + "@ClassParamA java.lang.String,V extends @ClassParamB" + + " java.lang.String>" + }, + {BUG_ID + FS + "typeannos" + FS + "Complex1.html", + "class Complex1<K extends " + + "@ClassParamA java.lang.String & java.lang.Runnable>" + }, + {BUG_ID + FS + "typeannos" + FS + "Complex2.html", + "class Complex2<K extends java.lang." + + "String & @ClassParamB java.lang.Runnable>" + }, + {BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html", + "class ComplexBoth<K extends @ClassParamA java.lang.String & @ClassParamA" + + " java.lang.Runnable>" + }, + + // Test for type annotations on method return types (MethodReturnType.java). + {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", + "
public <T> @MRtnA java.lang.String" +
+            " method()
" + }, + + // Test for type annotations on method type parameters (MethodTypeParameters.java). + {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html", + "
<K extends @MTyParamA java.lang.String>" +
+            " void methodExtends()
" + }, + {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html", + "
public final <K extends @MTyParamA " +
+            "java.lang.String> void methodExtends()
" + }, + + // Test for type annotations on throws (Throws.java). + {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html", + "
void oneException()" + NL +
+            "            throws @ThrA java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html", + "
void twoExceptions()" + NL +
+            "             throws @ThrA java.lang.RuntimeException," + NL +
+            "                    @ThrA java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html", + "
public final void oneException(java.lang.String a)" + NL +
+            "                        throws @ThrA java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html", + "
public final void twoExceptions(java.lang.String a)" + NL +
+            "                         throws @ThrA java.lang.RuntimeException," + NL +
+            "                                @ThrA java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html", + "
void oneException()" + NL +
+            "            throws @ThrB(value=\"m\") java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html", + "
void twoExceptions()" + NL +
+            "             throws @ThrB(value=\"m\") java.lang.RuntimeException," + NL +
+            "                    @ThrA java.lang.Exception
" + }, + + // Test for type annotations on wildcard type (Wildcards.java). + {BUG_ID + FS + "typeannos" + FS + "BoundTest.html", + "
void wcExtends(MyList<? extends @WldA" +
+            " java.lang.String> l)
" + }, + {BUG_ID + FS + "typeannos" + FS + "BoundTest.html", + "
MyList<? super @WldA java.lang.String>" +
+            " returnWcSuper()
" + }, + {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html", + "
void wcSuper(MyList<? super @WldB(value=\"m\") java.lang." +
+            "String> l)
" + }, + {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html", + "
MyList<? extends @WldB(value=\"m\") java.lang.String" +
+            "> returnWcExtends()
" + }, + + // Test for receiver annotations (Receivers.java). + {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", + "
void withException(@RcvrA " +
+            "DefaultUnmodified this)" + NL + "             throws java." +
+            "lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", + "
java.lang.String nonVoid(@RcvrA @RcvrB" +
+            "(value=\"m\")" +
+            " DefaultUnmodified this)
" + }, + {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", + "
<T extends java.lang.Runnable> void accept(" +
+            "@RcvrA DefaultUnmodified this," + NL +
+            "                                         T r)" + NL +
+            "      throws java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "PublicModified.html", + "
public final java.lang.String nonVoid(" +
+            "@RcvrA PublicModified this)
" + }, + {BUG_ID + FS + "typeannos" + FS + "PublicModified.html", + "
public final <T extends java.lang.Runnable> " +
+            "void accept(@RcvrA PublicModified this," + NL +
+            "                                         T r)" + NL +
+            "                  throws java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "WithValue.html", + "
<T extends java.lang.Runnable> void accept(" +
+            "@RcvrB(" +
+            "value=\"m\") WithValue this," + NL +
+            "                                         T r)" + NL +
+            "      throws java.lang.Exception
" + }, + {BUG_ID + FS + "typeannos" + FS + "WithFinal.html", + "
java.lang.String nonVoid(@RcvrB(value=\"m\") WithFinal" +
+            " this)
" + }, + {BUG_ID + FS + "typeannos" + FS + "WithBody.html", + "
void field(@RcvrA WithBody this)
" + }, + {BUG_ID + FS + "typeannos" + FS + "Generic2.html", + "
void test2(@RcvrA Generic2<X> this)
" + } + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestTypeAnnotations tester = new TestTypeAnnotations(); + run(tester, ARGS, TEST, NEGATED_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +} diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java new file mode 100644 index 00000000000..995c6256b9c --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java @@ -0,0 +1,45 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +abstract class MyClass extends @ClassExtA ParameterizedClass<@ClassExtB String> + implements @ClassExtB CharSequence, @ClassExtA ParameterizedInterface<@ClassExtB String> { } + +interface MyInterface extends @ClassExtA ParameterizedInterface<@ClassExtA String>, + @ClassExtB CharSequence { } + +class ParameterizedClass {} +interface ParameterizedInterface {} + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ClassExtA {} +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ClassExtB {} diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java new file mode 100644 index 00000000000..d3b556a3ad3 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java @@ -0,0 +1,60 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class Unannotated { } + +class ExtendsBound { } +class ExtendsGeneric> { } +class TwoBounds { } + +class Complex1 { } +class Complex2 { } +class ComplexBoth { } + +class ClassParamOuter { + void inner() { + class LUnannotated { } + + class LExtendsBound { } + class LExtendsGeneric> { } + class LTwoBounds { } + + class LComplex1 { } + class LComplex2 { } + class LComplexBoth { } + } +} + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ClassParamA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ClassParamB { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java new file mode 100644 index 00000000000..cb143136d2c --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java @@ -0,0 +1,76 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class DefaultScope { + Parameterized unannotated; + Parameterized<@FldA String, String> firstTypeArg; + Parameterized secondTypeArg; + Parameterized<@FldA String, @FldB String> bothTypeArgs; + + Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String> + nestedParameterized; + + @FldA String [] array1; + @FldA String @FldB [] array1Deep; + @FldA String [] [] array2; + @FldA String @FldA [] @FldB [] array2Deep; + String @FldA [] [] array2First; + String [] @FldB [] array2Second; + + // Old-style array syntax + String array2FirstOld @FldA []; + String array2SecondOld [] @FldB []; +} + +class ModifiedScoped { + public final Parameterized unannotated = null; + public final Parameterized<@FldA String, String> firstTypeArg = null; + public final Parameterized secondTypeArg = null; + public final Parameterized<@FldA String, @FldB String> bothTypeArgs = null; + + public final Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String> + nestedParameterized = null; + + public final @FldA String [] array1 = null; + public final @FldA String @FldB [] array1Deep = null; + public final @FldA String [] [] array2 = null; + public final @FldA String @FldA [] @FldB [] array2Deep = null; + public final String @FldA [] [] array2First = null; + public final String [] @FldB [] array2Second = null; +} + +class Parameterized { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface FldA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface FldB { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java new file mode 100644 index 00000000000..fbfb9789199 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java @@ -0,0 +1,78 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class MtdDefaultScope { + MtdParameterized unannotated() { return null; } + MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; } + MtdParameterized secondTypeArg() { return null; } + MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; } + + MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String> + nestedMtdParameterized() { return null; } + + public @MRtnA String method() { return null; } + + @MRtnA String [] array1() { return null; } + @MRtnA String @MRtnB [] array1Deep() { return null; } + @MRtnA String [] [] array2() { return null; } + @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; } + String @MRtnA [] [] array2First() { return null; } + String [] @MRtnB [] array2Second() { return null; } + + // Old-style array syntax + String array2FirstOld() @MRtnA [] { return null; } + String array2SecondOld() [] @MRtnB [] { return null; } +} + +class MtdModifiedScoped { + public final MtdParameterized unannotated() { return null; } + public final MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; } + public final MtdParameterized secondTypeArg() { return null; } + public final MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; } + + public final MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String> + nestedMtdParameterized() { return null; } + + public final @MRtnA String [] array1() { return null; } + public final @MRtnA String @MRtnB [] array1Deep() { return null; } + public final @MRtnA String [] [] array2() { return null; } + public final @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; } + public final String @MRtnA [] [] array2First() { return null; } + public final String [] @MRtnB [] array2Second() { return null; } +} + +class MtdParameterized { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface MRtnA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface MRtnB { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java new file mode 100644 index 00000000000..dbfe2862db4 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java @@ -0,0 +1,52 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class UnscopedUnmodified { + void methodExtends() {} + > void nestedExtends() {} + > void dual() {} + > void dualOneAnno() {} +} + +class PublicModifiedMethods { + public final void methodExtends() {} + public final > void nestedExtends() {} + public final > void dual() {} + public final > void dualOneAnno() {} +} + +class MtdTyParameterized { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface MTyParamA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface MTyParamB { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java new file mode 100644 index 00000000000..6fe8dfcd108 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java @@ -0,0 +1,54 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class Parameters { + void unannotated(ParaParameterized a) {} + void firstTypeArg(ParaParameterized<@ParamA String, String> a) {} + void secondTypeArg(ParaParameterized a) {} + void bothTypeArgs(ParaParameterized<@ParamA String, @ParamB String> both) {} + + void nestedParaParameterized(ParaParameterized<@ParamA ParaParameterized<@ParamA String, @ParamB String>, @ParamB String> a) {} + + void array1(@ParamA String [] a) {} + void array1Deep(@ParamA String @ParamB [] a) {} + void array2(@ParamA String [] [] a) {} + void array2Deep(@ParamA String @ParamA [] @ParamB [] a) {} + void array2First(String @ParamA [] [] a) {} + void array2Second(String [] @ParamB [] a) {} +} + +class ParaParameterized { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ParamA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ParamB { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java new file mode 100644 index 00000000000..a46dd39f7de --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java @@ -0,0 +1,131 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class DefaultUnmodified { + void plain(@RcvrA DefaultUnmodified this) { } + void generic(@RcvrA DefaultUnmodified this) { } + void withException(@RcvrA DefaultUnmodified this) throws Exception { } + String nonVoid(@RcvrA @RcvrB("m") DefaultUnmodified this) { return null; } + void accept(@RcvrA DefaultUnmodified this, T r) throws Exception { } +} + +class PublicModified { + public final void plain(@RcvrA PublicModified this) { } + public final void generic(@RcvrA PublicModified this) { } + public final void withException(@RcvrA PublicModified this) throws Exception { } + public final String nonVoid(@RcvrA PublicModified this) { return null; } + public final void accept(@RcvrA PublicModified this, T r) throws Exception { } +} + +class WithValue { + void plain(@RcvrB("m") WithValue this) { } + void generic(@RcvrB("m") WithValue this) { } + void withException(@RcvrB("m") WithValue this) throws Exception { } + String nonVoid(@RcvrB("m") WithValue this) { return null; } + void accept(@RcvrB("m") WithValue this, T r) throws Exception { } +} + +class WithFinal { + void plain(final @RcvrB("m") WithFinal this) { } + void generic(final @RcvrB("m") WithFinal this) { } + void withException(final @RcvrB("m") WithFinal this) throws Exception { } + String nonVoid(final @RcvrB("m") WithFinal this) { return null; } + void accept(final @RcvrB("m") WithFinal this, T r) throws Exception { } +} + +class WithBody { + Object f; + + void field(@RcvrA WithBody this) { + this.f = null; + } + void meth(@RcvrA WithBody this) { + this.toString(); + } +} + +class Generic1 { + void test1(Generic1 this) {} + void test2(@RcvrA Generic1 this) {} + void test3(Generic1<@RcvrA X> this) {} + void test4(@RcvrA Generic1<@RcvrA X> this) {} +} + +class Generic2<@RcvrA X> { + void test1(Generic2 this) {} + void test2(@RcvrA Generic2 this) {} + void test3(Generic2<@RcvrA X> this) {} + void test4(@RcvrA Generic2<@RcvrA X> this) {} +} + +class Generic3 { + void test1(Generic3 this) {} + void test2(@RcvrA Generic3 this) {} + void test3(Generic3<@RcvrA X> this) {} + void test4(@RcvrA Generic3<@RcvrA X> this) {} +} + +class Generic4 { + void test1(Generic4 this) {} + void test2(@RcvrA Generic4 this) {} + void test3(Generic4<@RcvrA X> this) {} + void test4(@RcvrA Generic4<@RcvrA X> this) {} +} + +class Outer { + class Inner { + void none(Outer.Inner this) {} + void outer(@RcvrA Outer.Inner this) {} + void inner(Outer. @RcvrB("i") Inner this) {} + void both(@RcvrA Outer.@RcvrB("i") Inner this) {} + + void innerOnlyNone(Inner this) {} + void innerOnly(@RcvrA Inner this) {} + } +} + +class GenericOuter { + class GenericInner { + void none(GenericOuter.GenericInner this) {} + void outer(@RcvrA GenericOuter.GenericInner this) {} + void inner(GenericOuter. @RcvrB("i") GenericInner this) {} + void both(@RcvrA GenericOuter.@RcvrB("i") GenericInner this) {} + + void innerOnlyNone(GenericInner this) {} + void innerOnly(@RcvrA GenericInner this) {} + } +} + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface RcvrA {} +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface RcvrB { String value(); } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java new file mode 100644 index 00000000000..75a31dd3ecf --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java @@ -0,0 +1,51 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class ThrDefaultUnmodified { + void oneException() throws @ThrA Exception {} + void twoExceptions() throws @ThrA RuntimeException, @ThrA Exception {} +} + +class ThrPublicModified { + public final void oneException(String a) throws @ThrA Exception {} + public final void twoExceptions(String a) throws @ThrA RuntimeException, @ThrA Exception {} +} + +class ThrWithValue { + void oneException() throws @ThrB("m") Exception {} + void twoExceptions() throws @ThrB(value="m") RuntimeException, @ThrA Exception {} +} + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ThrA {} +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface ThrB { String value(); } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java new file mode 100644 index 00000000000..057bfad3bf3 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java @@ -0,0 +1,60 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class TypUnannotated { } +class OneAnnotated<@TyParaA K> { } +class TwoAnnotated<@TyParaA K, @TyParaA V> { } +class SecondAnnotated { } + +class TestMethods { + void unannotated() { } + <@TyParaA K> void oneAnnotated() { } + <@TyParaA K, @TyParaB("m") V> void twoAnnotated() { } + void secondAnnotated() { } +} + +class UnannotatedB { } +class OneAnnotatedB<@TyParaB("m") K> { } +class TwoAnnotatedB<@TyParaB("m") K, @TyParaB("m") V> { } +class SecondAnnotatedB { } + +class OneAnnotatedC<@TyParaC K> { } +class TwoAnnotatedC<@TyParaC K, @TyParaC V> { } +class SecondAnnotatedC { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface TyParaA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface TyParaB { String value(); } +@Target(ElementType.TYPE_USE) +@Documented +@interface TyParaC { } diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java new file mode 100644 index 00000000000..bb956e80a92 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java @@ -0,0 +1,42 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface VarArgA {} + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class Varargs { + + // Handle annotations on a varargs element type + void varargPlain(Object @VarArgA... objs) { + } + + void varargGeneric(Class @VarArgA ... clz) { + } +} diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java new file mode 100644 index 00000000000..593115c37f1 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java @@ -0,0 +1,74 @@ +/* + * 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. + * + * 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 typeannos; + +import java.lang.annotation.*; + +/* + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. + */ +class BoundTest { + void wcExtends(MyList l) { } + void wcSuper(MyList l) { } + + MyList returnWcExtends() { return null; } + MyList returnWcSuper() { return null; } + MyList> complex() { return null; } +} + +class BoundWithValue { + void wcExtends(MyList l) { } + void wcSuper(MyList l) { } + + MyList returnWcExtends() { return null; } + MyList returnWcSuper() { return null; } + MyList> complex() { return null; } +} + +class SelfTest { + void wcExtends(MyList<@WldA ?> l) { } + void wcSuper(MyList<@WldA ?> l) { } + + MyList<@WldA ?> returnWcExtends() { return null; } + MyList<@WldA ?> returnWcSuper() { return null; } + MyList<@WldA ? extends @WldA MyList<@WldB("m") ?>> complex() { return null; } +} + +class SelfWithValue { + void wcExtends(MyList<@WldB("m") ?> l) { } + void wcSuper(MyList<@WldB(value="m") ?> l) { } + + MyList<@WldB("m") ?> returnWcExtends() { return null; } + MyList<@WldB(value="m") ?> returnWcSuper() { return null; } + MyList<@WldB("m") ? extends MyList<@WldB("m") ? super String>> complex() { return null; } +} + +class MyList { } + +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface WldA { } +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +@interface WldB { String value(); } From cde5be4904a56f74c68e64a05aed19a55f1227c0 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Wed, 10 Apr 2013 12:31:02 +0100 Subject: [PATCH 04/37] 8011432: javac, compiler regression iterable + captured type Reviewed-by: mcimadamore --- .../com/sun/tools/javac/comp/Lower.java | 6 +- .../MethodRefDupInConstantPoolTest.java | 55 +++++++++++++------ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java index 388c7a52fba..6b1caf6a701 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java @@ -48,6 +48,7 @@ import static com.sun.tools.javac.code.Kinds.*; import static com.sun.tools.javac.code.TypeTag.*; import static com.sun.tools.javac.jvm.ByteCodes.*; import static com.sun.tools.javac.tree.JCTree.Tag.*; +import javax.lang.model.type.TypeKind; /** This pass translates away some syntactic sugar: inner classes, * class literals, assertions, foreach loops, etc. @@ -3400,8 +3401,11 @@ public class Lower extends TreeTranslator { if (iterableType.getTypeArguments().nonEmpty()) iteratorTarget = types.erasure(iterableType.getTypeArguments().head); Type eType = tree.expr.type; + while (eType.hasTag(TYPEVAR)) { + eType = eType.getUpperBound(); + } tree.expr.type = types.erasure(eType); - if (eType.hasTag(TYPEVAR) && eType.getUpperBound().isCompound()) + if (eType.isCompound()) tree.expr = make.TypeCast(types.erasure(iterableType), tree.expr); Symbol iterator = lookupMethod(tree.expr.pos(), names.iterator, diff --git a/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java b/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java index 60a0f3a0d48..7b3027fb255 100644 --- a/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java +++ b/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java @@ -23,8 +23,9 @@ /* * @test - * @bug 5053846 + * @bug 5053846 8011432 * @summary javac: MethodRef entries are duplicated in the constant pool + * @summary javac, compiler regression iterable + captured type */ import java.io.PrintWriter; @@ -43,9 +44,13 @@ public class MethodRefDupInConstantPoolTest { void run() { check("-v", Paths.get(System.getProperty("test.classes"), - "TestHelper1.class").toString()); + this.getClass().getSimpleName() + "$TestHelper1.class").toString()); check("-v", Paths.get(System.getProperty("test.classes"), - "TestHelper2.class").toString()); + this.getClass().getSimpleName() + "$TestHelper2.class").toString()); + check("-v", Paths.get(System.getProperty("test.classes"), + this.getClass().getSimpleName() + "$TestHelper3.class").toString()); + check("-v", Paths.get(System.getProperty("test.classes"), + this.getClass().getSimpleName() + "$TestHelper4.class").toString()); } void check(String... params) { @@ -68,24 +73,38 @@ public class MethodRefDupInConstantPoolTest { int end = out.indexOf("{"); return out.substring(start, end); } -} -class TestHelper1 { - void m() { - Vector v = new Vector(); - Iterator iter = v.iterator(); - while (iter.hasNext()) { - Object o = iter.next(); - Object o2 = o; - } - for (Object o: v) { - Object o2 = o; + class TestHelper1 { + void m() { + Vector v = new Vector(); + Iterator iter = v.iterator(); + while (iter.hasNext()) { + Object o = iter.next(); + Object o2 = o; + } + for (Object o: v) { + Object o2 = o; + } } } -} -class TestHelper2> { - void test(X x) { - for (String s : x) { } + class TestHelper2> { + void test(X x) { + for (String s : x) { } + } + } + + interface Data extends Iterable {} + + class TestHelper3> { + void test(X x) { + for (Data s : x) { } + } + } + + class TestHelper4 { + void test(Iterable t) { + for(Object a: t.iterator().next()); + } } } From ab923e74bf0f278fc08bd039b89976a8c9f4a013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 10 Apr 2013 14:00:11 +0200 Subject: [PATCH 05/37] 8011714: Regexp decimal escape handling still not correct Reviewed-by: lagergren, attila --- .../runtime/regexp/RegExpScanner.java | 128 +++++++++++------- nashorn/test/script/basic/JDK-8011714.js | 68 ++++++++++ .../test/script/basic/JDK-8011714.js.EXPECTED | 27 ++++ 3 files changed, 174 insertions(+), 49 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8011714.js create mode 100644 nashorn/test/script/basic/JDK-8011714.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java index 11928464add..496cf609838 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java @@ -108,15 +108,11 @@ final class RegExpScanner extends Scanner { final int pos = iterator.next(); final int num = iterator.next(); if (num > caps.size()) { - // Non-existing reference should never match, if smaller than 8 convert to octal escape - // to be compatible with other engines. - if (num < 8) { - String escape = "\\x0" + num; - sb.insert(pos, escape); - } else { - neverMatches = true; - break; - } + // Non-existing backreference. If the number begins with a valid octal convert it to + // Unicode escape and append the rest to a literal character sequence. + final StringBuilder buffer = new StringBuilder(); + octalOrLiteral(Integer.toString(num), buffer); + sb.insert(pos, buffer); } } @@ -632,7 +628,7 @@ final class RegExpScanner extends Scanner { // form "\\ca".match([string with ascii 1 at char0]). Translating // them to unicode does it though. sb.setLength(sb.length() - 1); - unicode(c - 'A' + 1); + unicode(c - 'A' + 1, sb); skip(1); return true; } @@ -673,7 +669,7 @@ final class RegExpScanner extends Scanner { final int startIn = position; final int startOut = sb.length(); - if (ch0 == '0' && !isDecimalDigit(ch1)) { + if (ch0 == '0' && !isOctalDigit(ch1)) { skip(1); // DecimalEscape :: 0. If i is zero, return the EscapeValue consisting of a character (Unicodevalue0000); sb.append("\u0000"); @@ -681,50 +677,56 @@ final class RegExpScanner extends Scanner { } if (isDecimalDigit(ch0)) { - final int num = ch0 - '0'; - // Single digit escape, treat as backreference. - if (!isDecimalDigit(ch1)) { - if (num <= caps.size() && caps.get(num - 1).getNegativeLookaheadLevel() > 0) { + if (ch0 == '0') { + // We know this is an octal escape. + if (inCharClass) { + // Convert octal escape to unicode escape if inside character class. + int octalValue = 0; + while (isOctalDigit(ch0)) { + octalValue = octalValue * 8 + ch0 - '0'; + skip(1); + } + + unicode(octalValue, sb); + + } else { + // Copy decimal escape as-is + decimalDigits(); + } + } else { + // This should be a backreference, but could also be an octal escape or even a literal string. + int decimalValue = 0; + while (isDecimalDigit(ch0)) { + decimalValue = decimalValue * 10 + ch0 - '0'; + skip(1); + } + + if (inCharClass) { + // No backreferences in character classes. Encode as unicode escape or literal char sequence + sb.setLength(sb.length() - 1); + octalOrLiteral(Integer.toString(decimalValue), sb); + + } else if (decimalValue <= caps.size() && caps.get(decimalValue - 1).getNegativeLookaheadLevel() > 0) { // Captures that live inside a negative lookahead are dead after the // lookahead and will be undefined if referenced from outside. - if (caps.get(num - 1).getNegativeLookaheadLevel() > negativeLookaheadLevel) { + if (caps.get(decimalValue - 1).getNegativeLookaheadLevel() > negativeLookaheadLevel) { sb.setLength(sb.length() - 1); } else { - sb.append(ch0); + sb.append(decimalValue); } - skip(1); - return true; - } else if (num > caps.size()) { - // Forward reference to a capture group. Forward references are always undefined so we - // can omit it from the output buffer. Additionally, if the capture group does not exist - // the whole regexp becomes invalid, so register the reference for later processing. + } else if (decimalValue > caps.size()) { + // Forward reference to a capture group. Forward references are always undefined so we can omit + // it from the output buffer. However, if the target capture does not exist, we need to rewrite + // the reference as hex escape or literal string, so register the reference for later processing. sb.setLength(sb.length() - 1); - forwardReferences.add(num); + forwardReferences.add(decimalValue); forwardReferences.add(sb.length()); - skip(1); - return true; - } - } - - if (inCharClass) { - // Convert octal escape to unicode escape if inside character class. - StringBuilder digit = new StringBuilder(4); - while (isDecimalDigit(ch0)) { - digit.append(ch0); - skip(1); + } else { + // Append as backreference + sb.append(decimalValue); } - int value = Integer.parseInt(digit.toString(), 8); //throws exception that leads to SyntaxError if not octal - if (value > 0xff) { - throw new NumberFormatException(digit.toString()); - } - - unicode(value); - - } else { - // Copy decimal escape as-is - decimalDigits(); } return true; } @@ -965,13 +967,41 @@ final class RegExpScanner extends Scanner { return true; } - private void unicode(final int value) { + private void unicode(final int value, final StringBuilder buffer) { final String hex = Integer.toHexString(value); - sb.append('u'); + buffer.append('u'); for (int i = 0; i < 4 - hex.length(); i++) { - sb.append('0'); + buffer.append('0'); } - sb.append(hex); + buffer.append(hex); + } + + // Convert what would have been a backreference into a unicode escape, or a number literal, or both. + private void octalOrLiteral(final String numberLiteral, final StringBuilder buffer) { + final int length = numberLiteral.length(); + int octalValue = 0; + int pos = 0; + // Maximum value for octal escape is 0377 (255) so we stop the loop at 32 + while (pos < length && octalValue < 0x20) { + final char ch = numberLiteral.charAt(pos); + if (isOctalDigit(ch)) { + octalValue = octalValue * 8 + ch - '0'; + } else { + break; + } + pos++; + } + if (octalValue > 0) { + buffer.append('\\'); + unicode(octalValue, buffer); + buffer.append(numberLiteral.substring(pos)); + } else { + buffer.append(numberLiteral); + } + } + + private static boolean isOctalDigit(final char ch) { + return ch >= '0' && ch <= '7'; } private static boolean isDecimalDigit(final char ch) { diff --git a/nashorn/test/script/basic/JDK-8011714.js b/nashorn/test/script/basic/JDK-8011714.js new file mode 100644 index 00000000000..dac00743ee8 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011714.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011714: Regexp decimal escape handling still not correct + * + * @test + * @run + */ + +// \0 should be interpreted as character here +print(/\08/.test("\x008")); +print(/[\08]/.test("8")); +print(/[\08]/.test("\x00")); + +// Can't be converted to octal thus encoded as literal char sequence +print(/\8/.exec("\\8")); +print(/[\8]/.exec("\\")); +print(/[\8]/.exec("8")); + +// 0471 is too high for an octal escape so it is \047 outside a character class +// and \\471 inside a character class +print(/\471/.exec("\x271")); +print(/[\471]/.exec("1")); +print(/[\471]/.exec("\x27")); + +// 0366 is a valid octal escape (246) +print(/\366/.test("\xf6")); +print(/[\366]/.test("\xf6")); +print(/[\366]/.test("\xf6")); + +// more tests for conversion of invalid backreferences to octal escapes or literals +print(/(a)(b)(c)(d)\4/.exec("abcdd")); +print(/(a)(b)(c)(d)\4x/.exec("abcddx")); +print(/(a)(b)(c)(d)\47/.exec("abcdd7")); +print(/(a)(b)(c)(d)\47/.exec("abcd\x27")); +print(/(a)(b)(c)(d)\47xyz/.exec("abcd\x27xyz")); +print(/(a)(b)(c)(d)[\47]/.exec("abcd\x27")); +print(/(a)(b)(c)(d)[\47]xyz/.exec("abcd\x27xyz")); +print(/(a)(b)(c)(d)\48/.exec("abcd\x048")); +print(/(a)(b)(c)(d)\48xyz/.exec("abcd\x048xyz")); +print(/(a)(b)(c)(d)[\48]/.exec("abcd\x04")); +print(/(a)(b)(c)(d)[\48]xyz/.exec("abcd\x04xyz")); +print(/(a)(b)(c)(d)\84/.exec("abcd84")); +print(/(a)(b)(c)(d)\84xyz/.exec("abcd84xyz")); +print(/(a)(b)(c)(d)[\84]/.exec("abcd8")); +print(/(a)(b)(c)(d)[\84]xyz/.exec("abcd8xyz")); + diff --git a/nashorn/test/script/basic/JDK-8011714.js.EXPECTED b/nashorn/test/script/basic/JDK-8011714.js.EXPECTED new file mode 100644 index 00000000000..c5a8b345cc7 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011714.js.EXPECTED @@ -0,0 +1,27 @@ +true +true +true +8 +null +8 +'1 +1 +' +true +true +true +abcdd,a,b,c,d +abcddx,a,b,c,d +null +abcd',a,b,c,d +abcd'xyz,a,b,c,d +abcd',a,b,c,d +abcd'xyz,a,b,c,d +abcd8,a,b,c,d +abcd8xyz,a,b,c,d +abcd,a,b,c,d +abcdxyz,a,b,c,d +abcd84,a,b,c,d +abcd84xyz,a,b,c,d +abcd8,a,b,c,d +abcd8xyz,a,b,c,d From 3c60983c024561a598406b9fe60b31ecaec827da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 10 Apr 2013 14:05:11 +0200 Subject: [PATCH 06/37] 8011749: Bugs with empty character class handling Reviewed-by: lagergren, attila --- .../runtime/regexp/RegExpScanner.java | 34 ++--------------- nashorn/test/script/basic/JDK-8011749.js | 38 +++++++++++++++++++ .../test/script/basic/JDK-8011749.js.EXPECTED | 5 +++ 3 files changed, 47 insertions(+), 30 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8011749.js create mode 100644 nashorn/test/script/basic/JDK-8011749.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java index 496cf609838..9b30ca15288 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java @@ -47,9 +47,6 @@ final class RegExpScanner extends Scanner { */ private final StringBuilder sb; - /** Is this the special case of a regexp that never matches anything */ - private boolean neverMatches; - /** Expected token table */ private final Map expected = new HashMap<>(); @@ -99,9 +96,6 @@ final class RegExpScanner extends Scanner { } private void processForwardReferences() { - if (neverMatches()) { - return; - } Iterator iterator = forwardReferences.descendingIterator(); while (iterator.hasNext()) { @@ -136,9 +130,6 @@ final class RegExpScanner extends Scanner { } scanner.processForwardReferences(); - if (scanner.neverMatches()) { - return null; // never matches - } // Throw syntax error unless we parsed the entire JavaScript regexp without syntax errors if (scanner.position != string.length()) { @@ -147,16 +138,6 @@ final class RegExpScanner extends Scanner { } return scanner; - } - - /** - * Does this regexp ever match anything? Use of e.g. [], which is legal in JavaScript, - * is an example where we never match - * - * @return boolean - */ - private boolean neverMatches() { - return neverMatches; } final StringBuilder getStringBuilder() { @@ -278,23 +259,16 @@ final class RegExpScanner extends Scanner { } if (atom()) { - boolean emptyCharacterClass = false; + // Check for character classes that never or always match if (sb.toString().endsWith("[]")) { - emptyCharacterClass = true; + sb.setLength(sb.length() - 1); + sb.append("^\\s\\S]"); } else if (sb.toString().endsWith("[^]")) { sb.setLength(sb.length() - 2); sb.append("\\s\\S]"); } - boolean quantifier = quantifier(); - - if (emptyCharacterClass) { - if (!quantifier) { - neverMatches = true; //never matches ever. - } - // Note: we could check if quantifier has min zero to mark empty character class as dead. - } - + quantifier(); return true; } diff --git a/nashorn/test/script/basic/JDK-8011749.js b/nashorn/test/script/basic/JDK-8011749.js new file mode 100644 index 00000000000..41d9ac64e20 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011749.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011749: Bugs with empty character class handling + * + * @test + * @run + */ + +// empty class in alternative +print(/[]|[^]/.exec("a")); +print(/[]|[]/.test("a")); +print(/[]|[]|[a]/.exec("a")); + +// empty class in negative lookahead +print(/(?![])/.test("")); +print(/(?![])./.exec("a")); diff --git a/nashorn/test/script/basic/JDK-8011749.js.EXPECTED b/nashorn/test/script/basic/JDK-8011749.js.EXPECTED new file mode 100644 index 00000000000..82d8c103af8 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011749.js.EXPECTED @@ -0,0 +1,5 @@ +a +false +a +true +a From ad7e2cd8de17b0d1e202452f48a5076db97ca1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 10 Apr 2013 14:08:00 +0200 Subject: [PATCH 07/37] 8011756: Wrong characters supported in RegExp \c escape Reviewed-by: lagergren, attila --- .../runtime/regexp/RegExpScanner.java | 16 ++--- nashorn/test/script/basic/JDK-8011756.js | 59 +++++++++++++++++++ .../test/script/basic/JDK-8011756.js.EXPECTED | 22 +++++++ 3 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8011756.js create mode 100644 nashorn/test/script/basic/JDK-8011756.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java index 9b30ca15288..d31a2a9e4ef 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java @@ -596,13 +596,14 @@ final class RegExpScanner extends Scanner { * ABCDEFGHIJKLMNOPQRSTUVWXYZ */ private boolean controlLetter() { - final char c = Character.toUpperCase(ch0); - if (c >= 'A' && c <= 'Z') { + // To match other engines we also accept '0'..'9' and '_' as control letters inside a character class. + if ((ch0 >= 'A' && ch0 <= 'Z') || (ch0 >= 'a' && ch0 <= 'z') + || (inCharClass && (isDecimalDigit(ch0) || ch0 == '_'))) { // for some reason java regexps don't like control characters on the // form "\\ca".match([string with ascii 1 at char0]). Translating // them to unicode does it though. sb.setLength(sb.length() - 1); - unicode(c - 'A' + 1, sb); + unicode(ch0 % 32, sb); skip(1); return true; } @@ -621,14 +622,7 @@ final class RegExpScanner extends Scanner { } // ES 5.1 A.7 requires "not IdentifierPart" here but all major engines accept any character here. if (ch0 == 'c') { - // Ignore invalid control letter escape if within a character class - if (inCharClass && ch1 != ']') { - sb.setLength(sb.length() - 1); - skip(2); - return true; - } else { - sb.append('\\'); // Treat invalid \c control sequence as \\c - } + sb.append('\\'); // Treat invalid \c control sequence as \\c } else if (NON_IDENT_ESCAPES.indexOf(ch0) == -1) { sb.setLength(sb.length() - 1); } diff --git a/nashorn/test/script/basic/JDK-8011756.js b/nashorn/test/script/basic/JDK-8011756.js new file mode 100644 index 00000000000..c0e8d834fec --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011756.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011756: Wrong characters supported in RegExp \c escape + * + * @test + * @run + */ + + +// Invalid control letters should be escaped: +print(/\cı/.test("\x09")); +print(/\cı/.test("\\cı")); + +print(/\cſ/.test("\x13")); +print(/\cſ/.test("\\cſ")); + +print(/[\cſ]/.test("\x13")); +print(/[\cſ]/.test("\\")); +print(/[\cſ]/.test("c")); +print(/[\cſ]/.test("ſ")); + +print(/[\c#]/.test("\\")); +print(/[\c#]/.test("c")); +print(/[\c#]/.test("#")); + +// The characters that are supported by other engines are '0'-'9', '_': +print(/[\c0]/.test("\x10")); +print(/[\c1]/.test("\x11")); +print(/[\c2]/.test("\x12")); +print(/[\c3]/.test("\x13")); +print(/[\c4]/.test("\x14")); +print(/[\c5]/.test("\x15")); +print(/[\c6]/.test("\x16")); +print(/[\c7]/.test("\x17")); +print(/[\c8]/.test("\x18")); +print(/[\c9]/.test("\x19")); +print(/[\c_]/.test("\x1F")); diff --git a/nashorn/test/script/basic/JDK-8011756.js.EXPECTED b/nashorn/test/script/basic/JDK-8011756.js.EXPECTED new file mode 100644 index 00000000000..63722a57d9b --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011756.js.EXPECTED @@ -0,0 +1,22 @@ +false +true +false +true +false +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true From 30fdece57099b2d24ac729de976312eabfc2d282 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Thu, 11 Apr 2013 13:20:03 +0530 Subject: [PATCH 08/37] 8011960: [2,1].sort(null) should throw TypeError Reviewed-by: hannesw, lagergren --- .../nashorn/internal/objects/NativeArray.java | 12 +++-- nashorn/test/script/basic/JDK-8011960.js | 53 +++++++++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8011960.js diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java index 9f36134ac95..b0b7fc1530c 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java @@ -793,11 +793,15 @@ public final class NativeArray extends ScriptObject { } private static ScriptFunction compareFunction(final Object comparefn) { - try { - return (ScriptFunction)comparefn; - } catch (final ClassCastException e) { - return null; //undefined or null + if (comparefn == ScriptRuntime.UNDEFINED) { + return null; } + + if (! (comparefn instanceof ScriptFunction)) { + throw typeError("not.a.function", ScriptRuntime.safeToString(comparefn)); + } + + return (ScriptFunction)comparefn; } private static Object[] sort(final Object[] array, final Object comparefn) { diff --git a/nashorn/test/script/basic/JDK-8011960.js b/nashorn/test/script/basic/JDK-8011960.js new file mode 100644 index 00000000000..f691d2c855d --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011960.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011960: [2,1].sort(null) should throw TypeError + * + * @test + * @run + */ + +function check(func) { + try { + [2,1].sort(func); + fail("should have thrown TypeError for :" + func); + } catch (e) { + if (! (e instanceof TypeError)) { + fail("TypeError not thrown for sort comparefn: " + func); + } + } +} + +// should not result in TypeError for undefined +[1, 2].sort(undefined); + +// TypeError for null +check(null); + +// should result in TypeError other non-callable params +check(32); +check("foo"); +check(false); +check({}); +check([]); From 9170d68b5ac49a38ae643ad702e1fee1bf9d61f0 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Thu, 11 Apr 2013 15:04:55 +0530 Subject: [PATCH 09/37] 8011974: Comparator function returning negative and positive Infinity does not work as expected with Array.prototype.sort Reviewed-by: hannesw, lagergren --- .../nashorn/internal/objects/NativeArray.java | 4 +- nashorn/test/script/basic/JDK-8011974.js | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8011974.js diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java index b0b7fc1530c..7569df1d258 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java @@ -76,7 +76,7 @@ public final class NativeArray extends ScriptObject { private static final MethodHandle REDUCE_CALLBACK_INVOKER = Bootstrap.createDynamicInvoker("dyn:call", Object.class, Object.class, Undefined.class, Object.class, Object.class, int.class, Object.class); - private static final MethodHandle CALL_CMP = Bootstrap.createDynamicInvoker("dyn:call", int.class, + private static final MethodHandle CALL_CMP = Bootstrap.createDynamicInvoker("dyn:call", double.class, ScriptFunction.class, Object.class, Object.class, Object.class); private static final InvokeByName TO_LOCALE_STRING = new InvokeByName("toLocaleString", ScriptObject.class, String.class); @@ -823,7 +823,7 @@ public final class NativeArray extends ScriptObject { if (cmp != null) { try { - return (int)CALL_CMP.invokeExact(cmp, cmpThis, x, y); + return (int)Math.signum((double)CALL_CMP.invokeExact(cmp, cmpThis, x, y)); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { diff --git a/nashorn/test/script/basic/JDK-8011974.js b/nashorn/test/script/basic/JDK-8011974.js new file mode 100644 index 00000000000..f3f9b4ae0bb --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011974.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011974: Comparator function returning negative and positive Infinity does not work as expected with Array.prototype.sort + * + * @test + * @run + */ + +function compare(x, y) { + return x < y? -Infinity : (x > y? Infinity: 0) +} + +var sorted = [5, 4, 3, 2, 1].sort(compare); + +if (sorted + '' != "1,2,3,4,5") { + fail("Array.prototype.sort does not work when compare returns +/-Infinity"); +} From 0e49b64b83667a5775f1dad235aeca468cc671d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 11 Apr 2013 12:16:39 +0200 Subject: [PATCH 10/37] 8011980: Allow NUL character in character class Reviewed-by: sundar, lagergren --- .../runtime/regexp/RegExpScanner.java | 1 - nashorn/test/script/basic/JDK-8011980.js | 34 +++++++++++++++++++ .../test/script/basic/JDK-8011980.js.EXPECTED | 4 +++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 nashorn/test/script/basic/JDK-8011980.js create mode 100644 nashorn/test/script/basic/JDK-8011980.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java index d31a2a9e4ef..e651c44e126 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java @@ -874,7 +874,6 @@ final class RegExpScanner extends Scanner { switch (ch0) { case ']': case '-': - case '\0': return false; case '[': diff --git a/nashorn/test/script/basic/JDK-8011980.js b/nashorn/test/script/basic/JDK-8011980.js new file mode 100644 index 00000000000..a83f28640ff --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011980.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/** + * JDK-8011980: Allow NUL character in character class + * + * @test + * @run + */ + +print(RegExp("\0").test("\0")); +print(RegExp("[\0]").test("\0")); +print(RegExp("[\x00]").test("\0")); +print(RegExp("[\u0000]").test("\0")); diff --git a/nashorn/test/script/basic/JDK-8011980.js.EXPECTED b/nashorn/test/script/basic/JDK-8011980.js.EXPECTED new file mode 100644 index 00000000000..1140ff52e2b --- /dev/null +++ b/nashorn/test/script/basic/JDK-8011980.js.EXPECTED @@ -0,0 +1,4 @@ +true +true +true +true From 6f2f8b14be4d2e5ec75eb85c135a804def80d777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Borggr=C3=A9n-Franck?= Date: Fri, 12 Apr 2013 12:05:04 +0200 Subject: [PATCH 11/37] 7015104: use new subtype of TypeSymbol for type parameters Reviewed-by: jjg, mcimadamore --- .../com/sun/tools/javac/code/Symbol.java | 72 ++++++++++--------- .../com/sun/tools/javac/code/Symtab.java | 3 +- .../com/sun/tools/javac/code/Type.java | 2 +- .../com/sun/tools/javac/comp/Infer.java | 2 +- .../scope/7017664/CompoundScopeTest.java | 4 +- .../test/tools/javac/types/TypeHarness.java | 4 +- 6 files changed, 44 insertions(+), 43 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java index 97af4174e31..cfdfa5a2f97 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java @@ -496,10 +496,11 @@ public abstract class Symbol implements Element { return List.nil(); } - public List getTypeParameters() { - ListBuffer l = ListBuffer.lb(); + public List getTypeParameters() { + ListBuffer l = ListBuffer.lb(); for (Type t : type.getTypeArguments()) { - l.append(t.tsym); + Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER); + l.append((TypeVariableSymbol)t.tsym); } return l.toList(); } @@ -546,19 +547,12 @@ public abstract class Symbol implements Element { } } - /** A class for type symbols. Type variables are represented by instances - * of this class, classes and packages by instances of subclasses. + /** A base class for Symbols representing types. */ - public static class TypeSymbol - extends Symbol implements TypeParameterElement { - // Implements TypeParameterElement because type parameters don't - // have their own TypeSymbol subclass. - // TODO: type parameters should have their own TypeSymbol subclass - - public TypeSymbol(long flags, Name name, Type type, Symbol owner) { - super(TYP, flags, name, type, owner); + public static abstract class TypeSymbol extends Symbol { + public TypeSymbol(int kind, long flags, Name name, Type type, Symbol owner) { + super(kind, flags, name, type, owner); } - /** form a fully qualified name from a name and an owner */ static public Name formFullName(Name name, Symbol owner) { @@ -610,11 +604,7 @@ public abstract class Symbol implements Element { return this.type.hasTag(TYPEVAR); } - // For type params; overridden in subclasses. - public ElementKind getKind() { - return ElementKind.TYPE_PARAMETER; - } - + @Override public java.util.List getEnclosedElements() { List list = List.nil(); if (kind == TYP && type.hasTag(TYPEVAR)) { @@ -627,22 +617,30 @@ public abstract class Symbol implements Element { return list; } - // For type params. - // Perhaps not needed if getEnclosingElement can be spec'ed - // to do the same thing. - // TODO: getGenericElement() might not be needed - public Symbol getGenericElement() { - return owner; - } - - public R accept(ElementVisitor v, P p) { - Assert.check(type.hasTag(TYPEVAR)); // else override will be invoked - return v.visitTypeParameter(this, p); - } - + @Override public R accept(Symbol.Visitor v, P p) { return v.visitTypeSymbol(this, p); } + } + + /** + * Type variables are represented by instances of this class. + */ + public static class TypeVariableSymbol + extends TypeSymbol implements TypeParameterElement { + + public TypeVariableSymbol(long flags, Name name, Type type, Symbol owner) { + super(TYP, flags, name, type, owner); + } + + public ElementKind getKind() { + return ElementKind.TYPE_PARAMETER; + } + + @Override + public Symbol getGenericElement() { + return owner; + } public List getBounds() { TypeVar t = (TypeVar)type; @@ -658,6 +656,11 @@ public abstract class Symbol implements Element { return ct.interfaces_field; } } + + @Override + public R accept(ElementVisitor v, P p) { + return v.visitTypeParameter(this, p); + } } /** A class for package symbols @@ -670,8 +673,7 @@ public abstract class Symbol implements Element { public ClassSymbol package_info; // see bug 6443073 public PackageSymbol(Name name, Type type, Symbol owner) { - super(0, name, type, owner); - this.kind = PCK; + super(PCK, 0, name, type, owner); this.members_field = null; this.fullname = formFullName(name, owner); } @@ -783,7 +785,7 @@ public abstract class Symbol implements Element { public Pool pool; public ClassSymbol(long flags, Name name, Type type, Symbol owner) { - super(flags, name, type, owner); + super(TYP, flags, name, type, owner); this.members_field = null; this.fullname = formFullName(name, owner); this.flatname = formFlatName(name, owner); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java index 12918fd46d9..aebfda502da 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java @@ -404,12 +404,11 @@ public class Symtab { return messages.getLocalizedString("compiler.misc.unnamed.package"); } }; - noSymbol = new TypeSymbol(0, names.empty, Type.noType, rootPackage) { + noSymbol = new TypeSymbol(Kinds.NIL, 0, names.empty, Type.noType, rootPackage) { public R accept(ElementVisitor v, P p) { return v.visitUnknown(this, p); } }; - noSymbol.kind = Kinds.NIL; // create the error symbols errSymbol = new ClassSymbol(PUBLIC|STATIC|ACYCLIC, names.any, null, rootPackage); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java index 0d16fb328c1..0d2a14612e4 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java @@ -1145,7 +1145,7 @@ public class Type implements PrimitiveType { public TypeVar(Name name, Symbol owner, Type lower) { super(TYPEVAR, null); - tsym = new TypeSymbol(0, name, this, owner); + tsym = new TypeVariableSymbol(0, name, this, owner); this.lower = lower; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java index c7935a05209..d696a928857 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java @@ -262,7 +262,7 @@ public class Infer { UndetVar uv = (UndetVar)inferenceContext.asFree(t); List upperBounds = uv.getBounds(InferenceBound.UPPER); if (Type.containsAny(upperBounds, vars)) { - TypeSymbol fresh_tvar = new TypeSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner); + TypeSymbol fresh_tvar = new TypeVariableSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner); fresh_tvar.type = new TypeVar(fresh_tvar, types.makeCompoundType(uv.getBounds(InferenceBound.UPPER)), null); todo.append(uv); uv.inst = fresh_tvar.type; diff --git a/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java b/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java index eda1836ef30..075a750a310 100644 --- a/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java +++ b/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.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 @@ -147,7 +147,7 @@ public class CompoundScopeTest { Scope createScope(int nelems) { Scope s = new Scope(symtab.noSymbol); for (int i = 0 ; i < nelems ; i++) { - Symbol sym = new TypeSymbol(0, names.fromString("s" + i), null, null); + Symbol sym = new TypeVariableSymbol(0, names.fromString("s" + i), null, null); s.enter(sym); elems = elems.prepend(sym); List shadowed = shadowedMap.get(sym.name); diff --git a/langtools/test/tools/javac/types/TypeHarness.java b/langtools/test/tools/javac/types/TypeHarness.java index 7233b5468cc..a53d94761ba 100644 --- a/langtools/test/tools/javac/types/TypeHarness.java +++ b/langtools/test/tools/javac/types/TypeHarness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -309,7 +309,7 @@ public class TypeHarness { } public TypeVar TypeVariable(Type bound) { - TypeSymbol tvsym = new TypeSymbol(0, syntheticName(), null, predef.noSymbol); + TypeSymbol tvsym = new TypeVariableSymbol(0, syntheticName(), null, predef.noSymbol); tvsym.type = new TypeVar(tvsym, bound, null); return (TypeVar)tvsym.type; } From f88be03f6b23329a917519c9e156fbc71af56eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 12 Apr 2013 16:31:16 +0200 Subject: [PATCH 12/37] 8011884: Regexp literals are compiled twice Reviewed-by: lagergren, sundar --- .../runtime/regexp/joni/Analyser.java | 3 --- .../internal/runtime/regexp/joni/Regex.java | 21 ++++++++++++++++--- .../regexp/joni/ast/QuantifierNode.java | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java index 65d3fcd3c9a..49a2a925ec8 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java @@ -156,9 +156,6 @@ final class Analyser extends Parser { env.memNodes = null; - new ArrayCompiler(this).compile(); - //new AsmCompiler(this).compile(); - if (regex.numRepeat != 0 || regex.btMemEnd != 0) { regex.stackPopLevel = StackPopLevel.ALL; } else { diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java index ae98cb56cbc..da5b98271b7 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java @@ -55,8 +55,9 @@ public final class Regex implements RegexState { int[]repeatRangeLo; int[]repeatRangeHi; - public WarnCallback warnings; - public MatcherFactory factory; + WarnCallback warnings; + MatcherFactory factory; + private Analyser analyser; int options; int userOptions; @@ -140,19 +141,33 @@ public final class Regex implements RegexState { this.caseFoldFlag = caseFoldFlag; this.warnings = warnings; - new Analyser(new ScanEnvironment(this, syntax), chars, p, end).compile(); + this.analyser = new Analyser(new ScanEnvironment(this, syntax), chars, p, end); + this.analyser.compile(); this.warnings = null; } + public void compile() { + if (factory == null && analyser != null) { + Compiler compiler = new ArrayCompiler(analyser); + analyser = null; // only do this once + compiler.compile(); + } + } + public Matcher matcher(char[] chars) { return matcher(chars, 0, chars.length); } public Matcher matcher(char[] chars, int p, int end) { + compile(); return factory.create(this, chars, p, end); } + public WarnCallback getWarnings() { + return warnings; + } + public int numberOfCaptures() { return numMem; } diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java index 76a5868d000..26cde98506f 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java @@ -231,12 +231,12 @@ public final class QuantifierNode extends StateNode { break; case DEL: - env.reg.warnings.warn(new String(chars, p, end) + + env.reg.getWarnings().warn(new String(chars, p, end) + " redundant nested repeat operator"); break; default: - env.reg.warnings.warn(new String(chars, p, end) + + env.reg.getWarnings().warn(new String(chars, p, end) + " nested repeat operator " + Reduce.PopularQStr[targetQNum] + " and " + Reduce.PopularQStr[nestQNum] + " was replaced with '" + Reduce.ReduceQStr[Reduce.REDUCE_TABLE[targetQNum][nestQNum].ordinal()] + "'"); From 3e3d516b787d5b8b3e81584e634e5cd97e2f6aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 12 Apr 2013 16:32:24 +0200 Subject: [PATCH 13/37] 8011885: Switch to Joni as default Regexp engine Reviewed-by: lagergren, sundar --- .../src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java index 6ff66f21d05..4a7ac11bc99 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java @@ -40,7 +40,7 @@ public class RegExpFactory { private final static String JONI = "joni"; static { - final String impl = Options.getStringProperty("nashorn.regexp.impl", JDK); + final String impl = Options.getStringProperty("nashorn.regexp.impl", JONI); switch (impl) { case JONI: instance = new JoniRegExp.Factory(); From 3044b19d21c016decb5416b52874e032f772bbc9 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Sat, 13 Apr 2013 12:25:44 +0100 Subject: [PATCH 14/37] 8010659: Javac Crashes while building OpenJFX Reviewed-by: jjg --- .../sun/tools/javac/comp/CompileStates.java | 92 +++++++++++++++++++ .../com/sun/tools/javac/comp/TransTypes.java | 34 ++++++- .../sun/tools/javac/main/JavaCompiler.java | 49 +++------- .../JavacProcessingEnvironment.java | 2 +- ...CrashWhenMixingBinariesAndSourcesTest.java | 66 +++++++++++++ .../typeAnnotations/TypeProcOnly.java | 6 +- .../packageanno/PackageProcessor.java | 6 +- 7 files changed, 207 insertions(+), 48 deletions(-) create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/CompileStates.java create mode 100644 langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/CompileStates.java b/langtools/src/share/classes/com/sun/tools/javac/comp/CompileStates.java new file mode 100644 index 00000000000..f192063bf80 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/CompileStates.java @@ -0,0 +1,92 @@ +/* + * 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 com.sun.tools.javac.comp; + +import java.util.HashMap; + +import com.sun.tools.javac.util.Context; + +/** Partial map to record which compiler phases have been executed + * for each compilation unit. Used for ATTR and FLOW phases. + * + *

This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class CompileStates extends HashMap, CompileStates.CompileState> { + /** The context key for the compile states. */ + protected static final Context.Key compileStatesKey = + new Context.Key(); + + /** Get the CompileStates instance for this context. */ + public static CompileStates instance(Context context) { + CompileStates instance = context.get(compileStatesKey); + if (instance == null) { + instance = new CompileStates(context); + } + return instance; + } + + /** Ordered list of compiler phases for each compilation unit. */ + public enum CompileState { + INIT(0), + PARSE(1), + ENTER(2), + PROCESS(3), + ATTR(4), + FLOW(5), + TRANSTYPES(6), + UNLAMBDA(7), + LOWER(8), + GENERATE(9); + + CompileState(int value) { + this.value = value; + } + public boolean isAfter(CompileState other) { + return value > other.value; + } + public static CompileState max(CompileState a, CompileState b) { + return a.value > b.value ? a : b; + } + private final int value; + }; + + private static final long serialVersionUID = 1812267524140424433L; + + protected Context context; + + public CompileStates(Context context) { + this.context = context; + context.put(compileStatesKey, this); + } + + public boolean isDone(Env env, CompileState cs) { + CompileState ecs = get(env); + return (ecs != null) && !cs.isAfter(ecs); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java index 0b191293db7..65d5685ee86 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java @@ -40,6 +40,7 @@ import static com.sun.tools.javac.code.Kinds.*; import static com.sun.tools.javac.code.TypeTag.CLASS; import static com.sun.tools.javac.code.TypeTag.TYPEVAR; import static com.sun.tools.javac.code.TypeTag.VOID; +import static com.sun.tools.javac.comp.CompileStates.CompileState; /** This pass translates Generic Java to conventional Java. * @@ -77,8 +78,11 @@ public class TransTypes extends TreeTranslator { */ private final boolean addBridges; + private final CompileStates compileStates; + protected TransTypes(Context context) { context.put(transTypesKey, this); + compileStates = CompileStates.instance(context); names = Names.instance(context); log = Log.instance(context); syms = Symtab.instance(context); @@ -904,16 +908,40 @@ public class TransTypes extends TreeTranslator { private Env env; + private static final String statePreviousToFlowAssertMsg = + "The current compile state [%s] of class %s is previous to FLOW"; + void translateClass(ClassSymbol c) { Type st = types.supertype(c.type); - // process superclass before derived - if (st.hasTag(CLASS)) + if (st.hasTag(CLASS)) { translateClass((ClassSymbol)st.tsym); + } Env myEnv = enter.typeEnvs.remove(c); - if (myEnv == null) + if (myEnv == null) { return; + } + + /* The two assertions below are set for early detection of any attempt + * to translate a class that: + * + * 1) has no compile state being it the most outer class. + * We accept this condition for inner classes. + * + * 2) has a compile state which is previous to Flow state. + */ + boolean envHasCompState = compileStates.get(myEnv) != null; + if (!envHasCompState && c.outermostClass() == c) { + Assert.error("No info for outermost class: " + myEnv.enclClass.sym); + } + + if (envHasCompState && + CompileState.FLOW.isAfter(compileStates.get(myEnv))) { + Assert.error(String.format(statePreviousToFlowAssertMsg, + compileStates.get(myEnv), myEnv.enclClass.sym)); + } + Env oldEnv = env; try { env = myEnv; diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java index fc4786a2a60..f186a81785e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -25,6 +25,7 @@ package com.sun.tools.javac.main; +import com.sun.tools.javac.comp.CompileStates; import java.io.*; import java.util.HashMap; import java.util.HashSet; @@ -61,6 +62,7 @@ import com.sun.tools.javac.processing.*; import com.sun.tools.javac.tree.*; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.*; +import com.sun.tools.javac.comp.CompileStates.CompileState; import com.sun.tools.javac.util.Log.WriterKind; import static com.sun.tools.javac.code.TypeTag.CLASS; @@ -326,6 +328,8 @@ public class JavaCompiler implements ClassReader.SourceCompleter { **/ protected boolean implicitSourceFilesRead; + protected CompileStates compileStates; + /** Construct a new compiler using a shared context. */ public JavaCompiler(Context context) { @@ -348,6 +352,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter { fileManager = context.get(JavaFileManager.class); parserFactory = ParserFactory.instance(context); + compileStates = CompileStates.instance(context); try { // catch completion problems with predefineds @@ -521,42 +526,6 @@ public class JavaCompiler implements ClassReader.SourceCompleter { */ public List closeables = List.nil(); - /** Ordered list of compiler phases for each compilation unit. */ - public enum CompileState { - INIT(0), - PARSE(1), - ENTER(2), - PROCESS(3), - ATTR(4), - FLOW(5), - TRANSTYPES(6), - UNLAMBDA(7), - LOWER(8), - GENERATE(9); - - CompileState(int value) { - this.value = value; - } - boolean isAfter(CompileState other) { - return value > other.value; - } - public static CompileState max(CompileState a, CompileState b) { - return a.value > b.value ? a : b; - } - private final int value; - }; - /** Partial map to record which compiler phases have been executed - * for each compilation unit. Used for ATTR and FLOW phases. - */ - protected class CompileStates extends HashMap,CompileState> { - private static final long serialVersionUID = 1812267524140424433L; - boolean isDone(Env env, CompileState cs) { - CompileState ecs = get(env); - return (ecs != null) && !cs.isAfter(ecs); - } - } - private CompileStates compileStates = new CompileStates(); - /** The set of currently compiled inputfiles, needed to ensure * we don't accidentally overwrite an input file when -s is set. * initialized by `compile'. @@ -1395,13 +1364,17 @@ public class JavaCompiler implements ClassReader.SourceCompleter { @Override public void visitClassDef(JCClassDecl node) { Type st = types.supertype(node.sym.type); - if (st.hasTag(CLASS)) { + boolean envForSuperTypeFound = false; + while (!envForSuperTypeFound && st.hasTag(CLASS)) { ClassSymbol c = st.tsym.outermostClass(); Env stEnv = enter.getEnv(c); if (stEnv != null && env != stEnv) { - if (dependencies.add(stEnv)) + if (dependencies.add(stEnv)) { scan(stEnv.tree); + } + envForSuperTypeFound = true; } + st = types.supertype(st); } super.visitClassDef(node); } diff --git a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index d71184d5157..48429decbae 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -59,7 +59,6 @@ import com.sun.tools.javac.file.JavacFileManager; import com.sun.tools.javac.jvm.*; import com.sun.tools.javac.jvm.ClassReader.BadClassFile; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.main.JavaCompiler.CompileState; import com.sun.tools.javac.model.JavacElements; import com.sun.tools.javac.model.JavacTypes; import com.sun.tools.javac.parser.*; @@ -79,6 +78,7 @@ import com.sun.tools.javac.util.Names; import com.sun.tools.javac.util.Options; import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING; import static com.sun.tools.javac.main.Option.*; +import static com.sun.tools.javac.comp.CompileStates.CompileState; import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*; /** diff --git a/langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java b/langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java new file mode 100644 index 00000000000..bfce546a877 --- /dev/null +++ b/langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java @@ -0,0 +1,66 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8010659 + * @summary Javac Crashes while building OpenJFX + * @library /tools/javac/lib + * @build ToolBox + * @run main CompilerCrashWhenMixingBinariesAndSourcesTest + */ + +public class CompilerCrashWhenMixingBinariesAndSourcesTest { + private static final String ASource = + "class A {\n" + + " void test() {new B(){};}\n" + + "}"; + private static final String BSource = + "class B extends C {}"; + private static final String CSource = + "class C extends D {\n" + + " String m(int i) {return null;}\n" + + "}"; + private static final String DSource = + "class D {\n" + + " Object m(int i) {return null;}\n" + + "}"; + + public static void main (String[] args) throws Exception{ + ToolBox.JavaToolArgs javacParams = new ToolBox.JavaToolArgs() + .setSources(ASource, BSource, CSource, DSource); + ToolBox.javac(javacParams); + + ToolBox.rm("A.class"); + ToolBox.rm("A$1.class"); + ToolBox.rm("C.class"); + ToolBox.rm("D.class"); + + javacParams = new ToolBox.JavaToolArgs() + .setOptions("-cp", ".") + .setSources(ASource, CSource, DSource); + ToolBox.javac(javacParams); + } +} diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java b/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java index 31ec31adceb..e7e3831cdbd 100644 --- a/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java +++ b/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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,12 +32,12 @@ import javax.lang.model.util.ElementFilter; import com.sun.source.util.JavacTask; import com.sun.source.util.TaskEvent; import com.sun.source.util.TaskListener; -import com.sun.source.util.TreePath; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.main.JavaCompiler.CompileState; import com.sun.tools.javac.processing.JavacProcessingEnvironment; import com.sun.tools.javac.util.Context; +import static com.sun.tools.javac.comp.CompileStates.CompileState; + /* * @test * @summary test that type processors are run when -proc:only is passed. diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java b/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java index 02e20ad3b19..6d4c3b65b7f 100644 --- a/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java +++ b/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -31,12 +31,12 @@ import javax.lang.model.util.ElementFilter; import com.sun.source.util.JavacTask; import com.sun.source.util.TaskEvent; import com.sun.source.util.TaskListener; -import com.sun.source.util.TreePath; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.main.JavaCompiler.CompileState; import com.sun.tools.javac.processing.JavacProcessingEnvironment; import com.sun.tools.javac.util.Context; +import static com.sun.tools.javac.comp.CompileStates.CompileState; + /* * @test * @summary test that package annotations are available to type processors. From 56d97d65076b98c2177fb6d112ee5da350b148d9 Mon Sep 17 00:00:00 2001 From: Bhavesh Patel Date: Sat, 13 Apr 2013 18:48:29 -0700 Subject: [PATCH 15/37] 8009686: Generated javadoc documentation should be able to display type annotation on an array Reviewed-by: jjg --- .../com/sun/javadoc/ExecutableMemberDoc.java | 9 - .../share/classes/com/sun/javadoc/Type.java | 9 + .../doclets/formats/html/LinkFactoryImpl.java | 2 +- .../doclets/formats/html/LinkOutputImpl.java | 7 + .../toolkit/util/links/LinkFactory.java | 19 +- .../toolkit/util/links/LinkOutput.java | 8 + .../sun/tools/javadoc/AbstractTypeImpl.java | 4 + .../com/sun/tools/javadoc/ClassDocImpl.java | 4 + .../javadoc/ExecutableMemberDocImpl.java | 18 -- .../com/sun/tools/javadoc/PrimitiveType.java | 4 + .../com/sun/tools/javadoc/TypeMaker.java | 4 + .../TestTypeAnnotations.java | 184 ++++++++++++++++-- .../testTypeAnnotations/typeannos/Fields.java | 8 +- 13 files changed, 237 insertions(+), 43 deletions(-) diff --git a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java index 6f3e16c6ba7..8792c9c537d 100644 --- a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java +++ b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java @@ -95,15 +95,6 @@ public interface ExecutableMemberDoc extends MemberDoc { */ Type receiverType(); - /** - * Get the receiver annotations of this executable element. - * Return an empty array if there are none. - * - * @return the receiver annotations of this executable element. - * @since 1.8 - */ - AnnotationDesc[] receiverAnnotations(); - /** * Return the throws tags in this method. * diff --git a/langtools/src/share/classes/com/sun/javadoc/Type.java b/langtools/src/share/classes/com/sun/javadoc/Type.java index 07b7c0d0509..77d9a732154 100644 --- a/langtools/src/share/classes/com/sun/javadoc/Type.java +++ b/langtools/src/share/classes/com/sun/javadoc/Type.java @@ -160,4 +160,13 @@ public interface Type { * @since 1.5 */ AnnotationTypeDoc asAnnotationTypeDoc(); + + /** + * If this type is an array type, return the element type of the + * array. Otherwise, return null. + * + * @return a Type representing the element type or null. + * @since 1.8 + */ + Type getElementType(); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java index 16ada0cea33..e4346ead840 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java @@ -157,9 +157,9 @@ public class LinkFactoryImpl extends LinkFactory { if (!isFirst) { linkInfo.displayLength += 1; output.append(" "); - isFirst = false; } output.append(anno); + isFirst = false; } if (!annos.isEmpty()) { linkInfo.displayLength += 1; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java index b4171971709..7cd2f6f9b05 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java @@ -60,6 +60,13 @@ public class LinkOutputImpl implements LinkOutput { (String) o : ((LinkOutputImpl)o).toString()); } + /** + * {@inheritDoc} + */ + public void insert(int offset, Object o) { + output.insert(offset, o.toString()); + } + /** * {@inheritDoc} */ diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java index 4af405754b3..97e6fe75f5a 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java @@ -61,7 +61,7 @@ public abstract class LinkFactory { //Just a primitive. linkInfo.displayLength += type.typeName().length(); linkOutput.append(type.typeName()); - } else if (type.asAnnotatedType() != null) { + } else if (type.asAnnotatedType() != null && type.dimension().length() == 0) { linkOutput.append(getTypeAnnotationLinks(linkInfo)); linkInfo.type = type.asAnnotatedType().underlyingType(); linkOutput.append(getLinkOutput(linkInfo)); @@ -141,8 +141,21 @@ public abstract class LinkFactory { linkInfo.displayLength += 3; linkOutput.append("..."); } else { - linkInfo.displayLength += type.dimension().length(); - linkOutput.append(type.dimension()); + while (type != null && type.dimension().length() > 0) { + linkInfo.displayLength += type.dimension().length(); + if (type.asAnnotatedType() != null) { + linkInfo.type = type; + linkOutput.append(" "); + linkOutput.append(getTypeAnnotationLinks(linkInfo)); + linkOutput.append("[]"); + type = type.asAnnotatedType().underlyingType().getElementType(); + } else { + linkOutput.append("[]"); + type = type.getElementType(); + } + } + linkInfo.type = type; + linkOutput.insert(0, getTypeAnnotationLinks(linkInfo)); } return linkOutput; } else if (linkInfo.classDoc != null) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java index cb58ae4667a..d917ee8cd05 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java @@ -44,4 +44,12 @@ public interface LinkOutput { * @param o the object to append. */ public void append(Object o); + + /** + * Insert the given object into the output sequence. + * + * @param offset the offset. + * @param o the object to be inserted. + */ + public void insert(int offset, Object o); } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java index 6adcb43f90b..856cd558ea8 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java @@ -61,6 +61,10 @@ abstract class AbstractTypeImpl implements com.sun.javadoc.Type { return type.tsym.getQualifiedName().toString(); } + public com.sun.javadoc.Type getElementType() { + return null; + } + public String simpleTypeName() { return type.tsym.name.toString(); } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java index 3d1ac353cc0..da28e39a630 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java @@ -108,6 +108,10 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc { this.tsym = sym; } + public com.sun.javadoc.Type getElementType() { + return null; + } + /** * Returns the flags in terms of javac's flags */ diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java index 943c3a26855..f86047ed263 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java @@ -210,24 +210,6 @@ public abstract class ExecutableMemberDocImpl return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null; } - public AnnotationDesc[] receiverAnnotations() { - // TODO: change how receiver annotations are output! - Type recvtype = sym.type.asMethodType().recvtype; - if (recvtype == null) { - return new AnnotationDesc[0]; - } - if (!recvtype.isAnnotated()) { - return new AnnotationDesc[0]; - } - List typeAnnos = ((com.sun.tools.javac.code.Type.AnnotatedType)recvtype).typeAnnotations; - AnnotationDesc result[] = new AnnotationDesc[typeAnnos.length()]; - int i = 0; - for (Attribute.Compound a : typeAnnos) { - result[i++] = new AnnotationDescImpl(env, a); - } - return result; - } - /** * Return the formal type parameters of this method or constructor. * Return an empty array if there are none. diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java b/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java index 9f6345f98b0..a3a81983734 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java @@ -63,6 +63,10 @@ class PrimitiveType implements com.sun.javadoc.Type { return name; } + public com.sun.javadoc.Type getElementType() { + return null; + } + /** * Return qualified name of type excluding any dimension information. *

diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java b/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java index 098a175878c..bf76f830b94 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java @@ -222,6 +222,10 @@ public class TypeMaker { private com.sun.javadoc.Type skipArraysCache = null; + public com.sun.javadoc.Type getElementType() { + return TypeMaker.getType(env, env.types.elemtype(arrayType)); + } + private com.sun.javadoc.Type skipArrays() { if (skipArraysCache == null) { Type t; diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java index 0c795d94274..db86f6b8933 100644 --- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8005091 + * @bug 8005091 8009686 * @summary Make sure that type annotations are displayed correctly * @author Bhavesh Patel * @library ../lib/ @@ -34,7 +34,7 @@ public class TestTypeAnnotations extends JavadocTester { //Test information. - private static final String BUG_ID = "8005091"; + private static final String BUG_ID = "8005091-8009686"; //Javadoc arguments. private static final String[] ARGS = new String[] { @@ -45,18 +45,37 @@ public class TestTypeAnnotations extends JavadocTester { private static final String[][] NEGATED_TEST = NO_TEST; private static final String[][] TEST = { // Test for type annotations on Class Extends (ClassExtends.java). + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "MyClass.html", + "extends @ClassExtA ParameterizedClass<" + + "@ClassExtB java.lang.String>" + }, + */ + /* @ignore 8012173 {BUG_ID + FS + "typeannos" + FS + "MyClass.html", "implements @ClassExtB java.lang.CharSequence, " + - "ParameterizedInterface<java.lang.String>" + "@ClassExtA ParameterizedInterface<" + + "@ClassExtB java.lang.String>" }, + */ + /* @ignore 8012173 {BUG_ID + FS + "typeannos" + FS + "MyInterface.html", - "extends ParameterizedInterface<java." + - "lang.String>, @ClassExtB java.lang.CharSequence" + "extends @ClassExtA " + + "ParameterizedInterface<@ClassExtA java.lang.String>, " + + "@ClassExtB java.lang.CharSequence" }, + */ // Test for type annotations on Class Parameters (ClassParameters.java). {BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html", @@ -64,11 +83,21 @@ public class TestTypeAnnotations extends JavadocTester { "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + "typeannos\">@ClassParamA java.lang.String>" }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html", + "

 class ExtendsGeneric<K extends " +
+            "@ClassParamA Unannotated<" +
+            "@ClassParamB java.lang.String>>"
+        },
+        */
         {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
-            "class TwoBounds<K extends  class TwoBounds<K extends " +
-            "@ClassParamA java.lang.String,V extends @ClassParamB" +
+            "@ClassParamA java.lang.String,V extends @ClassParamB" +
             " java.lang.String>"
         },
         {BUG_ID + FS + "typeannos" + FS + "Complex1.html",
@@ -89,12 +118,86 @@ public class TestTypeAnnotations extends JavadocTester {
             " java.lang.Runnable>"
         },
 
+        // Test for type annotations on fields (Fields.java).
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+            "
Parameterized<@FldA java.lang.String," +
+            "@FldB java.lang.String> bothTypeArgs
" + }, + */ + {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", + "
@FldA java.lang.String @FldB [] " +
+            "array1Deep
" + }, + {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", + "
java.lang.String[] @FldB [] array2SecondOld
" + }, + {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", + "
@FldD java.lang.String @FldC @FldA" +
+            " [] @FldC @FldB [] array2Deep
" + }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html", + "
public final Parameterized<@FldA " +
+            "Parameterized<@FldA java.lang.String," +
+            "@FldB java.lang.String>,@FldB java.lang.String> " +
+            "nestedParameterized
" + }, + */ + {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html", + "
public final @FldA java.lang.String[][] " +
+            "array2
" + }, + // Test for type annotations on method return types (MethodReturnType.java). {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", "
public <T> @MRtnA java.lang.String" +
             " method()
" }, + {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", + "
@MRtnA java.lang.String @MRtnA [] " +
+            "@MRtnB [] array2Deep()
" + }, + {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", + "
@MRtnA java.lang.String[][] array2()
" + }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "MtdModifiedScoped.html", + "
public final MtdParameterized<@MRtnA " +
+            "MtdParameterized<@MRtnA java.lang." +
+            "String,@MRtnB java.lang.String>,@MRtnB java." +
+            "lang.String> nestedMtdParameterized()
" + }, + */ // Test for type annotations on method type parameters (MethodTypeParameters.java). {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html", @@ -102,11 +205,63 @@ public class TestTypeAnnotations extends JavadocTester { "annotation in typeannos\">@MTyParamA java.lang.String>" + " void methodExtends()
" }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html", + "
<K extends @MTyParamA " +
+            "MtdTyParameterized<@MTyParamB java.lang.String" +
+            ">> void nestedExtends()
" + }, + */ {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html", "
public final <K extends @MTyParamA " +
             "java.lang.String> void methodExtends()
" }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html", + "
public final <K extends @MTyParamA " +
+            "java.lang.String,V extends @MTyParamA " +
+            "MtdTyParameterized<@MTyParamB java.lang.String" +
+            ">> void dual()
" + }, + */ + + // Test for type annotations on parameters (Parameters.java). + {BUG_ID + FS + "typeannos" + FS + "Parameters.html", + "
void unannotated(" +
+            "ParaParameterized<java.lang.String,java.lang.String>" +
+            " a)
" + }, + /* @ignore 8012173 + {BUG_ID + FS + "typeannos" + FS + "Parameters.html", + "
void nestedParaParameterized(" +
+            "ParaParameterized<@ParamA " +
+            "ParaParameterized<@ParamA java.lang.String," +
+            "@ParamB java.lang.String>,@ParamB" +
+            " java.lang.String> a)
" + }, + */ + {BUG_ID + FS + "typeannos" + FS + "Parameters.html", + "
void array2Deep(@ParamA java.lang.String " +
+            "@ParamA [] @ParamB [] a)
" + }, // Test for type annotations on throws (Throws.java). {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html", @@ -148,6 +303,13 @@ public class TestTypeAnnotations extends JavadocTester { "annotation in typeannos\">@ThrA java.lang.Exception" }, + // Test for type annotations on type parameters (TypeParameters.java). + {BUG_ID + FS + "typeannos" + FS + "TestMethods.html", + "
<K,V extends @TyParaA java.lang.String> " +
+            "void secondAnnotated()
" + }, + // Test for type annotations on wildcard type (Wildcards.java). {BUG_ID + FS + "typeannos" + FS + "BoundTest.html", "
void wcExtends( { }
 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
 @Documented
 @interface FldB { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldC { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldD { }

From efc501257bde46815a9d82fb494a70831833b901 Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:11:29 +0100
Subject: [PATCH 16/37] 8011383: Symbol.getModifiers omits ACC_ABSTRACT from
 interface with default methods

Fixup for default method modifiers erroneously applies to class-level modifiers

Reviewed-by: jjg
---
 .../com/sun/tools/javac/code/Symbol.java      |   9 +-
 .../defaultMethods/DefaultMethodFlags.java    | 111 ++++++++++++++++++
 2 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
index cfdfa5a2f97..7276303b8b3 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
@@ -454,8 +454,7 @@ public abstract class Symbol implements Element {
     }
 
     public Set getModifiers() {
-        long flags = flags();
-        return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & ~ABSTRACT : flags);
+        return Flags.asModifierSet(flags());
     }
 
     public Name getSimpleName() {
@@ -1128,6 +1127,12 @@ public abstract class Symbol implements Element {
             return m;
         }
 
+        @Override
+        public Set getModifiers() {
+            long flags = flags();
+            return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & ~ABSTRACT : flags);
+        }
+
         /** The Java source which this symbol represents.
          */
         public String toString() {
diff --git a/langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java b/langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java
new file mode 100644
index 00000000000..2aea0e46ea5
--- /dev/null
+++ b/langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java
@@ -0,0 +1,111 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011383
+ * @summary Symbol.getModifiers omits ACC_ABSTRACT from interface with default methods
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
+import javax.lang.model.element.*;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+import com.sun.tools.javac.util.Assert;
+
+public class DefaultMethodFlags {
+
+    public static void main(String[] args) throws IOException {
+        new DefaultMethodFlags().run(args);
+    }
+
+    void run(String[] args) throws IOException {
+        checkDefaultMethodFlags();
+    }
+
+    void checkDefaultMethodFlags() throws IOException {
+        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = c.getStandardFileManager(null, null, null);
+        Iterable fos =
+                fm.getJavaFileObjectsFromFiles(
+                Arrays.asList(new File(
+                System.getProperty("test.src"),
+                this.getClass().getSimpleName() + ".java")));
+        JavacTask task = (JavacTask) c.getTask(null, fm, null, null, null, fos);
+
+        task.addTaskListener(new TaskListener() {
+
+            @Override
+            public void started(TaskEvent e) {}
+
+            @Override
+            public void finished(TaskEvent e) {
+                if (e.getKind() == TaskEvent.Kind.ANALYZE) {
+                    TypeElement te = e.getTypeElement();
+                    if (te.getSimpleName().toString().equals("I")) {
+                        checkDefaultInterface(te);
+                    }
+                }
+            }
+        });
+
+        task.analyze();
+    }
+
+    void checkDefaultInterface(TypeElement te) {
+        System.err.println("Checking " + te.getSimpleName());
+        Assert.check(te.getModifiers().contains(Modifier.ABSTRACT));
+        for (Element e : te.getEnclosedElements()) {
+            if (e.getSimpleName().toString().matches("(\\w)_(default|static|abstract)")) {
+                boolean abstractExpected = false;
+                String methodKind = e.getSimpleName().toString().substring(2);
+                switch (methodKind) {
+                    case "default":
+                    case "static":
+                        break;
+                    case "abstract":
+                        abstractExpected = true;
+                        break;
+                    default:
+                        Assert.error("Cannot get here!" + methodKind);
+                }
+                Assert.check(e.getModifiers().contains(Modifier.ABSTRACT) == abstractExpected);
+            }
+        }
+    }
+}
+
+interface I {
+    default void m_default() { }
+    static void m_static() { }
+    void m_abstract();
+}

From 2b94dbb504c3a8166945e1560ab4e8f234b554a2 Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:12:17 +0100
Subject: [PATCH 17/37] 8011377: Javac crashes when multiple lambdas are
 defined in an array

Wrong attribution environment used by DeferredAttr

Reviewed-by: jjg
---
 .../com/sun/tools/javac/comp/Flow.java        |  2 +-
 .../test/tools/javac/lambda/TargetType71.java | 34 +++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 langtools/test/tools/javac/lambda/TargetType71.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
index 3942f22b2a1..5c1fc76e19a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
@@ -719,7 +719,7 @@ public class Flow {
                 Flow.this.make = make;
                 pendingExits = new ListBuffer();
                 alive = true;
-                scan(env.tree);
+                scan(tree);
             } finally {
                 pendingExits = null;
                 Flow.this.make = null;
diff --git a/langtools/test/tools/javac/lambda/TargetType71.java b/langtools/test/tools/javac/lambda/TargetType71.java
new file mode 100644
index 00000000000..9f17a1e6caf
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/TargetType71.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011377
+ * @summary Javac crashes when multiple lambdas are defined in an array
+ * @compile TargetType71.java
+ */
+class TargetType71 {
+    void test() {
+        Runnable[] rs = { () -> { String x = null; }, () -> { String x = null; } };
+    }
+}

From e59fd44a7342de9368366bd125dfd91a36122bca Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:15:07 +0100
Subject: [PATCH 18/37] 8011376: Spurious checked exception errors in nested
 method call

Fallback attribution logic doesn't work properly when lambda throws checked exceptions

Reviewed-by: jjg
---
 .../com/sun/tools/javac/comp/Attr.java        | 12 ++++--
 .../test/tools/javac/lambda/TargetType72.java | 39 +++++++++++++++++++
 2 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100644 langtools/test/tools/javac/lambda/TargetType72.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
index 1d324365fd6..94a0cd03c11 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -2455,20 +2455,24 @@ public class Attr extends JCTree.Visitor {
                                 argtypes.append(param.vartype.type) :
                                 argtypes.append(syms.errType);
                     }
-                    return new MethodType(argtypes, Type.recoveryType, List.nil(), syms.methodClass);
+                    return new MethodType(argtypes, Type.recoveryType,
+                            List.of(syms.throwableType), syms.methodClass);
                 case REFERENCE:
-                    return new MethodType(List.nil(), Type.recoveryType, List.nil(), syms.methodClass);
+                    return new MethodType(List.nil(), Type.recoveryType,
+                            List.of(syms.throwableType), syms.methodClass);
                 default:
                     Assert.error("Cannot get here!");
             }
             return null;
         }
 
-        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env env, final InferenceContext inferenceContext, final Type... ts) {
+        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env env,
+                final InferenceContext inferenceContext, final Type... ts) {
             checkAccessibleTypes(pos, env, inferenceContext, List.from(ts));
         }
 
-        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env env, final InferenceContext inferenceContext, final List ts) {
+        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env env,
+                final InferenceContext inferenceContext, final List ts) {
             if (inferenceContext.free(ts)) {
                 inferenceContext.addFreeTypeListener(ts, new FreeTypeListener() {
                     @Override
diff --git a/langtools/test/tools/javac/lambda/TargetType72.java b/langtools/test/tools/javac/lambda/TargetType72.java
new file mode 100644
index 00000000000..c74efab03d0
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/TargetType72.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011376
+ * @summary Spurious checked exception errors in nested method call
+ * @compile TargetType72.java
+ */
+import java.io.IOException;
+import java.util.concurrent.Callable;
+
+class TargetType72 {
+
+    Callable c = id(id(()->{ if (true) throw new java.io.IOException(); return 0; }));
+
+     Z id(Z z) { return null; }
+
+}

From 8f2d47cf793e566e74113592edbe5ec343ce4f80 Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:16:05 +0100
Subject: [PATCH 19/37] 8011028: lang/INFR/infr001/infr00101md/infr00101md.java
 fails to compile after switch to JDK8-b82

Fix bug in Types.removeWildcards

Reviewed-by: jjg
---
 .../com/sun/tools/javac/code/Types.java       |  2 +-
 .../test/tools/javac/lambda/TargetType69.java |  4 +-
 .../test/tools/javac/lambda/TargetType70.java | 52 +++++++++++++++++++
 3 files changed, 55 insertions(+), 3 deletions(-)
 create mode 100644 langtools/test/tools/javac/lambda/TargetType70.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
index f307dc33c85..083dc223db5 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
@@ -589,7 +589,7 @@ public class Types {
                             CapturedType capVar = (CapturedType)capturedTypeargs.head;
                             //use declared bound if it doesn't depend on formal type-args
                             bound = capVar.bound.containsAny(capturedSite.getTypeArguments()) ?
-                                    syms.objectType : capVar.bound;
+                                    wt.type : capVar.bound;
                             break;
                         default:
                             bound = wt.type;
diff --git a/langtools/test/tools/javac/lambda/TargetType69.java b/langtools/test/tools/javac/lambda/TargetType69.java
index 0b47bb099af..065c1e95fb2 100644
--- a/langtools/test/tools/javac/lambda/TargetType69.java
+++ b/langtools/test/tools/javac/lambda/TargetType69.java
@@ -25,11 +25,11 @@
  * @test
  * @bug 8010303
  * @summary Graph inference: missing incorporation step causes spurious inference error
- * @compile TargetType68.java
+ * @compile TargetType69.java
  */
 import java.util.*;
 
-class TargetType68 {
+class TargetType69 {
 
     interface Function {
         Y m(X x);
diff --git a/langtools/test/tools/javac/lambda/TargetType70.java b/langtools/test/tools/javac/lambda/TargetType70.java
new file mode 100644
index 00000000000..3686813e0c0
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/TargetType70.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011028
+ * @summary lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
+ * @compile TargetType70.java
+ */
+class TargetType70  {
+
+    static class Sup {}
+    static class Sub extends Sup {}
+
+    interface I, U> {
+        T m(U o);
+    }
+
+    static class GenSup {
+        GenSup(T f) { }
+    }
+
+    static class GenSub extends GenSup {
+        GenSub(T f) { super(f); }
+    }
+
+     void m(I, T> o1, T o2) { }
+
+    void test(Sub sub) {
+        m(GenSub::new, sub);
+    }
+}

From 8b680bdde22069eb715b91b3364db3084c7ca312 Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:17:30 +0100
Subject: [PATCH 20/37] 8011392: Missing checkcast when casting to intersection
 type

Javac should emit a checkcast for each additional target type specified in an intersection type cast

Reviewed-by: jjg
---
 .../com/sun/tools/javac/comp/TransTypes.java  | 10 ++++
 .../tools/javac/lambda/Intersection03.java    | 49 +++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 langtools/test/tools/javac/lambda/Intersection03.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java
index 65d5685ee86..a58dec6f7f1 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java
@@ -710,8 +710,18 @@ public class TransTypes extends TreeTranslator {
 
     public void visitTypeCast(JCTypeCast tree) {
         tree.clazz = translate(tree.clazz, null);
+        Type originalTarget = tree.type;
         tree.type = erasure(tree.type);
         tree.expr = translate(tree.expr, tree.type);
+        if (originalTarget.isCompound()) {
+            Type.IntersectionClassType ict = (Type.IntersectionClassType)originalTarget;
+            for (Type c : ict.getExplicitComponents()) {
+                Type ec = erasure(c);
+                if (!types.isSameType(ec, tree.type)) {
+                    tree.expr = coerce(tree.expr, ec);
+                }
+            }
+        }
         result = tree;
     }
 
diff --git a/langtools/test/tools/javac/lambda/Intersection03.java b/langtools/test/tools/javac/lambda/Intersection03.java
new file mode 100644
index 00000000000..a6de78828ea
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/Intersection03.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011392
+ * @summary Missing checkcast when casting to intersection type
+ */
+import java.util.*;
+
+public class Intersection03 {
+
+    static int assertionCount = 0;
+
+    static void assertTrue(boolean cond) {
+        assertionCount++;
+        if (!cond) throw new AssertionError();
+    }
+
+    public static void main(String[] args) {
+        try {
+            Runnable r = (List & Runnable)new ArrayList();
+            assertTrue(false);
+        } catch (ClassCastException cce) {
+            assertTrue(true);
+        }
+        assertTrue(assertionCount == 1);
+    }
+}

From 8ab167f0ed10201241d773fb8ad4bb8ba89c4958 Mon Sep 17 00:00:00 2001
From: Maurizio Cimadamore 
Date: Mon, 15 Apr 2013 14:18:30 +0100
Subject: [PATCH 21/37] 8010923: Avoid redundant speculative attribution

Add optimization to avoid speculative attribution for certain argument expressions

Reviewed-by: jjg
---
 .../com/sun/tools/javac/comp/Attr.java        |   7 +-
 .../sun/tools/javac/comp/DeferredAttr.java    | 215 ++++++++++++++++++
 .../com/sun/tools/javac/comp/Resolve.java     |   5 +
 .../com/sun/tools/javac/tree/TreeInfo.java    |  17 --
 4 files changed, 225 insertions(+), 19 deletions(-)

diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
index 94a0cd03c11..34998862480 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -148,6 +148,7 @@ public class Attr extends JCTree.Visitor {
         varInfo = new ResultInfo(VAR, Type.noType);
         unknownExprInfo = new ResultInfo(VAL, Type.noType);
         unknownTypeInfo = new ResultInfo(TYP, Type.noType);
+        unknownTypeExprInfo = new ResultInfo(Kinds.TYP | Kinds.VAL, Type.noType);
         recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext);
     }
 
@@ -559,6 +560,7 @@ public class Attr extends JCTree.Visitor {
     final ResultInfo varInfo;
     final ResultInfo unknownExprInfo;
     final ResultInfo unknownTypeInfo;
+    final ResultInfo unknownTypeExprInfo;
     final ResultInfo recoveryInfo;
 
     Type pt() {
@@ -667,7 +669,7 @@ public class Attr extends JCTree.Visitor {
     List attribArgs(List trees, Env env) {
         ListBuffer argtypes = new ListBuffer();
         for (JCExpression arg : trees) {
-            Type argtype = allowPoly && TreeInfo.isPoly(arg, env.tree) ?
+            Type argtype = allowPoly && deferredAttr.isDeferred(env, arg) ?
                     deferredAttr.new DeferredType(arg, env) :
                     chk.checkNonVoid(arg, attribExpr(arg, env, Infer.anyPoly));
             argtypes.append(argtype);
@@ -2989,7 +2991,8 @@ public class Attr extends JCTree.Visitor {
         Env localEnv = env.dup(tree);
         //should we propagate the target type?
         final ResultInfo castInfo;
-        final boolean isPoly = TreeInfo.isPoly(tree.expr, tree);
+        JCExpression expr = TreeInfo.skipParens(tree.expr);
+        boolean isPoly = expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE);
         if (isPoly) {
             //expression is a poly - we need to propagate target type info
             castInfo = new ResultInfo(VAL, clazztype, new Check.NestedCheckContext(resultInfo.checkContext) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index 04015a46a86..0dd6fe3887a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -800,4 +800,219 @@ public class DeferredAttr extends JCTree.Visitor {
             }
         }
     }
+
+    /**
+     * Does the argument expression {@code expr} need speculative type-checking?
+     */
+    boolean isDeferred(Env env, JCExpression expr) {
+        DeferredChecker dc = new DeferredChecker(env);
+        dc.scan(expr);
+        return dc.result.isPoly();
+    }
+
+    /**
+     * The kind of an argument expression. This is used by the analysis that
+     * determines as to whether speculative attribution is necessary.
+     */
+    enum ArgumentExpressionKind {
+
+        /** kind that denotes poly argument expression */
+        POLY,
+        /** kind that denotes a standalone expression */
+        NO_POLY,
+        /** kind that denotes a primitive/boxed standalone expression */
+        PRIMITIVE;
+
+        /**
+         * Does this kind denote a poly argument expression
+         */
+        public final boolean isPoly() {
+            return this == POLY;
+        }
+
+        /**
+         * Does this kind denote a primitive standalone expression
+         */
+        public final boolean isPrimitive() {
+            return this == PRIMITIVE;
+        }
+
+        /**
+         * Compute the kind of a standalone expression of a given type
+         */
+        static ArgumentExpressionKind standaloneKind(Type type, Types types) {
+            return types.unboxedTypeOrType(type).isPrimitive() ?
+                    ArgumentExpressionKind.PRIMITIVE :
+                    ArgumentExpressionKind.NO_POLY;
+        }
+
+        /**
+         * Compute the kind of a method argument expression given its symbol
+         */
+        static ArgumentExpressionKind methodKind(Symbol sym, Types types) {
+            Type restype = sym.type.getReturnType();
+            if (sym.type.hasTag(FORALL) &&
+                    restype.containsAny(((ForAll)sym.type).tvars)) {
+                return ArgumentExpressionKind.POLY;
+            } else {
+                return ArgumentExpressionKind.standaloneKind(restype, types);
+            }
+        }
+    }
+
+    /**
+     * Tree scanner used for checking as to whether an argument expression
+     * requires speculative attribution
+     */
+    final class DeferredChecker extends FilterScanner {
+
+        Env env;
+        ArgumentExpressionKind result;
+
+        public DeferredChecker(Env env) {
+            super(deferredCheckerTags);
+            this.env = env;
+        }
+
+        @Override
+        public void visitLambda(JCLambda tree) {
+            //a lambda is always a poly expression
+            result = ArgumentExpressionKind.POLY;
+        }
+
+        @Override
+        public void visitReference(JCMemberReference tree) {
+            //a method reference is always a poly expression
+            result = ArgumentExpressionKind.POLY;
+        }
+
+        @Override
+        public void visitTypeCast(JCTypeCast tree) {
+            //a cast is always a standalone expression
+            result = ArgumentExpressionKind.NO_POLY;
+        }
+
+        @Override
+        public void visitConditional(JCConditional tree) {
+            scan(tree.truepart);
+            if (!result.isPrimitive()) {
+                result = ArgumentExpressionKind.POLY;
+                return;
+            }
+            scan(tree.falsepart);
+            result = reduce(ArgumentExpressionKind.PRIMITIVE);
+        }
+
+        @Override
+        public void visitNewClass(JCNewClass tree) {
+            result = (TreeInfo.isDiamond(tree) || attr.findDiamonds) ?
+                    ArgumentExpressionKind.POLY : ArgumentExpressionKind.NO_POLY;
+        }
+
+        @Override
+        public void visitApply(JCMethodInvocation tree) {
+            Name name = TreeInfo.name(tree.meth);
+
+            //fast path
+            if (tree.typeargs.nonEmpty() ||
+                    name == name.table.names._this ||
+                    name == name.table.names._super) {
+                result = ArgumentExpressionKind.NO_POLY;
+                return;
+            }
+
+            //slow path
+            final JCExpression rec = tree.meth.hasTag(SELECT) ?
+                    ((JCFieldAccess)tree.meth).selected :
+                    null;
+
+            if (rec != null && !isSimpleReceiver(rec)) {
+                //give up if receiver is too complex (to cut down analysis time)
+                result = ArgumentExpressionKind.POLY;
+                return;
+            }
+
+            Type site = rec != null ?
+                    attribSpeculative(rec, env, attr.unknownTypeExprInfo).type :
+                    env.enclClass.sym.type;
+
+            ListBuffer args = ListBuffer.lb();
+            for (int i = 0; i < tree.args.length(); i ++) {
+                args.append(Type.noType);
+            }
+
+            Resolve.LookupHelper lh = rs.new LookupHelper(name, site, args.toList(), List.nil(), MethodResolutionPhase.VARARITY) {
+                @Override
+                Symbol lookup(Env env, MethodResolutionPhase phase) {
+                    return rec == null ?
+                        rs.findFun(env, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
+                        rs.findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), false);
+                }
+                @Override
+                Symbol access(Env env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+                    return sym;
+                }
+            };
+
+            Symbol sym = rs.lookupMethod(env, tree, site.tsym, rs.arityMethodCheck, lh);
+
+            if (sym.kind == Kinds.AMBIGUOUS) {
+                Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
+                result = ArgumentExpressionKind.PRIMITIVE;
+                for (List ambigousSyms = err.ambiguousSyms ;
+                        ambigousSyms.nonEmpty() && !result.isPoly() ;
+                        ambigousSyms = ambigousSyms.tail) {
+                    Symbol s = ambigousSyms.head;
+                    if (s.kind == Kinds.MTH) {
+                        result = reduce(ArgumentExpressionKind.methodKind(s, types));
+                    }
+                }
+            } else {
+                result = (sym.kind == Kinds.MTH) ?
+                    ArgumentExpressionKind.methodKind(sym, types) :
+                    ArgumentExpressionKind.NO_POLY;
+            }
+        }
+        //where
+            private boolean isSimpleReceiver(JCTree rec) {
+                switch (rec.getTag()) {
+                    case IDENT:
+                        return true;
+                    case SELECT:
+                        return isSimpleReceiver(((JCFieldAccess)rec).selected);
+                    case TYPEAPPLY:
+                    case TYPEARRAY:
+                        return true;
+                    case ANNOTATED_TYPE:
+                        return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType);
+                    default:
+                        return false;
+                }
+            }
+            private ArgumentExpressionKind reduce(ArgumentExpressionKind kind) {
+                switch (result) {
+                    case PRIMITIVE: return kind;
+                    case NO_POLY: return kind.isPoly() ? kind : result;
+                    case POLY: return result;
+                    default:
+                        Assert.error();
+                        return null;
+                }
+            }
+
+        @Override
+        public void visitLiteral(JCLiteral tree) {
+            Type litType = attr.litType(tree.typetag);
+            result = ArgumentExpressionKind.standaloneKind(litType, types);
+        }
+
+        @Override
+        void skip(JCTree tree) {
+            result = ArgumentExpressionKind.NO_POLY;
+        }
+    }
+    //where
+    private EnumSet deferredCheckerTags =
+            EnumSet.of(LAMBDA, REFERENCE, PARENS, TYPECAST,
+                    CONDEXPR, NEWCLASS, APPLY, LITERAL);
 }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
index 309596b8c7e..03ae28854c2 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -3603,6 +3603,11 @@ public class Resolve {
             this.delegatedError = delegatedError;
         }
 
+        @Override
+        public Symbol baseSymbol() {
+            return delegatedError.baseSymbol();
+        }
+
         @Override
         protected Symbol access(Name name, TypeSymbol location) {
             return delegatedError.access(name, location);
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
index 3991aaeb55a..d5a575264af 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
@@ -249,23 +249,6 @@ public class TreeInfo {
         }
     }
 
-    /** Return true if a a tree corresponds to a poly expression. */
-    public static boolean isPoly(JCTree tree, JCTree origin) {
-        switch (tree.getTag()) {
-            case APPLY:
-            case NEWCLASS:
-            case CONDEXPR:
-                return !origin.hasTag(TYPECAST);
-            case LAMBDA:
-            case REFERENCE:
-                return true;
-            case PARENS:
-                return isPoly(((JCParens)tree).expr, origin);
-            default:
-                return false;
-        }
-    }
-
     /** set 'polyKind' on given tree */
     public static void setPolyKind(JCTree tree, PolyKind pkind) {
         switch (tree.getTag()) {

From 2c3899554fa3d45c2c366c29e8fbfbeb404f31ba Mon Sep 17 00:00:00 2001
From: Jim Gish 
Date: Tue, 16 Apr 2013 13:25:39 -0400
Subject: [PATCH 22/37] 8011347: JKD-8009824 has broken webrev with some ksh
 versions

Reviewed-by: mduigou
---
 make/scripts/webrev.ksh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/make/scripts/webrev.ksh b/make/scripts/webrev.ksh
index c95bce74523..9fef47fa69e 100644
--- a/make/scripts/webrev.ksh
+++ b/make/scripts/webrev.ksh
@@ -27,7 +27,7 @@
 # Documentation is available via 'webrev -h'.
 #
 
-WEBREV_UPDATED=23.18-hg+jbs
+WEBREV_UPDATED=24.0-hg+jbs
 
 HTML='
 &2
+      echo "Created changeset: $CHANGESETPATH" 1>&2
       # Use it in place of the jdk.patch created above
       rm -f $WDIR/$WNAME.patch
     fi

From 88e1b692236cf5b4a6bba79ebfae1b6d3b19db6c Mon Sep 17 00:00:00 2001
From: Mandy Chung 
Date: Tue, 16 Apr 2013 22:11:33 -0700
Subject: [PATCH 23/37] 8010117: Annotate jdk caller sensitive methods with
 @sun.reflect.CallerSensitive

Reviewed-by: jrose, alanb, twisti, sundar
---
 .../scripting/NashornScriptEngineFactory.java | 40 ++-----------------
 .../jdk/nashorn/internal/runtime/Context.java |  4 +-
 2 files changed, 7 insertions(+), 37 deletions(-)

diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java
index e38284da99e..1ca6dcdd4b3 100644
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java
@@ -210,42 +210,10 @@ public final class NashornScriptEngineFactory implements ScriptEngineFactory {
     }
 
     private static ClassLoader getAppClassLoader() {
-        if (System.getSecurityManager() == null) {
-            return Thread.currentThread().getContextClassLoader();
-        }
-
-        // Try to determine the caller class loader. Use that if it can be
-        // found. If not, use the class loader of nashorn itself as the
-        // "application" class loader for scripts.
-
-        // User could have called ScriptEngineFactory.getScriptEngine()
-        //
-        // 
-        //  
-        //   
-        //    
-        //
-        // or used one of the getEngineByABC methods of ScriptEngineManager.
-        //
-        // 
-        //  
-        //   
-        //    
-        //     
-
-        // So, stack depth is 3 or 4 (recall it is zero based). We try
-        // stack depths 3, 4 and look for non-bootstrap caller.
-        Class caller = null;
-        for (int depth = 3; depth < 5; depth++) {
-            caller = Reflection.getCallerClass(depth);
-            if (caller != null && caller.getClassLoader() != null) {
-                // found a non-bootstrap caller
-                break;
-            }
-        }
-
-        final ClassLoader ccl = (caller == null)? null : caller.getClassLoader();
-        // if caller loader is null, then use nashorn's own loader
+        // Revisit: script engine implementation needs the capability to
+        // find the class loader of the context in which the script engine
+        // is running so that classes will be found and loaded properly
+        ClassLoader ccl = Thread.currentThread().getContextClassLoader();
         return (ccl == null)? NashornScriptEngineFactory.class.getClassLoader() : ccl;
     }
 }
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Context.java b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
index 448df143c24..6a7276154dd 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
@@ -56,6 +56,7 @@ import jdk.nashorn.internal.ir.debug.PrintVisitor;
 import jdk.nashorn.internal.parser.Parser;
 import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
 import jdk.nashorn.internal.runtime.options.Options;
+import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 
 /**
@@ -113,11 +114,12 @@ public final class Context {
      * Get the current global scope
      * @return the current global scope
      */
+    @CallerSensitive
     public static ScriptObject getGlobal() {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             // skip getCallerClass and getGlobal and get to the real caller
-            Class caller = Reflection.getCallerClass(2);
+            Class caller = Reflection.getCallerClass();
             ClassLoader callerLoader = caller.getClassLoader();
 
             // Allow this method only for nashorn's own classes, objects

From 0e9ad4439af67f7d8a30815faa787532bb865c7b Mon Sep 17 00:00:00 2001
From: Vicente Romero 
Date: Wed, 17 Apr 2013 11:11:33 +0100
Subject: [PATCH 24/37] 8011181: javac, empty UTF8 entry generated for inner
 class

Reviewed-by: jjg
---
 .../com/sun/tools/javac/jvm/ClassWriter.java  |  3 +-
 .../EmptyUTF8ForInnerClassNameTest.java       | 81 +++++++++++++++++++
 2 files changed, 83 insertions(+), 1 deletion(-)
 create mode 100644 langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java

diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
index 178350cf90d..5ce323b0e94 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
@@ -1016,7 +1016,8 @@ public class ClassWriter extends ClassFile {
 //          log.errWriter.println("enter inner " + c);//DEBUG
             enterInner(c.owner.enclClass());
             pool.put(c);
-            pool.put(c.name);
+            if (c.name != names.empty)
+                pool.put(c.name);
             if (innerClasses == null) {
                 innerClasses = new HashSet();
                 innerClassesQueue = new ListBuffer();
diff --git a/langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java b/langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java
new file mode 100644
index 00000000000..27adb3c6d71
--- /dev/null
+++ b/langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011181
+ * @summary javac, empty UTF8 entry generated for inner class
+ */
+
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.classfile.ClassFile;
+
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8;
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8_info;
+import static com.sun.tools.classfile.ConstantPool.CPInfo;
+
+public class EmptyUTF8ForInnerClassNameTest {
+
+    public static void main(String[] args) throws Exception {
+        new EmptyUTF8ForInnerClassNameTest().run();
+    }
+
+    void run() throws Exception {
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$1.class"));
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$EnumPlusSwitch.class"));
+    }
+
+    void checkClassFile(final Path path) throws Exception {
+        ClassFile classFile = ClassFile.read(
+                new BufferedInputStream(Files.newInputStream(path)));
+        for (CPInfo cpInfo : classFile.constant_pool.entries()) {
+            if (cpInfo.getTag() == CONSTANT_Utf8) {
+                CONSTANT_Utf8_info utf8Info = (CONSTANT_Utf8_info)cpInfo;
+                Assert.check(utf8Info.value.length() > 0,
+                        "UTF8 with length 0 found at class " + classFile.getName());
+            }
+        }
+    }
+
+    static class EnumPlusSwitch {
+        enum E {E1}
+
+        public int m (E e) {
+            switch (e) {
+                case E1:
+                    return 0;
+            }
+            return -1;
+        }
+    }
+
+}

From af106dbe5629ed324f9296d25c43979e40a46d6d Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:04 -0700
Subject: [PATCH 25/37] Added tag jdk8-b86 for changeset 02ed1673d56f

---
 .hgtags-top-repo | 1 +
 1 file changed, 1 insertion(+)

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

From 146af42db6a24a4833beb5c53415ceb30026e68a Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:06 -0700
Subject: [PATCH 26/37] Added tag jdk8-b86 for changeset ec149fe77498

---
 corba/.hgtags | 1 +
 1 file changed, 1 insertion(+)

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

From 28c4fc4666e548e0e18b616bc8fadcf290890e05 Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:11 -0700
Subject: [PATCH 27/37] Added tag jdk8-b86 for changeset b1cf5aefa461

---
 hotspot/.hgtags | 1 +
 1 file changed, 1 insertion(+)

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

From 1026125334d856295555673cd110269a8578763a Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:19 -0700
Subject: [PATCH 28/37] Added tag jdk8-b86 for changeset 6733de0488b4

---
 jaxp/.hgtags | 1 +
 1 file changed, 1 insertion(+)

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

From da15ff63ad8e9a78c6f88cae6a6acbb29380f0c7 Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:21 -0700
Subject: [PATCH 29/37] Added tag jdk8-b86 for changeset 41918e176381

---
 jaxws/.hgtags | 1 +
 1 file changed, 1 insertion(+)

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

From b88db650119f6e9c912c5584c2876a7a81e2e383 Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:32 -0700
Subject: [PATCH 30/37] Added tag jdk8-b86 for changeset 29071bf3de15

---
 langtools/.hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/langtools/.hgtags b/langtools/.hgtags
index 13976a389f0..c2d0fcb8c8a 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -207,3 +207,4 @@ ed69d087fdfd394491657a28ba9bc58e7849b7db jdk8-b81
 22ba3f92d4ae43bbc19793e854171cae2586f644 jdk8-b83
 cfb65ca92082b2412aed66c8422c2466bde544ef jdk8-b84
 4a48f31735349782ad13980267358c97076adc66 jdk8-b85
+6ab578e141dfd17c4dc03869bb204aafa490c9f4 jdk8-b86

From c00ad9959faeb8f6e2fe004bd91fe2a56f6890cd Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 18 Apr 2013 10:30:34 -0700
Subject: [PATCH 31/37] Added tag jdk8-b86 for changeset 6ee429aebbde

---
 nashorn/.hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index e8096319e89..6f149c63938 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -195,3 +195,4 @@ b8a1b238c77c7c00024daaa2cb7d10838e017b5f jdk8-b69
 053d7c55dc8272b58b8bb870dc92a4acf896d52a jdk8-b83
 999cc1bf55203f51b2985feae6378932667ecff2 jdk8-b84
 e0378f0a50dafdcfb7b04f6401d320f89884baa1 jdk8-b85
+002ad9d6735f36d1204e133324c73058c8abb1b0 jdk8-b86

From 05f3d6ab4ba47dce9509d374d134caf909f9de32 Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Tue, 23 Apr 2013 18:25:52 -0700
Subject: [PATCH 32/37] 8012643: JDK8 b86 source with GPL header errors

Reviewed-by: dholmes, alanb
---
 jdk/test/java/lang/Runtime/exec/WinCommand.java              | 2 +-
 jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/jdk/test/java/lang/Runtime/exec/WinCommand.java b/jdk/test/java/lang/Runtime/exec/WinCommand.java
index 6d34a1e433c..1504c891eab 100644
--- a/jdk/test/java/lang/Runtime/exec/WinCommand.java
+++ b/jdk/test/java/lang/Runtime/exec/WinCommand.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
diff --git a/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java b/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java
index f05dd023f9a..99ecd24b221 100644
--- a/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java
+++ b/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * 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

From 8b7ccb804f4d5c009ac5ac7065eeaa7ecc9d135e Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Tue, 23 Apr 2013 18:33:20 -0700
Subject: [PATCH 33/37] 8012643: JDK8 b86 source with GPL header errors

Reviewed-by: dholmes, alanb
---
 .../internal/api/EnvelopeStyle.java           | 51 +++++++-----------
 .../internal/api/EnvelopeStyleFeature.java    | 51 +++++++-----------
 .../internal/api/databinding/Databinding.java | 51 +++++++-----------
 .../api/databinding/DatabindingFactory.java   | 51 +++++++-----------
 .../api/databinding/DatabindingMode.java      | 51 +++++++-----------
 .../databinding/DatabindingModeFeature.java   | 51 +++++++-----------
 .../databinding/ExternalMetadataFeature.java  | 51 +++++++-----------
 .../api/databinding/JavaCallInfo.java         | 51 +++++++-----------
 .../api/databinding/WSDLGenerator.java        | 51 +++++++-----------
 .../api/databinding/WSDLResolver.java         | 51 +++++++-----------
 .../message/BaseDistributedPropertySet.java   | 52 +++++++------------
 .../internal/api/message/BasePropertySet.java | 51 +++++++-----------
 .../internal/api/message/ContentType.java     | 51 +++++++-----------
 .../api/message/DistributedPropertySet.java   | 51 +++++++-----------
 .../internal/api/message/MessageContext.java  | 51 +++++++-----------
 .../api/message/MessageContextFactory.java    | 51 +++++++-----------
 .../internal/api/message/PropertySet.java     | 51 +++++++-----------
 .../message/ReadOnlyPropertyException.java    | 51 +++++++-----------
 .../impl/encoding/StreamDecoderImpl.java      | 52 +++++++------------
 .../internalspi/encoding/StreamDecoder.java   | 51 +++++++-----------
 .../ExistingAnnotationsType.java              | 51 +++++++-----------
 .../jaxws_databinding/JavaMethod.java         | 51 +++++++-----------
 .../jaxws_databinding/JavaParam.java          | 52 +++++++------------
 .../JavaWsdlMappingType.java                  | 52 +++++++------------
 .../jaxws_databinding/ObjectFactory.java      | 51 +++++++-----------
 .../SoapBindingParameterStyle.java            | 52 +++++++------------
 .../jaxws_databinding/SoapBindingStyle.java   | 52 +++++++------------
 .../jaxws_databinding/SoapBindingUse.java     | 52 +++++++------------
 .../webservices/jaxws_databinding/Util.java   | 51 +++++++-----------
 .../jaxws_databinding/WebParamMode.java       | 52 +++++++------------
 .../jaxws_databinding/XmlAction.java          | 51 +++++++-----------
 .../jaxws_databinding/XmlAddressing.java      | 52 +++++++------------
 .../jaxws_databinding/XmlBindingType.java     | 52 +++++++------------
 .../jaxws_databinding/XmlFaultAction.java     | 51 +++++++-----------
 .../jaxws_databinding/XmlHandlerChain.java    | 52 +++++++------------
 .../jaxws_databinding/XmlMTOM.java            | 52 +++++++------------
 .../jaxws_databinding/XmlOneway.java          | 51 +++++++-----------
 .../jaxws_databinding/XmlRequestWrapper.java  | 51 +++++++-----------
 .../jaxws_databinding/XmlResponseWrapper.java | 52 +++++++------------
 .../jaxws_databinding/XmlSOAPBinding.java     | 52 +++++++------------
 .../jaxws_databinding/XmlServiceMode.java     | 52 +++++++------------
 .../jaxws_databinding/XmlWebEndpoint.java     | 52 +++++++------------
 .../jaxws_databinding/XmlWebFault.java        | 52 +++++++------------
 .../jaxws_databinding/XmlWebMethod.java       | 51 +++++++-----------
 .../jaxws_databinding/XmlWebParam.java        | 52 +++++++------------
 .../jaxws_databinding/XmlWebResult.java       | 52 +++++++------------
 .../jaxws_databinding/XmlWebService.java      | 52 +++++++------------
 .../XmlWebServiceClient.java                  | 52 +++++++------------
 .../XmlWebServiceProvider.java                | 52 +++++++------------
 .../jaxws_databinding/XmlWebServiceRef.java   | 52 +++++++------------
 .../jaxws_databinding/package-info.java       | 52 +++++++------------
 51 files changed, 940 insertions(+), 1685 deletions(-)

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

From 03a7499322544d8c3e48cd3b0c23d864e545bee2 Mon Sep 17 00:00:00 2001
From: Sean Mullan 
Date: Thu, 25 Apr 2013 11:18:29 -0400
Subject: [PATCH 34/37] 8011313: OCSP timeout set to wrong value if
 com.sun.security.ocsp.timeout not defined

Reviewed-by: vinnie
---
 .../classes/sun/security/provider/certpath/OCSP.java     | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java
index 03c910b8897..ca82ef598a0 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -85,10 +85,9 @@ public final class OCSP {
      * value is negative, set the timeout length to the default.
      */
     private static int initializeTimeout() {
-        int tmp = java.security.AccessController.doPrivileged(
-                new GetIntegerAction("com.sun.security.ocsp.timeout",
-                                     DEFAULT_CONNECT_TIMEOUT));
-        if (tmp < 0) {
+        Integer tmp = java.security.AccessController.doPrivileged(
+                new GetIntegerAction("com.sun.security.ocsp.timeout"));
+        if (tmp == null || tmp < 0) {
             return DEFAULT_CONNECT_TIMEOUT;
         }
         // Convert to milliseconds, as the system property will be

From 72f0064b92601af364469169cc6119b303f222fa Mon Sep 17 00:00:00 2001
From: "J. Duke" 
Date: Wed, 5 Jul 2017 18:50:43 +0200
Subject: [PATCH 35/37] Added tag jdk8-b86 for changeset da9a4c931281

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

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

From a664982c79afd9687aa5b598e889c15127e0fa78 Mon Sep 17 00:00:00 2001
From: David Katleman 
Date: Thu, 25 Apr 2013 09:24:24 -0700
Subject: [PATCH 36/37] Added tag jdk8-b87 for changeset 2871326c0383

---
 jdk/.hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/jdk/.hgtags b/jdk/.hgtags
index cc1dd780285..1c4e24bef66 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -208,3 +208,4 @@ ac519af51769e92c51b597a730974e8607357709 jdk8-b83
 7b4721e4edb4e1c65e9c839a70d7cc67f81c7632 jdk8-b84
 296676d534c52888c36e305a2bf7f345c4ca70f8 jdk8-b85
 7989cd0cc3a9149864589438ee2c949015d8aa9a jdk8-b86
+d5228e624826a10ccc5b05f30ad8d839b58fe48d jdk8-b87

From a618ff7cf99fbc932ca148458ea3bc8bd70c2e1c Mon Sep 17 00:00:00 2001
From: Sean Mullan 
Date: Thu, 25 Apr 2013 15:48:11 -0400
Subject: [PATCH 37/37] 8013228: Create new system properties to control
 allowable OCSP clock skew and CRL connection timeout

Reviewed-by: vinnie
---
 .../provider/certpath/CertPathHelper.java     |  2 +-
 .../certpath/DistributionPointFetcher.java    | 17 +++++-----
 .../provider/certpath/OCSPResponse.java       | 31 ++++++++++++++++---
 .../provider/certpath/URICertStore.java       | 31 ++++++++++++++++++-
 4 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java b/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
index 517e91167ee..bd3a34281ba 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
@@ -64,7 +64,7 @@ public abstract class CertPathHelper {
         instance.implSetPathToNames(sel, names);
     }
 
-    static void setDateAndTime(X509CRLSelector sel, Date date, long skew) {
+    public static void setDateAndTime(X509CRLSelector sel, Date date, long skew) {
         instance.implSetDateAndTime(sel, date, skew);
     }
 }
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
index ab784524546..bee12e43bee 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
@@ -50,7 +50,7 @@ import sun.security.x509.*;
  * @author Sean Mullan
  * @since 1.4.2
  */
-class DistributionPointFetcher {
+public class DistributionPointFetcher {
 
     private static final Debug debug = Debug.getInstance("certpath");
 
@@ -66,13 +66,14 @@ class DistributionPointFetcher {
      * Return the X509CRLs matching this selector. The selector must be
      * an X509CRLSelector with certificateChecking set.
      */
-    static Collection getCRLs(X509CRLSelector selector,
-                                       boolean signFlag, PublicKey prevKey,
-                                       String provider,
-                                       List certStores,
-                                       boolean[] reasonsMask,
-                                       Set trustAnchors,
-                                       Date validity)
+    public static Collection getCRLs(X509CRLSelector selector,
+                                              boolean signFlag,
+                                              PublicKey prevKey,
+                                              String provider,
+                                              List certStores,
+                                              boolean[] reasonsMask,
+                                              Set trustAnchors,
+                                              Date validity)
         throws CertStoreException
     {
         X509Certificate cert = selector.getCertificateChecking();
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
index 78802bf79bd..2cd437dc263 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@ import java.util.Map;
 import javax.security.auth.x500.X500Principal;
 
 import sun.misc.HexDumpEncoder;
+import sun.security.action.GetIntegerAction;
 import sun.security.x509.*;
 import sun.security.util.*;
 
@@ -144,9 +145,31 @@ public final class OCSPResponse {
     // Object identifier for the OCSPSigning key purpose
     private static final String KP_OCSP_SIGNING_OID = "1.3.6.1.5.5.7.3.9";
 
-    // Maximum clock skew in milliseconds (15 minutes) allowed when checking
-    // validity of OCSP responses
-    private static final long MAX_CLOCK_SKEW = 900000;
+    // Default maximum clock skew in milliseconds (15 minutes)
+    // allowed when checking validity of OCSP responses
+    private static final int DEFAULT_MAX_CLOCK_SKEW = 900000;
+
+    /**
+     * Integer value indicating the maximum allowable clock skew, in seconds,
+     * to be used for the OCSP check.
+     */
+    private static final int MAX_CLOCK_SKEW = initializeClockSkew();
+
+    /**
+     * Initialize the maximum allowable clock skew by getting the OCSP
+     * clock skew system property. If the property has not been set, or if its
+     * value is negative, set the skew to the default.
+     */
+    private static int initializeClockSkew() {
+        Integer tmp = java.security.AccessController.doPrivileged(
+                new GetIntegerAction("com.sun.security.ocsp.clockSkew"));
+        if (tmp == null || tmp < 0) {
+            return DEFAULT_MAX_CLOCK_SKEW;
+        }
+        // Convert to milliseconds, as the system property will be
+        // specified in seconds
+        return tmp * 1000;
+    }
 
     // an array of all of the CRLReasons (used in SingleResponse)
     private static CRLReason[] values = CRLReason.values();
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java b/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
index 33694ab51fb..a5ec5d36e8d 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -51,6 +51,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
+import sun.security.action.GetIntegerAction;
 import sun.security.x509.AccessDescription;
 import sun.security.x509.GeneralNameInterface;
 import sun.security.x509.URIName;
@@ -121,6 +122,33 @@ class URICertStore extends CertStoreSpi {
     private CertStore ldapCertStore;
     private String ldapPath;
 
+    // Default maximum connect timeout in milliseconds (15 seconds)
+    // allowed when downloading CRLs
+    private static final int DEFAULT_CRL_CONNECT_TIMEOUT = 15000;
+
+    /**
+     * Integer value indicating the connect timeout, in seconds, to be
+     * used for the CRL download. A timeout of zero is interpreted as
+     * an infinite timeout.
+     */
+    private static final int CRL_CONNECT_TIMEOUT = initializeTimeout();
+
+    /**
+     * Initialize the timeout length by getting the CRL timeout
+     * system property. If the property has not been set, or if its
+     * value is negative, set the timeout length to the default.
+     */
+    private static int initializeTimeout() {
+        Integer tmp = java.security.AccessController.doPrivileged(
+                new GetIntegerAction("com.sun.security.crl.timeout"));
+        if (tmp == null || tmp < 0) {
+            return DEFAULT_CRL_CONNECT_TIMEOUT;
+        }
+        // Convert to milliseconds, as the system property will be
+        // specified in seconds
+        return tmp * 1000;
+    }
+
     /**
      * Creates a URICertStore.
      *
@@ -364,6 +392,7 @@ class URICertStore extends CertStoreSpi {
                 connection.setIfModifiedSince(lastModified);
             }
             long oldLastModified = lastModified;
+            connection.setConnectTimeout(CRL_CONNECT_TIMEOUT);
             try (InputStream in = connection.getInputStream()) {
                 lastModified = connection.getLastModified();
                 if (oldLastModified != 0) {