You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pi...@locus.apache.org on 2000/02/27 20:21:24 UTC
cvs commit: xml-xerces/java/src/javax/xml/parsers DocumentBuilderFactory.java SAXParserFactory.java
pier 00/02/27 11:21:24
Modified: java/src/javax/xml/parsers DocumentBuilderFactory.java
SAXParserFactory.java
Log:
Removed class loading mechanism requiring JDK 1.2
Revision Changes Path
1.2 +3 -18 xml-xerces/java/src/javax/xml/parsers/DocumentBuilderFactory.java
Index: DocumentBuilderFactory.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/DocumentBuilderFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DocumentBuilderFactory.java 2000/02/26 05:56:30 1.1
+++ DocumentBuilderFactory.java 2000/02/27 19:21:23 1.2
@@ -61,7 +61,7 @@
* @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
* @author Copyright © 1999-2000, Pierpaolo Fumagalli
* <a href="mailto:pier@betaversion.org">pier@betaversion.org</a>
- * @version 1.0 CVS $Revision: 1.1 $ $Date: 2000/02/26 05:56:30 $
+ * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/02/27 19:21:23 $
*/
public abstract class DocumentBuilderFactory {
@@ -106,27 +106,12 @@
*/
public static DocumentBuilderFactory newInstance() {
- // Evaluate wether we have to use or Class.forName() for JDK 1.1 or
- // Thread.currentThread().getContextClassLoader().loadClass() for
- // the new JDK 1.2
- boolean newPlatform=true;
- try {
- new ThreadLocal();
- } catch (NoClassDefFoundError t) {
- newPlatform=false;
- }
-
// Retrieve the javax.xml.parsers.DocumentBuilderFactory system property
String n=System.getProperty(property, factory);
try {
- // Attempt to load the factory class.
- Class c=null;
- if (!newPlatform) c=Class.forName(n);
- else c=Thread.currentThread().getContextClassLoader().loadClass(n);
-
- // Attempt to instantiate and return the factory class
- return (DocumentBuilderFactory)c.newInstance();
+ // Attempt to load, instantiate and return the factory class
+ return (DocumentBuilderFactory)Class.forName(n).newInstance();
} catch (ClassNotFoundException e) {
// The factory class was not found
1.2 +3 -18 xml-xerces/java/src/javax/xml/parsers/SAXParserFactory.java
Index: SAXParserFactory.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/SAXParserFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SAXParserFactory.java 2000/02/26 05:56:31 1.1
+++ SAXParserFactory.java 2000/02/27 19:21:23 1.2
@@ -63,7 +63,7 @@
* @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
* @author Copyright © 1999-2000, Pierpaolo Fumagalli
* <a href="mailto:pier@betaversion.org">pier@betaversion.org</a>
- * @version 1.0 CVS $Revision: 1.1 $ $Date: 2000/02/26 05:56:31 $
+ * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/02/27 19:21:23 $
*/
public abstract class SAXParserFactory {
@@ -106,27 +106,12 @@
*/
public static SAXParserFactory newInstance() {
- // Evaluate wether we have to use or Class.forName() for JDK 1.1 or
- // Thread.currentThread().getContextClassLoader().loadClass() for
- // the new JDK 1.2
- boolean newPlatform=true;
- try {
- new ThreadLocal();
- } catch (NoClassDefFoundError t) {
- newPlatform=false;
- }
-
// Retrieve the javax.xml.parsers.SAXParserFactory system property
String n=System.getProperty(property, factory);
try {
- // Attempt to load the factory class.
- Class c=null;
- if (!newPlatform) c=Class.forName(n);
- else c=Thread.currentThread().getContextClassLoader().loadClass(n);
-
- // Attempt to instantiate and return the factory class
- return (SAXParserFactory)c.newInstance();
+ // Attempt to load, instantiate and return the factory class
+ return (SAXParserFactory)Class.forName(n).newInstance();
} catch (ClassNotFoundException e) {
// The factory class was not found