author | thartmann |
Fri, 24 Aug 2018 08:17:23 +0200 | |
changeset 51514 | 1e332d63bd96 |
parent 48577 | 8dff65f1d611 |
permissions | -rw-r--r-- |
12005 | 1 |
/* |
45853
bfa06be36a17
8181154: Fix lint warnings in JAXP repo: deprecation
joehw
parents:
42806
diff
changeset
|
2 |
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
12005 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package javax.xml.transform; |
|
27 |
||
28 |
import java.io.File; |
|
12458 | 29 |
import java.lang.reflect.Method; |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
30 |
import java.lang.reflect.Modifier; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
31 |
import java.security.AccessController; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
32 |
import java.security.PrivilegedAction; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
33 |
import java.util.Iterator; |
12458 | 34 |
import java.util.Properties; |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
35 |
import java.util.ServiceConfigurationError; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
36 |
import java.util.ServiceLoader; |
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
37 |
import java.util.function.Supplier; |
47312 | 38 |
import jdk.xml.internal.SecuritySupport; |
12005 | 39 |
|
40 |
/** |
|
41 |
* <p>Implements pluggable Datatypes.</p> |
|
42 |
* |
|
43 |
* <p>This class is duplicated for each JAXP subpackage so keep it in |
|
44 |
* sync. It is package private for secure class loading.</p> |
|
45 |
* |
|
48412 | 46 |
* @author Santiago PericasGeertsen |
12005 | 47 |
*/ |
48 |
class FactoryFinder { |
|
16953 | 49 |
private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xalan.internal."; |
12005 | 50 |
|
51 |
/** |
|
52 |
* Internal debug flag. |
|
53 |
*/ |
|
54 |
private static boolean debug = false; |
|
55 |
||
56 |
/** |
|
27574 | 57 |
* Cache for properties in java.home/conf/jaxp.properties |
12005 | 58 |
*/ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
59 |
private final static Properties cacheProps = new Properties(); |
12005 | 60 |
|
61 |
/** |
|
27574 | 62 |
* Flag indicating if properties from java.home/conf/jaxp.properties |
12005 | 63 |
* have been cached. |
64 |
*/ |
|
12458 | 65 |
static volatile boolean firstTime = true; |
12005 | 66 |
|
67 |
// Define system property "jaxp.debug" to get output |
|
68 |
static { |
|
69 |
// Use try/catch block to support applets, which throws |
|
70 |
// SecurityException out of this code. |
|
71 |
try { |
|
47312 | 72 |
String val = SecuritySupport.getSystemProperty("jaxp.debug"); |
12005 | 73 |
// Allow simply setting the prop to turn on debug |
74 |
debug = val != null && !"false".equals(val); |
|
75 |
} |
|
76 |
catch (SecurityException se) { |
|
77 |
debug = false; |
|
78 |
} |
|
79 |
} |
|
80 |
||
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
81 |
private static void dPrint(Supplier<String> msgGen) { |
12005 | 82 |
if (debug) { |
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
83 |
System.err.println("JAXP: " + msgGen.get()); |
12005 | 84 |
} |
85 |
} |
|
86 |
||
87 |
/** |
|
88 |
* Attempt to load a class using the class loader supplied. If that fails |
|
89 |
* and fall back is enabled, the current (i.e. bootstrap) class loader is |
|
90 |
* tried. |
|
91 |
* |
|
92 |
* If the class loader supplied is <code>null</code>, first try using the |
|
93 |
* context class loader followed by the current (i.e. bootstrap) class |
|
94 |
* loader. |
|
12458 | 95 |
* |
96 |
* Use bootstrap classLoader if cl = null and useBSClsLoader is true |
|
12005 | 97 |
*/ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
98 |
static private Class<?> getProviderClass(String className, ClassLoader cl, |
12458 | 99 |
boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException |
12005 | 100 |
{ |
101 |
try { |
|
102 |
if (cl == null) { |
|
12458 | 103 |
if (useBSClsLoader) { |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
104 |
return Class.forName(className, false, FactoryFinder.class.getClassLoader()); |
12458 | 105 |
} else { |
47312 | 106 |
cl = SecuritySupport.getContextClassLoader(); |
12458 | 107 |
if (cl == null) { |
108 |
throw new ClassNotFoundException(); |
|
109 |
} |
|
110 |
else { |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
111 |
return Class.forName(className, false, cl); |
12458 | 112 |
} |
12005 | 113 |
} |
114 |
} |
|
115 |
else { |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
116 |
return Class.forName(className, false, cl); |
12005 | 117 |
} |
118 |
} |
|
119 |
catch (ClassNotFoundException e1) { |
|
120 |
if (doFallback) { |
|
121 |
// Use current class loader - should always be bootstrap CL |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
122 |
return Class.forName(className, false, FactoryFinder.class.getClassLoader()); |
12005 | 123 |
} |
124 |
else { |
|
125 |
throw e1; |
|
126 |
} |
|
127 |
} |
|
128 |
} |
|
129 |
||
130 |
/** |
|
131 |
* Create an instance of a class. Delegates to method |
|
132 |
* <code>getProviderClass()</code> in order to load the class. |
|
133 |
* |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
134 |
* @param type Base class / Service interface of the factory to |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
135 |
* instantiate. |
12458 | 136 |
* |
137 |
* @param className Name of the concrete class corresponding to the |
|
138 |
* service provider |
|
139 |
* |
|
140 |
* @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code> |
|
141 |
* current <code>Thread</code>'s context classLoader is used to load the factory class. |
|
142 |
* |
|
143 |
* @param doFallback True if the current ClassLoader should be tried as |
|
144 |
* a fallback if the class is not found using cl |
|
145 |
* |
|
48577 | 146 |
* @param overrideDefaultParser True to allow overriding the system-default |
147 |
* parser. |
|
12458 | 148 |
*/ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
149 |
static <T> T newInstance(Class<T> type, String className, ClassLoader cl, |
48577 | 150 |
boolean doFallback) |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
151 |
throws TransformerFactoryConfigurationError |
12458 | 152 |
{ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
153 |
assert type != null; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
154 |
|
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
155 |
boolean useBSClsLoader = false; |
16953 | 156 |
// make sure we have access to restricted packages |
157 |
if (System.getSecurityManager() != null) { |
|
158 |
if (className != null && className.startsWith(DEFAULT_PACKAGE)) { |
|
159 |
cl = null; |
|
160 |
useBSClsLoader = true; |
|
161 |
} |
|
162 |
} |
|
163 |
||
12005 | 164 |
try { |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
165 |
Class<?> providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
166 |
if (!type.isAssignableFrom(providerClass)) { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
167 |
throw new ClassCastException(className + " cannot be cast to " + type.getName()); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
168 |
} |
48577 | 169 |
Object instance = providerClass.getConstructor().newInstance(); |
170 |
||
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
171 |
final ClassLoader clD = cl; |
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
172 |
dPrint(()->"created new instance of " + providerClass + |
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
173 |
" using ClassLoader: " + clD); |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
174 |
return type.cast(instance); |
12005 | 175 |
} |
176 |
catch (ClassNotFoundException x) { |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
177 |
throw new TransformerFactoryConfigurationError(x, |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
178 |
"Provider " + className + " not found"); |
12005 | 179 |
} |
180 |
catch (Exception x) { |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
181 |
throw new TransformerFactoryConfigurationError(x, |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
182 |
"Provider " + className + " could not be instantiated: " + x); |
12005 | 183 |
} |
184 |
} |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
185 |
|
12458 | 186 |
/** |
12005 | 187 |
* Finds the implementation Class object in the specified order. Main |
188 |
* entry point. |
|
189 |
* @return Class object of factory, never null |
|
190 |
* |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
191 |
* @param type Base class / Service interface of the |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
192 |
* factory to find. |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
193 |
* |
12005 | 194 |
* @param fallbackClassName Implementation class name, if nothing else |
195 |
* is found. Use null to mean no fallback. |
|
196 |
* |
|
197 |
* Package private so this code can be shared. |
|
198 |
*/ |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
199 |
static <T> T find(Class<T> type, String fallbackClassName) |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
200 |
throws TransformerFactoryConfigurationError |
12005 | 201 |
{ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
202 |
assert type != null; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
203 |
|
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
204 |
final String factoryId = type.getName(); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
205 |
|
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
206 |
dPrint(()->"find factoryId =" + factoryId); |
12005 | 207 |
// Use the system property first |
208 |
try { |
|
47312 | 209 |
String systemProp = SecuritySupport.getSystemProperty(factoryId); |
12005 | 210 |
if (systemProp != null) { |
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
211 |
dPrint(()->"found system property, value=" + systemProp); |
48577 | 212 |
return newInstance(type, systemProp, null, true); |
12005 | 213 |
} |
214 |
} |
|
215 |
catch (SecurityException se) { |
|
216 |
if (debug) se.printStackTrace(); |
|
217 |
} |
|
218 |
||
27574 | 219 |
// try to read from $java.home/conf/jaxp.properties |
12005 | 220 |
try { |
221 |
if (firstTime) { |
|
222 |
synchronized (cacheProps) { |
|
223 |
if (firstTime) { |
|
47312 | 224 |
String configFile = SecuritySupport.getSystemProperty("java.home") + File.separator + |
27574 | 225 |
"conf" + File.separator + "jaxp.properties"; |
12005 | 226 |
File f = new File(configFile); |
227 |
firstTime = false; |
|
47312 | 228 |
if (SecuritySupport.doesFileExist(f)) { |
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
229 |
dPrint(()->"Read properties file "+f); |
47312 | 230 |
cacheProps.load(SecuritySupport.getFileInputStream(f)); |
12005 | 231 |
} |
232 |
} |
|
233 |
} |
|
234 |
} |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
235 |
final String factoryClassName = cacheProps.getProperty(factoryId); |
12005 | 236 |
|
237 |
if (factoryClassName != null) { |
|
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
238 |
dPrint(()->"found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName); |
48577 | 239 |
return newInstance(type, factoryClassName, null, true); |
12005 | 240 |
} |
241 |
} |
|
242 |
catch (Exception ex) { |
|
243 |
if (debug) ex.printStackTrace(); |
|
244 |
} |
|
245 |
||
246 |
// Try Jar Service Provider Mechanism |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
247 |
T provider = findServiceProvider(type); |
12005 | 248 |
if (provider != null) { |
249 |
return provider; |
|
250 |
} |
|
251 |
if (fallbackClassName == null) { |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
252 |
throw new TransformerFactoryConfigurationError(null, |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
253 |
"Provider for " + factoryId + " cannot be found"); |
12005 | 254 |
} |
255 |
||
42806
35843e3d5ef1
8146271: File system contention in debug print via XPathFactory.newInstance
aefimov
parents:
27574
diff
changeset
|
256 |
dPrint(()->"loaded from fallback value: " + fallbackClassName); |
48577 | 257 |
return newInstance(type, fallbackClassName, null, true); |
12005 | 258 |
} |
259 |
||
260 |
/* |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
261 |
* Try to find provider using the ServiceLoader. |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
262 |
* |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
263 |
* @param type Base class / Service interface of the factory to find. |
12005 | 264 |
* |
265 |
* @return instance of provider class if found or null |
|
266 |
*/ |
|
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
267 |
private static <T> T findServiceProvider(final Class<T> type) |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
268 |
throws TransformerFactoryConfigurationError |
12005 | 269 |
{ |
17264
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
270 |
try { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
271 |
return AccessController.doPrivileged(new PrivilegedAction<T>() { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
272 |
public T run() { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
273 |
final ServiceLoader<T> serviceLoader = ServiceLoader.load(type); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
274 |
final Iterator<T> iterator = serviceLoader.iterator(); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
275 |
if (iterator.hasNext()) { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
276 |
return iterator.next(); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
277 |
} else { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
278 |
return null; |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
279 |
} |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
280 |
} |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
281 |
}); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
282 |
} catch(ServiceConfigurationError e) { |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
283 |
// It is not possible to wrap an error directly in |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
284 |
// FactoryConfigurationError - so we need to wrap the |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
285 |
// ServiceConfigurationError in a RuntimeException. |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
286 |
// The alternative would be to modify the logic in |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
287 |
// FactoryConfigurationError to allow setting a |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
288 |
// Throwable as the cause, but that could cause |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
289 |
// compatibility issues down the road. |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
290 |
final RuntimeException x = new RuntimeException( |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
291 |
"Provider for " + type + " cannot be created", e); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
292 |
final TransformerFactoryConfigurationError error = |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
293 |
new TransformerFactoryConfigurationError(x, x.getMessage()); |
3aff554ad461
8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents:
16953
diff
changeset
|
294 |
throw error; |
12005 | 295 |
} |
296 |
} |
|
297 |
} |