incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1214860 - in /incubator/odf/trunk: validator/pom.xml xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java
Date Thu, 15 Dec 2011 16:57:22 GMT
Author: devinhan
Date: Thu Dec 15 16:57:22 2011
New Revision: 1214860

URL: http://svn.apache.org/viewvc?rev=1214860&view=rev
Log:
#ODFTOOLKIT-298# XLST-Runner and Validator aren't compatible with Java 5. [Developer:Robert
Wire,Devin]

Modified:
    incubator/odf/trunk/validator/pom.xml
    incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java
    incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java

Modified: incubator/odf/trunk/validator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/pom.xml?rev=1214860&r1=1214859&r2=1214860&view=diff
==============================================================================
--- incubator/odf/trunk/validator/pom.xml (original)
+++ incubator/odf/trunk/validator/pom.xml Thu Dec 15 16:57:22 2011
@@ -236,8 +236,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>2.3.2</version>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.5</source>
+                    <target>1.5</target>
                     <meminitial>512m</meminitial>
                     <maxmem>1024m</maxmem>
                     <showDeprecation>true</showDeprecation>

Modified: incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java?rev=1214860&r1=1214859&r2=1214860&view=diff
==============================================================================
--- incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java
(original)
+++ incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFURIResolver.java
Thu Dec 15 16:57:22 2011
@@ -63,7 +63,7 @@ class ODFURIResolver implements URIResol
         if( aBase.startsWith(m_aPackageBase) &&
             !aHRef.contains(":") && !aHRef.startsWith("/") )
         {
-            if( aHRef.isEmpty())
+            if( aHRef.length()==0)
             {
                 try
                 {

Modified: incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java?rev=1214860&r1=1214859&r2=1214860&view=diff
==============================================================================
--- incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java
(original)
+++ incubator/odf/trunk/xslt-runner/src/main/java/org/odftoolkit/odfxsltrunner/ODFXSLTRunner.java
Thu Dec 15 16:57:22 2011
@@ -315,9 +315,37 @@ public class ODFXSLTRunner {
 
         if( aTransformerFactoryClassName!=null )
             aLogger.logInfo( "Requesting transformer factory class: " + aTransformerFactoryClassName
);
-        TransformerFactory aFactory =
-                aTransformerFactoryClassName==null ? TransformerFactory.newInstance()
-                    : TransformerFactory.newInstance( aTransformerFactoryClassName, null
);
+		TransformerFactory aFactory = null;
+		if(aTransformerFactoryClassName==null)
+		{
+			aFactory = TransformerFactory.newInstance();
+		}
+		else
+		{
+		  try
+		  {
+			ClassLoader cl = Thread.currentThread().getContextClassLoader();
+            if (cl == null)
+                cl = ClassLoader.getSystemClassLoader();
+            Class classInstance = cl.loadClass(aTransformerFactoryClassName);
+			aFactory = (TransformerFactory)classInstance.newInstance();
+		  }
+		  catch( ClassNotFoundException ce )
+          {
+            aLogger.logFatalError(ce.getMessage());
+            return true;            
+          }
+		  catch( InstantiationException ie )
+          {
+            aLogger.logFatalError(ie.getMessage());
+            return true;            
+          }
+		  catch( IllegalAccessException ile )
+          {
+            aLogger.logFatalError(ile.getMessage());
+            return true;            
+          }
+		}
         ErrorListener aErrorListener = new TransformerErrorListener( aLogger );
         aLogger.logInfo( "Using transformer factory class: " + aFactory.getClass().getName()
);
         aFactory.setErrorListener(aErrorListener);



Mime
View raw message