aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraefimov <none@none>2015-07-23 13:27:39 +0300
committeraefimov <none@none>2015-07-23 13:27:39 +0300
commit517e8ed53d04649b36936d4eca4241d083d7c7b2 (patch)
treea8723a3e54dd325e3a21ce3efd1c628d2f5e9fb2 /src
parent9f6e4917ba2cf96143c757f84d03eac9fe3f49cf (diff)
downloadjdk8u_jaxp-517e8ed53d04649b36936d4eca4241d083d7c7b2.tar.gz
8131907: Numerous threads lock during XML processing while running Weblogic 12.1.3
Reviewed-by: rriggs, dfuchs, lancea
Diffstat (limited to 'src')
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
index 15afa2e..18fa395 100644
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
+++ b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
@@ -1,13 +1,13 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
- * Copyright 2001, 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
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
*
@@ -20,8 +20,10 @@
package com.sun.org.apache.xerces.internal.impl.dv;
-import java.util.Hashtable;
+import com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl;
+import com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl;
import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
+import java.util.Hashtable;
/**
* The factory to create and return DTD types. The implementation should
@@ -36,7 +38,11 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
*/
public abstract class DTDDVFactory {
- private static final String DEFAULT_FACTORY_CLASS = "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl";
+ private static final String DEFAULT_FACTORY_CLASS =
+ "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl";
+
+ private static final String XML11_DATATYPE_VALIDATOR_FACTORY =
+ "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
/**
* Get an instance of the default DTDDVFactory implementation.
@@ -59,9 +65,15 @@ public abstract class DTDDVFactory {
*/
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
try {
- // if the class name is not specified, use the default one
- return (DTDDVFactory)
- (ObjectFactory.newInstance(factoryClass, true));
+ if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
+ return new DTDDVFactoryImpl();
+ } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
+ return new XML11DTDDVFactoryImpl();
+ } else {
+ //fall back for compatibility
+ return (DTDDVFactory)
+ (ObjectFactory.newInstance(factoryClass, true));
+ }
}
catch (ClassCastException e) {
throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");