/hg/release/icedtea7-forest-2.3/jaxp: 6657673: Issues with JAXP
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Tue Apr 16 14:16:12 PDT 2013
changeset d2142901bcb7 in /hg/release/icedtea7-forest-2.3/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jaxp?cmd=changeset;node=d2142901bcb7
author: joehw
date: Sat Feb 16 18:03:23 2013 -0800
6657673: Issues with JAXP
Reviewed-by: alanb, lancea, ahgross, mullan
diffstat:
src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java | 6 +-
src/com/sun/org/apache/bcel/internal/util/Class2HTML.java | 3 +-
src/com/sun/org/apache/bcel/internal/util/ClassPath.java | 20 +-
src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java | 3 +-
src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java | 223 ++++++++++
src/com/sun/org/apache/xalan/internal/res/XSLMessages.java | 106 ++--
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java | 63 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java | 64 --
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java | 64 --
src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java | 11 +-
src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java | 98 +++-
src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java | 11 +-
src/com/sun/org/apache/xalan/internal/xslt/Process.java | 3 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java | 10 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java | 14 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java | 7 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java | 16 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java | 3 +-
src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java | 3 +-
src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java | 3 +-
src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java | 3 +-
src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java | 12 +
src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java | 14 +-
src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java | 15 +-
src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java | 63 +--
src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java | 4 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java | 11 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java | 7 +-
src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java | 5 +-
src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java | 9 +-
src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java | 7 +-
src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java | 7 +-
src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java | 7 +-
src/com/sun/org/apache/xerces/internal/util/SecurityManager.java | 70 +-
src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java | 13 +-
src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java | 36 +
src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java | 9 +-
src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java | 8 +-
src/com/sun/org/apache/xml/internal/dtm/DTMManager.java | 3 +-
src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java | 67 ---
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java | 66 --
src/com/sun/org/apache/xml/internal/res/XMLMessages.java | 65 +--
src/com/sun/org/apache/xml/internal/resolver/Catalog.java | 5 +-
src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java | 17 +-
src/com/sun/org/apache/xml/internal/resolver/Resolver.java | 5 +-
src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java | 3 +-
src/com/sun/org/apache/xml/internal/serializer/Encodings.java | 4 +-
src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java | 5 +-
src/com/sun/org/apache/xml/internal/serializer/ToStream.java | 3 +-
src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java | 5 +-
src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java | 100 +----
src/com/sun/org/apache/xml/internal/utils/TreeWalker.java | 7 +-
src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java | 141 +----
src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java | 7 +-
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java | 67 ---
src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java | 216 ++++----
src/com/sun/xml/internal/stream/XMLEntityStorage.java | 3 +-
src/com/sun/xml/internal/stream/writers/WriterUtility.java | 3 +-
src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java | 3 +-
src/javax/xml/datatype/FactoryFinder.java | 62 ++-
src/javax/xml/parsers/FactoryFinder.java | 10 +-
src/javax/xml/stream/FactoryFinder.java | 77 ++-
src/javax/xml/transform/FactoryFinder.java | 11 +-
src/javax/xml/validation/SchemaFactoryFinder.java | 43 +-
src/javax/xml/xpath/XPathFactoryFinder.java | 30 +-
src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java | 13 +-
src/org/xml/sax/helpers/NewInstance.java | 38 +-
src/org/xml/sax/helpers/ParserAdapter.java | 5 +-
src/org/xml/sax/helpers/ParserFactory.java | 13 +-
src/org/xml/sax/helpers/SecuritySupport.java | 108 ++++
src/org/xml/sax/helpers/XMLReaderFactory.java | 62 +-
111 files changed, 1139 insertions(+), 3262 deletions(-)
diffs (truncated from 6942 to 500 lines):
diff -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
--- a/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java Fri Mar 08 16:04:36 2013 +0000
+++ b/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java Sat Feb 16 18:03:23 2013 -0800
@@ -63,6 +63,7 @@
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 @@
* class file. Those interested in programatically generating classes
* should see the <a href="../generic/ClassGen.html">ClassGen</a> 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 <A HREF="mailto:markus.dahm at berlin.de">M. Dahm</A>
*/
@@ -451,9 +453,9 @@
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 -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
--- a/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java Fri Mar 08 16:04:36 2013 +0000
+++ b/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java Sat Feb 16 18:03:23 2013 -0800
@@ -82,6 +82,7 @@
* 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 <A HREF="mailto:markus.dahm at berlin.de">M. Dahm</A>
*/
public class Class2HTML implements Constants
@@ -137,7 +138,7 @@
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 -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/bcel/internal/util/ClassPath.java
--- a/src/com/sun/org/apache/bcel/internal/util/ClassPath.java Fri Mar 08 16:04:36 2013 +0000
+++ b/src/com/sun/org/apache/bcel/internal/util/ClassPath.java Sat Feb 16 18:03:23 2013 -0800
@@ -66,6 +66,7 @@
* 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 <A HREF="mailto:markus.dahm at berlin.de">M. Dahm</A>
*/
public class ClassPath implements Serializable {
@@ -83,7 +84,7 @@
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 @@
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 @@
String name = tok.nextToken();
File file = new File(name);
- if(file.exists())
+ if(SecuritySupport.getFileExists(file)) {
list.add(name);
+ }
}
}
}
@@ -159,9 +161,9 @@
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 @@
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 @@
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 -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
--- a/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java Fri Mar 08 16:04:36 2013 +0000
+++ b/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java Sat Feb 16 18:03:23 2013 -0800
@@ -72,6 +72,7 @@
* <pre>java com.sun.org.apache.bcel.internal.util.JavaWrapper -Dbcel.classloader=foo.MyLoader <real.class.name> [arguments]</pre>
* </p>
*
+ * @version $Id: JavaWrapper.java,v 1.3 2007-07-19 04:34:52 ofung Exp $
* @author <A HREF="mailto:markus.dahm at berlin.de">M. Dahm</A>
* @see ClassLoader
*/
@@ -79,7 +80,7 @@
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 -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java Sat Feb 16 18:03:23 2013 -0800
@@ -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<ListResourceBundle>() {
+ 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 -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
--- a/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java Fri Mar 08 16:04:36 2013 +0000
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java Sat Feb 16 18:03:23 2013 -0800
@@ -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 String createMessage(String msgKey, Object args[]) //throws Exception
+ {
+ if (XSLTBundle == null) {
+ XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
+ }
- /**
- * 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) {
+ return createMsg(XSLTBundle, msgKey, args);
+ } else {
+ return "Could not load any resource bundles.";
+ }
+ }
- 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.";
- }
-
- /**
- * 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)
- {
- return createMsg(XSLTBundle, msgKey, args);
- }
- else
- return "Could not load any resource bundles.";
- }
}
diff -r a2c49387365b -r d2142901bcb7 src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java Fri Mar 08 16:04:36 2013 +0000
More information about the distro-pkg-dev
mailing list