Author: dward
Date: 2010-06-07 16:01:19 -0400 (Mon, 07 Jun 2010)
New Revision: 33381
Modified:
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/XsltAction.java
Log:
Fix for JBESB-3330.
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/XsltAction.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/XsltAction.java 2010-06-07 18:45:03 UTC (rev 33380)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/XsltAction.java 2010-06-07 20:01:19 UTC (rev 33381)
@@ -442,9 +442,9 @@
/**
* Will try to extract and parse a configuration attribute named {@link ListenerTagNames#MAX_THREADS_TAG}
- * from the parent of the passed-in ConfigTree instance. If no parent exists, that is the ConfigTree
- * instance passed into this method is the root, then the same attribute is extracted and parsed
- * into an integer but from the config element.
+ * from the parent of the passed-in ConfigTree instance. If no parent exists (that is if the ConfigTree
+ * instance passed into this method is the root), or if the property is not defined on the parent, then
+ * the same attribute is extracted and parsed into an integer but from the config element.
*
* @param config The {@link ConfigTree} instance.
* @return int The parsed value the {@link ListenerTagNames#MAX_THREADS_TAG} configuration attribute
@@ -456,10 +456,14 @@
try
{
final ConfigTree parent = config.getParent();
- final String maxThreadsStr = parent != null ?
- parent.getRequiredAttribute(MAX_THREADS_TAG):
- config.getRequiredAttribute(MAX_THREADS_TAG);
-
+ String maxThreadsStr = null;
+ if (parent != null) {
+ maxThreadsStr = parent.getAttribute(MAX_THREADS_TAG);
+ }
+ if (maxThreadsStr == null) {
+ maxThreadsStr = config.getAttribute(MAX_THREADS_TAG, "1");
+ }
+
int maxThreads = Integer.parseInt(maxThreadsStr);
if (maxThreads <= 0)
throw new ConfigurationException(MAX_THREADS_TAG + " must be a positive integer. Was [" + maxThreads +"]");