You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/01/07 04:47:08 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/extensions ExtensionsTable.java
sboag 01/01/06 19:47:08
Modified: java/src/org/apache/xalan/extensions ExtensionsTable.java
Log:
Defend against empty class name, which showed up because
JDK 1.8 throws an illegalArgumentException. Probably more
defensive than it needs to be, Gary may want to restructure this
a bit. Addresses SPR ID#: SCUU4SPUV3
New SPR / Sev: 1 / JDK 1.1.8 only: extend01.xsl throws TransformerException...transformNode()
(The previous commit that listed this was an error,
that commit addressed SCUU4SPUXC).
Revision Changes Path
1.14 +9 -1 xml-xalan/java/src/org/apache/xalan/extensions/ExtensionsTable.java
Index: ExtensionsTable.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionsTable.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ExtensionsTable.java 2001/01/02 03:36:34 1.13
+++ ExtensionsTable.java 2001/01/07 03:47:08 1.14
@@ -289,13 +289,16 @@
/**
* Declare the appropriate java extension handler.
* @param ns the URI of namespace in which the function is needed
- * @return an ExtensionHandler for this namespace
+ * @return an ExtensionHandler for this namespace, or null if
+ * not found.
*
* @throws javax.xml.transform.TransformerException
*/
public ExtensionHandler makeJavaNamespace(String ns)
throws javax.xml.transform.TransformerException
{
+ if(null == ns || ns.trim().length() == 0) // defensive. I don't think it's needed. -sb
+ return null;
// First, prepare the name of the actual class or package. We strip
// out any leading "class:". Next, we see if there is a /. If so,
@@ -314,6 +317,11 @@
if (-1 != lastSlash)
className = className.substring(lastSlash + 1);
+
+ // The className can be null here, and can cause an error in getClassForName
+ // in JDK 1.8.
+ if(null == className || className.trim().length() == 0)
+ return null;
try
{