You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/10 15:36:19 UTC

(commons-bsf) branch master updated (2cffe6e -> b766a6b)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bsf.git


    from 2cffe6e  Bump dependencies
     new 26a0a33  Normalize source formatting
     new b766a6b  Replace internal StringBuffer with StringBuilder

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                            |    7 +-
 src/main/java/org/apache/bsf/BSFDeclaredBean.java  |    3 +-
 src/main/java/org/apache/bsf/BSFEngine.java        |  223 ++---
 src/main/java/org/apache/bsf/BSFException.java     |   83 +-
 src/main/java/org/apache/bsf/BSFManager.java       |  501 ++++------
 src/main/java/org/apache/bsf/BSF_Log.java          |  567 ++++++-----
 src/main/java/org/apache/bsf/BSF_LogFactory.java   |   24 +-
 src/main/java/org/apache/bsf/Main.java             |   65 +-
 .../org/apache/bsf/engines/jacl/BSFCommand.java    |  120 ++-
 .../org/apache/bsf/engines/jacl/JaclEngine.java    |  173 ++--
 .../org/apache/bsf/engines/java/JavaEngine.java    |  220 ++---
 .../bsf/engines/javaclass/JavaClassEngine.java     |   68 +-
 .../bsf/engines/javascript/JavaScriptEngine.java   |   86 +-
 .../org/apache/bsf/engines/jexl/JEXLEngine.java    |   90 +-
 .../apache/bsf/engines/jython/JythonEngine.java    |  432 ++++----
 .../org/apache/bsf/engines/xslt/XSLTEngine.java    |  142 ++-
 .../apache/bsf/engines/xslt/XSLTResultNode.java    |   20 +-
 .../java/org/apache/bsf/util/BSFClassLoader.java   |   88 +-
 .../java/org/apache/bsf/util/BSFEngineImpl.java    |   72 +-
 .../org/apache/bsf/util/BSFEventProcessor.java     |  143 ++-
 .../util/BSFEventProcessorReturningEventInfos.java |   49 +-
 .../java/org/apache/bsf/util/BSFFunctions.java     |   51 +-
 src/main/java/org/apache/bsf/util/Bean.java        |   22 +-
 src/main/java/org/apache/bsf/util/CodeBuffer.java  |  745 +++++++-------
 src/main/java/org/apache/bsf/util/EngineUtils.java |  354 +++----
 src/main/java/org/apache/bsf/util/IOUtils.java     |   28 +-
 .../java/org/apache/bsf/util/IndentWriter.java     |  108 +-
 src/main/java/org/apache/bsf/util/JavaUtils.java   |    9 +-
 src/main/java/org/apache/bsf/util/MethodUtils.java |  827 +++++++---------
 src/main/java/org/apache/bsf/util/ObjInfo.java     |  107 +-
 .../java/org/apache/bsf/util/ObjectRegistry.java   |   73 +-
 .../java/org/apache/bsf/util/ReflectionUtils.java  |  849 ++++++++--------
 .../org/apache/bsf/util/ScriptSymbolTable.java     |   29 +-
 src/main/java/org/apache/bsf/util/StringUtils.java |  631 ++++++------
 src/main/java/org/apache/bsf/util/cf/CFDriver.java |  257 +++--
 .../java/org/apache/bsf/util/cf/CodeFormatter.java |  619 ++++++------
 .../org/apache/bsf/util/event/EventAdapter.java    |   16 +-
 .../apache/bsf/util/event/EventAdapterImpl.java    |   16 +-
 .../bsf/util/event/EventAdapterRegistry.java       |  153 ++-
 .../org/apache/bsf/util/event/EventProcessor.java  |   16 +-
 .../adapters/java_awt_event_ActionAdapter.java     |    9 +-
 .../adapters/java_awt_event_AdjustmentAdapter.java |    9 +-
 .../adapters/java_awt_event_ComponentAdapter.java  |   32 +-
 .../adapters/java_awt_event_ContainerAdapter.java  |   16 +-
 .../adapters/java_awt_event_FocusAdapter.java      |   16 +-
 .../event/adapters/java_awt_event_ItemAdapter.java |    9 +-
 .../event/adapters/java_awt_event_KeyAdapter.java  |   23 +-
 .../adapters/java_awt_event_MouseAdapter.java      |   39 +-
 .../java_awt_event_MouseMotionAdapter.java         |   16 +-
 .../event/adapters/java_awt_event_TextAdapter.java |    9 +-
 .../adapters/java_awt_event_WindowAdapter.java     |   53 +-
 .../adapters/java_beans_PropertyChangeAdapter.java |    9 +-
 .../adapters/java_beans_VetoableChangeAdapter.java |   22 +-
 .../util/event/generator/AdapterClassLoader.java   |  275 +++---
 .../bsf/util/event/generator/ByteUtility.java      |  558 +++++------
 .../apache/bsf/util/event/generator/Bytecode.java  |  132 +--
 .../event/generator/EventAdapterGenerator.java     | 1028 ++++++++++----------
 .../org/apache/bsf/util/type/TypeConvertor.java    |   13 +-
 .../bsf/util/type/TypeConvertorRegistry.java       |  328 +++----
 src/test/java/org/apache/bsf/BSFTest.java          |   39 +-
 src/test/java/org/apache/bsf/FakeEngine.java       |   16 +-
 .../org/apache/bsf/engines/JavascriptTest.java     |   71 +-
 .../java/org/apache/bsf/engines/JythonTest.java    |   71 +-
 .../org/apache/bsf/engines/NetrexxTest_IGNORE.java |   64 +-
 .../java/org/apache/bsf/util/EngineUtilsTest.java  |   69 +-
 src/test/java/org/apache/bsf/util/IOUtilsTest.java |    6 +-
 .../java/org/apache/bsf/util/StringUtilsTest.java  |  112 +--
 src/test/java/org/apache/bsf/util/TestBean.java    |   17 +-
 68 files changed, 4992 insertions(+), 6155 deletions(-)


(commons-bsf) 01/02: Normalize source formatting

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bsf.git

commit 26a0a334a6dd23596811eaef88e592661b50ed27
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 10 10:29:19 2023 -0500

    Normalize source formatting
---
 src/main/java/org/apache/bsf/BSFDeclaredBean.java  |    3 +-
 src/main/java/org/apache/bsf/BSFEngine.java        |  223 ++---
 src/main/java/org/apache/bsf/BSFException.java     |   83 +-
 src/main/java/org/apache/bsf/BSFManager.java       |  501 ++++------
 src/main/java/org/apache/bsf/BSF_Log.java          |  567 ++++++-----
 src/main/java/org/apache/bsf/BSF_LogFactory.java   |   24 +-
 src/main/java/org/apache/bsf/Main.java             |   65 +-
 .../org/apache/bsf/engines/jacl/BSFCommand.java    |  120 ++-
 .../org/apache/bsf/engines/jacl/JaclEngine.java    |  173 ++--
 .../org/apache/bsf/engines/java/JavaEngine.java    |  218 ++---
 .../bsf/engines/javaclass/JavaClassEngine.java     |   68 +-
 .../bsf/engines/javascript/JavaScriptEngine.java   |   86 +-
 .../org/apache/bsf/engines/jexl/JEXLEngine.java    |   90 +-
 .../apache/bsf/engines/jython/JythonEngine.java    |  432 ++++----
 .../org/apache/bsf/engines/xslt/XSLTEngine.java    |  142 ++-
 .../apache/bsf/engines/xslt/XSLTResultNode.java    |   20 +-
 .../java/org/apache/bsf/util/BSFClassLoader.java   |   88 +-
 .../java/org/apache/bsf/util/BSFEngineImpl.java    |   72 +-
 .../org/apache/bsf/util/BSFEventProcessor.java     |  143 ++-
 .../util/BSFEventProcessorReturningEventInfos.java |   49 +-
 .../java/org/apache/bsf/util/BSFFunctions.java     |   51 +-
 src/main/java/org/apache/bsf/util/Bean.java        |   22 +-
 src/main/java/org/apache/bsf/util/CodeBuffer.java  |  745 +++++++-------
 src/main/java/org/apache/bsf/util/EngineUtils.java |  354 +++----
 src/main/java/org/apache/bsf/util/IOUtils.java     |   28 +-
 .../java/org/apache/bsf/util/IndentWriter.java     |  108 +-
 src/main/java/org/apache/bsf/util/JavaUtils.java   |    9 +-
 src/main/java/org/apache/bsf/util/MethodUtils.java |  827 +++++++---------
 src/main/java/org/apache/bsf/util/ObjInfo.java     |  107 +-
 .../java/org/apache/bsf/util/ObjectRegistry.java   |   73 +-
 .../java/org/apache/bsf/util/ReflectionUtils.java  |  849 ++++++++--------
 .../org/apache/bsf/util/ScriptSymbolTable.java     |   29 +-
 src/main/java/org/apache/bsf/util/StringUtils.java |  631 ++++++------
 src/main/java/org/apache/bsf/util/cf/CFDriver.java |  257 +++--
 .../java/org/apache/bsf/util/cf/CodeFormatter.java |  619 ++++++------
 .../org/apache/bsf/util/event/EventAdapter.java    |   16 +-
 .../apache/bsf/util/event/EventAdapterImpl.java    |   16 +-
 .../bsf/util/event/EventAdapterRegistry.java       |  153 ++-
 .../org/apache/bsf/util/event/EventProcessor.java  |   16 +-
 .../adapters/java_awt_event_ActionAdapter.java     |    9 +-
 .../adapters/java_awt_event_AdjustmentAdapter.java |    9 +-
 .../adapters/java_awt_event_ComponentAdapter.java  |   32 +-
 .../adapters/java_awt_event_ContainerAdapter.java  |   16 +-
 .../adapters/java_awt_event_FocusAdapter.java      |   16 +-
 .../event/adapters/java_awt_event_ItemAdapter.java |    9 +-
 .../event/adapters/java_awt_event_KeyAdapter.java  |   23 +-
 .../adapters/java_awt_event_MouseAdapter.java      |   39 +-
 .../java_awt_event_MouseMotionAdapter.java         |   16 +-
 .../event/adapters/java_awt_event_TextAdapter.java |    9 +-
 .../adapters/java_awt_event_WindowAdapter.java     |   53 +-
 .../adapters/java_beans_PropertyChangeAdapter.java |    9 +-
 .../adapters/java_beans_VetoableChangeAdapter.java |   22 +-
 .../util/event/generator/AdapterClassLoader.java   |  275 +++---
 .../bsf/util/event/generator/ByteUtility.java      |  558 +++++------
 .../apache/bsf/util/event/generator/Bytecode.java  |  132 +--
 .../event/generator/EventAdapterGenerator.java     | 1028 ++++++++++----------
 .../org/apache/bsf/util/type/TypeConvertor.java    |   13 +-
 .../bsf/util/type/TypeConvertorRegistry.java       |  328 +++----
 src/test/java/org/apache/bsf/BSFTest.java          |   39 +-
 src/test/java/org/apache/bsf/FakeEngine.java       |   16 +-
 .../org/apache/bsf/engines/JavascriptTest.java     |   71 +-
 .../java/org/apache/bsf/engines/JythonTest.java    |   71 +-
 .../org/apache/bsf/engines/NetrexxTest_IGNORE.java |   64 +-
 .../java/org/apache/bsf/util/EngineUtilsTest.java  |   69 +-
 src/test/java/org/apache/bsf/util/IOUtilsTest.java |    6 +-
 .../java/org/apache/bsf/util/StringUtilsTest.java  |  112 +--
 src/test/java/org/apache/bsf/util/TestBean.java    |   17 +-
 67 files changed, 4987 insertions(+), 6151 deletions(-)

diff --git a/src/main/java/org/apache/bsf/BSFDeclaredBean.java b/src/main/java/org/apache/bsf/BSFDeclaredBean.java
index 24e11bb..2db10c7 100644
--- a/src/main/java/org/apache/bsf/BSFDeclaredBean.java
+++ b/src/main/java/org/apache/bsf/BSFDeclaredBean.java
@@ -18,8 +18,7 @@
 package org.apache.bsf;
 
 /**
- * BSFDeclaredBeans are used internally by BSF to encapsulate information being
- * passed between a BSFManager and its various BSFEngines. Note that the
+ * BSFDeclaredBeans are used internally by BSF to encapsulate information being passed between a BSFManager and its various BSFEngines. Note that the
  * constructor is not public because this is not a public class.
  */
 public class BSFDeclaredBean {
diff --git a/src/main/java/org/apache/bsf/BSFEngine.java b/src/main/java/org/apache/bsf/BSFEngine.java
index 2494ed3..4cfd4a6 100644
--- a/src/main/java/org/apache/bsf/BSFEngine.java
+++ b/src/main/java/org/apache/bsf/BSFEngine.java
@@ -23,221 +23,158 @@ import java.util.Vector;
 import org.apache.bsf.util.CodeBuffer;
 
 /**
- * This is the view of a scripting engine assumed by the Bean Scripting
- * Framework. This interface is used when an application decides to
- * run some script under application control. (This is the reverse of
- * the more common situation, which is that of the scripting language
- * calling into the application.)
+ * This is the view of a scripting engine assumed by the Bean Scripting Framework. This interface is used when an application decides to run some script under
+ * application control. (This is the reverse of the more common situation, which is that of the scripting language calling into the application.)
  * <p>
- * When a scripting engine is first fired up, the initialize()
- * method is called right after construction.
+ * When a scripting engine is first fired up, the initialize() method is called right after construction.
  * <p>
- * A scripting engine must provide two access points for applications
- * to call into them: via function calls and via expression evaluation.
- * It must also support loading scripts.
+ * A scripting engine must provide two access points for applications to call into them: via function calls and via expression evaluation. It must also support
+ * loading scripts.
  * <p>
- * A scripting engine is a property change listener and will be notified
- * when any of the relevant properties of the manager change. (See
- * BSFManager to see which of its properties are bound.)
+ * A scripting engine is a property change listener and will be notified when any of the relevant properties of the manager change. (See BSFManager to see which
+ * of its properties are bound.)
  */
 public interface BSFEngine extends PropertyChangeListener {
 
     /**
-     * This is used by an application to invoke an anonymous function. An
-     * anonymous function is a multi-line script which when evaluated will
-     * produce a value. These are separated from expressions and scripts
-     * because the prior are spsed to be good 'ol expressions and scripts
-     * are not value returning. We allow anonymous functions to have parameters
-     * as well for completeness.
-     *
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
-     * @param lineNo   (context info) the line number in source for expr
-     * @param columnNo (context info) the column number in source for expr
-     * @param funcBody the multi-line, value returning script to evaluate
+     * This is used by an application to invoke an anonymous function. An anonymous function is a multi-line script which when evaluated will produce a value.
+     * These are separated from expressions and scripts because the prior are spsed to be good 'ol expressions and scripts are not value returning. We allow
+     * anonymous functions to have parameters as well for completeness.
+     *
+     * @param source     (context info) the source of this expression (e.g., filename)
+     * @param lineNo     (context info) the line number in source for expr
+     * @param columnNo   (context info) the column number in source for expr
+     * @param funcBody   the multi-line, value returning script to evaluate
      * @param paramNames the names of the parameters above assumes
-     * @param arguments values of the above parameters
+     * @param arguments  values of the above parameters
      *
      * @exception BSFException if anything goes wrong while doin' it.
      */
-    Object apply(
-        String source,
-        int lineNo,
-        int columnNo,
-        Object funcBody,
-        Vector paramNames,
-        Vector arguments)
-        throws BSFException;
+    Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments) throws BSFException;
+
     /**
-     * This is used by an application to call into the scripting engine
-     * to make a function/method call. The "object" argument is the object
-     * whose method is to be called, if that applies. For non-OO languages,
-     * this is typically ignored and should be given as null. For pretend-OO
-     * languages such as VB, this would be the (String) name of the object.
-     * The arguments are given in the args array.
+     * This is used by an application to call into the scripting engine to make a function/method call. The "object" argument is the object whose method is to
+     * be called, if that applies. For non-OO languages, this is typically ignored and should be given as null. For pretend-OO languages such as VB, this would
+     * be the (String) name of the object. The arguments are given in the args array.
      *
      * @param object object on which to make the call
      * @param name   name of the method / procedure to call
      * @param args   the arguments to be given to the procedure
      *
-     * @exception BSFException if anything goes wrong while eval'ing a
-	 *            BSFException is thrown. The reason indicates the problem.
-	 */
-	Object call(Object object, String name, Object[] args)
-		throws BSFException;
-	/**
-	 * This is used by an application to compile an anonymous function. See
-	 * comments in apply for more hdetails.
-	 *
-	 * @param source   (context info) the source of this expression
-	 *                 (e.g., filename)
-	 * @param lineNo   (context info) the line number in source for expr
-	 * @param columnNo (context info) the column number in source for expr
-	 * @param funcBody the multi-line, value returning script to evaluate
-	 * @param paramNames the names of the parameters above assumes
-	 * @param arguments values of the above parameters
-	 * @param cb       the CodeBuffer to compile into
-	 *
-	 * @exception BSFException if anything goes wrong while doin' it.
+     * @exception BSFException if anything goes wrong while eval'ing a BSFException is thrown. The reason indicates the problem.
      */
-    void compileApply(
-        String source,
-        int lineNo,
-        int columnNo,
-        Object funcBody,
-        Vector paramNames,
-        Vector arguments,
-        CodeBuffer cb)
-        throws BSFException;
+    Object call(Object object, String name, Object[] args) throws BSFException;
+
     /**
-     * This is used by an application to compile a value-returning expression.
-     * The expr may be string or some other type, depending on the language.
-     * The generated code is dumped into the {@code CodeBuffer}.
+     * This is used by an application to compile an anonymous function. See comments in apply for more hdetails.
+     *
+     * @param source     (context info) the source of this expression (e.g., filename)
+     * @param lineNo     (context info) the line number in source for expr
+     * @param columnNo   (context info) the column number in source for expr
+     * @param funcBody   the multi-line, value returning script to evaluate
+     * @param paramNames the names of the parameters above assumes
+     * @param arguments  values of the above parameters
+     * @param cb         the CodeBuffer to compile into
      *
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
+     * @exception BSFException if anything goes wrong while doin' it.
+     */
+    void compileApply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, CodeBuffer cb) throws BSFException;
+
+    /**
+     * This is used by an application to compile a value-returning expression. The expr may be string or some other type, depending on the language. The
+     * generated code is dumped into the {@code CodeBuffer}.
+     *
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param expr     the expression to compile
      * @param cb       the CodeBuffer to compile into
      *
-     * @exception BSFException if anything goes wrong while compiling a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while compiling a BSFException is thrown. The reason indicates the problem.
      */
-    void compileExpr(
-        String source,
-        int lineNo,
-        int columnNo,
-        Object expr,
-        CodeBuffer cb)
-        throws BSFException;
+    void compileExpr(String source, int lineNo, int columnNo, Object expr, CodeBuffer cb) throws BSFException;
+
     /**
-     * This is used by an application to compile some script. The
-     * script may be string or some other type, depending on the
-     * language. The generated code is dumped into the {@code CodeBuffer}.
+     * This is used by an application to compile some script. The script may be string or some other type, depending on the language. The generated code is
+     * dumped into the {@code CodeBuffer}.
      *
-     * @param source   (context info) the source of this script
-     *                 (e.g., filename)
+     * @param source   (context info) the source of this script (e.g., filename)
      * @param lineNo   (context info) the line number in source for script
      * @param columnNo (context info) the column number in source for script
      * @param script   the script to compile
      * @param cb       the CodeBuffer to compile into
      *
-     * @exception BSFException if anything goes wrong while compiling a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while compiling a BSFException is thrown. The reason indicates the problem.
      */
-    void compileScript(
-        String source,
-        int lineNo,
-        int columnNo,
-        Object script,
-        CodeBuffer cb)
-        throws BSFException;
+    void compileScript(String source, int lineNo, int columnNo, Object script, CodeBuffer cb) throws BSFException;
+
     /**
-     * Declare a bean after the engine has been started. Declared beans
-     * are beans that are named and which the engine must make available
-     * to the scripts it runs in the most first class way possible.
+     * Declare a bean after the engine has been started. Declared beans are beans that are named and which the engine must make available to the scripts it runs
+     * in the most first class way possible.
      *
      * @param bean the bean to declare
      *
      * @exception BSFException if the engine cannot do this operation
      */
     void declareBean(BSFDeclaredBean bean) throws BSFException;
+
     /**
-     * This is used by an application to evaluate an expression. The
-     * expression may be string or some other type, depending on the
-     * language. (For example, for BML it'll be an org.w3c.dom.Element
-     * object.)
+     * This is used by an application to evaluate an expression. The expression may be string or some other type, depending on the language. (For example, for
+     * BML it'll be an org.w3c.dom.Element object.)
      *
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param expr     the expression to evaluate
      *
-     * @exception BSFException if anything goes wrong while eval'ing a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while eval'ing a BSFException is thrown. The reason indicates the problem.
      */
-    Object eval(String source, int lineNo, int columnNo, Object expr)
-        throws BSFException;
+    Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException;
+
     /**
-     * This is used by an application to execute some script. The
-     * expression may be string or some other type, depending on the
-     * language. Returns nothing but if something goes wrong it excepts
-     * (of course).
+     * This is used by an application to execute some script. The expression may be string or some other type, depending on the language. Returns nothing but if
+     * something goes wrong it excepts (of course).
      *
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param script   the script to execute
      *
-     * @exception BSFException if anything goes wrong while exec'ing a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while exec'ing a BSFException is thrown. The reason indicates the problem.
      */
-    void exec(String source, int lineNo, int columnNo, Object script)
-        throws BSFException;
+    void exec(String source, int lineNo, int columnNo, Object script) throws BSFException;
+
     /**
-     * This is used by an application to execute some script, as though
-     * one were interacting with the language in an interactive session.
-     * The expression may be string or some other type, depending on the
-     * language. Returns nothing but if something goes wrong it excepts (of
-     * course).
-     *
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
+     * This is used by an application to execute some script, as though one were interacting with the language in an interactive session. The expression may be
+     * string or some other type, depending on the language. Returns nothing but if something goes wrong it excepts (of course).
+     *
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param script   the script to execute
      *
-     * @exception BSFException if anything goes wrong while exec'ing a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while exec'ing a BSFException is thrown. The reason indicates the problem.
      */
-    void iexec(String source, int lineNo, int columnNo, Object script)
-        throws BSFException;
+    void iexec(String source, int lineNo, int columnNo, Object script) throws BSFException;
 
     /**
-     * This method is used to initialize the engine right after construction.
-     * This method will be called before any calls to eval or call. At this
-     * time the engine should capture the current values of interesting
-     * properties from the manager. In the future, any changes to those
-     * will be mirrored to me by the manager via a property change event.
+     * This method is used to initialize the engine right after construction. This method will be called before any calls to eval or call. At this time the
+     * engine should capture the current values of interesting properties from the manager. In the future, any changes to those will be mirrored to me by the
+     * manager via a property change event.
      *
      * @param mgr           The BSFManager that's hosting this engine.
      * @param lang          Language string which this engine is handling.
-     * @param declaredBeans Vector of BSFDeclaredObject containing beans
-     *        that should be declared into the language runtime at init
-     *        time as best as possible.
+     * @param declaredBeans Vector of BSFDeclaredObject containing beans that should be declared into the language runtime at init time as best as possible.
      *
-     * @exception BSFException if anything goes wrong while init'ing a
-     *            BSFException is thrown. The reason indicates the problem.
+     * @exception BSFException if anything goes wrong while init'ing a BSFException is thrown. The reason indicates the problem.
      */
-    void initialize(BSFManager mgr, String lang, Vector declaredBeans)
-        throws BSFException;
+    void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException;
+
     /**
      * Graceful termination
      */
     void terminate();
+
     /**
      * Undeclare a previously declared bean.
      *
diff --git a/src/main/java/org/apache/bsf/BSFException.java b/src/main/java/org/apache/bsf/BSFException.java
index 72ceee6..c5a09b3 100644
--- a/src/main/java/org/apache/bsf/BSFException.java
+++ b/src/main/java/org/apache/bsf/BSFException.java
@@ -18,51 +18,54 @@
 package org.apache.bsf;
 
 /**
- * If something goes wrong while doing some scripting stuff, one of these
- * is thrown. The integer code indicates what's wrong and the message
- * may give more details. The reason one exception with multiple meanings
- * (via the code) [instead of multiple exception types] is used is due to
- * the interest to keep the run-time size small.
+ * If something goes wrong while doing some scripting stuff, one of these is thrown. The integer code indicates what's wrong and the message may give more
+ * details. The reason one exception with multiple meanings (via the code) [instead of multiple exception types] is used is due to the interest to keep the
+ * run-time size small.
  */
 public class BSFException extends Exception {
-  public static final int REASON_INVALID_ARGUMENT = 0;
-  public static final int REASON_IO_ERROR = 10;
-  public static final int REASON_UNKNOWN_LANGUAGE = 20;
-  public static final int REASON_EXECUTION_ERROR = 100;
-  public static final int REASON_UNSUPPORTED_FEATURE = 499;
-  public static final int REASON_OTHER_ERROR = 500;
+    public static final int REASON_INVALID_ARGUMENT = 0;
+    public static final int REASON_IO_ERROR = 10;
+    public static final int REASON_UNKNOWN_LANGUAGE = 20;
+    public static final int REASON_EXECUTION_ERROR = 100;
+    public static final int REASON_UNSUPPORTED_FEATURE = 499;
+    public static final int REASON_OTHER_ERROR = 500;
 
-  int reason;
-  Throwable targetThrowable;
+    int reason;
+    Throwable targetThrowable;
 
-  public BSFException (final int reason, final String msg) {
-    super (msg);
-    this.reason = reason;
-  }
-  public BSFException (final int reason, final String msg, final Throwable t) {
-    this (reason, msg);
-    targetThrowable = t;
-  }
-  public BSFException (final String msg) {
-    this (REASON_OTHER_ERROR, msg);
-  }
-  public int getReason () {
-    return reason;
-  }
-  public Throwable getTargetException () {
-    return targetThrowable;
-  }
-  public void printStackTrace () {
-    if (targetThrowable != null) {
-      final String msg = getMessage ();
+    public BSFException(final int reason, final String msg) {
+        super(msg);
+        this.reason = reason;
+    }
+
+    public BSFException(final int reason, final String msg, final Throwable t) {
+        this(reason, msg);
+        targetThrowable = t;
+    }
+
+    public BSFException(final String msg) {
+        this(REASON_OTHER_ERROR, msg);
+    }
+
+    public int getReason() {
+        return reason;
+    }
+
+    public Throwable getTargetException() {
+        return targetThrowable;
+    }
+
+    public void printStackTrace() {
+        if (targetThrowable != null) {
+            final String msg = getMessage();
 
-      if (msg != null && !msg.equals (targetThrowable.getMessage ())) {
-        System.err.print (msg + ": ");
-      }
+            if (msg != null && !msg.equals(targetThrowable.getMessage())) {
+                System.err.print(msg + ": ");
+            }
 
-      targetThrowable.printStackTrace ();
-    } else {
-      super.printStackTrace ();
+            targetThrowable.printStackTrace();
+        } else {
+            super.printStackTrace();
+        }
     }
-  }
 }
diff --git a/src/main/java/org/apache/bsf/BSFManager.java b/src/main/java/org/apache/bsf/BSFManager.java
index 8f5b1e7..6543d77 100644
--- a/src/main/java/org/apache/bsf/BSFManager.java
+++ b/src/main/java/org/apache/bsf/BSFManager.java
@@ -36,36 +36,27 @@ import java.util.Vector;
 import org.apache.bsf.util.CodeBuffer;
 import org.apache.bsf.util.ObjectRegistry;
 
-    // org.apache.commons.logging is delegated to "org.apache.bsf.BSF_Log[Factory]"
+// org.apache.commons.logging is delegated to "org.apache.bsf.BSF_Log[Factory]"
 // import org.apache.commons.logging.Log;
 // import org.apache.commons.logging.LogFactory;
 
 /**
- * This class is the entry point to the bean scripting framework. An
- * application wishing to integrate scripting to a Java app would
- * place an instance of a BSFManager in their code and use its services
- * to register the beans they want to make available for scripting,
- * load scripting engines, and run scripts.
+ * This class is the entry point to the bean scripting framework. An application wishing to integrate scripting to a Java app would place an instance of a
+ * BSFManager in their code and use its services to register the beans they want to make available for scripting, load scripting engines, and run scripts.
  * <p>
- * BSFManager serves as the registry of available scripting engines
- * as well. Loading and unloading of scripting engines is
- * supported as well. Each BSFManager loads one engine per language.
- * Several BSFManagers can be created per JVM.
+ * BSFManager serves as the registry of available scripting engines as well. Loading and unloading of scripting engines is supported as well. Each BSFManager
+ * loads one engine per language. Several BSFManagers can be created per JVM.
  */
 
 // changed 2007-01-28: ---rgf, fixed Class.forName() to use the context class loader instead; oversaw this the last time
-/* changed 2007-09-17: ---rgf, some Java hosts do not set the Thread's context class loader and
-                               load BSF with a customized ClassLoader!
-                               Resolution:
-                               - use Thread context ClassLoader, if resource or class to
-                                 load not found, then
-                               - use the BSFManager's defining ClassLoader instead, if it is
-                                 different to the context ClassLoader
-
-           2012-01-29, ---rgf, - context class loader may not be set, account for it (2009-09-10)
-                               - static constructor: fixed logic error in fallback code for getResources() (2011-01-08)
-           2014-12-30, ---rgf, - remove memory leak when terminating engines, cf. issue [BSF-41]
-*/
+/*
+ * changed 2007-09-17: ---rgf, some Java hosts do not set the Thread's context class loader and load BSF with a customized ClassLoader! Resolution: - use Thread
+ * context ClassLoader, if resource or class to load not found, then - use the BSFManager's defining ClassLoader instead, if it is different to the context
+ * ClassLoader
+ * 
+ * 2012-01-29, ---rgf, - context class loader may not be set, account for it (2009-09-10) - static constructor: fixed logic error in fallback code for
+ * getResources() (2011-01-08) 2014-12-30, ---rgf, - remove memory leak when terminating engines, cf. issue [BSF-41]
+ */
 
 public class BSFManager {
     // version string is in the form "abc.yyyymmdd" where
@@ -73,7 +64,7 @@ public class BSFManager {
     // and "yyyy" a four digit year, "mm" a two digit month, "dd" a two digit day.
     //
     // Example: "250.20120129" stands for: BSF version "2.5.0" as of "2012-01-29"
-    protected static String version="250.20141230";
+    protected static String version = "250.20141230";
 
     // table of registered scripting engines
     protected static Hashtable registeredEngines = new Hashtable();
@@ -83,16 +74,17 @@ public class BSFManager {
 
     // get the defined CL (ClassLoader which got used to define this class object) // rgf, 20070917
     protected static ClassLoader definedClassLoader;
-/*
-    protected static ClassLoader appClassLoader;        // application/system class loader
-    protected static ClassLoader extClassLoader;        // extension (option) class loader
-*/
+    /*
+     * protected static ClassLoader appClassLoader; // application/system class loader protected static ClassLoader extClassLoader; // extension (option) class
+     * loader
+     */
 
-    /** Returns the defined ClassLoader (the ClassLoader that got used to define the
-     *  org.apache.bsf.BSFManager class object).
-     *  @return the defined ClassLoader instance
+    /**
+     * Returns the defined ClassLoader (the ClassLoader that got used to define the org.apache.bsf.BSFManager class object).
+     * 
+     * @return the defined ClassLoader instance
      */
-    public static ClassLoader getDefinedClassLoader()  // rgf, 20070917
+    public static ClassLoader getDefinedClassLoader() // rgf, 20070917
     {
         return definedClassLoader;
     }
@@ -109,10 +101,10 @@ public class BSFManager {
     // of my interesting properties change
     protected PropertyChangeSupport pcs;
 
-/* rgf (20070917): wrong assumption; context ClassLoader needs to be explicitly
-                   requested before usage as BSF could be deployed with different
-                   context ClassLoaders on different threads!
-*/
+    /*
+     * rgf (20070917): wrong assumption; context ClassLoader needs to be explicitly requested before usage as BSF could be deployed with different context
+     * ClassLoaders on different threads!
+     */
 
     // the class loader to use if a class loader is needed. Default is
     // he who loaded me (which may be null in which case its Class.forName).
@@ -142,27 +134,26 @@ public class BSFManager {
     //////////////////////////////////////////////////////////////////////
 
     static {
-        final String strInfo="org.apache.bsf.BSFManager.dumpEnvironment() [from static{}]";
+        final String strInfo = "org.apache.bsf.BSFManager.dumpEnvironment() [from static{}]";
         try {
-            definedClassLoader=BSFManager.class.getClassLoader();   // get defining ClassLoader
+            definedClassLoader = BSFManager.class.getClassLoader(); // get defining ClassLoader
 
-            final String resourceName="org/apache/bsf/Languages.properties";
+            final String resourceName = "org/apache/bsf/Languages.properties";
 
             Enumeration e = null;
             // use the Thread's context class loader to locate the resources
-            final ClassLoader tccl=Thread.currentThread().getContextClassLoader();    // try to get the context class loader
-            if (tccl!=null)                         // no context class loader available!
+            final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); // try to get the context class loader
+            if (tccl != null) // no context class loader available!
             {
-                e=tccl.getResources(resourceName);
-            }
-            else  // fallback
+                e = tccl.getResources(resourceName);
+            } else // fallback
             {
-                e=definedClassLoader.getResources(resourceName);
-		Thread.currentThread().setContextClassLoader(definedClassLoader); // set Thread context class loader
+                e = definedClassLoader.getResources(resourceName);
+                Thread.currentThread().setContextClassLoader(definedClassLoader); // set Thread context class loader
             }
 
             while (e.hasMoreElements()) {
-                final URL url = (URL)e.nextElement();
+                final URL url = (URL) e.nextElement();
                 final InputStream is = url.openStream();
 
                 final Properties p = new Properties();
@@ -175,7 +166,7 @@ public class BSFManager {
                     final String className = value.substring(0, value.indexOf(","));
 
                     // get the extensions for this language
-                    final String exts = value.substring(value.indexOf(",")+1);
+                    final String exts = value.substring(value.indexOf(",") + 1);
                     final StringTokenizer st = new StringTokenizer(exts, "|");
                     final String[] extensions = new String[st.countTokens()];
 
@@ -189,15 +180,15 @@ public class BSFManager {
         } catch (final IOException ex) {
             final BSF_Log logger = BSF_LogFactory.getLog(BSFManager.class.getName());
             logger.debug("[BSFManager] static {...}");
-            logger.error("[BSFManager] Error reading Languages file, exception :",ex);
+            logger.error("[BSFManager] Error reading Languages file, exception :", ex);
 
-               // TODO: leave in case only a no-op-logger is available or remove next two statements?
+            // TODO: leave in case only a no-op-logger is available or remove next two statements?
             ex.printStackTrace();
             System.err.println("Error reading Languages file " + ex);
         } catch (final NoSuchElementException nsee) {
             final BSF_Log logger = BSF_LogFactory.getLog(BSFManager.class.getName());
             logger.debug("[BSFManager] static {...}");
-            logger.error("[BSFManager] Syntax error in Languages resource bundle, exception :",nsee);
+            logger.error("[BSFManager] Syntax error in Languages resource bundle, exception :", nsee);
 
             // TODO: leave in case only a no-op-logger is available or remove next two statements?
             nsee.printStackTrace();
@@ -205,7 +196,7 @@ public class BSFManager {
         } catch (final MissingResourceException mre) {
             final BSF_Log logger = BSF_LogFactory.getLog(BSFManager.class.getName());
             logger.debug("[BSFManager] static {...}");
-            logger.error("[BSFManager] Initialization error, exception :",mre);
+            logger.error("[BSFManager] Initialization error, exception :", mre);
 
             // TODO: leave in case only a no-op-logger is available or remove next two statements?
             mre.printStackTrace();
@@ -215,21 +206,20 @@ public class BSFManager {
 
     public BSFManager() {
         pcs = new PropertyChangeSupport(this);
-            // handle logger
+        // handle logger
         logger = BSF_LogFactory.getLog(this.getClass().getName());
     }
 
-   /** Returns the version string of BSF.
-     *
-     * @return version string in the form &quot;abc.yyyymmdd&quot; where
-       &quot;abc&quot; represents a dewey decimal number (three levels, each between 0 and 9), and
-       &quot;yyyy&quot; a four digit year, &quot;mm&quot; a two digit month,
-       &quot;dd&quot; a two digit day.
-    *
-       <br>Example: &quot;<code>250.20120129</code>&quot;
-       stands for: BSF version <code>2.5.0</code> as of <code>2012-01-29</code>.
-    *
-    *
+    /**
+     * Returns the version string of BSF.
+     *
+     * @return version string in the form &quot;abc.yyyymmdd&quot; where &quot;abc&quot; represents a dewey decimal number (three levels, each between 0 and 9),
+     *         and &quot;yyyy&quot; a four digit year, &quot;mm&quot; a two digit month, &quot;dd&quot; a two digit day.
+     *
+     *         <br>
+     *         Example: &quot;<code>250.20120129</code>&quot; stands for: BSF version <code>2.5.0</code> as of <code>2012-01-29</code>.
+     *
+     *
      * @since 2006-01-17
      */
     public static String getVersion() {
@@ -238,28 +228,20 @@ public class BSFManager {
     }
 
     /**
-     * Apply the given anonymous function of the given language to the given
-     * parameters and return the resulting value.
+     * Apply the given anonymous function of the given language to the given parameters and return the resulting value.
      *
-     * @param lang language identifier
-     * @param source (context info) the source of this expression
-     (e.g., filename)
-     * @param lineNo (context info) the line number in source for expr
-     * @param columnNo (context info) the column number in source for expr
-     * @param funcBody the multi-line, value returning script to evaluate
+     * @param lang       language identifier
+     * @param source     (context info) the source of this expression (e.g., filename)
+     * @param lineNo     (context info) the line number in source for expr
+     * @param columnNo   (context info) the column number in source for expr
+     * @param funcBody   the multi-line, value returning script to evaluate
      * @param paramNames the names of the parameters above assumes
-     * @param arguments values of the above parameters
+     * @param arguments  values of the above parameters
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public Object apply(final String lang,
-                        final String source,
-                        final int lineNo,
-                        final int columnNo,
-                        final Object funcBody,
-                        final Vector paramNames,
-                        final Vector arguments)
-        throws BSFException {
+    public Object apply(final String lang, final String source, final int lineNo, final int columnNo, final Object funcBody, final Vector paramNames,
+            final Vector arguments) throws BSFException {
         logger.debug("BSFManager:apply");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -271,13 +253,11 @@ public class BSFManager {
         Object result = null;
 
         try {
-            final Object resultf =
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                        public Object run() throws Exception {
-                            return e.apply(sourcef, lineNof, columnNof,
-                                           funcBodyf, paramNamesf, argumentsf);
-                        }
-                    });
+            final Object resultf = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                public Object run() throws Exception {
+                    return e.apply(sourcef, lineNof, columnNof, funcBodyf, paramNamesf, argumentsf);
+                }
+            });
             result = resultf;
         } catch (final PrivilegedActionException prive) {
 
@@ -289,30 +269,21 @@ public class BSFManager {
     }
 
     /**
-     * Compile the application of the given anonymous function of the given
-     * language to the given parameters into the given {@code CodeBuffer}.
+     * Compile the application of the given anonymous function of the given language to the given parameters into the given {@code CodeBuffer}.
      *
-     * @param lang language identifier
-     * @param source (context info) the source of this expression
-     (e.g., filename)
-     * @param lineNo (context info) the line number in source for expr
-     * @param columnNo (context info) the column number in source for expr
-     * @param funcBody the multi-line, value returning script to evaluate
+     * @param lang       language identifier
+     * @param source     (context info) the source of this expression (e.g., filename)
+     * @param lineNo     (context info) the line number in source for expr
+     * @param columnNo   (context info) the column number in source for expr
+     * @param funcBody   the multi-line, value returning script to evaluate
      * @param paramNames the names of the parameters above assumes
-     * @param arguments values of the above parameters
-     * @param cb       code buffer to compile into
+     * @param arguments  values of the above parameters
+     * @param cb         code buffer to compile into
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public void compileApply(final String lang,
-                             final String source,
-                             final int lineNo,
-                             final int columnNo,
-                             final Object funcBody,
-                             final Vector paramNames,
-                             final Vector arguments,
-                             final CodeBuffer cb)
-        throws BSFException {
+    public void compileApply(final String lang, final String source, final int lineNo, final int columnNo, final Object funcBody, final Vector paramNames,
+            final Vector arguments, final CodeBuffer cb) throws BSFException {
         logger.debug("BSFManager:compileApply");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -325,13 +296,11 @@ public class BSFManager {
 
         try {
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        e.compileApply(sourcef, lineNof, columnNof,
-                                       funcBodyf, paramNamesf,
-                                       argumentsf, cbf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    e.compileApply(sourcef, lineNof, columnNof, funcBodyf, paramNamesf, argumentsf, cbf);
+                    return null;
+                }
+            });
         } catch (final PrivilegedActionException prive) {
 
             logger.error("[BSFManager] Exception :", prive);
@@ -340,12 +309,10 @@ public class BSFManager {
     }
 
     /**
-     * Compile the given expression of the given language into the given
-     * {@code CodeBuffer}.
+     * Compile the given expression of the given language into the given {@code CodeBuffer}.
      *
      * @param lang     language identifier
-     * @param source   (context info) the source of this expression
-     (e.g., filename)
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param expr     the expression to compile
@@ -353,13 +320,8 @@ public class BSFManager {
      *
      * @exception BSFException if any error while compiling the expression
      */
-    public void compileExpr(final String lang,
-                            final String source,
-                            final int lineNo,
-                            final int columnNo,
-                            final Object expr,
-                            final CodeBuffer cb)
-        throws BSFException {
+    public void compileExpr(final String lang, final String source, final int lineNo, final int columnNo, final Object expr, final CodeBuffer cb)
+            throws BSFException {
         logger.debug("BSFManager:compileExpr");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -370,11 +332,11 @@ public class BSFManager {
 
         try {
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        e.compileExpr(sourcef, lineNof, columnNof, exprf, cbf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    e.compileExpr(sourcef, lineNof, columnNof, exprf, cbf);
+                    return null;
+                }
+            });
         } catch (final PrivilegedActionException prive) {
 
             logger.error("[BSFManager] Exception :", prive);
@@ -383,12 +345,10 @@ public class BSFManager {
     }
 
     /**
-     * Compile the given script of the given language into the given
-     * {@code CodeBuffer}.
+     * Compile the given script of the given language into the given {@code CodeBuffer}.
      *
      * @param lang     language identifier
-     * @param source   (context info) the source of this script
-     (e.g., filename)
+     * @param source   (context info) the source of this script (e.g., filename)
      * @param lineNo   (context info) the line number in source for script
      * @param columnNo (context info) the column number in source for script
      * @param script   the script to compile
@@ -396,13 +356,8 @@ public class BSFManager {
      *
      * @exception BSFException if any error while compiling the script
      */
-    public void compileScript(final String lang,
-                              final String source,
-                              final int lineNo,
-                              final int columnNo,
-                              final Object script,
-                              final CodeBuffer cb)
-        throws BSFException {
+    public void compileScript(final String lang, final String source, final int lineNo, final int columnNo, final Object script, final CodeBuffer cb)
+            throws BSFException {
         logger.debug("BSFManager:compileScript");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -413,12 +368,11 @@ public class BSFManager {
 
         try {
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        e.compileScript(sourcef, lineNof, columnNof,
-                                        scriptf, cbf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    e.compileScript(sourcef, lineNof, columnNof, scriptf, cbf);
+                    return null;
+                }
+            });
         } catch (final PrivilegedActionException prive) {
 
             logger.error("[BSFManager] Exception :", prive);
@@ -427,37 +381,25 @@ public class BSFManager {
     }
 
     /**
-     * Declare a bean. The difference between declaring and registering
-     * is that engines are spsed to make declared beans "pre-available"
-     * in the scripts as far as possible. That is, if a script author
-     * needs a registered bean, he needs to look it up in some way. However
-     * if he needs a declared bean, the language has the responsibility to
-     * make those beans avaialable "automatically."
+     * Declare a bean. The difference between declaring and registering is that engines are spsed to make declared beans "pre-available" in the scripts as far
+     * as possible. That is, if a script author needs a registered bean, he needs to look it up in some way. However if he needs a declared bean, the language
+     * has the responsibility to make those beans avaialable "automatically."
      * <p>
-     * When a bean is declared it is automatically registered as well
-     * so that any declared bean can be gotton to by looking it up as well.
+     * When a bean is declared it is automatically registered as well so that any declared bean can be gotton to by looking it up as well.
      * <p>
-     * If any of the languages that are already running in this manager
-     * says they don't like this (by throwing an exception) then this
-     * method will simply quit with that exception. That is, any engines
-     * that come after than in the engine enumeration will not even be
-     * told about this new bean.
+     * If any of the languages that are already running in this manager says they don't like this (by throwing an exception) then this method will simply quit
+     * with that exception. That is, any engines that come after than in the engine enumeration will not even be told about this new bean.
      * <p>
-     * So, in general its best to declare beans before the manager has
-     * been asked to load any engines because then the user can be informed
-     * when an engine rejects it. Also, its much more likely that an engine
-     * can declare a bean at start time than it can at any time.
+     * So, in general its best to declare beans before the manager has been asked to load any engines because then the user can be informed when an engine
+     * rejects it. Also, its much more likely that an engine can declare a bean at start time than it can at any time.
      *
      * @param beanName name to declare bean as
      * @param bean     the bean that's being declared
      * @param type     the type to represent the bean as
      *
-     * @exception BSFException if any of the languages that are already
-     *            running decides to throw an exception when asked to
-     *            declare this bean.
+     * @exception BSFException if any of the languages that are already running decides to throw an exception when asked to declare this bean.
      */
-    public void declareBean(final String beanName, final Object bean, final Class type)
-        throws BSFException {
+    public void declareBean(final String beanName, final Object bean, final Class type) throws BSFException {
         logger.debug("BSFManager:declareBean");
 
         registerBean(beanName, bean);
@@ -474,24 +416,17 @@ public class BSFManager {
     }
 
     /**
-     * Evaluate the given expression of the given language and return the
-     * resulting value.
+     * Evaluate the given expression of the given language and return the resulting value.
      *
-     * @param lang language identifier
-     * @param source (context info) the source of this expression
-     (e.g., filename)
-     * @param lineNo (context info) the line number in source for expr
+     * @param lang     language identifier
+     * @param source   (context info) the source of this expression (e.g., filename)
+     * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
-     * @param expr the expression to evaluate
+     * @param expr     the expression to evaluate
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public Object eval(final String lang,
-                       final String source,
-                       final int lineNo,
-                       final int columnNo,
-                       final Object expr)
-        throws BSFException {
+    public Object eval(final String lang, final String source, final int lineNo, final int columnNo, final Object expr) throws BSFException {
         logger.debug("BSFManager:eval");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -501,12 +436,11 @@ public class BSFManager {
         Object result = null;
 
         try {
-            final Object resultf =
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                        public Object run() throws Exception {
-                            return e.eval(sourcef, lineNof, columnNof, exprf);
-                        }
-                    });
+            final Object resultf = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                public Object run() throws Exception {
+                    return e.eval(sourcef, lineNof, columnNof, exprf);
+                }
+            });
             result = resultf;
         } catch (final PrivilegedActionException prive) {
 
@@ -528,20 +462,14 @@ public class BSFManager {
      * Execute the given script of the given language.
      *
      * @param lang     language identifier
-     * @param source   (context info) the source of this expression
-     (e.g., filename)
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param script   the script to execute
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public void exec(final String lang,
-                     final String source,
-                     final int lineNo,
-                     final int columnNo,
-                     final Object script)
-        throws BSFException {
+    public void exec(final String lang, final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
         logger.debug("BSFManager:exec");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -551,11 +479,11 @@ public class BSFManager {
 
         try {
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        e.exec(sourcef, lineNof, columnNof, scriptf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    e.exec(sourcef, lineNof, columnNof, scriptf);
+                    return null;
+                }
+            });
         } catch (final PrivilegedActionException prive) {
 
             logger.error("[BSFManager] Exception :", prive);
@@ -564,24 +492,17 @@ public class BSFManager {
     }
 
     /**
-     * Execute the given script of the given language, attempting to
-     * emulate an interactive session w/ the language.
+     * Execute the given script of the given language, attempting to emulate an interactive session w/ the language.
      *
      * @param lang     language identifier
-     * @param source   (context info) the source of this expression
-     *                 (e.g., filename)
+     * @param source   (context info) the source of this expression (e.g., filename)
      * @param lineNo   (context info) the line number in source for expr
      * @param columnNo (context info) the column number in source for expr
      * @param script   the script to execute
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public void iexec(final String lang,
-                     final String source,
-                     final int lineNo,
-                     final int columnNo,
-                     final Object script)
-        throws BSFException {
+    public void iexec(final String lang, final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
         logger.debug("BSFManager:iexec");
 
         final BSFEngine e = loadScriptingEngine(lang);
@@ -591,11 +512,11 @@ public class BSFManager {
 
         try {
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        e.iexec(sourcef, lineNof, columnNof, scriptf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    e.iexec(sourcef, lineNof, columnNof, scriptf);
+                    return null;
+                }
+            });
         } catch (final PrivilegedActionException prive) {
 
             logger.error("[BSFManager] Exception :", prive);
@@ -629,19 +550,15 @@ public class BSFManager {
     }
 
     /**
-     * Determine the language of a script file by looking at the file
-     * extension.
+     * Determine the language of a script file by looking at the file extension.
      *
      * @param fileName the name of the file
      *
-     * @return the scripting language the file is in if the file extension
-     *         is known to me (must have been registered via
-     *         registerScriptingEngine).
+     * @return the scripting language the file is in if the file extension is known to me (must have been registered via registerScriptingEngine).
      *
      * @exception BSFException if file's extension is unknown.
      */
-    public static String getLangFromFilename(final String fileName)
-        throws BSFException {
+    public static String getLangFromFilename(final String fileName) throws BSFException {
         final int dotIndex = fileName.lastIndexOf(".");
 
         if (dotIndex != -1) {
@@ -651,7 +568,7 @@ public class BSFManager {
             int index, loops = 0;
 
             if (langval != null) {
-                final ClassLoader tccl=Thread.currentThread().getContextClassLoader();    // rgf, 2009-09-10
+                final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); // rgf, 2009-09-10
 
                 while ((index = langval.indexOf(":", 0)) != -1) {
                     // Great. Multiple language engines registered
@@ -662,30 +579,25 @@ public class BSFManager {
                     loops++;
 
                     // Test to see if in classpath
-                    String engineName=null;
+                    String engineName = null;
                     try {
-                        engineName =
-                            (String) registeredEngines.get(lang);
+                        engineName = (String) registeredEngines.get(lang);
 
-                        boolean bTryDefinedClassLoader=false;
-                        if (tccl!=null)     // context CL available, try it first
+                        boolean bTryDefinedClassLoader = false;
+                        if (tccl != null) // context CL available, try it first
                         {
-                            try
-                            {
-                                tccl.loadClass (engineName);
-                            }
-                            catch (final ClassNotFoundException cnfe)
-                            {
-                                bTryDefinedClassLoader=true;
+                            try {
+                                tccl.loadClass(engineName);
+                            } catch (final ClassNotFoundException cnfe) {
+                                bTryDefinedClassLoader = true;
                             }
                         }
 
-                        if (bTryDefinedClassLoader || tccl==null)   // not found, try defined CL next
+                        if (bTryDefinedClassLoader || tccl == null) // not found, try defined CL next
                         {
                             definedClassLoader.loadClass(engineName);
                         }
-                    }
-                    catch (final ClassNotFoundException cnfe2) {
+                    } catch (final ClassNotFoundException cnfe2) {
                         // Bummer.
                         lang = langval;
                         continue;
@@ -694,7 +606,9 @@ public class BSFManager {
                     // Got past that? Good.
                     break;
                 }
-                if (loops == 0) { lang = langval; }
+                if (loops == 0) {
+                    lang = langval;
+                }
             }
 
             if (lang != null && lang != "") {
@@ -702,10 +616,7 @@ public class BSFManager {
             }
         }
         throw new BSFException(BSFException.REASON_OTHER_ERROR,
-                               "[BSFManager.getLangFromFilename] file extension missing or unknown: "
-                               + "unable to determine language for '"
-                               + fileName
-                               + "'");
+                "[BSFManager.getLangFromFilename] file extension missing or unknown: " + "unable to determine language for '" + fileName + "'");
     }
 
     /**
@@ -745,12 +656,9 @@ public class BSFManager {
      * Load a scripting engine based on the lang string identifying it.
      *
      * @param lang string identifying language
-     * @exception BSFException if the language is unknown (i.e., if it
-     *            has not been registered) with a reason of
-     *            REASON_UNKNOWN_LANGUAGE. If the language is known but
-     *            if the interface can't be created for some reason, then
-     *            the reason is set to REASON_OTHER_ERROR and the actual
-     *            exception is passed on as well.
+     * @exception BSFException if the language is unknown (i.e., if it has not been registered) with a reason of REASON_UNKNOWN_LANGUAGE. If the language is
+     *                         known but if the interface can't be created for some reason, then the reason is set to REASON_OTHER_ERROR and the actual
+     *                         exception is passed on as well.
      */
     public BSFEngine loadScriptingEngine(final String lang) throws BSFException {
         logger.debug("BSFManager:loadScriptingEngine");
@@ -765,26 +673,24 @@ public class BSFManager {
         final String engineClassName = (String) registeredEngines.get(lang);
         if (engineClassName == null) {
             logger.error("[BSFManager] unsupported language: " + lang);
-            throw new BSFException(BSFException.REASON_UNKNOWN_LANGUAGE,
-                                   "[BSFManager.loadScriptingEngine()] unsupported language: " + lang);
+            throw new BSFException(BSFException.REASON_UNKNOWN_LANGUAGE, "[BSFManager.loadScriptingEngine()] unsupported language: " + lang);
         }
 
         // create the engine and initialize it. if anything goes wrong
         // except.
         try {
 
-            Class engineClass=null;
+            Class engineClass = null;
 
-            final ClassLoader tccl=Thread.currentThread().getContextClassLoader();
-            if (tccl!=null) {
+            final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+            if (tccl != null) {
                 try {
-                    engineClass = tccl.loadClass (engineClassName);
+                    engineClass = tccl.loadClass(engineClassName);
+                } catch (final ClassNotFoundException cnfe) {
                 }
-                catch (final ClassNotFoundException cnfe)
-                {}
             }
 
-            if (engineClass==null)      // not found, try the defined classLoader
+            if (engineClass == null) // not found, try the defined classLoader
             {
                 engineClass = definedClassLoader.loadClass(engineClassName);
             }
@@ -794,31 +700,28 @@ public class BSFManager {
             final String langf = lang;
             final Vector dbf = declaredBeans;
             AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        engf.initialize(thisf, langf, dbf);
-                        return null;
-                    }
-                });
+                public Object run() throws Exception {
+                    engf.initialize(thisf, langf, dbf);
+                    return null;
+                }
+            });
             eng = engf;
             loadedEngines.put(lang, eng);
             pcs.addPropertyChangeListener(eng);
             return eng;
         } catch (final PrivilegedActionException prive) {
 
-                logger.error("[BSFManager] Exception :", prive);
-                throw (BSFException) prive.getException();
+            logger.error("[BSFManager] Exception :", prive);
+            throw (BSFException) prive.getException();
         } catch (final Throwable t) {
 
             logger.error("[BSFManager] Exception :", t);
-            throw new BSFException(BSFException.REASON_OTHER_ERROR,
-                                   "[BSFManager.loadScriptingEngine()] unable to load language: " + lang,
-                                   t);
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "[BSFManager.loadScriptingEngine()] unable to load language: " + lang, t);
         }
     }
 
     /**
-     * return a handle to a bean registered in the bean registry by the
-     * application or a scripting engine. Returns null if bean is not found.
+     * return a handle to a bean registered in the bean registry by the application or a scripting engine. Returns null if bean is not found.
      *
      * @param beanName name of bean to look up
      *
@@ -828,7 +731,7 @@ public class BSFManager {
         logger.debug("BSFManager:lookupBean");
 
         try {
-            return ((BSFDeclaredBean)objectRegistry.lookup(beanName)).bean;
+            return ((BSFDeclaredBean) objectRegistry.lookup(beanName)).bean;
         } catch (final IllegalArgumentException e) {
 
             logger.debug("[BSFManager] Exception :", e);
@@ -837,8 +740,7 @@ public class BSFManager {
     }
 
     /**
-     * Registering a bean allows a scripting engine or the application to
-     * access that bean by name and to manipulate it.
+     * Registering a bean allows a scripting engine or the application to access that bean by name and to manipulate it.
      *
      * @param beanName name to register under
      * @param bean     the bean to register
@@ -848,7 +750,7 @@ public class BSFManager {
 
         BSFDeclaredBean tempBean;
 
-        if(bean == null) {
+        if (bean == null) {
             tempBean = new BSFDeclaredBean(beanName, null, null);
         } else {
 
@@ -858,18 +760,13 @@ public class BSFManager {
     }
 
     /**
-     * Register a scripting engine in the static registry of the
-     * BSFManager.
+     * Register a scripting engine in the static registry of the BSFManager.
      *
-     * @param lang string identifying language
-     * @param engineClassName fully qualified name of the class interfacing
-     *        the language to BSF.
-     * @param extensions array of file extensions that should be mapped to
-     *        this language type. may be null.
+     * @param lang            string identifying language
+     * @param engineClassName fully qualified name of the class interfacing the language to BSF.
+     * @param extensions      array of file extensions that should be mapped to this language type. may be null.
      */
-    public static void registerScriptingEngine(final String lang,
-                                               final String engineClassName,
-                                               final String[] extensions) {
+    public static void registerScriptingEngine(final String lang, final String engineClassName, final String[] extensions) {
         registeredEngines.put(lang, engineClassName);
         if (extensions != null) {
             for (int i = 0; i < extensions.length; i++) {
@@ -881,8 +778,7 @@ public class BSFManager {
     }
 
     /**
-     * Set the class loader for those that need to use it. Default is he
-     * who loaded me or null (i.e., its Class.forName).
+     * Set the class loader for those that need to use it. Default is he who loaded me or null (i.e., its Class.forName).
      *
      * @param classLoader the class loader to use.
      */
@@ -894,8 +790,7 @@ public class BSFManager {
     }
 
     /**
-     * Set the classpath for those that need to use it. Default is the value
-     * of the java.class.path property.
+     * Set the classpath for those that need to use it. Default is the value of the java.class.path property.
      *
      * @param classPath the classpath to use
      */
@@ -907,9 +802,7 @@ public class BSFManager {
     }
 
     /**
-     * Set the object registry used by this manager. By default a new
-     * one is created when the manager is new'ed and this overwrites
-     * that one.
+     * Set the object registry used by this manager. By default a new one is created when the manager is new'ed and this overwrites that one.
      *
      * @param objectRegistry the registry to use
      */
@@ -920,14 +813,10 @@ public class BSFManager {
     }
 
     /**
-     * Temporary directory to put stuff into (for those who need to). Note
-     * that unless this directory is in the classpath or unless the
-     * classloader knows to look in here, any classes here will not
-     * be found! BSFManager provides a service method to load a class
-     * which uses either the classLoader provided by the class loader
-     * property or, if that fails, a class loader which knows to load from
-     * the tempdir to try to load the class. Default value of tempDir
-     * is "." (current working dir).
+     * Temporary directory to put stuff into (for those who need to). Note that unless this directory is in the classpath or unless the classloader knows to
+     * look in here, any classes here will not be found! BSFManager provides a service method to load a class which uses either the classLoader provided by the
+     * class loader property or, if that fails, a class loader which knows to load from the tempdir to try to load the class. Default value of tempDir is "."
+     * (current working dir).
      *
      * @param tempDir the temporary directory
      */
@@ -948,7 +837,7 @@ public class BSFManager {
         BSFEngine engine;
         while (enginesEnum.hasMoreElements()) {
             engine = (BSFEngine) enginesEnum.nextElement();
-            pcs.removePropertyChangeListener(engine);   // rgf, 2014-12-30: removing memory leak
+            pcs.removePropertyChangeListener(engine); // rgf, 2014-12-30: removing memory leak
             engine.terminate();
         }
 
@@ -956,17 +845,13 @@ public class BSFManager {
     }
 
     /**
-     * Undeclare a previously declared bean. This removes the bean from
-     * the list of declared beans in the manager as well as asks every
-     * running engine to undeclared the bean. As with above, if any
-     * of the engines except when asked to undeclare, this method does
-     * not catch that exception. Quietly returns if the bean is unknown.
+     * Undeclare a previously declared bean. This removes the bean from the list of declared beans in the manager as well as asks every running engine to
+     * undeclared the bean. As with above, if any of the engines except when asked to undeclare, this method does not catch that exception. Quietly returns if
+     * the bean is unknown.
      *
      * @param beanName name of bean to undeclare
      *
-     * @exception BSFException if any of the languages that are already
-     *            running decides to throw an exception when asked to
-     *            undeclare this bean.
+     * @exception BSFException if any of the languages that are already running decides to throw an exception when asked to undeclare this bean.
      */
     public void undeclareBean(final String beanName) throws BSFException {
         logger.debug("BSFManager:undeclareBean");
diff --git a/src/main/java/org/apache/bsf/BSF_Log.java b/src/main/java/org/apache/bsf/BSF_Log.java
index 824af61..3acb885 100644
--- a/src/main/java/org/apache/bsf/BSF_Log.java
+++ b/src/main/java/org/apache/bsf/BSF_Log.java
@@ -16,137 +16,128 @@
  */
 
 package org.apache.bsf;
-import  java.lang.reflect.*;
 
-/** This class is used in BSF for logging (a delegator for <em>org.apache.commons.logging</em>,
- *  which is needed for compilation) using the <code>org.apache.commons.logging.Log</code>
- *  methods.
-
- Therefore this class implements all the  <code>org.apache.commons.logging.Log</code>
- methods. If <code>org.apache.commons.logging.LogFactory</code> is available, then this
- * class is used to get an <code>org.apache.commons.logging.Log</code> instance to which to
- * forward the message.
-
- *  Therefore, if Apache's common logging is available, then it is employed.
- * If Apache's commons logging is <em>not</em> available then a <em>no-op</em> behavior
- is employed, modelled after <code>org.apache.commons.logging.impl.NoOpLog</code>.
-
-*/
+import java.lang.reflect.*;
+
+/**
+ * This class is used in BSF for logging (a delegator for <em>org.apache.commons.logging</em>, which is needed for compilation) using the
+ * <code>org.apache.commons.logging.Log</code> methods.
+ * 
+ * Therefore this class implements all the <code>org.apache.commons.logging.Log</code> methods. If <code>org.apache.commons.logging.LogFactory</code> is
+ * available, then this class is used to get an <code>org.apache.commons.logging.Log</code> instance to which to forward the message.
+ * 
+ * Therefore, if Apache's common logging is available, then it is employed. If Apache's commons logging is <em>not</em> available then a <em>no-op</em> behavior
+ * is employed, modelled after <code>org.apache.commons.logging.impl.NoOpLog</code>.
+ * 
+ */
 
-/* ---rgf, 2007-01-29, loading and invoking all methods via reflection
-   ---rgf, 2007-09-17, adjusted for using default class loader, if system class loader fails
-   ---rgf, 2011-01-08, cf. [https://issues.apache.org/jira/browse/BSF-37]
-                       - context class loader may not be set, account for it (2009-09-10)
-                       - fix logic error if context class loader is not set (e.g. observed on MacOSX, 2011-01-08)
-*/
+/*
+ * ---rgf, 2007-01-29, loading and invoking all methods via reflection ---rgf, 2007-09-17, adjusted for using default class loader, if system class loader fails
+ * ---rgf, 2011-01-08, cf. [https://issues.apache.org/jira/browse/BSF-37] - context class loader may not be set, account for it (2009-09-10) - fix logic error
+ * if context class loader is not set (e.g. observed on MacOSX, 2011-01-08)
+ */
 
 //@Immutable
 public class BSF_Log // implements org.apache.commons.logging.Log
 {
-    final private static int iDebug=0;  // don't show any debug-info
-    final static private Class       oac_LogFactory;
-    //NOTUSED final static private Method      oac_LogFactoryGetLog_Clazz;
-    final static private Method      oac_LogFactoryGetLog_String;
-
-    final static private Method[] meths = new Method [18];  // store the Log methods
-        // define the slots in the array
-    final private static int debug1 =  0 ;
-    final private static int debug2 =  1 ;
-    final private static int isDebugEnabled =  2 ;
-    final private static int error1 =  3 ;
-    final private static int error2 =  4 ;
-    final private static int isErrorEnabled =  5 ;
-    final private static int fatal1 =  6 ;
-    final private static int fatal2 =  7 ;
-    final private static int isFatalEnabled =  8 ;
-    final private static int info1  =  9 ;
-    final private static int info2  = 10 ;
-    final private static int isInfoEnabled  = 11 ;
-    final private static int trace1 = 12 ;
-    final private static int trace2 = 13 ;
-    final private static int isTraceEnabled = 14 ;
-    final private static int warn1  = 15 ;
-    final private static int warn2  = 16 ;
-    final private static int isWarnEnabled  = 17 ;
-
-    static {           // try to demand load the apache commons logging LogFactory
+    final private static int iDebug = 0; // don't show any debug-info
+    final static private Class oac_LogFactory;
+    // NOTUSED final static private Method oac_LogFactoryGetLog_Clazz;
+    final static private Method oac_LogFactoryGetLog_String;
+
+    final static private Method[] meths = new Method[18]; // store the Log methods
+    // define the slots in the array
+    final private static int debug1 = 0;
+    final private static int debug2 = 1;
+    final private static int isDebugEnabled = 2;
+    final private static int error1 = 3;
+    final private static int error2 = 4;
+    final private static int isErrorEnabled = 5;
+    final private static int fatal1 = 6;
+    final private static int fatal2 = 7;
+    final private static int isFatalEnabled = 8;
+    final private static int info1 = 9;
+    final private static int info2 = 10;
+    final private static int isInfoEnabled = 11;
+    final private static int trace1 = 12;
+    final private static int trace2 = 13;
+    final private static int isTraceEnabled = 14;
+    final private static int warn1 = 15;
+    final private static int warn2 = 16;
+    final private static int isWarnEnabled = 17;
+
+    static { // try to demand load the apache commons logging LogFactory
 
         Class oac_LogFactory_ = null;
-        //NOTUSED Method oac_LogFactoryGetLog_Clazz_ = null;
+        // NOTUSED Method oac_LogFactoryGetLog_Clazz_ = null;
         Method oac_LogFactoryGetLog_String_ = null;
 
-        try     // rgf, 20070917: o.k., if not found, try definedClassLoader instead
+        try // rgf, 20070917: o.k., if not found, try definedClassLoader instead
         {
-            ClassLoader cl= Thread.currentThread().getContextClassLoader();
+            ClassLoader cl = Thread.currentThread().getContextClassLoader();
 
-            final String str4Log="org.apache.commons.logging.Log";
+            final String str4Log = "org.apache.commons.logging.Log";
 
             Class logClass = null;
 
-            if (cl!=null)   // use current Thread's context class loader, if set
+            if (cl != null) // use current Thread's context class loader, if set
             {
                 try {
-                    logClass        = cl.loadClass(str4Log);
+                    logClass = cl.loadClass(str4Log);
+                } catch (final ClassNotFoundException e1) // not found by contextClassLoader
+                {
                 }
-                catch (final ClassNotFoundException e1) // not found by contextClassLoader
-                {}
             }
 
-            if (logClass==null)   // not found, try defined class loader instead
+            if (logClass == null) // not found, try defined class loader instead
             {
-                final ClassLoader defCL=BSFManager.getDefinedClassLoader();
+                final ClassLoader defCL = BSFManager.getDefinedClassLoader();
                 logClass = defCL.loadClass(str4Log);
-                cl=defCL;       // class found, hence we use the definedClassLoader here
+                cl = defCL; // class found, hence we use the definedClassLoader here
             }
 
             oac_LogFactory_ = cl.loadClass("org.apache.commons.logging.LogFactory");
 
-                // get method with Class object argument
-            //NOTUSED oac_LogFactoryGetLog_Clazz_ = oac_LogFactory_.getMethod("getLog", new Class[] {Class.class});
-
-                // get method with String object argument
-            oac_LogFactoryGetLog_String_ = oac_LogFactory_.getMethod("getLog", new Class[] {String.class});
-
-                // get the Log methods
-            final String str[][]={{"debug", "isDebugEnabled"},
-                            {"error", "isErrorEnabled"},
-                            {"fatal", "isFatalEnabled"},
-                            {"info",  "isInfoEnabled" },
-                            {"trace", "isTraceEnabled"},
-                            {"warn",  "isWarnEnabled" }};
-            int i=0;
-            for ( ; i<6; i++)
-            {
-                final int j=i*3;
-                meths[j  ]=logClass.getMethod(str[i][0], new Class[] {Object.class});
+            // get method with Class object argument
+            // NOTUSED oac_LogFactoryGetLog_Clazz_ = oac_LogFactory_.getMethod("getLog", new Class[] {Class.class});
+
+            // get method with String object argument
+            oac_LogFactoryGetLog_String_ = oac_LogFactory_.getMethod("getLog", new Class[] { String.class });
 
-                meths[j+1]=logClass.getMethod(str[i][0], new Class[] {Object.class, Throwable.class});
+            // get the Log methods
+            final String str[][] = { { "debug", "isDebugEnabled" }, { "error", "isErrorEnabled" }, { "fatal", "isFatalEnabled" }, { "info", "isInfoEnabled" },
+                    { "trace", "isTraceEnabled" }, { "warn", "isWarnEnabled" } };
+            int i = 0;
+            for (; i < 6; i++) {
+                final int j = i * 3;
+                meths[j] = logClass.getMethod(str[i][0], new Class[] { Object.class });
 
-                meths[j+2]=logClass.getMethod(str[i][1], new Class[] {} );
+                meths[j + 1] = logClass.getMethod(str[i][0], new Class[] { Object.class, Throwable.class });
+
+                meths[j + 2] = logClass.getMethod(str[i][1], new Class[] {});
 
             }
         }
 
         catch (final ClassNotFoundException e)// o.k., so we do not use org.apache.commons.logging in this run
         {
-            if (iDebug>1) {
+            if (iDebug > 1) {
                 e.printStackTrace();
             }
-            oac_LogFactory_=null;              // make sure it does not get used
-            oac_LogFactoryGetLog_String_=null; // make sure it does not get used
-        }
-        catch (final NoSuchMethodException  e)// o.k., so we do not use org.apache.commons.logging in this run
+            oac_LogFactory_ = null; // make sure it does not get used
+            oac_LogFactoryGetLog_String_ = null; // make sure it does not get used
+        } catch (final NoSuchMethodException e)// o.k., so we do not use org.apache.commons.logging in this run
         {
-            if (iDebug>1) {
+            if (iDebug > 1) {
                 e.printStackTrace();
             }
-            oac_LogFactory_=null;              // make sure it does not get used
-            oac_LogFactoryGetLog_String_=null; // make sure it does not get used
+            oac_LogFactory_ = null; // make sure it does not get used
+            oac_LogFactoryGetLog_String_ = null; // make sure it does not get used
         }
 
         // Set up final fields
         oac_LogFactory = oac_LogFactory_;
-        //NOTUSED oac_LogFactoryGetLog_Clazz = oac_LogFactoryGetLog_Clazz_;
+        // NOTUSED oac_LogFactoryGetLog_Clazz = oac_LogFactoryGetLog_Clazz_;
         oac_LogFactoryGetLog_String = oac_LogFactoryGetLog_String_;
     }
 
@@ -156,347 +147,333 @@ public class BSF_Log // implements org.apache.commons.logging.Log
     /** Proxy object for <em>org.apache.commons.logging.Log</em>, if available. */
     private final Object oac_logger;
 
-    public BSF_Log()
-    {
+    public BSF_Log() {
         this("<?>");
     }
 
-    public BSF_Log(final String name)
-    {
+    public BSF_Log(final String name) {
         Object oac_logger_ = null;
-        this.name=name;
-        if (oac_LogFactory!=null)
-        {
-            try     // try to get an org.apache.commons.logging.Log object from the LogFactory
+        this.name = name;
+        if (oac_LogFactory != null) {
+            try // try to get an org.apache.commons.logging.Log object from the LogFactory
             {
-                oac_logger_=oac_LogFactoryGetLog_String.invoke(oac_LogFactory, new Object[] {name});
+                oac_logger_ = oac_LogFactoryGetLog_String.invoke(oac_LogFactory, new Object[] { name });
+            } catch (final Exception e) {
+                e.printStackTrace();
             }
-            catch (final Exception e) { e.printStackTrace(); }
         }
         oac_logger = oac_logger_;
     }
 
-    public BSF_Log(final Class clazz)
-    {
+    public BSF_Log(final Class clazz) {
         this(clazz.getName());
     }
 
-    public void debug(final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void debug(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).debug(msg);
-            meths[debug1].invoke(oac_logger, new Object [] {msg});
+            meths[debug1].invoke(oac_logger, new Object[] { msg });
 
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void debug(final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void debug(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).debug(msg, t);
-            meths[debug2].invoke(oac_logger, new Object [] {msg, t});
+            meths[debug2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void error(final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void error(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).error(msg);
-            meths[error1].invoke(oac_logger, new Object [] {msg});
+            meths[error1].invoke(oac_logger, new Object[] { msg });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void error(final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void error(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).error(msg, t);
-            meths[error2].invoke(oac_logger, new Object [] {msg, t});
+            meths[error2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void fatal(final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void fatal(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).fatal(msg);
-            meths[fatal1].invoke(oac_logger, new Object [] {msg});
+            meths[fatal1].invoke(oac_logger, new Object[] { msg });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void fatal(final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void fatal(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).fatal(msg, t);
-            meths[fatal2].invoke(oac_logger, new Object [] {msg, t});
+            meths[fatal2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void info (final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void info(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).info(msg);
-            meths[info1].invoke(oac_logger, new Object [] {msg});
+            meths[info1].invoke(oac_logger, new Object[] { msg });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void info (final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void info(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).info(msg, t);
-            meths[info2].invoke(oac_logger, new Object [] {msg, t});
+            meths[info2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void trace(final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void trace(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).trace(msg);
-            meths[trace1].invoke(oac_logger, new Object [] {msg});
+            meths[trace1].invoke(oac_logger, new Object[] { msg });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void trace(final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void trace(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).trace(msg, t);
-            meths[trace2].invoke(oac_logger, new Object [] {msg, t});
+            meths[trace2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void warn (final Object msg)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void warn(final Object msg) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).warn(msg);
-            meths[warn1].invoke(oac_logger, new Object [] {msg});
+            meths[warn1].invoke(oac_logger, new Object[] { msg });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public void warn (final Object msg, final Throwable t)
-    {
-        if (oac_logger==null)
-         {
-            return;   // no org.apache.commons.logging.Log object ?
+    public void warn(final Object msg, final Throwable t) {
+        if (oac_logger == null) {
+            return; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // ((org.apache.commons.logging.Log) oac_logger).warn(msg, t);
-            meths[warn2].invoke(oac_logger, new Object [] {msg, t});
+            meths[warn2].invoke(oac_logger, new Object[] { msg, t });
+        } catch (final Exception e) {
+            e.printStackTrace();
         }
-        catch (final Exception e) { e.printStackTrace(); }
     }
 
-    public boolean isDebugEnabled()
-    {
-        if (oac_logger==null) {return false;}   // no org.apache.commons.logging.Log object ?
+    public boolean isDebugEnabled() {
+        if (oac_logger == null) {
+            return false;
+        } // no org.apache.commons.logging.Log object ?
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isDebugEnabled();
-            return ((Boolean) meths[isDebugEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isDebugEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-    public boolean isErrorEnabled()
-    {
-        if (oac_logger==null)
-         {
-            return false;     // no org.apache.commons.logging.Log object ?
+    public boolean isErrorEnabled() {
+        if (oac_logger == null) {
+            return false; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isErrorEnabled();
-            return ((Boolean) meths[isErrorEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isErrorEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-    public boolean isFatalEnabled()
-    {
-        if (oac_logger==null)
-         {
-            return false;     // no org.apache.commons.logging.Log object ?
+    public boolean isFatalEnabled() {
+        if (oac_logger == null) {
+            return false; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isFatalEnabled();
-            return ((Boolean) meths[isFatalEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isFatalEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-    public boolean isInfoEnabled ()
-    {
-        if (oac_logger==null)
-         {
-            return false;     // no org.apache.commons.logging.Log object ?
+    public boolean isInfoEnabled() {
+        if (oac_logger == null) {
+            return false; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isInfoEnabled();
-            return ((Boolean) meths[isInfoEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isInfoEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-    public boolean isTraceEnabled()
-    {
-        if (oac_logger==null)
-         {
-            return false;     // no org.apache.commons.logging.Log object ?
+    public boolean isTraceEnabled() {
+        if (oac_logger == null) {
+            return false; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isTraceEnabled();
-            return ((Boolean) meths[isTraceEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isTraceEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-    public boolean isWarnEnabled ()
-    {
-        if (oac_logger==null)
-         {
-            return false;     // no org.apache.commons.logging.Log object ?
+    public boolean isWarnEnabled() {
+        if (oac_logger == null) {
+            return false; // no org.apache.commons.logging.Log object ?
         }
 
-        try
-        {
+        try {
             // return ((org.apache.commons.logging.Log) oac_logger).isWarnEnabled();
-            return ((Boolean) meths[isWarnEnabled].invoke(oac_logger, new Object [] {})).booleanValue();
+            return ((Boolean) meths[isWarnEnabled].invoke(oac_logger, new Object[] {})).booleanValue();
+        } catch (final Exception e) {
+        } finally {
+            return false;
         }
-        catch (final Exception e) {  }
-        finally             { return false; }
     }
 
-        // for development purposes only (to debug this class on its own)
-    public static void main (final String args[]) {
+    // for development purposes only (to debug this class on its own)
+    public static void main(final String args[]) {
         System.out.println("in BSF_Log ...");
         System.out.println("--------------------------------------------------------");
         System.out.println("--------------------------------------------------------");
-        BSF_Log bl=new BSF_Log();
+        BSF_Log bl = new BSF_Log();
         dump(bl);
-        bl=new BSF_Log(Class.class);
+        bl = new BSF_Log(Class.class);
         dump(bl);
-        bl=new BSF_Log("Rony was here...");
+        bl = new BSF_Log("Rony was here...");
         dump(bl);
 
     }
 
-    static void dump(final BSF_Log bl)
-    {
-        System.out.println("\n\tbl=["+bl+"] --->>>   --->>>   --->>>");
-        System.err.print("/debug **/"); bl.debug("debug message. "); System.err.println("\\** debug.\\");
-        System.err.print("/error **/"); bl.error("error message. "); System.err.println("\\** error.\\");
-        System.err.print("/fatal **/"); bl.fatal("fatal message. "); System.err.println("\\** fatal.\\");
-        System.err.print("/info  **/"); bl.info ("info  message. "); System.err.println("\\** info .\\");
-        System.err.print("/trace **/"); bl.trace("trace message. "); System.err.println("\\** trace.\\");
-        System.err.print("/warn  **/"); bl.warn ("warn  message. "); System.err.println("\\** warn .\\");
+    static void dump(final BSF_Log bl) {
+        System.out.println("\n\tbl=[" + bl + "] --->>>   --->>>   --->>>");
+        System.err.print("/debug **/");
+        bl.debug("debug message. ");
+        System.err.println("\\** debug.\\");
+        System.err.print("/error **/");
+        bl.error("error message. ");
+        System.err.println("\\** error.\\");
+        System.err.print("/fatal **/");
+        bl.fatal("fatal message. ");
+        System.err.println("\\** fatal.\\");
+        System.err.print("/info  **/");
+        bl.info("info  message. ");
+        System.err.println("\\** info .\\");
+        System.err.print("/trace **/");
+        bl.trace("trace message. ");
+        System.err.println("\\** trace.\\");
+        System.err.print("/warn  **/");
+        bl.warn("warn  message. ");
+        System.err.println("\\** warn .\\");
         System.err.println();
 
-        final Throwable t=new Throwable ("Test from Rony for: "+bl);
-        System.err.print("/debug **/"); bl.debug("debug message. ", t); System.err.println("\\** debug.\\");
-        System.err.print("/error **/"); bl.error("error message. ", t); System.err.println("\\** error.\\");
-        System.err.print("/fatal **/"); bl.fatal("fatal message. ", t); System.err.println("\\** fatal.\\");
-        System.err.print("/info  **/"); bl.info ("info  message. ", t); System.err.println("\\** info .\\");
-        System.err.print("/trace **/"); bl.trace("trace message. ", t); System.err.println("\\** trace.\\");
-        System.err.print("/warn  **/"); bl.warn ("warn  message. ", t); System.err.println("\\** warn .\\");
+        final Throwable t = new Throwable("Test from Rony for: " + bl);
+        System.err.print("/debug **/");
+        bl.debug("debug message. ", t);
+        System.err.println("\\** debug.\\");
+        System.err.print("/error **/");
+        bl.error("error message. ", t);
+        System.err.println("\\** error.\\");
+        System.err.print("/fatal **/");
+        bl.fatal("fatal message. ", t);
+        System.err.println("\\** fatal.\\");
+        System.err.print("/info  **/");
+        bl.info("info  message. ", t);
+        System.err.println("\\** info .\\");
+        System.err.print("/trace **/");
+        bl.trace("trace message. ", t);
+        System.err.println("\\** trace.\\");
+        System.err.print("/warn  **/");
+        bl.warn("warn  message. ", t);
+        System.err.println("\\** warn .\\");
         System.err.println();
 
-        System.out.println("\tisDebugEnabled: "+bl.isDebugEnabled());
-        System.out.println("\tisErrorEnabled: "+bl.isErrorEnabled());
-        System.out.println("\tisFatalEnabled: "+bl.isFatalEnabled());
-        System.out.println("\tisInfo Enabled: "+bl.isInfoEnabled());
-        System.out.println("\tisTraceEnabled: "+bl.isTraceEnabled());
-        System.out.println("\tisWarn Enabled: "+bl.isWarnEnabled());
+        System.out.println("\tisDebugEnabled: " + bl.isDebugEnabled());
+        System.out.println("\tisErrorEnabled: " + bl.isErrorEnabled());
+        System.out.println("\tisFatalEnabled: " + bl.isFatalEnabled());
+        System.out.println("\tisInfo Enabled: " + bl.isInfoEnabled());
+        System.out.println("\tisTraceEnabled: " + bl.isTraceEnabled());
+        System.out.println("\tisWarn Enabled: " + bl.isWarnEnabled());
 
-        System.out.println("\tbl=["+bl+"] <<<---   <<<---   <<<---");
+        System.out.println("\tbl=[" + bl + "] <<<---   <<<---   <<<---");
         System.out.println("--------------------------------------------------------");
     }
 }
-
diff --git a/src/main/java/org/apache/bsf/BSF_LogFactory.java b/src/main/java/org/apache/bsf/BSF_LogFactory.java
index 8ac8e2d..8e46d20 100644
--- a/src/main/java/org/apache/bsf/BSF_LogFactory.java
+++ b/src/main/java/org/apache/bsf/BSF_LogFactory.java
@@ -17,27 +17,23 @@
 
 package org.apache.bsf;
 
-/** This class is used in BSF as BSF_LogFactory returning a BSF_Log instance, which is
- * a delegator for an <code>org.apache.commons.logging.Log</code> object.
+/**
+ * This class is used in BSF as BSF_LogFactory returning a BSF_Log instance, which is a delegator for an <code>org.apache.commons.logging.Log</code> object.
  *
- It implements the static <code>org.apache.commons.logging.LogFactory.getLog({String|Class} object)</code>
- * methods which return an instance of the class <code>org.apache.bsf.BSF_Log</code>, which in
- * turn implements all the methods of the <code>org.apache.commons.logging.Log</code> interface class.
+ * It implements the static <code>org.apache.commons.logging.LogFactory.getLog({String|Class} object)</code> methods which return an instance of the class
+ * <code>org.apache.bsf.BSF_Log</code>, which in turn implements all the methods of the <code>org.apache.commons.logging.Log</code> interface class.
  *
-*/
+ */
 
-public class BSF_LogFactory
-{
-    protected BSF_LogFactory() {}              // mimickries org.apache.commons.logging.LogFactory
+public class BSF_LogFactory {
+    protected BSF_LogFactory() {
+    } // mimickries org.apache.commons.logging.LogFactory
 
-    static public BSF_Log getLog (final String name)
-    {
+    static public BSF_Log getLog(final String name) {
         return new BSF_Log(name);
     }
 
-    static public BSF_Log getLog (final Class clz)
-    {
+    static public BSF_Log getLog(final Class clz) {
         return new BSF_Log(clz);
     }
 }
-
diff --git a/src/main/java/org/apache/bsf/Main.java b/src/main/java/org/apache/bsf/Main.java
index b30acef..ad37dee 100644
--- a/src/main/java/org/apache/bsf/Main.java
+++ b/src/main/java/org/apache/bsf/Main.java
@@ -32,8 +32,7 @@ import org.apache.bsf.util.CodeBuffer;
 import org.apache.bsf.util.IOUtils;
 
 /**
- * This is the main driver for BSF to be run on the command line
- * to eval/exec/compile scripts directly.
+ * This is the main driver for BSF to be run on the command line to eval/exec/compile scripts directly.
  */
 public class Main {
     private static final String ARG_IN = "-in";
@@ -77,9 +76,7 @@ public class Main {
                 if (inFileName != null) {
                     language = BSFManager.getLangFromFilename(inFileName);
                 } else {
-                    throw new BSFException(
-                        BSFException.REASON_OTHER_ERROR,
-                        "unable to determine language");
+                    throw new BSFException(BSFException.REASON_OTHER_ERROR, "unable to determine language");
                 }
             }
 
@@ -102,13 +99,7 @@ public class Main {
 
                 final CodeBuffer cb = new CodeBuffer();
                 cb.setClassName(outClassName);
-                mgr.compileScript(
-                    language,
-                    inFileName,
-                    0,
-                    0,
-                    IOUtils.getStringFromReader(in),
-                    cb);
+                mgr.compileScript(language, inFileName, 0, 0, IOUtils.getStringFromReader(in), cb);
                 cb.print(pw, true);
                 out.close();
             } else {
@@ -124,20 +115,18 @@ public class Main {
                         if (obj instanceof Frame) {
                             f = (Frame) obj;
                         } else {
-                            f = new Frame ("BSF Result: " + inFileName);
-                            f.add ((java.awt.Component) obj);
+                            f = new Frame("BSF Result: " + inFileName);
+                            f.add((java.awt.Component) obj);
                         }
                         // Add a window listener to quit on closing.
-                        f.addWindowListener(
-                                new WindowAdapter () {
-                                    public void windowClosing (final WindowEvent e) {
-                                        System.exit (0);
-                                    }
-                                }
-                        );
-                        f.pack ();
-                        // f.show(); // javac 1.5 warns to use f.show(), Apache build scripts abort as a result  :(
-                        f.setVisible(true);     // available since Java 1.1
+                        f.addWindowListener(new WindowAdapter() {
+                            public void windowClosing(final WindowEvent e) {
+                                System.exit(0);
+                            }
+                        });
+                        f.pack();
+                        // f.show(); // javac 1.5 warns to use f.show(), Apache build scripts abort as a result :(
+                        f.setVisible(true); // available since Java 1.1
                     } else {
                         System.err.println("Result: " + obj);
 
@@ -158,27 +147,15 @@ public class Main {
         System.err.println();
         System.err.println("    args:");
         System.err.println();
-        System.err.println(
-            "      [-in                fileName]   default: " + DEFAULT_IN_FILE_NAME);
-        System.err.println(
-            "      [-lang          languageName]   default: "
-                + "<If -in is specified and -lang");
-        System.err.println(
-            "                                               "
-                + " is not, attempt to determine");
-        System.err.println(
-            "                                               "
-                + " language from file extension;");
-        System.err.println(
-            "                                               "
-                + " otherwise, -lang is required.>");
-        System.err.println(
-            "      [-mode   (eval|exec|compile)]   default: " + DEFAULT_MODE);
+        System.err.println("      [-in                fileName]   default: " + DEFAULT_IN_FILE_NAME);
+        System.err.println("      [-lang          languageName]   default: " + "<If -in is specified and -lang");
+        System.err.println("                                               " + " is not, attempt to determine");
+        System.err.println("                                               " + " language from file extension;");
+        System.err.println("                                               " + " otherwise, -lang is required.>");
+        System.err.println("      [-mode   (eval|exec|compile)]   default: " + DEFAULT_MODE);
         System.err.println();
-        System.err.println(
-            "    Additional args used only if -mode is " + "set to \"compile\":");
+        System.err.println("    Additional args used only if -mode is " + "set to \"compile\":");
         System.err.println();
-        System.err.println(
-            "      [-out              className]   default: " + DEFAULT_CLASS_NAME);
+        System.err.println("      [-out              className]   default: " + DEFAULT_CLASS_NAME);
     }
 }
diff --git a/src/main/java/org/apache/bsf/engines/jacl/BSFCommand.java b/src/main/java/org/apache/bsf/engines/jacl/BSFCommand.java
index 0d0aaaf..d516eb1 100644
--- a/src/main/java/org/apache/bsf/engines/jacl/BSFCommand.java
+++ b/src/main/java/org/apache/bsf/engines/jacl/BSFCommand.java
@@ -31,78 +31,68 @@ import tcl.lang.TclObject;
 
 // class used to add "bsf" command to the Jacl runtime
 class BSFCommand implements Command {
-  BSFManager mgr;
-  BSFEngine jengine;
+    BSFManager mgr;
+    BSFEngine jengine;
 
-  BSFCommand (final BSFManager mgr, final BSFEngine jengine) {
-    this.mgr = mgr;
-    this.jengine = jengine;
-  }
-  public void cmdProc (final Interp interp,
-               final TclObject argv[]) throws TclException {
-    if (argv.length < 2) {
-      interp.setResult ("invalid # of args; usage: bsf " +
-        "lookupBean|registerBean|unregisterBean|addEventListener args");
-      throw new TclException (TCL.ERROR);
+    BSFCommand(final BSFManager mgr, final BSFEngine jengine) {
+        this.mgr = mgr;
+        this.jengine = jengine;
     }
 
-    final String op = argv[1].toString ();
+    public void cmdProc(final Interp interp, final TclObject argv[]) throws TclException {
+        if (argv.length < 2) {
+            interp.setResult("invalid # of args; usage: bsf " + "lookupBean|registerBean|unregisterBean|addEventListener args");
+            throw new TclException(TCL.ERROR);
+        }
 
-    if (op.equals ("lookupBean")) {
-      if (argv.length != 3) {
-    interp.setResult ("invalid # of args; usage: bsf " +
-              "lookupBean name-of-bean");
-    throw new TclException (TCL.ERROR);
-      }
+        final String op = argv[1].toString();
 
-      final String beanName = argv[2].toString ();
-      final Object bean = mgr.lookupBean (beanName);
-      if (bean == null) {
-    interp.setResult ("unknown object: " + beanName);
-    throw new TclException (TCL.ERROR);
-      }
-      interp.setResult (ReflectObject.newInstance (interp, bean.getClass (),
-                           bean));
+        if (op.equals("lookupBean")) {
+            if (argv.length != 3) {
+                interp.setResult("invalid # of args; usage: bsf " + "lookupBean name-of-bean");
+                throw new TclException(TCL.ERROR);
+            }
 
-    } else if (op.equals ("registerBean")) {
-      if (argv.length != 4) {
-    interp.setResult ("invalid # of args; usage: bsf " +
-              "registerBean name-of-bean bean");
-    throw new TclException (TCL.ERROR);
-      }
-      mgr.registerBean (argv[2].toString (),
-            ReflectObject.get (interp, argv[3]));
-      interp.setResult ("");
+            final String beanName = argv[2].toString();
+            final Object bean = mgr.lookupBean(beanName);
+            if (bean == null) {
+                interp.setResult("unknown object: " + beanName);
+                throw new TclException(TCL.ERROR);
+            }
+            interp.setResult(ReflectObject.newInstance(interp, bean.getClass(), bean));
 
-    } else if (op.equals ("unregisterBean")) {
-      if (argv.length != 3) {
-    interp.setResult ("invalid # of args; usage: bsf " +
-              "unregisterBean name-of-bean");
-    throw new TclException (TCL.ERROR);
-      }
-      mgr.unregisterBean (argv[2].toString ());
-      interp.setResult ("");
+        } else if (op.equals("registerBean")) {
+            if (argv.length != 4) {
+                interp.setResult("invalid # of args; usage: bsf " + "registerBean name-of-bean bean");
+                throw new TclException(TCL.ERROR);
+            }
+            mgr.registerBean(argv[2].toString(), ReflectObject.get(interp, argv[3]));
+            interp.setResult("");
 
-    } else if (op.equals ("addEventListener")) {
-      if (argv.length != 6) {
-    interp.setResult ("invalid # of args; usage: bsf " +
-              "addEventListener object event-set-name filter " +
-              "script-to-run");
-    throw new TclException (TCL.ERROR);
-      }
-      try {
-    // usage: bsf addEventListener object event-set filter script
-    String filter = argv[4].toString ();
-    filter = filter.equals ("") ? null : filter;
-    EngineUtils.addEventListener (ReflectObject.get (interp, argv[2]),
-                      argv[3].toString (), filter,
-                      jengine, mgr, "<event-script>", 0, 0,
-                      argv[5].toString ());
-      } catch (final BSFException e) {
-    e.printStackTrace ();
-    interp.setResult ("got BSF exception: " + e.getMessage ());
-    throw new TclException (TCL.ERROR);
-      }
+        } else if (op.equals("unregisterBean")) {
+            if (argv.length != 3) {
+                interp.setResult("invalid # of args; usage: bsf " + "unregisterBean name-of-bean");
+                throw new TclException(TCL.ERROR);
+            }
+            mgr.unregisterBean(argv[2].toString());
+            interp.setResult("");
+
+        } else if (op.equals("addEventListener")) {
+            if (argv.length != 6) {
+                interp.setResult("invalid # of args; usage: bsf " + "addEventListener object event-set-name filter " + "script-to-run");
+                throw new TclException(TCL.ERROR);
+            }
+            try {
+                // usage: bsf addEventListener object event-set filter script
+                String filter = argv[4].toString();
+                filter = filter.equals("") ? null : filter;
+                EngineUtils.addEventListener(ReflectObject.get(interp, argv[2]), argv[3].toString(), filter, jengine, mgr, "<event-script>", 0, 0,
+                        argv[5].toString());
+            } catch (final BSFException e) {
+                e.printStackTrace();
+                interp.setResult("got BSF exception: " + e.getMessage());
+                throw new TclException(TCL.ERROR);
+            }
+        }
     }
-  }
 }
diff --git a/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java b/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
index 866551a..325d613 100644
--- a/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
+++ b/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
@@ -33,107 +33,98 @@ import tcl.lang.TclObject;
 import tcl.lang.TclString;
 
 /**
- * This is the interface to Scriptics's Jacl (Tcl) from the
- * Bean Scripting Framework.
+ * This is the interface to Scriptics's Jacl (Tcl) from the Bean Scripting Framework.
  * <p>
  */
 
 public class JaclEngine extends BSFEngineImpl {
-  /* the Jacl interpretor object */
-  private Interp interp;
-
-  /**
-   *
-   * @param method The name of the method to call.
-   * @param args an array of arguments to be
-   * passed to the extension, which may be either
-   * Vectors of Nodes, or Strings.
-   */
-  public Object call (final Object obj, final String method, final Object[] args)
-                                                        throws BSFException {
-    final StringBuffer tclScript = new StringBuffer (method);
-    if (args != null) {
-      for( int i = 0 ; i < args.length ; i++ ) {
-    tclScript.append (" ");
-    tclScript.append (args[i].toString ());
-      }
-    }
-    return eval ("<function call>", 0, 0, tclScript.toString ());
-  }
-  /**
-   * Declare a bean
-   */
-  public void declareBean (final BSFDeclaredBean bean) throws BSFException {
-    final String expr = "set " + bean.name + " [bsf lookupBean \"" + bean.name +
-	  "\"]";
-    eval ("<declare bean>", 0, 0, expr);
-  }
-  /**
-   * This is used by an application to evaluate a string containing
-   * some expression.
-   */
-  public Object eval (final String source, final int lineNo, final int columnNo,
-              final Object oscript) throws BSFException {
-    final String script = oscript.toString ();
-    try {
-      interp.eval (script);
-      final TclObject result = interp.getResult();
-      final Object internalRep = result.getInternalRep();
-
-      // if the object has a corresponding Java type, unwrap it
-      if (internalRep instanceof ReflectObject) {
-        return ReflectObject.get(interp,result);
-    }
-      if (internalRep instanceof TclString) {
-        return result.toString();
-    }
-      if (internalRep instanceof TclDouble) {
-        return new Double(TclDouble.get(interp,result));
+    /* the Jacl interpretor object */
+    private Interp interp;
+
+    /**
+     *
+     * @param method The name of the method to call.
+     * @param args   an array of arguments to be passed to the extension, which may be either Vectors of Nodes, or Strings.
+     */
+    public Object call(final Object obj, final String method, final Object[] args) throws BSFException {
+        final StringBuffer tclScript = new StringBuffer(method);
+        if (args != null) {
+            for (int i = 0; i < args.length; i++) {
+                tclScript.append(" ");
+                tclScript.append(args[i].toString());
+            }
+        }
+        return eval("<function call>", 0, 0, tclScript.toString());
     }
-      if (internalRep instanceof TclInteger) {
-        return new Integer(TclInteger.get(interp,result));
+
+    /**
+     * Declare a bean
+     */
+    public void declareBean(final BSFDeclaredBean bean) throws BSFException {
+        final String expr = "set " + bean.name + " [bsf lookupBean \"" + bean.name + "\"]";
+        eval("<declare bean>", 0, 0, expr);
     }
 
-      return result;
-    } catch (final TclException e) {
-      throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                  "error while eval'ing Jacl expression: " +
-                  interp.getResult (), e);
+    /**
+     * This is used by an application to evaluate a string containing some expression.
+     */
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript) throws BSFException {
+        final String script = oscript.toString();
+        try {
+            interp.eval(script);
+            final TclObject result = interp.getResult();
+            final Object internalRep = result.getInternalRep();
+
+            // if the object has a corresponding Java type, unwrap it
+            if (internalRep instanceof ReflectObject) {
+                return ReflectObject.get(interp, result);
+            }
+            if (internalRep instanceof TclString) {
+                return result.toString();
+            }
+            if (internalRep instanceof TclDouble) {
+                return new Double(TclDouble.get(interp, result));
+            }
+            if (internalRep instanceof TclInteger) {
+                return new Integer(TclInteger.get(interp, result));
+            }
+
+            return result;
+        } catch (final TclException e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "error while eval'ing Jacl expression: " + interp.getResult(), e);
+        }
     }
-  }
-  /**
-   * Initialize the engine.
-   */
-  public void initialize (final BSFManager mgr, final String lang,
-              final Vector declaredBeans) throws BSFException {
-    super.initialize (mgr, lang, declaredBeans);
-
-    // create interpreter
-    interp = new Interp();
-
-    // register the extension that user's can use to get at objects
-    // registered by the app
-    interp.createCommand ("bsf", new BSFCommand (mgr, this));
-
-    // Make java functions be available to Jacl
+
+    /**
+     * Initialize the engine.
+     */
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
+        super.initialize(mgr, lang, declaredBeans);
+
+        // create interpreter
+        interp = new Interp();
+
+        // register the extension that user's can use to get at objects
+        // registered by the app
+        interp.createCommand("bsf", new BSFCommand(mgr, this));
+
+        // Make java functions be available to Jacl
         try {
-        interp.eval("jaclloadjava");
-    } catch (final TclException e) {
-        throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                    "error while loading java package: " +
-                    interp.getResult (), e);
+            interp.eval("jaclloadjava");
+        } catch (final TclException e) {
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "error while loading java package: " + interp.getResult(), e);
+        }
+
+        final int size = declaredBeans.size();
+        for (int i = 0; i < size; i++) {
+            declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
+        }
     }
 
-    final int size = declaredBeans.size ();
-    for (int i = 0; i < size; i++) {
-      declareBean ((BSFDeclaredBean) declaredBeans.elementAt (i));
+    /**
+     * Undeclare a previously declared bean.
+     */
+    public void undeclareBean(final BSFDeclaredBean bean) throws BSFException {
+        eval("<undeclare bean>", 0, 0, "set " + bean.name + " \"\"");
     }
-  }
-
-  /**
-   * Undeclare a previously declared bean.
-   */
-  public void undeclareBean (final BSFDeclaredBean bean) throws BSFException {
-    eval ("<undeclare bean>", 0, 0, "set " + bean.name + " \"\"");
-  }
 }
diff --git a/src/main/java/org/apache/bsf/engines/java/JavaEngine.java b/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
index adc84ab..82cce45 100644
--- a/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
+++ b/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
@@ -37,12 +37,11 @@ import org.apache.bsf.util.MethodUtils;
 import org.apache.bsf.util.ObjInfo;
 
 /**
- * This is the interface to Java from the
- * Bean Scripting Framework.
+ * This is the interface to Java from the Bean Scripting Framework.
  * <p>
- * The Java code must be written script-style -- that is, just the body of
- * the function, without class or method headers or footers.
- * The JavaEngine will generate those via a "boilerplate" wrapper:
+ * The Java code must be written script-style -- that is, just the body of the function, without class or method headers or footers. The JavaEngine will
+ * generate those via a "boilerplate" wrapper:
+ * 
  * <pre>
  * <code>
  * import java.lang.*;
@@ -54,32 +53,24 @@ import org.apache.bsf.util.ObjInfo;
  * }
  * </code>
  * </pre>
- * $$CLASSNAME$$ will be replaced by a generated classname of the form
- * BSFJava*, and the bsf parameter can be used to retrieve application
- * objects registered with the Bean Scripting Framework.
+ * 
+ * $$CLASSNAME$$ will be replaced by a generated classname of the form BSFJava*, and the bsf parameter can be used to retrieve application objects registered
+ * with the Bean Scripting Framework.
  * <p>
- * If you use the placeholder string $$CLASSNAME$$ elsewhere
- * in your script -- including within text strings -- BSFJavaEngine will
- * replace it with the generated name of the class before the Java code
- * is compiled.
+ * If you use the placeholder string $$CLASSNAME$$ elsewhere in your script -- including within text strings -- BSFJavaEngine will replace it with the generated
+ * name of the class before the Java code is compiled.
  * <p>
  * <h2>Hazards:</h2>
  * <p>
- * NOTE that it is your responsibility to convert the code into an acceptable
- * Java string. If you're invoking the JavaEngine directly (as in the
- * JSPLikeInJava example) that means \"quoting\" characters that would
- * otherwise cause trouble.
+ * NOTE that it is your responsibility to convert the code into an acceptable Java string. If you're invoking the JavaEngine directly (as in the JSPLikeInJava
+ * example) that means \"quoting\" characters that would otherwise cause trouble.
  * <p>
- * ALSO NOTE that it is your responsibility to return an object, or null in
- * lieu thereof!
+ * ALSO NOTE that it is your responsibility to return an object, or null in lieu thereof!
  * <p>
- * Since the code has to be compiled to a Java classfile, invoking it involves
- * a fair amount of computation to load and execute the compiler. We are
- * currently making an attempt to manage that by caching the class
- * after it has been loaded, but the indexing is fairly primitive. It has
- * been suggested that the Bean Scripting Framework may want to support
- * preload-and-name-script and execute-preloaded-script-by-name options to
- * provide better control over when and how much overhead occurs.
+ * Since the code has to be compiled to a Java classfile, invoking it involves a fair amount of computation to load and execute the compiler. We are currently
+ * making an attempt to manage that by caching the class after it has been loaded, but the indexing is fairly primitive. It has been suggested that the Bean
+ * Scripting Framework may want to support preload-and-name-script and execute-preloaded-script-by-name options to provide better control over when and how much
+ * overhead occurs.
  * <p>
  */
 public class JavaEngine extends BSFEngineImpl {
@@ -93,11 +84,8 @@ public class JavaEngine extends BSFEngineImpl {
     private BSF_Log logger;
 
     /**
-     * Create a scratchfile, open it for writing, return its name.
-     * Relies on the filesystem to provide us with uniqueness testing.
-     * NOTE THAT uniqueFileOffset continues to count; we don't want to
-     * risk reusing a classname we have previously loaded in this session
-     * even if the classfile has been deleted.
+     * Create a scratchfile, open it for writing, return its name. Relies on the filesystem to provide us with uniqueness testing. NOTE THAT uniqueFileOffset
+     * continues to count; we don't want to risk reusing a classname we have previously loaded in this session even if the classfile has been deleted.
      */
     private int uniqueFileOffset = -1;
 
@@ -105,6 +93,7 @@ public class JavaEngine extends BSFEngineImpl {
         File file = null;
         FileOutputStream fos = null;
         String className = null;
+
         GeneratedFile(final File file, final FileOutputStream fos, final String className) {
             this.file = file;
             this.fos = fos;
@@ -115,51 +104,40 @@ public class JavaEngine extends BSFEngineImpl {
     /**
      * Constructor.
      */
-    public JavaEngine () {
-            // handle logger
+    public JavaEngine() {
+        // handle logger
         logger = BSF_LogFactory.getLog(this.getClass().getName());
         // Do compilation-possible check here??????????????
     }
 
-    public Object call (final Object object, final String method, final Object[] args)
-    throws BSFException
-    {
-        throw new BSFException (BSFException.REASON_UNSUPPORTED_FEATURE,
-        "call() is not currently supported by JavaEngine");
+    public Object call(final Object object, final String method, final Object[] args) throws BSFException {
+        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE, "call() is not currently supported by JavaEngine");
     }
 
-    public void compileScript (final String source, final int lineNo, final int columnNo,
-            final Object script, final CodeBuffer cb) throws BSFException {
-        final ObjInfo oldRet = cb.getFinalServiceMethodStatement ();
+    public void compileScript(final String source, final int lineNo, final int columnNo, final Object script, final CodeBuffer cb) throws BSFException {
+        final ObjInfo oldRet = cb.getFinalServiceMethodStatement();
 
-        if (oldRet != null && oldRet.isExecutable ()) {
-            cb.addServiceMethodStatement (oldRet.objName + ";");
+        if (oldRet != null && oldRet.isExecutable()) {
+            cb.addServiceMethodStatement(oldRet.objName + ";");
         }
 
-        cb.addServiceMethodStatement (script.toString ());
-        cb.setFinalServiceMethodStatement (null);
+        cb.addServiceMethodStatement(script.toString());
+        cb.setFinalServiceMethodStatement(null);
     }
 
     /**
-     * This is used by an application to evaluate a string containing
-     * some expression. It should store the "bsf" handle where the
-     * script can get to it, for callback purposes.
+     * This is used by an application to evaluate a string containing some expression. It should store the "bsf" handle where the script can get to it, for
+     * callback purposes.
      * <p>
-     * Note that Java compilation imposes serious overhead,
-     * but in exchange you get full Java performance
-     * once the classes have been created (minus the cache lookup cost).
+     * Note that Java compilation imposes serious overhead, but in exchange you get full Java performance once the classes have been created (minus the cache
+     * lookup cost).
      * <p>
-     * Nobody knows whether javac is threadsafe.
-     * I'm going to serialize access to protect it.
+     * Nobody knows whether javac is threadsafe. I'm going to serialize access to protect it.
      * <p>
-     * There is no published API for invoking javac as a class. There's a trick
-     * that seems to work for Java 1.1.x, but it stopped working in Java 1.2.
-     * We will attempt to use it, then if necessary fall back on invoking
-     * javac via the command line.
+     * There is no published API for invoking javac as a class. There's a trick that seems to work for Java 1.1.x, but it stopped working in Java 1.2. We will
+     * attempt to use it, then if necessary fall back on invoking javac via the command line.
      */
-    public Object eval (final String source, final int lineNo, final int columnNo,
-            final Object oscript) throws BSFException
-            {
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript) throws BSFException {
         Object retval = null;
         String classname = null;
         GeneratedFile gf = null;
@@ -169,39 +147,36 @@ public class JavaEngine extends BSFEngineImpl {
 
         try {
             // Do we already have a class exactly matching this code?
-            javaclass = (Class)codeToClass.get(basescript);
+            javaclass = (Class) codeToClass.get(basescript);
 
-            if(javaclass != null) {
-                classname=javaclass.getName();
+            if (javaclass != null) {
+                classname = javaclass.getName();
             } else {
-                gf = openUniqueFile(tempDir, "BSFJava",".java");
-                if( gf == null) {
+                gf = openUniqueFile(tempDir, "BSFJava", ".java");
+                if (gf == null) {
                     throw new BSFException("couldn't create JavaEngine scratchfile");
                 }
                 // Obtain classname
                 classname = gf.className;
 
                 // Write the kluge header to the file.
-                gf.fos.write(("import java.lang.*;"+
-                        "import java.util.*;"+
-                        "public class "+classname+" {\n" +
-                "  static public Object BSFJavaEngineEntry(org.apache.bsf.BSFManager bsf) {\n")
-                .getBytes());
+                gf.fos.write(("import java.lang.*;" + "import java.util.*;" + "public class " + classname + " {\n"
+                        + "  static public Object BSFJavaEngineEntry(org.apache.bsf.BSFManager bsf) {\n").getBytes());
 
                 // Edit the script to replace placeholder with the generated
                 // classname. Note that this occurs _after_ the cache was checked!
                 int startpoint = script.indexOf(placeholder);
                 int endpoint;
-                if(startpoint >= 0) {
+                if (startpoint >= 0) {
                     final StringBuffer changed = new StringBuffer();
-                    for(; startpoint >=0; startpoint = script.indexOf(placeholder,startpoint)) {
-                        changed.setLength(0);   // Reset for 2nd pass or later
-                        if(startpoint > 0) {
-                            changed.append(script.substring(0,startpoint));
+                    for (; startpoint >= 0; startpoint = script.indexOf(placeholder, startpoint)) {
+                        changed.setLength(0); // Reset for 2nd pass or later
+                        if (startpoint > 0) {
+                            changed.append(script.substring(0, startpoint));
                         }
                         changed.append(classname);
-                        endpoint = startpoint+placeholder.length();
-                        if(endpoint < script.length()) {
+                        endpoint = startpoint + placeholder.length();
+                        if (endpoint < script.length()) {
                             changed.append(script.substring(endpoint));
                         }
                         script = changed.toString();
@@ -232,7 +207,7 @@ public class JavaEngine extends BSFEngineImpl {
 
                 // Compile through Java to .class file
                 // May not be threadsafe. Serialize access on static object:
-                synchronized(serializeCompilation) {
+                synchronized (serializeCompilation) {
                     JavaUtils.JDKcompile(gf.file.getPath(), classPath);
                 }
 
@@ -243,39 +218,35 @@ public class JavaEngine extends BSFEngineImpl {
                 codeToClass.put(basescript, javaclass);
             }
 
-            final Object[] callArgs = {mgr};
-            retval = internalCall(this,"BSFJavaEngineEntry",callArgs);
+            final Object[] callArgs = { mgr };
+            retval = internalCall(this, "BSFJavaEngineEntry", callArgs);
         }
 
-        catch(final Exception e) {
-            e.printStackTrace ();
-            throw new BSFException (BSFException.REASON_IO_ERROR, e.getMessage ());
+        catch (final Exception e) {
+            e.printStackTrace();
+            throw new BSFException(BSFException.REASON_IO_ERROR, e.getMessage());
         } finally {
             // Cleanup: delete the .java and .class files
 
 //          if(gf!=null && gf.file!=null && gf.file.exists())
 //          gf.file.delete();  // .java file
 
-            if(classname!=null) {
+            if (classname != null) {
                 // Generated class
-                File file = new File(tempDir+File.separatorChar+classname+".class");
+                File file = new File(tempDir + File.separatorChar + classname + ".class");
 //              if(file.exists())
 //              file.delete();
 
                 // Search for and clean up minor classes, classname$xxx.class
-                file = new File(tempDir);  // ***** Is this required?
-                minorPrefix = classname+"$"; // Indirect arg to filter
-                final String[] minorClassfiles = file.list(new FilenameFilter()
-                            {
-                        // Starts with classname$ and ends with .class
-                        public boolean accept(final File dir,final String name) {
-                            return
-                            (0 == name.indexOf(minorPrefix))
-                            &&
-                            (name.lastIndexOf(".class") == name.length()-6);
-                        }
-                            });
-                for(int i = 0; i < minorClassfiles.length; ++i) {
+                file = new File(tempDir); // ***** Is this required?
+                minorPrefix = classname + "$"; // Indirect arg to filter
+                final String[] minorClassfiles = file.list(new FilenameFilter() {
+                    // Starts with classname$ and ends with .class
+                    public boolean accept(final File dir, final String name) {
+                        return (0 == name.indexOf(minorPrefix)) && (name.lastIndexOf(".class") == name.length() - 6);
+                    }
+                });
+                for (int i = 0; i < minorClassfiles.length; ++i) {
                     file = new File(minorClassfiles[i]);
 //                  file.delete();
                 }
@@ -284,70 +255,65 @@ public class JavaEngine extends BSFEngineImpl {
         return retval;
     }
 
-    public void initialize (final BSFManager mgr, final String lang,
-            final Vector declaredBeans) throws BSFException {
-        super.initialize (mgr, lang, declaredBeans);
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
+        super.initialize(mgr, lang, declaredBeans);
     }
+
     /**
      * Return an object from an extension.
+     * 
      * @param object Object on which to make the internal_call (ignored).
      * @param method The name of the method to internal_call.
-     * @param args an array of arguments to be
-     * passed to the extension, which may be either
-     * Vectors of Nodes, or Strings.
+     * @param args   an array of arguments to be passed to the extension, which may be either Vectors of Nodes, or Strings.
      */
-    Object internalCall (final Object object, final String method, final Object[] args)
-    throws BSFException
-    {
-        //***** ISSUE: Only static methods are currently supported
+    Object internalCall(final Object object, final String method, final Object[] args) throws BSFException {
+        // ***** ISSUE: Only static methods are currently supported
         Object retval = null;
         try {
-            if(javaclass != null) {
-                //***** This should call the lookup used in BML, for typesafety
+            if (javaclass != null) {
+                // ***** This should call the lookup used in BML, for typesafety
                 final Class[] argtypes = new Class[args.length];
-                for(int i=0; i<args.length; ++i) {
-                    argtypes[i]=args[i].getClass();
+                for (int i = 0; i < args.length; ++i) {
+                    argtypes[i] = args[i].getClass();
                 }
                 final Method m = MethodUtils.getMethod(javaclass, method, argtypes);
                 retval = m.invoke(null, args);
             }
-        }
-        catch(final Exception e) {
-            throw new BSFException (BSFException.REASON_IO_ERROR, e.getMessage ());
+        } catch (final Exception e) {
+            throw new BSFException(BSFException.REASON_IO_ERROR, e.getMessage());
         }
         return retval;
     }
 
-    private GeneratedFile openUniqueFile(final String directory,final String prefix,final String suffix) {
+    private GeneratedFile openUniqueFile(final String directory, final String prefix, final String suffix) {
         File file = null;
         FileOutputStream fos = null;
-        final int max = 1000;     // Don't try forever
+        final int max = 1000; // Don't try forever
         GeneratedFile gf = null;
         int i;
         String className = null;
-        for(i=max,++uniqueFileOffset; fos==null && i>0;--i,++uniqueFileOffset) {
+        for (i = max, ++uniqueFileOffset; fos == null && i > 0; --i, ++uniqueFileOffset) {
             // Probably a timing hazard here... ***************
             try {
-                className = prefix+uniqueFileOffset;
-                file = new File(directory+File.separatorChar+className+suffix);
-                if(file != null && !file.exists()) {
+                className = prefix + uniqueFileOffset;
+                file = new File(directory + File.separatorChar + className + suffix);
+                if (file != null && !file.exists()) {
                     fos = new FileOutputStream(file);
                 }
-            }
-            catch(final Exception e) {
+            } catch (final Exception e) {
                 // File could not be opened for write, or Security Exception
                 // was thrown. If someone else created the file before we could
                 // open it, that's probably a threading conflict and we don't
                 // bother reporting it.
-                if(!file.exists()) {
+                if (!file.exists()) {
                     logger.error("openUniqueFile: unexpected ", e);
                 }
             }
         }
-        if(fos==null) {
-            logger.error("openUniqueFile: Failed "+max+"attempts.");
+        if (fos == null) {
+            logger.error("openUniqueFile: Failed " + max + "attempts.");
         } else {
-            gf = new GeneratedFile(file,fos,className);
+            gf = new GeneratedFile(file, fos, className);
         }
         return gf;
     }
diff --git a/src/main/java/org/apache/bsf/engines/javaclass/JavaClassEngine.java b/src/main/java/org/apache/bsf/engines/javaclass/JavaClassEngine.java
index ca27e45..a25bd09 100644
--- a/src/main/java/org/apache/bsf/engines/javaclass/JavaClassEngine.java
+++ b/src/main/java/org/apache/bsf/engines/javaclass/JavaClassEngine.java
@@ -25,48 +25,38 @@ import org.apache.bsf.util.BSFEngineImpl;
 import org.apache.bsf.util.MethodUtils;
 
 /**
- * This is the interface to scripts consisting of Java objects from the
- * Bean Scripting Framework.
+ * This is the interface to scripts consisting of Java objects from the Bean Scripting Framework.
  */
 public class JavaClassEngine extends BSFEngineImpl {
-  /**
-   * call the named method of the given object. If object is an instance
-   * of Class, then the call is a static call on that object. If not, its
-   * an instance method call or a static call (as per Java) on the given
-   * object.
-   */
-  public Object call (final Object object, final String method, final Object[] args)
-                                                        throws BSFException {
-    // determine arg types
-    Class[] argTypes = null;
-    if (args != null) {
-      argTypes = new Class[args.length];
-      for (int i = 0; i < args.length; i++) {
-    argTypes[i] = (args[i] != null) ? args[i].getClass () : null;
-      }
+    /**
+     * call the named method of the given object. If object is an instance of Class, then the call is a static call on that object. If not, its an instance
+     * method call or a static call (as per Java) on the given object.
+     */
+    public Object call(final Object object, final String method, final Object[] args) throws BSFException {
+        // determine arg types
+        Class[] argTypes = null;
+        if (args != null) {
+            argTypes = new Class[args.length];
+            for (int i = 0; i < args.length; i++) {
+                argTypes[i] = (args[i] != null) ? args[i].getClass() : null;
+            }
+        }
+
+        // now find method with the right signature, call it and return result
+        try {
+            final Method m = MethodUtils.getMethod(object, method, argTypes);
+            return m.invoke(object, args);
+        } catch (final Exception e) {
+            // something went wrong while invoking method
+            final Throwable t = (e instanceof InvocationTargetException) ? ((InvocationTargetException) e).getTargetException() : null;
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "method invocation failed: " + e + ((t == null) ? "" : (" target exception: " + t)), t);
+        }
     }
 
-    // now find method with the right signature, call it and return result
-    try {
-      final Method m = MethodUtils.getMethod (object, method, argTypes);
-      return m.invoke (object, args);
-    } catch (final Exception e) {
-      // something went wrong while invoking method
-      final Throwable t = (e instanceof InvocationTargetException) ?
-                ((InvocationTargetException)e).getTargetException () :
-                null;
-      throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                  "method invocation failed: " + e +
-                  ((t==null)?"":(" target exception: "+t)), t);
+    /**
+     * This is used by an application to evaluate an object containing some expression - clearly not possible for compiled code ..
+     */
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript) throws BSFException {
+        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE, "Java bytecode engine can't evaluate expressions");
     }
-  }
-  /**
-   * This is used by an application to evaluate an object containing
-   * some expression - clearly not possible for compiled code ..
-   */
-  public Object eval (final String source, final int lineNo, final int columnNo,
-              final Object oscript) throws BSFException {
-    throw new BSFException (BSFException.REASON_UNSUPPORTED_FEATURE,
-                "Java bytecode engine can't evaluate expressions");
-  }
 }
diff --git a/src/main/java/org/apache/bsf/engines/javascript/JavaScriptEngine.java b/src/main/java/org/apache/bsf/engines/javascript/JavaScriptEngine.java
index 32867d4..e2bb032 100644
--- a/src/main/java/org/apache/bsf/engines/javascript/JavaScriptEngine.java
+++ b/src/main/java/org/apache/bsf/engines/javascript/JavaScriptEngine.java
@@ -36,29 +36,24 @@ import org.mozilla.javascript.WrappedException;
 import org.mozilla.javascript.Wrapper;
 
 /**
- * This is the interface to Netscape's Rhino (JavaScript) from the
- * Bean Scripting Framework.
+ * This is the interface to Netscape's Rhino (JavaScript) from the Bean Scripting Framework.
  * <p>
- * The original version of this code was first written by Adam Peller
- * for use in LotusXSL. Sanjiva took his code and adapted it for BSF.
+ * The original version of this code was first written by Adam Peller for use in LotusXSL. Sanjiva took his code and adapted it for BSF.
  */
 public class JavaScriptEngine extends BSFEngineImpl {
     /**
-     * The global script object, where all embedded functions are defined,
-     * as well as the standard ECMA "core" objects.
+     * The global script object, where all embedded functions are defined, as well as the standard ECMA "core" objects.
      */
     private Scriptable global;
 
     /**
      * Return an object from an extension.
+     * 
      * @param object Object on which to make the call (ignored).
      * @param method The name of the method to call.
-     * @param args an array of arguments to be
-     * passed to the extension, which may be either
-     * Vectors of Nodes, or Strings.
+     * @param args   an array of arguments to be passed to the extension, which may be either Vectors of Nodes, or Strings.
      */
-    public Object call(final Object object, final String method, final Object[] args)
-        throws BSFException {
+    public Object call(final Object object, final String method, final Object[] args) throws BSFException {
 
         Object retval = null;
         Context cx;
@@ -70,10 +65,9 @@ public class JavaScriptEngine extends BSFEngineImpl {
 
             final Object fun = global.get(method, global);
             // NOTE: Source and line arguments are nonsense in a call().
-            //       Any way to make these arguments *sensible?
+            // Any way to make these arguments *sensible?
             if (fun == Scriptable.NOT_FOUND) {
-                throw new EvaluatorException("function " + method +
-                                             " not found.", "none", 0);
+                throw new EvaluatorException("function " + method + " not found.", "none", 0);
             }
 
             cx.setOptimizationLevel(-1);
@@ -82,31 +76,25 @@ public class JavaScriptEngine extends BSFEngineImpl {
             cx.setOptimizationLevel(0);
             cx.setDebugger(null, null);
 
-            retval =
-                ((Function) fun).call(cx, global, global, args);
+            retval = ((Function) fun).call(cx, global, global, args);
 
 //                ScriptRuntime.call(cx, fun, global, args, global);
 
             if (retval instanceof Wrapper) {
                 retval = ((Wrapper) retval).unwrap();
             }
-        }
-        catch (final Throwable t) {
+        } catch (final Throwable t) {
             handleError(t);
-        }
-        finally {
+        } finally {
             Context.exit();
         }
         return retval;
     }
 
     public void declareBean(final BSFDeclaredBean bean) throws BSFException {
-        if ((bean.bean instanceof Number) ||
-            (bean.bean instanceof String) ||
-            (bean.bean instanceof Boolean)) {
+        if ((bean.bean instanceof Number) || (bean.bean instanceof String) || (bean.bean instanceof Boolean)) {
             global.put(bean.name, global, bean.bean);
-        }
-        else {
+        } else {
             // Must wrap non-scriptable objects before presenting to Rhino
             final Scriptable wrapped = Context.toObject(bean.bean, global);
             global.put(bean.name, global, wrapped);
@@ -114,11 +102,9 @@ public class JavaScriptEngine extends BSFEngineImpl {
     }
 
     /**
-     * This is used by an application to evaluate a string containing
-     * some expression.
+     * This is used by an application to evaluate a string containing some expression.
      */
-    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript)
-        throws BSFException {
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript) throws BSFException {
 
         final String scriptText = oscript.toString();
         Object retval = null;
@@ -133,19 +119,15 @@ public class JavaScriptEngine extends BSFEngineImpl {
             cx.setOptimizationLevel(0);
             cx.setDebugger(null, null);
 
-            retval = cx.evaluateString(global, scriptText,
-                                       source, lineNo,
-                                       null);
+            retval = cx.evaluateString(global, scriptText, source, lineNo, null);
 
             if (retval instanceof NativeJavaObject) {
                 retval = ((NativeJavaObject) retval).unwrap();
             }
 
-        }
-        catch (final Throwable t) { // includes JavaScriptException, rethrows Errors
+        } catch (final Throwable t) { // includes JavaScriptException, rethrows Errors
             handleError(t);
-        }
-        finally {
+        } finally {
             Context.exit();
         }
         return retval;
@@ -169,15 +151,11 @@ public class JavaScriptEngine extends BSFEngineImpl {
                 // Display its stack trace as a diagnostic
                 target = (Throwable) value;
             }
-        }
-        else if (t instanceof EvaluatorException ||
-                 t instanceof SecurityException) {
+        } else if (t instanceof EvaluatorException || t instanceof SecurityException) {
             message = t.getLocalizedMessage();
-        }
-        else if (t instanceof RuntimeException) {
+        } else if (t instanceof RuntimeException) {
             message = "Internal Error: " + t.toString();
-        }
-        else if (t instanceof StackOverflowError) {
+        } else if (t instanceof StackOverflowError) {
             message = "Stack Overflow";
         }
 
@@ -191,21 +169,15 @@ public class JavaScriptEngine extends BSFEngineImpl {
             // corrected the situation by aborting the loop and
             // a long stacktrace would end up on the user's console
             throw (Error) t;
-        }
-        else {
-            throw new BSFException(BSFException.REASON_OTHER_ERROR,
-                                   "JavaScript Error: " + message,
-                                   target);
+        } else {
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "JavaScript Error: " + message, target);
         }
     }
 
     /**
-     * Initialize the engine.
-     * Put the manager into the context-manager
-     * map hashtable too.
+     * Initialize the engine. Put the manager into the context-manager map hashtable too.
      */
-    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans)
-        throws BSFException {
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
 
         super.initialize(mgr, lang, declaredBeans);
 
@@ -216,14 +188,12 @@ public class JavaScriptEngine extends BSFEngineImpl {
             final Scriptable bsf = Context.toObject(new BSFFunctions(mgr, this), global);
             global.put("bsf", global, bsf);
 
-            for(final Iterator it = declaredBeans.iterator(); it.hasNext();) {
+            for (final Iterator it = declaredBeans.iterator(); it.hasNext();) {
                 declareBean((BSFDeclaredBean) it.next());
             }
-        }
-        catch (final Throwable t) {
+        } catch (final Throwable t) {
 
-        }
-        finally {
+        } finally {
             Context.exit();
         }
     }
diff --git a/src/main/java/org/apache/bsf/engines/jexl/JEXLEngine.java b/src/main/java/org/apache/bsf/engines/jexl/JEXLEngine.java
index 2343ff3..df49f3f 100644
--- a/src/main/java/org/apache/bsf/engines/jexl/JEXLEngine.java
+++ b/src/main/java/org/apache/bsf/engines/jexl/JEXLEngine.java
@@ -32,8 +32,7 @@ import org.apache.commons.jexl.Script;
 import org.apache.commons.jexl.ScriptFactory;
 
 /**
- * {@link BSFEngine} for Commons JEXL.
- * Requires Commons JEXL version 1.1 or later.
+ * {@link BSFEngine} for Commons JEXL. Requires Commons JEXL version 1.1 or later.
  *
  * @see <a href="http://commons.apache.org/jexl/">Commons JEXL</a>
  *
@@ -44,18 +43,15 @@ public class JEXLEngine extends BSFEngineImpl {
     private JexlContext jc;
 
     /**
-     * Initialize the JEXL engine by creating a JexlContext and populating it
-     * with the declared beans.
+     * Initialize the JEXL engine by creating a JexlContext and populating it with the declared beans.
      *
-     * @param mgr The {@link BSFManager}.
-     * @param lang The language.
+     * @param mgr           The {@link BSFManager}.
+     * @param lang          The language.
      * @param declaredBeans The vector of the initially declared beans.
      *
-     * @throws BSFException For any exception that occurs while trying to
-     *                      initialize the engine.
+     * @throws BSFException For any exception that occurs while trying to initialize the engine.
      */
-    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans)
-            throws BSFException {
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
         super.initialize(mgr, lang, declaredBeans);
         jc = JexlHelper.createContext();
         for (int i = 0; i < declaredBeans.size(); i++) {
@@ -65,8 +61,7 @@ public class JEXLEngine extends BSFEngineImpl {
     }
 
     /**
-     * Terminate the JEXL engine by clearing and destroying the backing
-     * JEXLContext.
+     * Terminate the JEXL engine by clearing and destroying the backing JEXLContext.
      */
     public void terminate() {
         if (jc != null) {
@@ -78,11 +73,9 @@ public class JEXLEngine extends BSFEngineImpl {
     /**
      * Adds this bean to the backing JexlContext.
      *
-     * @param bean The {@link BSFDeclaredBean} to be added to the backing
-     *             context.
+     * @param bean The {@link BSFDeclaredBean} to be added to the backing context.
      *
-     * @throws BSFException For any exception that occurs while trying to
-     *                      declare the bean.
+     * @throws BSFException For any exception that occurs while trying to declare the bean.
      */
     public void declareBean(final BSFDeclaredBean bean) throws BSFException {
         jc.getVars().put(bean.name, bean.bean);
@@ -91,11 +84,9 @@ public class JEXLEngine extends BSFEngineImpl {
     /**
      * Removes this bean from the backing JexlContext.
      *
-     * @param bean The {@link BSFDeclaredBean} to be removed from the backing
-     *             context.
+     * @param bean The {@link BSFDeclaredBean} to be removed from the backing context.
      *
-     * @throws BSFException For any exception that occurs while trying to
-     *                      undeclare the bean.
+     * @throws BSFException For any exception that occurs while trying to undeclare the bean.
      */
     public void undeclareBean(final BSFDeclaredBean bean) throws BSFException {
         jc.getVars().remove(bean.name);
@@ -105,15 +96,13 @@ public class JEXLEngine extends BSFEngineImpl {
      * Evaluates the expression as a JEXL Script.
      *
      * @param fileName The file name, if it is available.
-     * @param lineNo The line number, if it is available.
-     * @param colNo The column number, if it is available.
-     * @param expr The expression to be evaluated.
+     * @param lineNo   The line number, if it is available.
+     * @param colNo    The column number, if it is available.
+     * @param expr     The expression to be evaluated.
      *
-     * @throws BSFException For any exception that occurs while
-     *                      evaluating the expression.
+     * @throws BSFException For any exception that occurs while evaluating the expression.
      */
-    public Object eval(final String fileName, final int lineNo, final int colNo, final Object expr)
-            throws BSFException {
+    public Object eval(final String fileName, final int lineNo, final int colNo, final Object expr) throws BSFException {
         if (expr == null) {
             return null;
         }
@@ -128,8 +117,7 @@ public class JEXLEngine extends BSFEngineImpl {
             }
             return jExpr.execute(jc);
         } catch (final Exception e) {
-            throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
-                "Exception from Commons JEXL:\n" + e.getMessage(), e);
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception from Commons JEXL:\n" + e.getMessage(), e);
         }
     }
 
@@ -137,15 +125,13 @@ public class JEXLEngine extends BSFEngineImpl {
      * Executes the script as a JEXL {@link Script}.
      *
      * @param fileName The file name, if it is available.
-     * @param lineNo The line number, if it is available.
-     * @param colNo The column number, if it is available.
-     * @param script The script to be executed.
+     * @param lineNo   The line number, if it is available.
+     * @param colNo    The column number, if it is available.
+     * @param script   The script to be executed.
      *
-     * @throws BSFException For any exception that occurs while
-     *                      executing the script.
+     * @throws BSFException For any exception that occurs while executing the script.
      */
-    public void exec(final String fileName, final int lineNo, final int colNo, final Object script)
-            throws BSFException {
+    public void exec(final String fileName, final int lineNo, final int colNo, final Object script) throws BSFException {
         if (script == null) {
             return;
         }
@@ -160,25 +146,21 @@ public class JEXLEngine extends BSFEngineImpl {
             }
             jExpr.execute(jc);
         } catch (final Exception e) {
-            throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
-                "Exception from Commons JEXL:\n" + e.getMessage(), e);
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception from Commons JEXL:\n" + e.getMessage(), e);
         }
     }
 
     /**
-     * Same behavior as {@link #exec(String, int, int, Object)} for
-     * JEXLEngine.
+     * Same behavior as {@link #exec(String, int, int, Object)} for JEXLEngine.
      *
      * @param fileName The file name, if it is available.
-     * @param lineNo The line number, if it is available.
-     * @param colNo The column number, if it is available.
-     * @param script The script to be executed.
+     * @param lineNo   The line number, if it is available.
+     * @param colNo    The column number, if it is available.
+     * @param script   The script to be executed.
      *
-     * @throws BSFException For any exception that occurs while interactively
-     *                      executing the script.
+     * @throws BSFException For any exception that occurs while interactively executing the script.
      */
-    public void iexec(final String fileName, final int lineNo, final int colNo, final Object script)
-            throws BSFException {
+    public void iexec(final String fileName, final int lineNo, final int colNo, final Object script) throws BSFException {
         exec(fileName, lineNo, colNo, script);
     }
 
@@ -186,16 +168,14 @@ public class JEXLEngine extends BSFEngineImpl {
      * Uses reflection to make the call.
      *
      * @param object The object to make the call on.
-     * @param name The call to make.
-     * @param args The arguments to pass.
+     * @param name   The call to make.
+     * @param args   The arguments to pass.
      *
      * @return The result of the call.
      *
-     * @throws BSFException For any exception that occurs while making
-     *                      the call.
+     * @throws BSFException For any exception that occurs while making the call.
      */
-    public Object call(final Object object, final String name, final Object[] args)
-            throws BSFException {
+    public Object call(final Object object, final String name, final Object[] args) throws BSFException {
         try {
             final Class[] types = new Class[args.length];
             for (int i = 0; i < args.length; i++) {
@@ -204,10 +184,8 @@ public class JEXLEngine extends BSFEngineImpl {
             final Method m = object.getClass().getMethod(name, types);
             return m.invoke(object, args);
         } catch (final Exception e) {
-            throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
-                "Exception from JEXLEngine:\n" + e.getMessage(), e);
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception from JEXLEngine:\n" + e.getMessage(), e);
         }
     }
 
 }
-
diff --git a/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java b/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
index 1afd891..8517dbd 100644
--- a/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
+++ b/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
@@ -36,243 +36,229 @@ import org.python.core.PySystemState;
 import org.python.util.InteractiveInterpreter;
 
 /**
- * This is the interface to Jython (http://www.jython.org/) from BSF.
- * It's derived from the JPython 1.x engine
+ * This is the interface to Jython (http://www.jython.org/) from BSF. It's derived from the JPython 1.x engine
  */
 
 public class JythonEngine extends BSFEngineImpl {
-  BSFPythonInterpreter interp;
-  private final static Pattern fromRegExp = Pattern.compile("from ([.^\\S]*)");
-
-  /**
-   * call the named method of the given object.
-   */
-  public Object call (final Object object, final String method, final Object[] args)
-      throws BSFException {
-      try {
-          PyObject[] pyargs = Py.EmptyObjects;
-
-          if (args != null) {
-              pyargs = new PyObject[args.length];
-              for (int i = 0; i < pyargs.length; i++) {
-                pyargs[i] = Py.java2py(args[i]);
+    BSFPythonInterpreter interp;
+    private final static Pattern fromRegExp = Pattern.compile("from ([.^\\S]*)");
+
+    /**
+     * call the named method of the given object.
+     */
+    public Object call(final Object object, final String method, final Object[] args) throws BSFException {
+        try {
+            PyObject[] pyargs = Py.EmptyObjects;
+
+            if (args != null) {
+                pyargs = new PyObject[args.length];
+                for (int i = 0; i < pyargs.length; i++) {
+                    pyargs[i] = Py.java2py(args[i]);
+                }
             }
-          }
 
-          if (object != null) {
-              final PyObject o = Py.java2py(object);
-              return unwrap(o.invoke(method, pyargs));
-          }
+            if (object != null) {
+                final PyObject o = Py.java2py(object);
+                return unwrap(o.invoke(method, pyargs));
+            }
+
+            PyObject m = interp.get(method);
+
+            if (m == null) {
+                m = interp.eval(method);
+            }
+            if (m != null) {
+                return unwrap(m.__call__(pyargs));
+            }
+
+            return null;
+        } catch (final PyException e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Jython:\n" + e, e);
+        }
+    }
+
+    /**
+     * Declare a bean
+     */
+    public void declareBean(final BSFDeclaredBean bean) throws BSFException {
+        interp.set(bean.name, bean.bean);
+    }
+
+    /**
+     * Evaluate an anonymous function (differs from eval() in that apply() handles multiple lines).
+     */
+    public Object apply(final String source, final int lineNo, final int columnNo, final Object funcBody, final Vector paramNames, final Vector arguments)
+            throws BSFException {
+        try {
+            /*
+             * We wrapper the original script in a function definition, and evaluate the function. A hack, no question, but it allows apply() to pretend to work
+             * on Jython.
+             */
+            final StringBuffer script = new StringBuffer(byteify(funcBody.toString()));
+            int index = 0;
+            script.insert(0, "def bsf_temp_fn():\n");
+
+            while (index < script.length()) {
+                if (script.charAt(index) == '\n') {
+                    script.insert(index + 1, '\t');
+                }
+                index++;
+            }
+
+            final String scriptStr = script.toString();
+            importPackage(scriptStr);
+            interp.exec(scriptStr);
+
+            Object result = interp.eval("bsf_temp_fn()");
 
-          PyObject m = interp.get(method);
+            if (result instanceof PyJavaInstance) {
+                result = ((PyJavaInstance) result).__tojava__(Object.class);
+            }
+            return result;
+        } catch (final PyException e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Jython:\n" + e, e);
+        }
+    }
 
-          if (m == null) {
-            m = interp.eval(method);
+    /**
+     * Evaluate an expression.
+     */
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
+        try {
+            final String scriptStr = byteify(script.toString());
+            importPackage(scriptStr);
+            Object result = interp.eval(scriptStr);
+            if (result instanceof PyJavaInstance) {
+                result = ((PyJavaInstance) result).__tojava__(Object.class);
+            }
+            return result;
+        } catch (final PyException e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Jython:\n" + e, e);
         }
-          if (m != null) {
-              return unwrap(m.__call__(pyargs));
-          }
-
-          return null;
-      } catch (final PyException e) {
-          throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                                  "exception from Jython:\n" + e, e);
-      }
-  }
-
-  /**
-   * Declare a bean
-   */
-  public void declareBean (final BSFDeclaredBean bean) throws BSFException {
-	interp.set (bean.name, bean.bean);
-  }
-
-  /**
-   * Evaluate an anonymous function (differs from eval() in that apply()
-   * handles multiple lines).
-   */
-  public Object apply (final String source, final int lineNo, final int columnNo,
-                       final Object funcBody, final Vector paramNames,
-                       final Vector arguments) throws BSFException {
-      try {
-          /* We wrapper the original script in a function definition, and
-           * evaluate the function. A hack, no question, but it allows
-           * apply() to pretend to work on Jython.
-           */
-          final StringBuffer script = new StringBuffer(byteify(funcBody.toString()));
-          int index = 0;
-          script.insert(0, "def bsf_temp_fn():\n");
-
-          while (index < script.length()) {
-              if (script.charAt(index) == '\n') {
-                  script.insert(index+1, '\t');
-              }
-              index++;
-          }
-
-          final String scriptStr = script.toString ();
-          importPackage(scriptStr);
-          interp.exec (scriptStr);
-
-          Object result = interp.eval ("bsf_temp_fn()");
-
-          if (result instanceof PyJavaInstance) {
-            result = ((PyJavaInstance)result).__tojava__(Object.class);
+    }
+
+    /**
+     * Execute a script.
+     */
+    public void exec(final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
+        try {
+            final String scriptStr = byteify(script.toString());
+            importPackage(scriptStr);
+            interp.exec(scriptStr);
+        } catch (final PyException e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Jython:\n" + e, e);
         }
-          return result;
-      } catch (final PyException e) {
-          throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                                  "exception from Jython:\n" + e, e);
-      }
-  }
-
-  /**
-   * Evaluate an expression.
-   */
-  public Object eval (final String source, final int lineNo, final int columnNo,
-		      final Object script) throws BSFException {
-	try {
-	  final String scriptStr = byteify(script.toString ());
-	  importPackage(scriptStr);
-	  Object result = interp.eval (scriptStr);
-	  if (result instanceof PyJavaInstance) {
-        result = ((PyJavaInstance)result).__tojava__(Object.class);
     }
-	  return result;
-	} catch (final PyException e) {
-	  throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-			      "exception from Jython:\n" + e, e);
-	}
-  }
-
-  /**
-   * Execute a script.
-   */
-  public void exec (final String source, final int lineNo, final int columnNo,
-		    final Object script) throws BSFException {
-	try {
-	  final String scriptStr = byteify(script.toString());
-	  importPackage(scriptStr);
-	  interp.exec (scriptStr);
-	} catch (final PyException e) {
-	  throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-			      "exception from Jython:\n" + e, e);
-	}
-  }
-
-  private void importPackage(final String script) {
-	final Matcher matcher = fromRegExp.matcher(script);
-	while (matcher.find()) {
-		final String packageName = matcher.group(1);
-		PySystemState.add_package(packageName);
-	}
-  }
-
-  /**
-   * Execute script code, emulating console interaction.
-   */
-  public void iexec (final String source, final int lineNo, final int columnNo,
-                     final Object script) throws BSFException {
-      String scriptStr = byteify(script.toString());
-      importPackage(scriptStr);
-      final int newline = scriptStr.indexOf("\n");
-
-      if (newline > -1) {
-        scriptStr = scriptStr.substring(0, newline);
+
+    private void importPackage(final String script) {
+        final Matcher matcher = fromRegExp.matcher(script);
+        while (matcher.find()) {
+            final String packageName = matcher.group(1);
+            PySystemState.add_package(packageName);
+        }
     }
 
-      try {
-          if (interp.buffer.length() > 0) {
-            interp.buffer.append("\n");
+    /**
+     * Execute script code, emulating console interaction.
+     */
+    public void iexec(final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
+        String scriptStr = byteify(script.toString());
+        importPackage(scriptStr);
+        final int newline = scriptStr.indexOf("\n");
+
+        if (newline > -1) {
+            scriptStr = scriptStr.substring(0, newline);
         }
-          interp.buffer.append(scriptStr);
-          if (!(interp.runsource(interp.buffer.toString()))) {
+
+        try {
+            if (interp.buffer.length() > 0) {
+                interp.buffer.append("\n");
+            }
+            interp.buffer.append(scriptStr);
+            if (!(interp.runsource(interp.buffer.toString()))) {
+                interp.resetbuffer();
+            }
+        } catch (final PyException e) {
             interp.resetbuffer();
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Jython:\n" + e, e);
         }
-      } catch (final PyException e) {
-          interp.resetbuffer();
-          throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
-                                 "exception from Jython:\n" + e, e);
-      }
-  }
-
-  /**
-   * Initialize the engine.
-   */
-  public void initialize (final BSFManager mgr, final String lang,
-						  final Vector declaredBeans) throws BSFException {
-	super.initialize (mgr, lang, declaredBeans);
-
-	// create an interpreter
-	interp = new BSFPythonInterpreter ();
-
-    // ensure that output and error streams are re-directed correctly
-    interp.setOut(System.out);
-    interp.setErr(System.err);
-
-	// register the mgr with object name "bsf"
-	interp.set ("bsf", new BSFFunctions (mgr, this));
-
-    // Declare all declared beans to the interpreter
-	final int size = declaredBeans.size ();
-	for (int i = 0; i < size; i++) {
-	  declareBean ((BSFDeclaredBean) declaredBeans.elementAt (i));
-	}
-  }
-
-  /**
-   * Undeclare a previously declared bean.
-   */
-  public void undeclareBean (final BSFDeclaredBean bean) throws BSFException {
-	interp.set (bean.name, null);
-  }
-
-  public Object unwrap(final PyObject result) {
-	if (result != null) {
-	   final Object ret = result.__tojava__(Object.class);
-	   if (ret != Py.NoConversion) {
-        return ret;
     }
-	}
-	return result;
-  }
-
-  private String byteify (final String orig) {
-      // Ugh. Jython likes to be fed bytes, rather than the input string.
-      final ByteArrayInputStream bais =
-          new ByteArrayInputStream(orig.getBytes());
-      final StringBuffer s = new StringBuffer();
-      int c;
-
-      while ((c = bais.read()) >= 0) {
-          s.append((char)c);
-      }
-
-      return s.toString();
-  }
-
-  private class BSFPythonInterpreter extends InteractiveInterpreter {
-
-      public BSFPythonInterpreter() {
-      }
-
-      // Override runcode so as not to print the stack dump
-      public void runcode(final PyObject code) {
-          try {
-              this.exec(code);
-          } catch (final PyException exc) {
-              throw exc;
-          }
-      }
-  }
-
-  public void propertyChange(final PropertyChangeEvent e) {
-	  super.propertyChange(e);
-	  final String name = e.getPropertyName();
-      final Object value = e.getNewValue();
-      if (name.equals("classLoader")) {
-		Py.getSystemState().setClassLoader((ClassLoader) value);
-      }
-
-  }
+
+    /**
+     * Initialize the engine.
+     */
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
+        super.initialize(mgr, lang, declaredBeans);
+
+        // create an interpreter
+        interp = new BSFPythonInterpreter();
+
+        // ensure that output and error streams are re-directed correctly
+        interp.setOut(System.out);
+        interp.setErr(System.err);
+
+        // register the mgr with object name "bsf"
+        interp.set("bsf", new BSFFunctions(mgr, this));
+
+        // Declare all declared beans to the interpreter
+        final int size = declaredBeans.size();
+        for (int i = 0; i < size; i++) {
+            declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
+        }
+    }
+
+    /**
+     * Undeclare a previously declared bean.
+     */
+    public void undeclareBean(final BSFDeclaredBean bean) throws BSFException {
+        interp.set(bean.name, null);
+    }
+
+    public Object unwrap(final PyObject result) {
+        if (result != null) {
+            final Object ret = result.__tojava__(Object.class);
+            if (ret != Py.NoConversion) {
+                return ret;
+            }
+        }
+        return result;
+    }
+
+    private String byteify(final String orig) {
+        // Ugh. Jython likes to be fed bytes, rather than the input string.
+        final ByteArrayInputStream bais = new ByteArrayInputStream(orig.getBytes());
+        final StringBuffer s = new StringBuffer();
+        int c;
+
+        while ((c = bais.read()) >= 0) {
+            s.append((char) c);
+        }
+
+        return s.toString();
+    }
+
+    private class BSFPythonInterpreter extends InteractiveInterpreter {
+
+        public BSFPythonInterpreter() {
+        }
+
+        // Override runcode so as not to print the stack dump
+        public void runcode(final PyObject code) {
+            try {
+                this.exec(code);
+            } catch (final PyException exc) {
+                throw exc;
+            }
+        }
+    }
+
+    public void propertyChange(final PropertyChangeEvent e) {
+        super.propertyChange(e);
+        final String name = e.getPropertyName();
+        final Object value = e.getNewValue();
+        if (name.equals("classLoader")) {
+            Py.getSystemState().setClassLoader((ClassLoader) value);
+        }
+
+    }
 }
diff --git a/src/main/java/org/apache/bsf/engines/xslt/XSLTEngine.java b/src/main/java/org/apache/bsf/engines/xslt/XSLTEngine.java
index 8c94f0e..6403eea 100644
--- a/src/main/java/org/apache/bsf/engines/xslt/XSLTEngine.java
+++ b/src/main/java/org/apache/bsf/engines/xslt/XSLTEngine.java
@@ -42,8 +42,7 @@ import org.w3c.dom.Node;
 /**
  * Xerces XSLT interface to BSF. Requires Xalan and Xerces from Apache.
  *
- * This integration uses the BSF registry to pass in any src document
- * and stylesheet base URI that the user may wish to set.
+ * This integration uses the BSF registry to pass in any src document and stylesheet base URI that the user may wish to set.
  *
  * Re-implemented for the Xalan 2 codebase
  *
@@ -55,132 +54,119 @@ public class XSLTEngine extends BSFEngineImpl {
     // Log logger = LogFactory.getLog(this.getClass().getName());
     BSF_Log logger = null;
 
-    public XSLTEngine ()
-    {
-            // handle logger
+    public XSLTEngine() {
+        // handle logger
         logger = BSF_LogFactory.getLog(this.getClass().getName());
     }
 
     /**
      * call the named method of the given object.
      */
-    public Object call (final Object object, final String method, final Object[] args)
-        throws BSFException {
-    throw new BSFException (BSFException.REASON_UNSUPPORTED_FEATURE,
-                                "BSF:XSLTEngine can't call methods");
+    public Object call(final Object object, final String method, final Object[] args) throws BSFException {
+        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE, "BSF:XSLTEngine can't call methods");
     }
 
     /**
      * Declare a bean by setting it as a parameter
      */
-    public void declareBean (final BSFDeclaredBean bean) throws BSFException {
-        transformer.setParameter (bean.name, new XObject (bean.bean));
+    public void declareBean(final BSFDeclaredBean bean) throws BSFException {
+        transformer.setParameter(bean.name, new XObject(bean.bean));
     }
 
     /**
-     * Evaluate an expression. In this case, an expression is assumed
-     * to be a stylesheet of the template style (see the XSLT spec).
+     * Evaluate an expression. In this case, an expression is assumed to be a stylesheet of the template style (see the XSLT spec).
      */
-    public Object eval (final String source, final int lineNo, final int columnNo,
-                        final Object oscript) throws BSFException {
-    // get the style base URI (the place from where Xerces XSLT will
-    // look for imported/included files and referenced docs): if a
-    // bean named "xslt:styleBaseURI" is registered, then cvt it
-    // to a string and use that. Otherwise use ".", which means the
-    // base is the directory where the process is running from
-    final Object sbObj = mgr.lookupBean ("xslt:styleBaseURI");
-    final String styleBaseURI = (sbObj == null) ? "." : sbObj.toString ();
-
-    // Locate the stylesheet.
-    StreamSource styleSource;
-
-        styleSource =
-            new StreamSource(new StringReader(oscript.toString ()));
+    public Object eval(final String source, final int lineNo, final int columnNo, final Object oscript) throws BSFException {
+        // get the style base URI (the place from where Xerces XSLT will
+        // look for imported/included files and referenced docs): if a
+        // bean named "xslt:styleBaseURI" is registered, then cvt it
+        // to a string and use that. Otherwise use ".", which means the
+        // base is the directory where the process is running from
+        final Object sbObj = mgr.lookupBean("xslt:styleBaseURI");
+        final String styleBaseURI = (sbObj == null) ? "." : sbObj.toString();
+
+        // Locate the stylesheet.
+        StreamSource styleSource;
+
+        styleSource = new StreamSource(new StringReader(oscript.toString()));
         styleSource.setSystemId(styleBaseURI);
 
         try {
             transformer = tFactory.newTransformer(styleSource);
         } catch (final Exception e) {
             logger.error("Exception from Xerces XSLT:", e);
-            throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                                    "Exception from Xerces XSLT: " + e, e);
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception from Xerces XSLT: " + e, e);
         }
 
-    // get the src to work on: if a bean named "xslt:src" is registered
-    // and its a Node, then use it as the source. If its not a Node, then
-    // if its a URL parse it, if not treat it as a file and make a URL and
-    // parse it and go. If no xslt:src is found, use an empty document
-    // (stylesheet is treated as a literal result element stylesheet)
-    final Object srcObj = mgr.lookupBean ("xslt:src");
-    Object xis = null;
-    if (srcObj != null) {
+        // get the src to work on: if a bean named "xslt:src" is registered
+        // and its a Node, then use it as the source. If its not a Node, then
+        // if its a URL parse it, if not treat it as a file and make a URL and
+        // parse it and go. If no xslt:src is found, use an empty document
+        // (stylesheet is treated as a literal result element stylesheet)
+        final Object srcObj = mgr.lookupBean("xslt:src");
+        Object xis = null;
+        if (srcObj != null) {
             if (srcObj instanceof Node) {
-        xis = new DOMSource((Node)srcObj);
+                xis = new DOMSource((Node) srcObj);
             } else {
-        try {
+                try {
                     String mesg = "as anything";
                     if (srcObj instanceof Reader) {
-            xis = new StreamSource ((Reader) srcObj);
-            mesg = "as a Reader";
+                        xis = new StreamSource((Reader) srcObj);
+                        mesg = "as a Reader";
                     } else if (srcObj instanceof File) {
-                        xis = new StreamSource ((File) srcObj);
+                        xis = new StreamSource((File) srcObj);
                         mesg = "as a file";
                     } else {
-                        final String srcObjstr=srcObj.toString();
-                        xis = new StreamSource (new StringReader(srcObjstr));
+                        final String srcObjstr = srcObj.toString();
+                        xis = new StreamSource(new StringReader(srcObjstr));
                         if (srcObj instanceof URL) {
                             mesg = "as a URL";
                         } else {
-                            ((StreamSource) xis).setPublicId (srcObjstr);
+                            ((StreamSource) xis).setPublicId(srcObjstr);
                             mesg = "as an XML string";
                         }
                     }
 
                     if (xis == null) {
-            throw new Exception ("Unable to get input from '" +
-                                             srcObj + "' " + mesg);
+                        throw new Exception("Unable to get input from '" + srcObj + "' " + mesg);
                     }
-        } catch (final Exception e) {
-                    throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                                            "BSF:XSLTEngine: unable to get " +
-                                            "input from '" + srcObj + "' as XML", e);
-        }
+                } catch (final Exception e) {
+                    throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "BSF:XSLTEngine: unable to get " + "input from '" + srcObj + "' as XML", e);
+                }
             }
-    } else {
+        } else {
             // create an empty document - real src must come into the
             // stylesheet using "doc(...)" [see XSLT spec] or the stylesheet
             // must be of literal result element type
             xis = new StreamSource();
-    }
+        }
 
-    // set all declared beans as parameters.
-    for (int i = 0; i < declaredBeans.size (); i++) {
-            final BSFDeclaredBean b = (BSFDeclaredBean) declaredBeans.elementAt (i);
-            transformer.setParameter (b.name, new XObject (b.bean));
-    }
+        // set all declared beans as parameters.
+        for (int i = 0; i < declaredBeans.size(); i++) {
+            final BSFDeclaredBean b = (BSFDeclaredBean) declaredBeans.elementAt(i);
+            transformer.setParameter(b.name, new XObject(b.bean));
+        }
 
-    // declare a "bsf" parameter which is the BSF handle so that
-    // the script can do BSF stuff if it wants to
-    transformer.setParameter ("bsf",
-                                  new XObject (new BSFFunctions (mgr, this)));
+        // declare a "bsf" parameter which is the BSF handle so that
+        // the script can do BSF stuff if it wants to
+        transformer.setParameter("bsf", new XObject(new BSFFunctions(mgr, this)));
 
-    // do it
-    try {
+        // do it
+        try {
             final DOMResult result = new DOMResult();
-            transformer.transform ((StreamSource) xis, result);
-            return new XSLTResultNode (result.getNode());
-    } catch (final Exception e) {
-            throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
-                                    "exception while eval'ing XSLT script" + e, e);
-    }
+            transformer.transform((StreamSource) xis, result);
+            return new XSLTResultNode(result.getNode());
+        } catch (final Exception e) {
+            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception while eval'ing XSLT script" + e, e);
+        }
     }
 
     /**
      * Initialize the engine.
      */
-    public void initialize (final BSFManager mgr, final String lang,
-                            final Vector declaredBeans) throws BSFException {
-    super.initialize (mgr, lang, declaredBeans);
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
+        super.initialize(mgr, lang, declaredBeans);
 
         tFactory = TransformerFactory.newInstance();
     }
@@ -188,10 +174,10 @@ public class XSLTEngine extends BSFEngineImpl {
     /**
      * Undeclare a bean by setting he parameter represeting it to null
      */
-    public void undeclareBean (final BSFDeclaredBean bean) throws BSFException {
+    public void undeclareBean(final BSFDeclaredBean bean) throws BSFException {
         // Cannot clear only one parameter in Xalan 2, so we set it to null
-        if ((transformer.getParameter (bean.name)) != null) {
-            transformer.setParameter (bean.name, null);
+        if ((transformer.getParameter(bean.name)) != null) {
+            transformer.setParameter(bean.name, null);
         }
     }
 }
diff --git a/src/main/java/org/apache/bsf/engines/xslt/XSLTResultNode.java b/src/main/java/org/apache/bsf/engines/xslt/XSLTResultNode.java
index e17af46..59ae387 100644
--- a/src/main/java/org/apache/bsf/engines/xslt/XSLTResultNode.java
+++ b/src/main/java/org/apache/bsf/engines/xslt/XSLTResultNode.java
@@ -19,16 +19,14 @@ package org.apache.bsf.engines.xslt;
 
 import org.w3c.dom.Node;
 
-public class XSLTResultNode
-{
-  Node node;
+public class XSLTResultNode {
+    Node node;
 
-  public XSLTResultNode(final Node node)
-  {
-    this.node = node;
-  }
-  public Node getNode()
-  {
-    return node;
-  }
+    public XSLTResultNode(final Node node) {
+        this.node = node;
+    }
+
+    public Node getNode() {
+        return node;
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/BSFClassLoader.java b/src/main/java/org/apache/bsf/util/BSFClassLoader.java
index d12e678..ee28572 100644
--- a/src/main/java/org/apache/bsf/util/BSFClassLoader.java
+++ b/src/main/java/org/apache/bsf/util/BSFClassLoader.java
@@ -22,53 +22,53 @@ import java.io.FileInputStream;
 import java.util.Hashtable;
 
 /**
- * This class loader knows to load a class from the tempDir dir
- * of the environment of the given manager.
+ * This class loader knows to load a class from the tempDir dir of the environment of the given manager.
  */
 class BSFClassLoader extends ClassLoader {
-  Hashtable cache = new Hashtable ();
-  String tempDir = ".";
+    Hashtable cache = new Hashtable();
+    String tempDir = ".";
 
-  // note the non-public constructor - this is only avail within
-  // this package.
-  BSFClassLoader () {
-  }
-  public synchronized Class loadClass (final String name, final boolean resolve)
-                                               throws ClassNotFoundException {
-    Class c = (Class) cache.get (name);
-    if (c == null) {
-      // is it a system class
-      try {
-    c = findSystemClass (name);
-    cache.put (name, c);
-    return c;
-      } catch (final ClassNotFoundException e) {
-    // nope
-      }
-      try {
-    final byte[] data = loadClassData (name);
-    c = defineClass (name, data, 0, data.length);
-    cache.put (name, c);
-      } catch (final Exception e) {
-    e.printStackTrace ();
-    throw new ClassNotFoundException ("unable to resolve class '" +
-                      name + "'");
-      }
+    // note the non-public constructor - this is only avail within
+    // this package.
+    BSFClassLoader() {
     }
-    if (resolve) {
-        resolveClass (c);
+
+    public synchronized Class loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
+        Class c = (Class) cache.get(name);
+        if (c == null) {
+            // is it a system class
+            try {
+                c = findSystemClass(name);
+                cache.put(name, c);
+                return c;
+            } catch (final ClassNotFoundException e) {
+                // nope
+            }
+            try {
+                final byte[] data = loadClassData(name);
+                c = defineClass(name, data, 0, data.length);
+                cache.put(name, c);
+            } catch (final Exception e) {
+                e.printStackTrace();
+                throw new ClassNotFoundException("unable to resolve class '" + name + "'");
+            }
+        }
+        if (resolve) {
+            resolveClass(c);
+        }
+        return c;
+    }
+
+    private byte[] loadClassData(final String name) throws Exception {
+        final String fileName = tempDir + File.separatorChar + name + ".class";
+        final FileInputStream fi = new FileInputStream(fileName);
+        final byte[] data = new byte[fi.available()];
+        fi.read(data);
+        fi.close();
+        return data;
+    }
+
+    public void setTempDir(final String tempDir) {
+        this.tempDir = tempDir;
     }
-    return c;
-  }
-  private byte[] loadClassData (final String name) throws Exception {
-    final String fileName = tempDir + File.separatorChar + name + ".class";
-    final FileInputStream fi = new FileInputStream (fileName);
-    final byte[] data = new byte[fi.available ()];
-    fi.read (data);
-    fi.close();
-    return data;
-  }
-  public void setTempDir (final String tempDir) {
-    this.tempDir = tempDir;
-  }
 }
diff --git a/src/main/java/org/apache/bsf/util/BSFEngineImpl.java b/src/main/java/org/apache/bsf/util/BSFEngineImpl.java
index 30c788c..4956edf 100644
--- a/src/main/java/org/apache/bsf/util/BSFEngineImpl.java
+++ b/src/main/java/org/apache/bsf/util/BSFEngineImpl.java
@@ -26,9 +26,8 @@ import org.apache.bsf.BSFException;
 import org.apache.bsf.BSFManager;
 
 /**
- * This is a base implementation of the BSFEngine interface which
- * engine implementations may choose to extend to get the basic
- * methods of the interface implemented.
+ * This is a base implementation of the BSFEngine interface which engine implementations may choose to extend to get the basic methods of the interface
+ * implemented.
  */
 
 public abstract class BSFEngineImpl implements BSFEngine {
@@ -41,37 +40,30 @@ public abstract class BSFEngineImpl implements BSFEngine {
     protected ClassLoader classLoader;
 
     /**
-     * Default impl of apply - calls eval ignoring parameters and returns
-     * the result.
+     * Default impl of apply - calls eval ignoring parameters and returns the result.
      */
-    public Object apply(final String source, final int lineNo, final int columnNo,
-                        final Object funcBody, final Vector paramNames, final Vector arguments)
-        throws BSFException {
+    public Object apply(final String source, final int lineNo, final int columnNo, final Object funcBody, final Vector paramNames, final Vector arguments)
+            throws BSFException {
         return eval(source, lineNo, columnNo, funcBody);
     }
 
     /**
      * Default impl of compileApply - calls compileExpr ignoring parameters.
      */
-    public void compileApply(final String source, final int lineNo, final int columnNo,
-                             final Object funcBody, final Vector paramNames,
-                             final Vector arguments, final CodeBuffer cb)
-        throws BSFException {
+    public void compileApply(final String source, final int lineNo, final int columnNo, final Object funcBody, final Vector paramNames, final Vector arguments,
+            final CodeBuffer cb) throws BSFException {
         compileExpr(source, lineNo, columnNo, funcBody, cb);
     }
 
     /**
-     * Default impl of compileExpr - generates code that'll create a new
-     * manager, evaluate the expression, and return the value.
+     * Default impl of compileExpr - generates code that'll create a new manager, evaluate the expression, and return the value.
      */
-    public void compileExpr(final String source, final int lineNo, final int columnNo,
-                            final Object expr, final CodeBuffer cb) throws BSFException {
+    public void compileExpr(final String source, final int lineNo, final int columnNo, final Object expr, final CodeBuffer cb) throws BSFException {
         ObjInfo bsfInfo = cb.getSymbol("bsf");
 
         if (bsfInfo == null) {
             bsfInfo = new ObjInfo(BSFManager.class, "bsf");
-            cb.addFieldDeclaration("org.apache.bsf.BSFManager bsf = " +
-                                   "new org.apache.bsf.BSFManager();");
+            cb.addFieldDeclaration("org.apache.bsf.BSFManager bsf = " + "new org.apache.bsf.BSFManager();");
             cb.putSymbol("bsf", bsfInfo);
         }
 
@@ -86,25 +78,20 @@ public abstract class BSFEngineImpl implements BSFEngine {
             cb.addServiceMethodStatement(oldRet.objName + ";");
         }
 
-        cb.setFinalServiceMethodStatement(new ObjInfo(Object.class,
-                                                      evalString));
+        cb.setFinalServiceMethodStatement(new ObjInfo(Object.class, evalString));
 
         cb.addServiceMethodException("org.apache.bsf.BSFException");
     }
 
     /**
-     * Default impl of compileScript - generates code that'll create a new
-     * manager, and execute the script.
+     * Default impl of compileScript - generates code that'll create a new manager, and execute the script.
      */
-    public void compileScript(final String source, final int lineNo, final int columnNo,
-                              final Object script, final CodeBuffer cb)
-        throws BSFException {
+    public void compileScript(final String source, final int lineNo, final int columnNo, final Object script, final CodeBuffer cb) throws BSFException {
         ObjInfo bsfInfo = cb.getSymbol("bsf");
 
         if (bsfInfo == null) {
             bsfInfo = new ObjInfo(BSFManager.class, "bsf");
-            cb.addFieldDeclaration("org.apache.bsf.BSFManager bsf = " +
-                                   "new org.apache.bsf.BSFManager();");
+            cb.addFieldDeclaration("org.apache.bsf.BSFManager bsf = " + "new org.apache.bsf.BSFManager();");
             cb.putSymbol("bsf", bsfInfo);
         }
 
@@ -125,34 +112,28 @@ public abstract class BSFEngineImpl implements BSFEngine {
     }
 
     public void declareBean(final BSFDeclaredBean bean) throws BSFException {
-        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE,
-                               "language " + lang +
-                               " does not support declareBean(...).");
+        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE, "language " + lang + " does not support declareBean(...).");
     }
 
     /**
      * Default impl of execute - calls eval and ignores the result.
      */
-    public void exec(final String source, final int lineNo, final int columnNo, final Object script)
-        throws BSFException {
+    public void exec(final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
         eval(source, lineNo, columnNo, script);
     }
 
     /**
      * Default impl of interactive execution - calls eval and ignores the result.
      */
-    public void iexec(final String source, final int lineNo, final int columnNo, final Object script)
-        throws BSFException {
+    public void iexec(final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
         eval(source, lineNo, columnNo, script);
     }
 
     /**
-     * initialize the engine; called right after construction by
-     * the manager. Declared beans are simply kept in a vector and
-     * that's it. Subclasses must do whatever they want with it.
+     * initialize the engine; called right after construction by the manager. Declared beans are simply kept in a vector and that's it. Subclasses must do
+     * whatever they want with it.
      */
-    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans)
-        throws BSFException {
+    public void initialize(final BSFManager mgr, final String lang, final Vector declaredBeans) throws BSFException {
 
         this.mgr = mgr;
         this.lang = lang;
@@ -166,8 +147,7 @@ public abstract class BSFEngineImpl implements BSFEngine {
     }
 
     /**
-     * Receive property change events from the manager and update my fields
-     * as needed.
+     * Receive property change events from the manager and update my fields as needed.
      *
      * @param e PropertyChange event with the change data
      */
@@ -177,11 +157,9 @@ public abstract class BSFEngineImpl implements BSFEngine {
 
         if (name.equals("classPath")) {
             classPath = (String) value;
-        }
-        else if (name.equals("tempDir")) {
+        } else if (name.equals("tempDir")) {
             tempDir = (String) value;
-        }
-        else if (name.equals("classLoader")) {
+        } else if (name.equals("classLoader")) {
             classLoader = (ClassLoader) value;
         }
     }
@@ -193,8 +171,6 @@ public abstract class BSFEngineImpl implements BSFEngine {
     }
 
     public void undeclareBean(final BSFDeclaredBean bean) throws BSFException {
-        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE,
-                               "language " + lang +
-                               " does not support undeclareBean(...).");
+        throw new BSFException(BSFException.REASON_UNSUPPORTED_FEATURE, "language " + lang + " does not support undeclareBean(...).");
     }
 }
diff --git a/src/main/java/org/apache/bsf/util/BSFEventProcessor.java b/src/main/java/org/apache/bsf/util/BSFEventProcessor.java
index 532e196..c70dc43 100644
--- a/src/main/java/org/apache/bsf/util/BSFEventProcessor.java
+++ b/src/main/java/org/apache/bsf/util/BSFEventProcessor.java
@@ -26,90 +26,81 @@ import org.apache.bsf.BSFManager;
 import org.apache.bsf.util.event.EventProcessor;
 
 /**
- * This is used to support binding scripts to be run when an event
- * occurs.
+ * This is used to support binding scripts to be run when an event occurs.
  */
 public class BSFEventProcessor implements EventProcessor {
-  BSFEngine engine;
-  BSFManager manager;
-  String filter;
-  String source;
-  int lineNo;
-  int columnNo;
-  Object script;
+    BSFEngine engine;
+    BSFManager manager;
+    String filter;
+    String source;
+    int lineNo;
+    int columnNo;
+    Object script;
 
-  /**
-   * Package-protected constructor makes this class unavailable for
-   * public use.
-   */
-  BSFEventProcessor (final BSFEngine engine, final BSFManager manager, final String filter,
-             final String source, final int lineNo, final int columnNo, final Object script)
-       throws BSFException {
-    this.engine = engine;
-    this.manager = manager;
-    this.filter = filter;
-    this.source = source;
-    this.lineNo = lineNo;
-    this.columnNo = columnNo;
-    this.script = script;
-  }
-  //////////////////////////////////////////////////////////////////////////
-  //
-  // event is delegated to me by the adapters using this. inFilter is
-  // in general the name of the method via which the event was received
-  // at the adapter. For prop/veto change events, inFilter is the name
-  // of the property. In any case, in the event processor, I only forward
-  // those events if for which the filters match (if one is specified).
-
-  public void processEvent (final String inFilter, final Object[] evtInfo) {
-    try {
-      processExceptionableEvent (inFilter, evtInfo);
-    } catch (final RuntimeException re) {
-      // rethrow this .. I don't want to intercept run-time stuff
-      // that can in fact occur legit
-      throw re;
-    } catch (final Exception e) {
-      // should not occur
-      System.err.println ("BSFError: non-exceptionable event delivery " +
-              "threw exception (that's not nice): " + e);
-      e.printStackTrace ();
+    /**
+     * Package-protected constructor makes this class unavailable for public use.
+     */
+    BSFEventProcessor(final BSFEngine engine, final BSFManager manager, final String filter, final String source, final int lineNo, final int columnNo,
+            final Object script) throws BSFException {
+        this.engine = engine;
+        this.manager = manager;
+        this.filter = filter;
+        this.source = source;
+        this.lineNo = lineNo;
+        this.columnNo = columnNo;
+        this.script = script;
     }
-  }
-  //////////////////////////////////////////////////////////////////////////
-  //
-  // same as above, but used when the method event method may generate
-  // an exception which must go all the way back to the source (as in
-  // the vetoableChange case)
+    //////////////////////////////////////////////////////////////////////////
+    //
+    // event is delegated to me by the adapters using this. inFilter is
+    // in general the name of the method via which the event was received
+    // at the adapter. For prop/veto change events, inFilter is the name
+    // of the property. In any case, in the event processor, I only forward
+    // those events if for which the filters match (if one is specified).
 
-  public void processExceptionableEvent (final String inFilter, final Object[] evtInfo) throws Exception
-  {
-      if ((filter != null) && !isFilteredEvent(filter, inFilter)) {
-      // ignore this event
-      return;
+    public void processEvent(final String inFilter, final Object[] evtInfo) {
+        try {
+            processExceptionableEvent(inFilter, evtInfo);
+        } catch (final RuntimeException re) {
+            // rethrow this .. I don't want to intercept run-time stuff
+            // that can in fact occur legit
+            throw re;
+        } catch (final Exception e) {
+            // should not occur
+            System.err.println("BSFError: non-exceptionable event delivery " + "threw exception (that's not nice): " + e);
+            e.printStackTrace();
+        }
     }
+    //////////////////////////////////////////////////////////////////////////
+    //
+    // same as above, but used when the method event method may generate
+    // an exception which must go all the way back to the source (as in
+    // the vetoableChange case)
+
+    public void processExceptionableEvent(final String inFilter, final Object[] evtInfo) throws Exception {
+        if ((filter != null) && !isFilteredEvent(filter, inFilter)) {
+            // ignore this event
+            return;
+        }
 
-    // run the script
-    engine.exec (source, lineNo, columnNo, script);
+        // run the script
+        engine.exec(source, lineNo, columnNo, script);
 // System.err.println("returned from engine.exec.");
-  }
+    }
 
-  private static boolean isFilteredEvent(final String filter, final String inFilter)
-  {
-      boolean bRes=filter.equalsIgnoreCase(inFilter);
-      if (bRes)
-      {
-          return bRes;
-      }
+    private static boolean isFilteredEvent(final String filter, final String inFilter) {
+        boolean bRes = filter.equalsIgnoreCase(inFilter);
+        if (bRes) {
+            return bRes;
+        }
 
-      final String[] chunks =filter.replace('+',' ').split(" ");
-      for (int i=0;i<chunks.length;i++)
-      {
-          bRes=chunks[i].equalsIgnoreCase(inFilter);
-          if (bRes)
-          {
-              return bRes;
-          }
-      }
-      return bRes;
-  }
+        final String[] chunks = filter.replace('+', ' ').split(" ");
+        for (int i = 0; i < chunks.length; i++) {
+            bRes = chunks[i].equalsIgnoreCase(inFilter);
+            if (bRes) {
+                return bRes;
+            }
+        }
+        return bRes;
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/BSFEventProcessorReturningEventInfos.java b/src/main/java/org/apache/bsf/util/BSFEventProcessorReturningEventInfos.java
index 6b71d42..d9f6b30 100644
--- a/src/main/java/org/apache/bsf/util/BSFEventProcessorReturningEventInfos.java
+++ b/src/main/java/org/apache/bsf/util/BSFEventProcessorReturningEventInfos.java
@@ -38,9 +38,8 @@ import org.apache.bsf.util.event.EventProcessor;
 
 /**
  *
- * This is used to support binding scripts to be run when an event occurs,
- * forwarding the arguments supplied to the event listener. It is an adapted
- * version of org.apache.bsf.util.BSFEventProcessor.
+ * This is used to support binding scripts to be run when an event occurs, forwarding the arguments supplied to the event listener. It is an adapted version of
+ * org.apache.bsf.util.BSFEventProcessor.
  */
 public class BSFEventProcessorReturningEventInfos implements EventProcessor {
     BSFEngine engine;
@@ -63,18 +62,13 @@ public class BSFEventProcessorReturningEventInfos implements EventProcessor {
     // e.g. an object reference to forward event with received arguments to
 
     /**
-     * Package-protected constructor makes this class unavailable for public
-     * use.
+     * Package-protected constructor makes this class unavailable for public use.
      *
-     * @param dataFromScriptingEngine
-     *            this contains any object supplied by the scripting engine and
-     *            gets sent back with the supplied script. This could be used
-     *            e.g. for indicating which scripting engine object should be
-     *            ultimately informed of the event occurrence.
+     * @param dataFromScriptingEngine this contains any object supplied by the scripting engine and gets sent back with the supplied script. This could be used
+     *                                e.g. for indicating which scripting engine object should be ultimately informed of the event occurrence.
      */
-    BSFEventProcessorReturningEventInfos(final BSFEngine engine, final BSFManager manager,
-            final String filter, final String source, final int lineNo, final int columnNo,
-            final Object script, final Object dataFromScriptingEngine) throws BSFException {
+    BSFEventProcessorReturningEventInfos(final BSFEngine engine, final BSFManager manager, final String filter, final String source, final int lineNo,
+            final int columnNo, final Object script, final Object dataFromScriptingEngine) throws BSFException {
         this.engine = engine;
         this.manager = manager;
         this.filter = filter;
@@ -102,8 +96,7 @@ public class BSFEventProcessorReturningEventInfos implements EventProcessor {
             throw re;
         } catch (final Exception e) {
             // should not occur
-            System.err.println("BSFError: non-exceptionable event delivery "
-                    + "threw exception (that's not nice): " + e);
+            System.err.println("BSFError: non-exceptionable event delivery " + "threw exception (that's not nice): " + e);
             e.printStackTrace();
         }
     }
@@ -114,12 +107,11 @@ public class BSFEventProcessorReturningEventInfos implements EventProcessor {
     // an exception which must go all the way back to the source (as in
     // the vetoableChange case)
 
-    public void processExceptionableEvent(final String inFilter, final Object[] evtInfo)
-            throws Exception {
+    public void processExceptionableEvent(final String inFilter, final Object[] evtInfo) throws Exception {
 
         // System.err.println(this+": inFilter=["+inFilter+"],
         // filter=["+filter+"]");
-            if ((filter != null) && !isFilteredEvent(filter, inFilter)) {
+        if ((filter != null) && !isFilteredEvent(filter, inFilter)) {
             // ignore this event
             return;
         }
@@ -158,26 +150,21 @@ public class BSFEventProcessorReturningEventInfos implements EventProcessor {
         paramNames.add("BSFManager");
         paramValues.add(this.manager);
 
-        engine.apply(source, lineNo, columnNo, this.script, paramNames,
-                paramValues);
+        engine.apply(source, lineNo, columnNo, this.script, paramNames, paramValues);
 // System.err.println("returned from engine.exec.");
 
     }
 
-    private static boolean isFilteredEvent(final String filter, final String inFilter)
-    {
-        boolean bRes=filter.equalsIgnoreCase(inFilter);
-        if (bRes)
-        {
+    private static boolean isFilteredEvent(final String filter, final String inFilter) {
+        boolean bRes = filter.equalsIgnoreCase(inFilter);
+        if (bRes) {
             return bRes;
         }
 
-        final String[] chunks =filter.replace('+',' ').split(" ");
-        for (int i=0;i<chunks.length;i++)
-        {
-            bRes=chunks[i].equalsIgnoreCase(inFilter);
-            if (bRes)
-            {
+        final String[] chunks = filter.replace('+', ' ').split(" ");
+        for (int i = 0; i < chunks.length; i++) {
+            bRes = chunks[i].equalsIgnoreCase(inFilter);
+            if (bRes) {
                 return bRes;
             }
         }
diff --git a/src/main/java/org/apache/bsf/util/BSFFunctions.java b/src/main/java/org/apache/bsf/util/BSFFunctions.java
index 0b20194..035e85a 100644
--- a/src/main/java/org/apache/bsf/util/BSFFunctions.java
+++ b/src/main/java/org/apache/bsf/util/BSFFunctions.java
@@ -22,32 +22,31 @@ import org.apache.bsf.BSFException;
 import org.apache.bsf.BSFManager;
 
 /**
- * This is a utility that engine implementors may use as the Java
- * object they expose in the scripting language as "bsf". This has
- * essentially a subset of the methods in BSFManager plus some
- * stuff from the utils. Currently used by Javascript (Rhino) & BML.
+ * This is a utility that engine implementors may use as the Java object they expose in the scripting language as "bsf". This has essentially a subset of the
+ * methods in BSFManager plus some stuff from the utils. Currently used by Javascript (Rhino) & BML.
  */
 public class BSFFunctions {
-  BSFManager mgr;
-  BSFEngine engine;
-
-  public BSFFunctions (final BSFManager mgr, final BSFEngine engine) {
-    this.mgr = mgr;
-    this.engine = engine;
-  }
-  public void addEventListener (final Object src, final String eventSetName,
-                final String filter, final Object script)
-       throws BSFException {
-    EngineUtils.addEventListener (src, eventSetName, filter, engine,
-                  mgr, "<event-binding>", 0, 0, script);
-  }
-  public  Object lookupBean (final String name) {
-    return mgr.lookupBean (name);
-  }
-  public void registerBean (final String name, final Object bean) {
-    mgr.registerBean (name, bean);
-  }
-  public void unregisterBean (final String name) {
-    mgr.unregisterBean (name);
-  }
+    BSFManager mgr;
+    BSFEngine engine;
+
+    public BSFFunctions(final BSFManager mgr, final BSFEngine engine) {
+        this.mgr = mgr;
+        this.engine = engine;
+    }
+
+    public void addEventListener(final Object src, final String eventSetName, final String filter, final Object script) throws BSFException {
+        EngineUtils.addEventListener(src, eventSetName, filter, engine, mgr, "<event-binding>", 0, 0, script);
+    }
+
+    public Object lookupBean(final String name) {
+        return mgr.lookupBean(name);
+    }
+
+    public void registerBean(final String name, final Object bean) {
+        mgr.registerBean(name, bean);
+    }
+
+    public void unregisterBean(final String name) {
+        mgr.unregisterBean(name);
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/Bean.java b/src/main/java/org/apache/bsf/util/Bean.java
index cf8909f..184165f 100644
--- a/src/main/java/org/apache/bsf/util/Bean.java
+++ b/src/main/java/org/apache/bsf/util/Bean.java
@@ -18,20 +18,18 @@
 package org.apache.bsf.util;
 
 /**
- * A <em>Bean</em> is the class used to represent a bean: it holds a
- * type and a value. This is needed because otherwise we can't represent
- * the types of null-valued beans (or primitives) correctly. This was
- * originally in the BML player.
+ * A <em>Bean</em> is the class used to represent a bean: it holds a type and a value. This is needed because otherwise we can't represent the types of
+ * null-valued beans (or primitives) correctly. This was originally in the BML player.
  */
 public class Bean {
-  // type of this bean
-  public Class type;
+    // type of this bean
+    public Class type;
 
-  // its current value (mebbe null)
-  public Object value;
+    // its current value (mebbe null)
+    public Object value;
 
-  public Bean (final Class type, final Object value) {
-	this.type = type;
-	this.value = value;
-  }
+    public Bean(final Class type, final Object value) {
+        this.type = type;
+        this.value = value;
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/CodeBuffer.java b/src/main/java/org/apache/bsf/util/CodeBuffer.java
index 9f8f327..329724a 100644
--- a/src/main/java/org/apache/bsf/util/CodeBuffer.java
+++ b/src/main/java/org/apache/bsf/util/CodeBuffer.java
@@ -27,452 +27,381 @@ import java.util.Vector;
 import org.apache.bsf.util.cf.CodeFormatter;
 
 /**
- * A <code>CodeBuffer</code> object is used as a code repository for generated Java code.
- * It provides buffers which correspond to the various sections of a Java class.
+ * A <code>CodeBuffer</code> object is used as a code repository for generated Java code. It provides buffers which correspond to the various sections of a Java
+ * class.
  */
-public class CodeBuffer
-{
-  private final StringWriter fieldDeclSW       = new StringWriter(),
-                       methodDeclSW      = new StringWriter(),
-                       initializerSW     = new StringWriter(),
-                       constructorSW     = new StringWriter(),
-                       serviceMethodSW   = new StringWriter();
-
-  private final PrintWriter  fieldDeclPW       = new PrintWriter(fieldDeclSW),
-                       methodDeclPW      = new PrintWriter(methodDeclSW),
-                       initializerPW     = new PrintWriter(initializerSW),
-                       constructorPW     = new PrintWriter(constructorSW),
-                       serviceMethodPW   = new PrintWriter(serviceMethodSW);
-
-  private Stack        symbolTableStack  = new Stack();
-  private Hashtable    symbolTable       = new Hashtable(),
-                       usedSymbolIndices = new Hashtable();
-
-  private ObjInfo      finalStatementInfo;
-  private CodeBuffer   parent;
-
-  {
-    symbolTableStack.push(symbolTable);
-  }
-
-  // New stuff...
-  private final Vector imports                 = new Vector(),
-                 constructorArguments    = new Vector(),
-                 constructorExceptions   = new Vector(),
-                 serviceMethodExceptions = new Vector(),
-                 implementsVector        = new Vector();
-  private String packageName             = null,
-                 className               = "Test",
-                 serviceMethodName       = "exec",
-                 extendsName             = null;
-  private Class  serviceMethodReturnType = void.class;
-
-  public CodeBuffer()
-  {
-  }
-  public CodeBuffer(final CodeBuffer parent)
-  {
-    this.parent = parent;
-  }
-  public void addConstructorArgument(final ObjInfo arg)
-  {
-    constructorArguments.addElement(arg);
-  }
-  public void addConstructorException(final String exceptionName)
-  {
-    if (!constructorExceptions.contains(exceptionName))
-    {
-      constructorExceptions.addElement(exceptionName);
-    }
-  }
-  public void addConstructorStatement(final String statement)
-  {
-    constructorPW.println(statement);
-  }
-  public void addFieldDeclaration(final String statement)
-  {
-    fieldDeclPW.println(statement);
-  }
-  public void addImplements(final String importName)
-  {
-    if (!implementsVector.contains(importName))
+public class CodeBuffer {
+    private final StringWriter fieldDeclSW = new StringWriter(), methodDeclSW = new StringWriter(), initializerSW = new StringWriter(),
+            constructorSW = new StringWriter(), serviceMethodSW = new StringWriter();
+
+    private final PrintWriter fieldDeclPW = new PrintWriter(fieldDeclSW), methodDeclPW = new PrintWriter(methodDeclSW),
+            initializerPW = new PrintWriter(initializerSW), constructorPW = new PrintWriter(constructorSW), serviceMethodPW = new PrintWriter(serviceMethodSW);
+
+    private Stack symbolTableStack = new Stack();
+    private Hashtable symbolTable = new Hashtable(), usedSymbolIndices = new Hashtable();
+
+    private ObjInfo finalStatementInfo;
+    private CodeBuffer parent;
+
     {
-      implementsVector.addElement(importName);
+        symbolTableStack.push(symbolTable);
     }
-  }
-  public void addImport(final String importName)
-  {
-    if (!imports.contains(importName))
-    {
-      imports.addElement(importName);
-    }
-  }
-  public void addInitializerStatement(final String statement)
-  {
-    initializerPW.println(statement);
-  }
-  public void addMethodDeclaration(final String statement)
-  {
-    methodDeclPW.println(statement);
-  }
-  public void addServiceMethodException(final String exceptionName)
-  {
-    if (!serviceMethodExceptions.contains(exceptionName))
-    {
-      serviceMethodExceptions.addElement(exceptionName);
-    }
-  }
-  public void addServiceMethodStatement(final String statement)
-  {
-    serviceMethodPW.println(statement);
-  }
-  // Used internally by merge(...).
-  private void appendIfNecessary(final PrintWriter pw, final StringBuffer buf)
-  {
-    if (buf.length() > 0)
-    {
-      pw.print(buf.toString());
+
+    // New stuff...
+    private final Vector imports = new Vector(), constructorArguments = new Vector(), constructorExceptions = new Vector(),
+            serviceMethodExceptions = new Vector(), implementsVector = new Vector();
+    private String packageName = null, className = "Test", serviceMethodName = "exec", extendsName = null;
+    private Class serviceMethodReturnType = void.class;
+
+    public CodeBuffer() {
     }
-  }
-  public String buildNewSymbol(final String prefix)
-  {
-    Integer nextNum = getSymbolIndex(prefix);
 
-    if (nextNum == null)
-    {
-      nextNum = new Integer(0);
+    public CodeBuffer(final CodeBuffer parent) {
+        this.parent = parent;
     }
 
-    int    iNextNum = nextNum.intValue();
-    String symbol   = prefix + "_" + iNextNum;
+    public void addConstructorArgument(final ObjInfo arg) {
+        constructorArguments.addElement(arg);
+    }
 
-    while (getSymbol(symbol) != null)
-    {
-      iNextNum++;
-      symbol = prefix + "_" + iNextNum;
-    }
-
-    putSymbolIndex(prefix, new Integer(iNextNum + 1));
-
-    return symbol;
-  }
-  public void clearSymbolTable()
-  {
-    symbolTable       = new Hashtable();
-    symbolTableStack  = new Stack();
-    symbolTableStack.push(symbolTable);
-
-    usedSymbolIndices = new Hashtable();
-  }
-  public String getClassName()
-  {
-    return className;
-  }
-  public Vector getConstructorArguments()
-  {
-    return constructorArguments;
-  }
-  public StringBuffer getConstructorBuffer()
-  {
-    constructorPW.flush();
-
-    return constructorSW.getBuffer();
-  }
-  public Vector getConstructorExceptions()
-  {
-    return constructorExceptions;
-  }
-  public String getExtends()
-  {
-    return extendsName;
-  }
-  public StringBuffer getFieldBuffer()
-  {
-    fieldDeclPW.flush();
-
-    return fieldDeclSW.getBuffer();
-  }
-  public ObjInfo getFinalServiceMethodStatement()
-  {
-    return finalStatementInfo;
-  }
-  public Vector getImplements()
-  {
-    return implementsVector;
-  }
-  public Vector getImports()
-  {
-    return imports;
-  }
-  public StringBuffer getInitializerBuffer()
-  {
-    initializerPW.flush();
-
-    return initializerSW.getBuffer();
-  }
-  public StringBuffer getMethodBuffer()
-  {
-    methodDeclPW.flush();
-
-    return methodDeclSW.getBuffer();
-  }
-  public String getPackageName()
-  {
-    return packageName;
-  }
-  public StringBuffer getServiceMethodBuffer()
-  {
-    serviceMethodPW.flush();
-
-    return serviceMethodSW.getBuffer();
-  }
-  public Vector getServiceMethodExceptions()
-  {
-    return serviceMethodExceptions;
-  }
-  public String getServiceMethodName()
-  {
-    return serviceMethodName;
-  }
-  public Class getServiceMethodReturnType()
-  {
-    if (finalStatementInfo != null)
-    {
-      return finalStatementInfo.objClass;
+    public void addConstructorException(final String exceptionName) {
+        if (!constructorExceptions.contains(exceptionName)) {
+            constructorExceptions.addElement(exceptionName);
+        }
     }
-    else if (serviceMethodReturnType != null)
-    {
-      return serviceMethodReturnType;
+
+    public void addConstructorStatement(final String statement) {
+        constructorPW.println(statement);
     }
-    else
-    {
-      return void.class;
+
+    public void addFieldDeclaration(final String statement) {
+        fieldDeclPW.println(statement);
     }
-  }
-  public ObjInfo getSymbol(final String symbol)
-  {
-    ObjInfo ret = (ObjInfo)symbolTable.get(symbol);
 
-    if (ret == null && parent != null) {
-        ret = parent.getSymbol(symbol);
+    public void addImplements(final String importName) {
+        if (!implementsVector.contains(importName)) {
+            implementsVector.addElement(importName);
+        }
     }
 
-    return ret;
-  }
-  Integer getSymbolIndex(final String prefix)
-  {
-    if (parent != null)
-    {
-      return parent.getSymbolIndex(prefix);
+    public void addImport(final String importName) {
+        if (!imports.contains(importName)) {
+            imports.addElement(importName);
+        }
     }
-    else
-    {
-      return (Integer)usedSymbolIndices.get(prefix);
-    }
-  }
-  public Hashtable getSymbolTable()
-  {
-    return symbolTable;
-  }
-  public void merge(final CodeBuffer otherCB)
-  {
-    final Vector otherImports = otherCB.getImports();
-
-    for (int i = 0; i < otherImports.size(); i++)
-    {
-      addImport((String)otherImports.elementAt(i));
+
+    public void addInitializerStatement(final String statement) {
+        initializerPW.println(statement);
     }
 
-    appendIfNecessary(fieldDeclPW,     otherCB.getFieldBuffer());
-    appendIfNecessary(methodDeclPW,    otherCB.getMethodBuffer());
-    appendIfNecessary(initializerPW,   otherCB.getInitializerBuffer());
-    appendIfNecessary(constructorPW,   otherCB.getConstructorBuffer());
-    appendIfNecessary(serviceMethodPW, otherCB.getServiceMethodBuffer());
+    public void addMethodDeclaration(final String statement) {
+        methodDeclPW.println(statement);
+    }
 
-    final ObjInfo oldRet = getFinalServiceMethodStatement();
+    public void addServiceMethodException(final String exceptionName) {
+        if (!serviceMethodExceptions.contains(exceptionName)) {
+            serviceMethodExceptions.addElement(exceptionName);
+        }
+    }
 
-    if (oldRet != null && oldRet.isExecutable())
-    {
-      addServiceMethodStatement(oldRet.objName + ";");
-    }
-
-    setFinalServiceMethodStatement(otherCB.getFinalServiceMethodStatement());
-  }
-  public void popSymbolTable()
-  {
-    symbolTableStack.pop();
-    symbolTable = (Hashtable)symbolTableStack.peek();
-  }
-  public void print(final PrintWriter out, final boolean formatOutput)
-  {
-    if (formatOutput)
-    {
-      new CodeFormatter().formatCode(new StringReader(toString()), out);
+    public void addServiceMethodStatement(final String statement) {
+        serviceMethodPW.println(statement);
     }
-    else
-    {
-      out.print(toString());
-    }
-
-    out.flush();
-  }
-  public void pushSymbolTable()
-  {
-    symbolTable = (Hashtable)symbolTableStack.push(new ScriptSymbolTable(symbolTable));
-  }
-  public void putSymbol(final String symbol, final ObjInfo obj)
-  {
-    symbolTable.put(symbol, obj);
-  }
-  void putSymbolIndex(final String prefix, final Integer index)
-  {
-    if (parent != null)
-    {
-      parent.putSymbolIndex(prefix, index);
+
+    // Used internally by merge(...).
+    private void appendIfNecessary(final PrintWriter pw, final StringBuffer buf) {
+        if (buf.length() > 0) {
+            pw.print(buf.toString());
+        }
     }
-    else
-    {
-      usedSymbolIndices.put(prefix, index);
-    }
-  }
-  public void setClassName(final String className)
-  {
-    this.className = className;
-  }
-  public void setExtends(final String extendsName)
-  {
-    this.extendsName = extendsName;
-  }
-  public void setFinalServiceMethodStatement(final ObjInfo finalStatementInfo)
-  {
-    this.finalStatementInfo = finalStatementInfo;
-  }
-  public void setPackageName(final String packageName)
-  {
-    this.packageName = packageName;
-  }
-  public void setServiceMethodName(final String serviceMethodName)
-  {
-    this.serviceMethodName = serviceMethodName;
-  }
-  public void setServiceMethodReturnType(final Class serviceMethodReturnType)
-  {
-    this.serviceMethodReturnType = serviceMethodReturnType;
-  }
-  public void setSymbolTable(final Hashtable symbolTable)
-  {
-    this.symbolTable = symbolTable;
-  }
-  public boolean symbolTableIsStacked()
-  {
-    return (symbolTable instanceof ScriptSymbolTable);
-  }
-  public String toString()
-  {
-    final StringWriter sw  = new StringWriter();
-    final PrintWriter  pw  = new PrintWriter(sw);
-    final ObjInfo      ret = finalStatementInfo;
-
-    if (packageName != null && !packageName.equals(""))
-    {
-      pw.println("package " + packageName + ";");
-      pw.println();
+
+    public String buildNewSymbol(final String prefix) {
+        Integer nextNum = getSymbolIndex(prefix);
+
+        if (nextNum == null) {
+            nextNum = new Integer(0);
+        }
+
+        int iNextNum = nextNum.intValue();
+        String symbol = prefix + "_" + iNextNum;
+
+        while (getSymbol(symbol) != null) {
+            iNextNum++;
+            symbol = prefix + "_" + iNextNum;
+        }
+
+        putSymbolIndex(prefix, new Integer(iNextNum + 1));
+
+        return symbol;
     }
 
-    if (imports.size() > 0)
-    {
-      for (int i = 0; i < imports.size(); i++)
-      {
-        pw.println("import " + imports.elementAt(i) + ";");
-      }
+    public void clearSymbolTable() {
+        symbolTable = new Hashtable();
+        symbolTableStack = new Stack();
+        symbolTableStack.push(symbolTable);
 
-      pw.println();
+        usedSymbolIndices = new Hashtable();
     }
 
-    pw.println("public class " + className +
-               (extendsName != null && !extendsName.equals("")
-                ? " extends " + extendsName
-                : "") +
-               (implementsVector.size() > 0
-                ? " implements " +
-                  StringUtils.getCommaListFromVector(implementsVector)
-                : "")
-              );
-    pw.println("{");
+    public String getClassName() {
+        return className;
+    }
 
-    pw.print(getFieldBuffer().toString());
+    public Vector getConstructorArguments() {
+        return constructorArguments;
+    }
 
-    StringBuffer buf = getInitializerBuffer();
+    public StringBuffer getConstructorBuffer() {
+        constructorPW.flush();
 
-    if (buf.length() > 0)
-    {
-      pw.println();
-      pw.println("{");
-      pw.print(buf.toString());
-      pw.println("}");
+        return constructorSW.getBuffer();
     }
 
-    buf = getConstructorBuffer();
+    public Vector getConstructorExceptions() {
+        return constructorExceptions;
+    }
 
-    if (buf.length() > 0)
-    {
-      pw.println();
-      pw.println("public " + className + "(" +
-                 (constructorArguments.size() > 0
-                  ? StringUtils.getCommaListFromVector(constructorArguments)
-                  : ""
-                 ) + ")" +
-                 (constructorExceptions.size() > 0
-                  ? " throws " +
-                    StringUtils.getCommaListFromVector(constructorExceptions)
-                  : ""
-                 )
-                );
-      pw.println("{");
-      pw.print(buf.toString());
-      pw.println("}");
-    }
-
-    buf = getServiceMethodBuffer();
-
-    if (buf.length() > 0 || ret != null)
-    {
-      pw.println();
-      pw.println("public " +
-                  StringUtils.getClassName(getServiceMethodReturnType()) + " " +
-                  serviceMethodName + "()" +
-                 (serviceMethodExceptions.size() > 0
-                  ? " throws " +
-                    StringUtils.getCommaListFromVector(serviceMethodExceptions)
-                  : ""
-                 )
-                );
-      pw.println("{");
-
-      pw.print(buf.toString());
-
-      if (ret != null)
-      {
-        if (ret.isValueReturning())
-        {
-          pw.println();
-          pw.println("return " + ret.objName + ";");
+    public String getExtends() {
+        return extendsName;
+    }
+
+    public StringBuffer getFieldBuffer() {
+        fieldDeclPW.flush();
+
+        return fieldDeclSW.getBuffer();
+    }
+
+    public ObjInfo getFinalServiceMethodStatement() {
+        return finalStatementInfo;
+    }
+
+    public Vector getImplements() {
+        return implementsVector;
+    }
+
+    public Vector getImports() {
+        return imports;
+    }
+
+    public StringBuffer getInitializerBuffer() {
+        initializerPW.flush();
+
+        return initializerSW.getBuffer();
+    }
+
+    public StringBuffer getMethodBuffer() {
+        methodDeclPW.flush();
+
+        return methodDeclSW.getBuffer();
+    }
+
+    public String getPackageName() {
+        return packageName;
+    }
+
+    public StringBuffer getServiceMethodBuffer() {
+        serviceMethodPW.flush();
+
+        return serviceMethodSW.getBuffer();
+    }
+
+    public Vector getServiceMethodExceptions() {
+        return serviceMethodExceptions;
+    }
+
+    public String getServiceMethodName() {
+        return serviceMethodName;
+    }
+
+    public Class getServiceMethodReturnType() {
+        if (finalStatementInfo != null) {
+            return finalStatementInfo.objClass;
+        } else if (serviceMethodReturnType != null) {
+            return serviceMethodReturnType;
+        } else {
+            return void.class;
+        }
+    }
+
+    public ObjInfo getSymbol(final String symbol) {
+        ObjInfo ret = (ObjInfo) symbolTable.get(symbol);
+
+        if (ret == null && parent != null) {
+            ret = parent.getSymbol(symbol);
+        }
+
+        return ret;
+    }
+
+    Integer getSymbolIndex(final String prefix) {
+        if (parent != null) {
+            return parent.getSymbolIndex(prefix);
+        } else {
+            return (Integer) usedSymbolIndices.get(prefix);
+        }
+    }
+
+    public Hashtable getSymbolTable() {
+        return symbolTable;
+    }
+
+    public void merge(final CodeBuffer otherCB) {
+        final Vector otherImports = otherCB.getImports();
+
+        for (int i = 0; i < otherImports.size(); i++) {
+            addImport((String) otherImports.elementAt(i));
+        }
+
+        appendIfNecessary(fieldDeclPW, otherCB.getFieldBuffer());
+        appendIfNecessary(methodDeclPW, otherCB.getMethodBuffer());
+        appendIfNecessary(initializerPW, otherCB.getInitializerBuffer());
+        appendIfNecessary(constructorPW, otherCB.getConstructorBuffer());
+        appendIfNecessary(serviceMethodPW, otherCB.getServiceMethodBuffer());
+
+        final ObjInfo oldRet = getFinalServiceMethodStatement();
+
+        if (oldRet != null && oldRet.isExecutable()) {
+            addServiceMethodStatement(oldRet.objName + ";");
+        }
+
+        setFinalServiceMethodStatement(otherCB.getFinalServiceMethodStatement());
+    }
+
+    public void popSymbolTable() {
+        symbolTableStack.pop();
+        symbolTable = (Hashtable) symbolTableStack.peek();
+    }
+
+    public void print(final PrintWriter out, final boolean formatOutput) {
+        if (formatOutput) {
+            new CodeFormatter().formatCode(new StringReader(toString()), out);
+        } else {
+            out.print(toString());
         }
-        else if (ret.isExecutable())
-        {
-          pw.println(ret.objName + ";");
+
+        out.flush();
+    }
+
+    public void pushSymbolTable() {
+        symbolTable = (Hashtable) symbolTableStack.push(new ScriptSymbolTable(symbolTable));
+    }
+
+    public void putSymbol(final String symbol, final ObjInfo obj) {
+        symbolTable.put(symbol, obj);
+    }
+
+    void putSymbolIndex(final String prefix, final Integer index) {
+        if (parent != null) {
+            parent.putSymbolIndex(prefix, index);
+        } else {
+            usedSymbolIndices.put(prefix, index);
         }
-      }
+    }
+
+    public void setClassName(final String className) {
+        this.className = className;
+    }
+
+    public void setExtends(final String extendsName) {
+        this.extendsName = extendsName;
+    }
+
+    public void setFinalServiceMethodStatement(final ObjInfo finalStatementInfo) {
+        this.finalStatementInfo = finalStatementInfo;
+    }
+
+    public void setPackageName(final String packageName) {
+        this.packageName = packageName;
+    }
 
-      pw.println("}");
+    public void setServiceMethodName(final String serviceMethodName) {
+        this.serviceMethodName = serviceMethodName;
     }
 
-    pw.print(getMethodBuffer().toString());
+    public void setServiceMethodReturnType(final Class serviceMethodReturnType) {
+        this.serviceMethodReturnType = serviceMethodReturnType;
+    }
+
+    public void setSymbolTable(final Hashtable symbolTable) {
+        this.symbolTable = symbolTable;
+    }
+
+    public boolean symbolTableIsStacked() {
+        return (symbolTable instanceof ScriptSymbolTable);
+    }
+
+    public String toString() {
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        final ObjInfo ret = finalStatementInfo;
+
+        if (packageName != null && !packageName.equals("")) {
+            pw.println("package " + packageName + ";");
+            pw.println();
+        }
+
+        if (imports.size() > 0) {
+            for (int i = 0; i < imports.size(); i++) {
+                pw.println("import " + imports.elementAt(i) + ";");
+            }
 
-    pw.println("}");
+            pw.println();
+        }
+
+        pw.println("public class " + className + (extendsName != null && !extendsName.equals("") ? " extends " + extendsName : "")
+                + (implementsVector.size() > 0 ? " implements " + StringUtils.getCommaListFromVector(implementsVector) : ""));
+        pw.println("{");
+
+        pw.print(getFieldBuffer().toString());
+
+        StringBuffer buf = getInitializerBuffer();
+
+        if (buf.length() > 0) {
+            pw.println();
+            pw.println("{");
+            pw.print(buf.toString());
+            pw.println("}");
+        }
+
+        buf = getConstructorBuffer();
+
+        if (buf.length() > 0) {
+            pw.println();
+            pw.println("public " + className + "(" + (constructorArguments.size() > 0 ? StringUtils.getCommaListFromVector(constructorArguments) : "") + ")"
+                    + (constructorExceptions.size() > 0 ? " throws " + StringUtils.getCommaListFromVector(constructorExceptions) : ""));
+            pw.println("{");
+            pw.print(buf.toString());
+            pw.println("}");
+        }
 
-    pw.flush();
+        buf = getServiceMethodBuffer();
 
-    return sw.toString();
-  }
+        if (buf.length() > 0 || ret != null) {
+            pw.println();
+            pw.println("public " + StringUtils.getClassName(getServiceMethodReturnType()) + " " + serviceMethodName + "()"
+                    + (serviceMethodExceptions.size() > 0 ? " throws " + StringUtils.getCommaListFromVector(serviceMethodExceptions) : ""));
+            pw.println("{");
+
+            pw.print(buf.toString());
+
+            if (ret != null) {
+                if (ret.isValueReturning()) {
+                    pw.println();
+                    pw.println("return " + ret.objName + ";");
+                } else if (ret.isExecutable()) {
+                    pw.println(ret.objName + ";");
+                }
+            }
+
+            pw.println("}");
+        }
+
+        pw.print(getMethodBuffer().toString());
+
+        pw.println("}");
+
+        pw.flush();
+
+        return sw.toString();
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/EngineUtils.java b/src/main/java/org/apache/bsf/util/EngineUtils.java
index 80715fa..ec83126 100644
--- a/src/main/java/org/apache/bsf/util/EngineUtils.java
+++ b/src/main/java/org/apache/bsf/util/EngineUtils.java
@@ -26,22 +26,17 @@ import org.apache.bsf.BSFException;
 import org.apache.bsf.BSFManager;
 
 /**
- * This class contains utilities that language integrators can use
- * when implementing the BSFEngine interface.
+ * This class contains utilities that language integrators can use when implementing the BSFEngine interface.
  */
 
- /*
-    2012-01-15: Rony G. Flatscher
-        - take into account that the context thread class loader is not set, hence
-          raise an exception in loadClass(mgr,name) instead of returning null
-        - corrected some indentations
-
-    2007-09-21: Rony G. Flatscher, new class loading sequence:
-
-        - Thread's context class loader
-        - settable class loader stored with BSF manager
-        - BSFManager's defining class loader
-        - BSF-custom class loader (loads from temp dir)
+/*
+ * 2012-01-15: Rony G. Flatscher - take into account that the context thread class loader is not set, hence raise an exception in loadClass(mgr,name) instead of
+ * returning null - corrected some indentations
+ * 
+ * 2007-09-21: Rony G. Flatscher, new class loading sequence:
+ * 
+ * - Thread's context class loader - settable class loader stored with BSF manager - BSFManager's defining class loader - BSF-custom class loader (loads from
+ * temp dir)
  */
 public class EngineUtils {
     // the BSF class loader that knows how to load from the a specific
@@ -49,124 +44,87 @@ public class EngineUtils {
     static BSFClassLoader bsfCL;
 
     // rgf, 20070917: class loaders that we might need to load classes
-    static ClassLoader bsfManagerDefinedCL=BSFManager.getDefinedClassLoader();
+    static ClassLoader bsfManagerDefinedCL = BSFManager.getDefinedClassLoader();
 
     // ---rgf, 2003-02-13, determine whether changing accessibility of Methods is possible
-    static boolean bMethodHasSetAccessible=false;
+    static boolean bMethodHasSetAccessible = false;
     static {
-        final Class mc=Method.class;            // get the "Method" class object
-        final Class[] arg ={boolean.class};      // define an array with the primitive "boolean" pseudo class object
+        final Class mc = Method.class; // get the "Method" class object
+        final Class[] arg = { boolean.class }; // define an array with the primitive "boolean" pseudo class object
         try {
-            mc.getMethod("setAccessible", arg ); // is this method available?
-            bMethodHasSetAccessible=true; // no exception, hence method exists
-        }
-        catch (final Exception e)
-        {
-            bMethodHasSetAccessible=false;// exception occurred, hence method does not exist
+            mc.getMethod("setAccessible", arg); // is this method available?
+            bMethodHasSetAccessible = true; // no exception, hence method exists
+        } catch (final Exception e) {
+            bMethodHasSetAccessible = false;// exception occurred, hence method does not exist
         }
     }
 
     /**
-     * Add a script as a listener to some event coming out of an object. The
-     * first two args identify the src of the event and the event set
-     * and the rest identify the script which should be run when the event
-     * fires.
+     * Add a script as a listener to some event coming out of an object. The first two args identify the src of the event and the event set and the rest
+     * identify the script which should be run when the event fires.
      *
      * @param bean         event source
      * @param eventSetName name of event set from event src to bind to
      * @param filter       filter for events
      * @param engine       BSFEngine which can run this script
      * @param manager      BSFManager of the above engine
-     * @param source       (context info) the source of this expression
-     *                                    (e.g., filename)
+     * @param source       (context info) the source of this expression (e.g., filename)
      * @param lineNo       (context info) the line number in source for expr
      * @param columnNo     (context info) the column number in source for expr
      * @param script       the script to execute when the event occurs
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public static void addEventListener (final Object bean, final String eventSetName,
-                                         final String filter, final BSFEngine engine,
-                                         final BSFManager manager, final String source,
-                                         final int lineNo, final int columnNo,
-                                         final Object script) throws BSFException {
-        final BSFEventProcessor ep = new BSFEventProcessor (engine, manager, filter,
-                                                      source, lineNo, columnNo,
-                                                      script);
+    public static void addEventListener(final Object bean, final String eventSetName, final String filter, final BSFEngine engine, final BSFManager manager,
+            final String source, final int lineNo, final int columnNo, final Object script) throws BSFException {
+        final BSFEventProcessor ep = new BSFEventProcessor(engine, manager, filter, source, lineNo, columnNo, script);
 
         try {
-            ReflectionUtils.addEventListener (bean, eventSetName, ep);
+            ReflectionUtils.addEventListener(bean, eventSetName, ep);
         } catch (final Exception e) {
-            e.printStackTrace ();
-            throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                                    "[EngineUtils.addEventListener()] ouch while adding event listener: "
-                                    + e, e);
+            e.printStackTrace();
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "[EngineUtils.addEventListener()] ouch while adding event listener: " + e, e);
         }
     }
 
     /**
-     * Add a script as a listener to some event coming out of an object. The
-     * first two args identify the src of the event and the event set
-     * and the rest identify the script which should be run when the event
-     * fires. The processing will use the engine's apply() method.
+     * Add a script as a listener to some event coming out of an object. The first two args identify the src of the event and the event set and the rest
+     * identify the script which should be run when the event fires. The processing will use the engine's apply() method.
      *
-     * @param bean         event source
-     * @param eventSetName name of event set from event src to bind to
-     * @param filter       filter for events
-     * @param engine       BSFEngine which can run this script
-     * @param manager      BSFManager of the above engine
-     * @param source       (context info) the source of this expression (e.g., filename)
-     * @param lineNo       (context info) the line number in source for expr
-     * @param columnNo     (context info) the column number in source for expr
-     * @param script       the script to execute when the event occurs
-     * @param dataFromScriptingEngine
-     *                     this contains any object supplied by the scripting engine and gets sent
-     *                     back with the supplied script, if the event occurs.
-     *                     This could be used e.g. for indicating to the scripting engine which
-     *                     scripting engine object/routine/function/procedure
-     *                     should be ultimately informed of the event occurrence.
+     * @param bean                    event source
+     * @param eventSetName            name of event set from event src to bind to
+     * @param filter                  filter for events
+     * @param engine                  BSFEngine which can run this script
+     * @param manager                 BSFManager of the above engine
+     * @param source                  (context info) the source of this expression (e.g., filename)
+     * @param lineNo                  (context info) the line number in source for expr
+     * @param columnNo                (context info) the column number in source for expr
+     * @param script                  the script to execute when the event occurs
+     * @param dataFromScriptingEngine this contains any object supplied by the scripting engine and gets sent back with the supplied script, if the event
+     *                                occurs. This could be used e.g. for indicating to the scripting engine which scripting engine
+     *                                object/routine/function/procedure should be ultimately informed of the event occurrence.
      *
      * @exception BSFException if anything goes wrong while running the script
      */
-    public static void addEventListenerReturningEventInfos ( final Object bean,
-                               final String eventSetName,
-                               final String filter,
-                               final BSFEngine engine,
-                               final BSFManager manager,
-                               final String source,
-                               final int lineNo,
-                               final int columnNo,
-                               final Object script,
-                               final Object dataFromScriptingEngine
-                               ) throws BSFException
-    {
-        final BSFEventProcessorReturningEventInfos ep =
-        new BSFEventProcessorReturningEventInfos (engine,
-                                                  manager,
-                                                  filter,
-                                                  source,
-                                                  lineNo,
-                                                  columnNo,
-                                                  script,
-                                                  dataFromScriptingEngine
-                                                  );
+    public static void addEventListenerReturningEventInfos(final Object bean, final String eventSetName, final String filter, final BSFEngine engine,
+            final BSFManager manager, final String source, final int lineNo, final int columnNo, final Object script, final Object dataFromScriptingEngine)
+            throws BSFException {
+        final BSFEventProcessorReturningEventInfos ep = new BSFEventProcessorReturningEventInfos(engine, manager, filter, source, lineNo, columnNo, script,
+                dataFromScriptingEngine);
 
         try {
-            ReflectionUtils.addEventListener (bean, eventSetName, ep);
+            ReflectionUtils.addEventListener(bean, eventSetName, ep);
         } catch (final Exception e) {
-            e.printStackTrace ();
-            throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                                    "[EngineUtils.addEventListenerReturningEventInfos()] ouch while adding event listener: "
-                                    + e, e);
+            e.printStackTrace();
+            throw new BSFException(BSFException.REASON_OTHER_ERROR,
+                    "[EngineUtils.addEventListenerReturningEventInfos()] ouch while adding event listener: " + e, e);
         }
     }
 
     /**
-     * Finds and invokes a method with the given signature on the given
-     * bean. The signature of the method that's invoked is first taken
-     * as the types of the args, but if that fails, this tries to convert
-     * any primitive wrapper type args to their primitive counterparts
-     * to see whether a method exists that way. If it does, done.
+     * Finds and invokes a method with the given signature on the given bean. The signature of the method that's invoked is first taken as the types of the
+     * args, but if that fails, this tries to convert any primitive wrapper type args to their primitive counterparts to see whether a method exists that way.
+     * If it does, done.
      *
      * @param bean       the object on which to invoke the method
      * @param methodName name of the method
@@ -176,8 +134,7 @@ public class EngineUtils {
      *
      * @exception BSFException if something goes wrong
      */
-    public static Object callBeanMethod (final Object bean, final String methodName,
-                                         final Object[] args) throws BSFException {
+    public static Object callBeanMethod(final Object bean, final String methodName, final Object[] args) throws BSFException {
         Class[] argTypes = null;
         // determine arg types. note that a null argtype
         // matches any object type
@@ -185,120 +142,103 @@ public class EngineUtils {
         if (args != null) {
             argTypes = new Class[args.length];
             for (int i = 0; i < args.length; i++) {
-                argTypes[i] = (args[i] == null) ? null : args[i].getClass ();
+                argTypes[i] = (args[i] == null) ? null : args[i].getClass();
             }
         }
 
         // we want to allow a static call to occur on an object, similar
         // to what Java allows. So isStaticOnly is set to false.
         final boolean isStaticOnly = false;
-        final Class beanClass = (bean instanceof Class) ? (Class)bean :
-                                                    bean.getClass ();
+        final Class beanClass = (bean instanceof Class) ? (Class) bean : bean.getClass();
 
         // now try to call method with the right signature
-  	try {
-  	  Method m;
-  	  try {
-  	m = MethodUtils.getMethod (beanClass, methodName, argTypes,
-  				       isStaticOnly);
-  	  } catch (final NoSuchMethodException e) {
-  	// ok, so that didn't work - now try converting any primitive
-  	// wrapper types to their primitive counterparts
-  	try {
-  	  // if args is null the NullPointerException will get caught
-  	  // below and the right thing'll happen .. ugly but works
-  	  for (int i = 0; i < args.length; i++) {
-             if (args[i] instanceof Number)
-             {
-                 if      (args[i] instanceof Byte) {
-                    argTypes[i] = byte.class;
-                } else if (args[i] instanceof Integer) {
-                    argTypes[i] = int.class;
-                } else if (args[i] instanceof Long) {
-                    argTypes[i] = long.class;
-                } else if (args[i] instanceof Float) {
-                    argTypes[i] = float.class;
-                } else if (args[i] instanceof Double ) {
-                    argTypes[i] = double.class;
-                } else if (args[i] instanceof Short  ) {
-                    argTypes[i] = short.class;
+        try {
+            Method m;
+            try {
+                m = MethodUtils.getMethod(beanClass, methodName, argTypes, isStaticOnly);
+            } catch (final NoSuchMethodException e) {
+                // ok, so that didn't work - now try converting any primitive
+                // wrapper types to their primitive counterparts
+                try {
+                    // if args is null the NullPointerException will get caught
+                    // below and the right thing'll happen .. ugly but works
+                    for (int i = 0; i < args.length; i++) {
+                        if (args[i] instanceof Number) {
+                            if (args[i] instanceof Byte) {
+                                argTypes[i] = byte.class;
+                            } else if (args[i] instanceof Integer) {
+                                argTypes[i] = int.class;
+                            } else if (args[i] instanceof Long) {
+                                argTypes[i] = long.class;
+                            } else if (args[i] instanceof Float) {
+                                argTypes[i] = float.class;
+                            } else if (args[i] instanceof Double) {
+                                argTypes[i] = double.class;
+                            } else if (args[i] instanceof Short) {
+                                argTypes[i] = short.class;
+                            }
+                        } else if (args[i] instanceof Boolean) {
+                            argTypes[i] = boolean.class;
+                        } else if (args[i] instanceof Character) {
+                            argTypes[i] = char.class;
+                        }
+                    }
+
+                    m = MethodUtils.getMethod(beanClass, methodName, argTypes, isStaticOnly);
+                } catch (final Exception e2) {
+                    // throw the original
+                    throw e;
                 }
-             }
-             else if (args[i] instanceof Boolean) {
-                argTypes[i] = boolean.class;
-            } else if (args[i] instanceof Character) {
-                argTypes[i] = char.class;
             }
-  	  }
-
-  	  m = MethodUtils.getMethod (beanClass, methodName, argTypes,
-  					 isStaticOnly);
-  	} catch (final Exception e2) {
-  	  // throw the original
-  	  throw e;
-  	}
-  	  }
 
-  	  // call it, and return the result
-        try {
-            return m.invoke (bean, args);
-        }
-        catch (final Exception e)                   // 2003-02-23, --rgf, maybe an IllegalAccessException?
-        {
-            if (e instanceof IllegalAccessException &&
-                bMethodHasSetAccessible &&
-                Modifier.isPublic(m.getModifiers())   )   // if a public method allow access to it
+            // call it, and return the result
+            try {
+                return m.invoke(bean, args);
+            } catch (final Exception e) // 2003-02-23, --rgf, maybe an IllegalAccessException?
             {
-                m.setAccessible(true);        // allow unconditional access to method
-  	        return m.invoke (bean, args);
+                if (e instanceof IllegalAccessException && bMethodHasSetAccessible && Modifier.isPublic(m.getModifiers())) // if a public method allow access to
+                                                                                                                           // it
+                {
+                    m.setAccessible(true); // allow unconditional access to method
+                    return m.invoke(bean, args);
+                }
+                // re-throw the exception
+                throw e;
             }
-  	  // re-throw the exception
-  	  throw e;
-        }
 
         } catch (final Exception e) {
             // something went wrong while invoking method
-            final Throwable t = (e instanceof InvocationTargetException) ?
-                          ((InvocationTargetException)e).getTargetException () :
-                          null;
-            throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                                    "[EngineUtils.callBeanMethod()] method invocation failed: " + e +
-                                    ((t==null) ? "" :
-                                     (" target exception: " + t)), t);
+            final Throwable t = (e instanceof InvocationTargetException) ? ((InvocationTargetException) e).getTargetException() : null;
+            throw new BSFException(BSFException.REASON_OTHER_ERROR,
+                    "[EngineUtils.callBeanMethod()] method invocation failed: " + e + ((t == null) ? "" : (" target exception: " + t)), t);
         }
     }
 
     /**
-     * Creates a new bean. The signature of the constructor that's invoked
-     * is first taken as the types of the args, but if that fails, this tries
-     * to convert any primitive wrapper type args to their primitive
-     * counterparts to see whether a method exists that way. If it does, done.
+     * Creates a new bean. The signature of the constructor that's invoked is first taken as the types of the args, but if that fails, this tries to convert any
+     * primitive wrapper type args to their primitive counterparts to see whether a method exists that way. If it does, done.
      *
      * @param className fully qualified name of class to instantiate
      * @param args      array of constructor args (or null if none)
      *
      * @return the created bean
      *
-     * @exception BSFException if something goes wrong (@see
-     *            org.apache.cs.util.MethodUtils for the real
-     *            exceptions that can occur).
+     * @exception BSFException if something goes wrong (@see org.apache.cs.util.MethodUtils for the real exceptions that can occur).
      */
-    public static Object createBean (final String className, final Object args[])
-        throws BSFException {
+    public static Object createBean(final String className, final Object args[]) throws BSFException {
         Bean obj;
         Class[] argTypes = null;
 
         if (args != null) {
             argTypes = new Class[args.length];
             for (int i = 0; i < args.length; i++) {
-                argTypes[i] = (args[i] != null) ? args[i].getClass () : null;
+                argTypes[i] = (args[i] != null) ? args[i].getClass() : null;
             }
         }
 
         try {
             try {
-                obj = ReflectionUtils.createBean (null, className,
-                                                  argTypes, args);
+                obj = ReflectionUtils.createBean(null, className, argTypes, args);
                 return obj.value;
             } catch (final NoSuchMethodException me) {
                 // ok, so that didn't work - now try converting any primitive
@@ -315,8 +255,7 @@ public class EngineUtils {
                             argTypes[i] = char.class;
                         }
                     }
-                    obj = ReflectionUtils.createBean (null, className,
-                                                      argTypes, args);
+                    obj = ReflectionUtils.createBean(null, className, argTypes, args);
                     return obj.value;
                 } catch (final Exception e) {
                     // throw the previous exception
@@ -324,21 +263,19 @@ public class EngineUtils {
                 }
             }
         } catch (final Exception e) {
-            throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                                    "[EngineUtils.createBean()]" + e.getMessage (), e);
+            throw new BSFException(BSFException.REASON_OTHER_ERROR, "[EngineUtils.createBean()]" + e.getMessage(), e);
         }
     }
 
     /**
-     * Given a class return the type signature string fragment for it.
-     * That is, return "I" for int, "J" for long, ... etc..
+     * Given a class return the type signature string fragment for it. That is, return "I" for int, "J" for long, ... etc..
      *
      * @param cl class object for whom the signature fragment is needed.
      *
      * @return the string representing the type signature
      */
-    public static String getTypeSignatureString (final Class cl) {
-        if (cl.isPrimitive ()) {
+    public static String getTypeSignatureString(final Class cl) {
+        if (cl.isPrimitive()) {
             if (cl == boolean.class) {
                 return "Z";
             } else if (cl == byte.class) {
@@ -359,57 +296,52 @@ public class EngineUtils {
                 return "V";
             }
         } else {
-            final StringBuffer sb = new StringBuffer ("L");
-            sb.append (cl.getName ());
-            sb.append (";");
-            return sb.toString().replace ('.', '/');
+            final StringBuffer sb = new StringBuffer("L");
+            sb.append(cl.getName());
+            sb.append(";");
+            return sb.toString().replace('.', '/');
         }
     }
 
     /**
      * Loads a class using the following sequence of class loaders:
      * <ul>
-     * <li>  Thread's context class loader,
-     * <li>  settable class loader stored with BSFManager,
-     * <li>  BSFManager's defining class loader,
-     * <li>  BSF customized class loader (from the BSFManager's temporary directory).
+     * <li>Thread's context class loader,
+     * <li>settable class loader stored with BSFManager,
+     * <li>BSFManager's defining class loader,
+     * <li>BSF customized class loader (from the BSFManager's temporary directory).
      *
-     * @param mgr  BSFManager who's classLoader and tempDir props are
-     *        consulted
+     * @param mgr  BSFManager who's classLoader and tempDir props are consulted
      * @param name name of the class to load
      *
      * @return the loaded class
      *
      * @exception BSFException if something goes wrong.
      */
-    public static Class loadClass (final BSFManager mgr, final String name)
-        throws BSFException {
+    public static Class loadClass(final BSFManager mgr, final String name) throws BSFException {
 
         ClassLoader mgrCL = null;
 
         try {
             // TCCL may not be set, adapt logic!
-            final ClassLoader cl=Thread.currentThread().getContextClassLoader();
-            if (cl!=null)
-            {
-                try {   // try the Thread's context loader first
-                        return Thread.currentThread().getContextClassLoader().loadClass(name);
-                }
-                catch (final ClassNotFoundException e01) {
+            final ClassLoader cl = Thread.currentThread().getContextClassLoader();
+            if (cl != null) {
+                try { // try the Thread's context loader first
+                    return Thread.currentThread().getContextClassLoader().loadClass(name);
+                } catch (final ClassNotFoundException e01) {
                 }
             }
 
-            try {   // try the class loader of the supplied BSFManager ("mgr")
-                mgrCL = mgr.getClassLoader ();
+            try { // try the class loader of the supplied BSFManager ("mgr")
+                mgrCL = mgr.getClassLoader();
                 if (mgrCL != null) {
                     return mgrCL.loadClass(name);
                 }
-            }
-            catch (final ClassNotFoundException e02) {
-                    // o.k., now try the defined class loader
+            } catch (final ClassNotFoundException e02) {
+                // o.k., now try the defined class loader
             }
 
-                // try the class loader stored with the BSF manager
+            // try the class loader stored with the BSF manager
             if (mgrCL != bsfManagerDefinedCL) {
                 return bsfManagerDefinedCL.loadClass(name);
             }
@@ -418,17 +350,15 @@ public class EngineUtils {
             // try to load it from the temp dir using my own class loader
             try {
                 if (bsfCL == null) {
-                    bsfCL = new BSFClassLoader ();
+                    bsfCL = new BSFClassLoader();
                 }
-                bsfCL.setTempDir (mgr.getTempDir ());
-                return bsfCL.loadClass (name);
+                bsfCL.setTempDir(mgr.getTempDir());
+                return bsfCL.loadClass(name);
             } catch (final ClassNotFoundException e2) {
-                throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                        "[EngineUtils.loadClass()] unable to load class '" + name + "':" + e, e);
+                throw new BSFException(BSFException.REASON_OTHER_ERROR, "[EngineUtils.loadClass()] unable to load class '" + name + "':" + e, e);
             }
         }
 
-        throw new BSFException (BSFException.REASON_OTHER_ERROR,
-                "[EngineUtils.loadClass()] unable to load class '" + name + "'");
+        throw new BSFException(BSFException.REASON_OTHER_ERROR, "[EngineUtils.loadClass()] unable to load class '" + name + "'");
     }
 }
diff --git a/src/main/java/org/apache/bsf/util/IOUtils.java b/src/main/java/org/apache/bsf/util/IOUtils.java
index a9aa361..9007c68 100644
--- a/src/main/java/org/apache/bsf/util/IOUtils.java
+++ b/src/main/java/org/apache/bsf/util/IOUtils.java
@@ -27,23 +27,23 @@ import java.io.StringWriter;
  * This file is a collection of input/output utilities.
  */
 public class IOUtils {
-  // debug flag - generates debug stuff if true
-  static boolean debug = false;
+    // debug flag - generates debug stuff if true
+    static boolean debug = false;
 
-  //////////////////////////////////////////////////////////////////////////
+    //////////////////////////////////////////////////////////////////////////
 
-  public static String getStringFromReader (final Reader reader) throws IOException {
-    final BufferedReader bufIn = new BufferedReader(reader);
-    final StringWriter   swOut = new StringWriter();
-    final PrintWriter    pwOut = new PrintWriter(swOut);
-    String         tempLine;
+    public static String getStringFromReader(final Reader reader) throws IOException {
+        final BufferedReader bufIn = new BufferedReader(reader);
+        final StringWriter swOut = new StringWriter();
+        final PrintWriter pwOut = new PrintWriter(swOut);
+        String tempLine;
 
-    while ((tempLine = bufIn.readLine()) != null) {
-      pwOut.println(tempLine);
-    }
+        while ((tempLine = bufIn.readLine()) != null) {
+            pwOut.println(tempLine);
+        }
 
-    pwOut.flush();
+        pwOut.flush();
 
-    return swOut.toString();
-  }
+        return swOut.toString();
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/IndentWriter.java b/src/main/java/org/apache/bsf/util/IndentWriter.java
index 665487a..3d6d88b 100644
--- a/src/main/java/org/apache/bsf/util/IndentWriter.java
+++ b/src/main/java/org/apache/bsf/util/IndentWriter.java
@@ -22,63 +22,55 @@ import java.io.PrintWriter;
 import java.io.Writer;
 
 /**
- * An <code>IndentWriter</code> object behaves the same as a
- * <code>PrintWriter</code> object, with the additional capability
- * of being able to print strings that are prepended with a specified
- * amount of spaces.
+ * An <code>IndentWriter</code> object behaves the same as a <code>PrintWriter</code> object, with the additional capability of being able to print strings that
+ * are prepended with a specified amount of spaces.
  */
-public class IndentWriter extends PrintWriter
-{
-  /**
-   * Forwards its arguments to the <code>PrintWriter</code> constructor
-   * with the same signature.
-   */
-  public IndentWriter(final OutputStream out)
-  {
-    super(out);
-  }
-  /**
-   * Forwards its arguments to the <code>PrintWriter</code> constructor
-   * with the same signature.
-   */
-  public IndentWriter(final OutputStream out, final boolean autoFlush)
-  {
-    super(out, autoFlush);
-  }
-  /**
-   * Forwards its arguments to the <code>PrintWriter</code> constructor
-   * with the same signature.
-   */
-  public IndentWriter(final Writer out)
-  {
-    super(out);
-  }
-  /**
-   * Forwards its arguments to the <code>PrintWriter</code> constructor
-   * with the same signature.
-   */
-  public IndentWriter(final Writer out, final boolean autoFlush)
-  {
-    super(out, autoFlush);
-  }
-  /**
-   * Print the text (indented the specified amount) without inserting a linefeed.
-   *
-   * @param numberOfSpaces the number of spaces to indent the text.
-   * @param text the text to print.
-   */
-  public void print(final int numberOfSpaces, final String text)
-  {
-    super.print(StringUtils.getChars(numberOfSpaces, ' ') + text);
-  }
-  /**
-   * Print the text (indented the specified amount) and insert a linefeed.
-   *
-   * @param numberOfSpaces the number of spaces to indent the text.
-   * @param text the text to print.
-   */
-  public void println(final int numberOfSpaces, final String text)
-  {
-    super.println(StringUtils.getChars(numberOfSpaces, ' ') + text);
-  }
+public class IndentWriter extends PrintWriter {
+    /**
+     * Forwards its arguments to the <code>PrintWriter</code> constructor with the same signature.
+     */
+    public IndentWriter(final OutputStream out) {
+        super(out);
+    }
+
+    /**
+     * Forwards its arguments to the <code>PrintWriter</code> constructor with the same signature.
+     */
+    public IndentWriter(final OutputStream out, final boolean autoFlush) {
+        super(out, autoFlush);
+    }
+
+    /**
+     * Forwards its arguments to the <code>PrintWriter</code> constructor with the same signature.
+     */
+    public IndentWriter(final Writer out) {
+        super(out);
+    }
+
+    /**
+     * Forwards its arguments to the <code>PrintWriter</code> constructor with the same signature.
+     */
+    public IndentWriter(final Writer out, final boolean autoFlush) {
+        super(out, autoFlush);
+    }
+
+    /**
+     * Print the text (indented the specified amount) without inserting a linefeed.
+     *
+     * @param numberOfSpaces the number of spaces to indent the text.
+     * @param text           the text to print.
+     */
+    public void print(final int numberOfSpaces, final String text) {
+        super.print(StringUtils.getChars(numberOfSpaces, ' ') + text);
+    }
+
+    /**
+     * Print the text (indented the specified amount) and insert a linefeed.
+     *
+     * @param numberOfSpaces the number of spaces to indent the text.
+     * @param text           the text to print.
+     */
+    public void println(final int numberOfSpaces, final String text) {
+        super.println(StringUtils.getChars(numberOfSpaces, ' ') + text);
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/JavaUtils.java b/src/main/java/org/apache/bsf/util/JavaUtils.java
index 8438900..aad04dc 100644
--- a/src/main/java/org/apache/bsf/util/JavaUtils.java
+++ b/src/main/java/org/apache/bsf/util/JavaUtils.java
@@ -25,11 +25,11 @@ import java.io.IOException;
 public class JavaUtils {
     // Temporarily copied from JavaEngine...
 
-    private static BSF_Log logger=null;
+    private static BSF_Log logger = null;
 
     static {
-                    // handle logger
-                logger = BSF_LogFactory.getLog((org.apache.bsf.util.JavaUtils.class).getName());
+        // handle logger
+        logger = BSF_LogFactory.getLog((org.apache.bsf.util.JavaUtils.class).getName());
     }
 
     public static boolean JDKcompile(final String fileName, final String classPath) {
@@ -46,8 +46,7 @@ public class JavaUtils {
         } catch (final IOException e) {
             logger.error("ERROR: IO exception during exec(javac).", e);
         } catch (final SecurityException e) {
-            logger.error("ERROR: Unable to create subprocess to exec(javac).",
-                    e);
+            logger.error("ERROR: Unable to create subprocess to exec(javac).", e);
         } catch (final InterruptedException e) {
             logger.error("ERROR: Wait for exec(javac) was interrupted.", e);
         }
diff --git a/src/main/java/org/apache/bsf/util/MethodUtils.java b/src/main/java/org/apache/bsf/util/MethodUtils.java
index 0d50576..6839cdd 100644
--- a/src/main/java/org/apache/bsf/util/MethodUtils.java
+++ b/src/main/java/org/apache/bsf/util/MethodUtils.java
@@ -24,516 +24,397 @@ import java.util.Enumeration;
 import java.util.Vector;
 
 /**
- * This file is a collection of reflection utilities for dealing with
- * methods and constructors.
+ * This file is a collection of reflection utilities for dealing with methods and constructors.
  */
 public class MethodUtils {
 
-  /** Internal Class for getEntryPoint(). Implements 15.11.2.2 MORE
-    SPECIFIC rules.
-
-    Retains a list of methods (already known to match the
-    arguments). As each method is added, we check against past entries
-    to determine which if any is "more specific" -- defined as having
-    _all_ its arguments (not just a preponderance) be
-    method-convertable into those of another. If such a relationship
-    is found, the more-specific method is retained and the
-    less-specific method is discarded. At the end, if this has yielded
-    a single winner it is considered the Most Specific Method and
-    hence the one that should be invoked.  Otherwise, a
-    NoSuchMethodException is thrown.
-
-    PERFORMANCE VERSUS ARCHITECTURE: Arguably, this should "have-a"
-    Vector. But the code is 6% smaller, and possibly faster, if we
-    code it as "is-a" Vector. Since it's an inner class, nobody's
-    likely to abuse the privilage.
-
-    Note: "Static" in the case of an inner class means "Does not
-    reference instance data in the outer class", and is required since
-    our caller is a static method. */
-  private static class MoreSpecific
-  extends Vector
-  {
-    /** Submit an entry-point to the list. May be discarded if a past
-      entry is more specific, or may cause others to be discarded it
-      if is more specific.
-
-      newEntry: Method or Constructor under consideration.
-      */
-    void addItem (final Object newEntry)
-    {
-      if(size()==0) {
-        addElement(newEntry);
-    } else
-        {
-          final Class[] newargs=entryGetParameterTypes(newEntry);
-          boolean keep=true;
-          for (final Enumeration e = elements();
-               keep & e.hasMoreElements() ;
-                )
-            {
-              final Object oldEntry=e.nextElement();
-              // CAVEAT: Implicit references to enclosing class!
-              final Class[] oldargs=entryGetParameterTypes(oldEntry);
-              if(areMethodConvertable(oldargs,newargs)) {
-                removeElement(oldEntry); // New more specific; discard old
-            } else if(areMethodConvertable(newargs,oldargs))
-             {
-                keep=false;     // Old more specific; discard new
-              // Else they're tied. Keep both and hope someone beats both.
+    /**
+     * Internal Class for getEntryPoint(). Implements 15.11.2.2 MORE SPECIFIC rules.
+     * 
+     * Retains a list of methods (already known to match the arguments). As each method is added, we check against past entries to determine which if any is
+     * "more specific" -- defined as having _all_ its arguments (not just a preponderance) be method-convertable into those of another. If such a relationship
+     * is found, the more-specific method is retained and the less-specific method is discarded. At the end, if this has yielded a single winner it is
+     * considered the Most Specific Method and hence the one that should be invoked. Otherwise, a NoSuchMethodException is thrown.
+     * 
+     * PERFORMANCE VERSUS ARCHITECTURE: Arguably, this should "have-a" Vector. But the code is 6% smaller, and possibly faster, if we code it as "is-a" Vector.
+     * Since it's an inner class, nobody's likely to abuse the privilage.
+     * 
+     * Note: "Static" in the case of an inner class means "Does not reference instance data in the outer class", and is required since our caller is a static
+     * method.
+     */
+    private static class MoreSpecific extends Vector {
+        /**
+         * Submit an entry-point to the list. May be discarded if a past entry is more specific, or may cause others to be discarded it if is more specific.
+         * 
+         * newEntry: Method or Constructor under consideration.
+         */
+        void addItem(final Object newEntry) {
+            if (size() == 0) {
+                addElement(newEntry);
+            } else {
+                final Class[] newargs = entryGetParameterTypes(newEntry);
+                boolean keep = true;
+                for (final Enumeration e = elements(); keep & e.hasMoreElements();) {
+                    final Object oldEntry = e.nextElement();
+                    // CAVEAT: Implicit references to enclosing class!
+                    final Class[] oldargs = entryGetParameterTypes(oldEntry);
+                    if (areMethodConvertable(oldargs, newargs)) {
+                        removeElement(oldEntry); // New more specific; discard old
+                    } else if (areMethodConvertable(newargs, oldargs)) {
+                        keep = false; // Old more specific; discard new
+                        // Else they're tied. Keep both and hope someone beats both.
+                    }
+                }
+                if (keep) {
+                    addElement(newEntry);
+                }
             }
-            }
-          if(keep) {
-            addElement(newEntry);
-        }
         }
-    }
 
-    /** Obtain the single Most Specific entry-point. If there is no clear
-      winner, or if the list is empty, throw NoSuchMethodException.
-
-      Arguments describe the call we were hoping to resolve. They are
-      used to throw a nice verbose exception if something goes wrong.
-      */
-    Object getMostSpecific(final Class targetClass,final String methodName,
-                           final Class[] argTypes,final boolean isStaticReference)
-         throws NoSuchMethodException
-    {
-      if(size()==1) {
-        return firstElement();
-    }
-      if(size()>1)
-        {
-          final StringBuffer buf=new StringBuffer();
-          final Enumeration e=elements();
-          buf.append(e.nextElement());
-          while(e.hasMoreElements()) {
-            buf.append(" and ").append(e.nextElement());
-        }
-          throw new NoSuchMethodException (callToString(targetClass,
-                                                        methodName,
-                                                        argTypes,
-                                                        isStaticReference)+
-                                           " is ambiguous. It matches "+
-                                           buf.toString());
+        /**
+         * Obtain the single Most Specific entry-point. If there is no clear winner, or if the list is empty, throw NoSuchMethodException.
+         * 
+         * Arguments describe the call we were hoping to resolve. They are used to throw a nice verbose exception if something goes wrong.
+         */
+        Object getMostSpecific(final Class targetClass, final String methodName, final Class[] argTypes, final boolean isStaticReference)
+                throws NoSuchMethodException {
+            if (size() == 1) {
+                return firstElement();
+            }
+            if (size() > 1) {
+                final StringBuffer buf = new StringBuffer();
+                final Enumeration e = elements();
+                buf.append(e.nextElement());
+                while (e.hasMoreElements()) {
+                    buf.append(" and ").append(e.nextElement());
+                }
+                throw new NoSuchMethodException(
+                        callToString(targetClass, methodName, argTypes, isStaticReference) + " is ambiguous. It matches " + buf.toString());
+            }
+            return null;
         }
-      return null;
-    }
-  }
-
-  /** Convenience method: Test an entire parameter-list/argument-list pair
-    for isMethodConvertable(), qv.
-    */
-  static private boolean areMethodConvertable(final Class[] parms,final Class[] args)
-  {
-    if(parms.length!=args.length) {
-        return false;
     }
 
-    for(int i=0;i<parms.length;++i) {
-        if(!isMethodConvertable(parms[i],args[i])) {
+    /**
+     * Convenience method: Test an entire parameter-list/argument-list pair for isMethodConvertable(), qv.
+     */
+    static private boolean areMethodConvertable(final Class[] parms, final Class[] args) {
+        if (parms.length != args.length) {
             return false;
         }
-    }
 
-    return true;
-  }
-  /** Internal subroutine for getEntryPoint(): Format arguments as a
-      string describing the function being searched for. Used in
-      verbose exceptions. */
-  private static String callToString(final Class targetClass,final String methodName,
-                                    final Class[] argTypes,final boolean isStaticReference)
-  {
-    final StringBuffer buf = new StringBuffer();
-    if(isStaticReference) {
-        buf.append("static ");
-    }
-    buf.append(StringUtils.getClassName(targetClass));
-    if(methodName!=null) {
-        buf.append(".").append(methodName);
+        for (int i = 0; i < parms.length; ++i) {
+            if (!isMethodConvertable(parms[i], args[i])) {
+                return false;
+            }
+        }
+
+        return true;
     }
-    buf.append("(");
-    if (argTypes != null && argTypes.length>0) {
-      if(false)
-        {
-          // ????? Sanjiva has an ArrayToString method. Using it would
-          // save a few bytes, at cost of giving up some reusability.
+
+    /**
+     * Internal subroutine for getEntryPoint(): Format arguments as a string describing the function being searched for. Used in verbose exceptions.
+     */
+    private static String callToString(final Class targetClass, final String methodName, final Class[] argTypes, final boolean isStaticReference) {
+        final StringBuffer buf = new StringBuffer();
+        if (isStaticReference) {
+            buf.append("static ");
         }
-      else
-        {
-          buf.append(StringUtils.getClassName(argTypes[0]));
-          for (int i = 1; i < argTypes.length; i++) {
-            buf.append(",").append(StringUtils.getClassName(argTypes[i]));
-          }
+        buf.append(StringUtils.getClassName(targetClass));
+        if (methodName != null) {
+            buf.append(".").append(methodName);
         }
-    } else {
-        buf.append("[none]");
-    }
-    buf.append(")");
-    return buf.toString();
-  }
-  /** Utility function: obtain common data from either Method or
-      Constructor. (In lieu of an EntryPoint interface.) */
-  static int entryGetModifiers(final Object entry)
-  {
-    return (entry instanceof Method)
-      ? ((Method)entry).getModifiers()
-      : ((Constructor)entry).getModifiers();
-  }
-  // The common lookup code would be much easier if Method and
-  // Constructor shared an "EntryPoint" Interface. Unfortunately, even
-  // though their APIs are almost identical, they don't. These calls
-  // are a workaround...  at the cost of additional runtime overhead
-  // and some extra bytecodes.
-  //
-  // (A JDK bug report has been submitted requesting that they add the
-  // Interface; it would be easy, harmless, and useful.)
-
-  /** Utility function: obtain common data from either Method or
-      Constructor. (In lieu of an EntryPoint interface.) */
-  static String entryGetName(final Object entry)
-  {
-    return (entry instanceof Method)
-      ? ((Method)entry).getName()
-      : ((Constructor)entry).getName();
-  }
-  /** Utility function: obtain common data from either Method or
-      Constructor. (In lieu of an EntryPoint interface.) */
-  static Class[] entryGetParameterTypes(final Object entry)
-  {
-    return (entry instanceof Method)
-      ? ((Method)entry).getParameterTypes()
-      : ((Constructor)entry).getParameterTypes();
-  }
-  /** Utility function: obtain common data from either Method or
-      Constructor. (In lieu of an EntryPoint interface.) */
-  static String entryToString(final Object entry)
-  {
-    return (entry instanceof Method)
-      ? ((Method)entry).toString()
-      : ((Constructor)entry).toString();
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /** Class.getConstructor() finds only the entry point (if any)
-    _exactly_ matching the specified argument types. Our implmentation
-    can decide between several imperfect matches, using the same
-    search algorithm as the Java compiler.
-
-    Note that all constructors are static by definition, so
-    isStaticReference is true.
-
-    @exception NoSuchMethodException if constructor not found.
-    */
-  static public Constructor getConstructor(final Class targetClass, final Class[] argTypes)
-       throws SecurityException, NoSuchMethodException
-  {
-    return (Constructor) getEntryPoint(targetClass,null,argTypes,true);
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Search for entry point, per  Java Language Spec 1.0
-   * as amended, verified by comparison against compiler behavior.
-   *
-   * @param targetClass Class object for the class to be queried.
-   * @param methodName  Name of method to invoke, or null for constructor.
-   *                    Only Public methods will be accepted.
-   * @param argTypes    Classes of intended arguments.  Note that primitives
-   *                    must be specified via their TYPE equivalents,
-   *                    rather than as their wrapper classes -- Integer.TYPE
-   *                    rather than Integer. "null" may be passed in as an
-   *                    indication that you intend to invoke the method with
-   *                    a literal null argument and therefore can accept
-   *                    any object type in this position.
-   * @param isStaticReference  If true, and if the target is a Class object,
-   *                    only static methods will be accepted as valid matches.
-   *
-   * @return a Method or Constructor of the appropriate signature
-   *
-   * @exception SecurityException     if security violation
-   * @exception NoSuchMethodException if no such method
-   */
-  static private Object getEntryPoint(final Class targetClass,
-                                      final String methodName,
-                                      final Class[] argTypes,
-                                      final boolean isStaticReference)
-       throws SecurityException, NoSuchMethodException
-  {
-    // 15.11.1: OBTAIN STARTING CLASS FOR SEARCH
-    Object m=null;
-
-    // 15.11.2 DETERMINE ARGUMENT SIGNATURE
-    // (Passed in as argTypes array.)
-
-    // Shortcut: If an exact match exists, return it.
-    try {
-      if(methodName!=null)
-        {
-          m=targetClass.getMethod (methodName, argTypes);
-          if(isStaticReference &&
-             !Modifier.isStatic(entryGetModifiers(m)) )
-            {
-              throw
-                new NoSuchMethodException (callToString (targetClass,
-                                                         methodName,
-                                                         argTypes,
-                                                         isStaticReference)+
-                                           " resolved to instance " + m);
+        buf.append("(");
+        if (argTypes != null && argTypes.length > 0) {
+            if (false) {
+                // ????? Sanjiva has an ArrayToString method. Using it would
+                // save a few bytes, at cost of giving up some reusability.
+            } else {
+                buf.append(StringUtils.getClassName(argTypes[0]));
+                for (int i = 1; i < argTypes.length; i++) {
+                    buf.append(",").append(StringUtils.getClassName(argTypes[i]));
+                }
             }
-          return m;
         } else {
-        return targetClass.getConstructor (argTypes);
+            buf.append("[none]");
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+    /**
+     * Utility function: obtain common data from either Method or Constructor. (In lieu of an EntryPoint interface.)
+     */
+    static int entryGetModifiers(final Object entry) {
+        return (entry instanceof Method) ? ((Method) entry).getModifiers() : ((Constructor) entry).getModifiers();
+    }
+    // The common lookup code would be much easier if Method and
+    // Constructor shared an "EntryPoint" Interface. Unfortunately, even
+    // though their APIs are almost identical, they don't. These calls
+    // are a workaround... at the cost of additional runtime overhead
+    // and some extra bytecodes.
+    //
+    // (A JDK bug report has been submitted requesting that they add the
+    // Interface; it would be easy, harmless, and useful.)
+
+    /**
+     * Utility function: obtain common data from either Method or Constructor. (In lieu of an EntryPoint interface.)
+     */
+    static String entryGetName(final Object entry) {
+        return (entry instanceof Method) ? ((Method) entry).getName() : ((Constructor) entry).getName();
+    }
+
+    /**
+     * Utility function: obtain common data from either Method or Constructor. (In lieu of an EntryPoint interface.)
+     */
+    static Class[] entryGetParameterTypes(final Object entry) {
+        return (entry instanceof Method) ? ((Method) entry).getParameterTypes() : ((Constructor) entry).getParameterTypes();
     }
 
-    } catch (final NoSuchMethodException e) {
-      // no-args has no alternatives!
-      if(argTypes==null || argTypes.length==0)
-      {
-        throw
-          new NoSuchMethodException (callToString (targetClass,
-                                                   methodName,
-                                                   argTypes,
-                                                   isStaticReference)+
-                                     " not found.");
-      }
-      // Else fall through.
+    /**
+     * Utility function: obtain common data from either Method or Constructor. (In lieu of an EntryPoint interface.)
+     */
+    static String entryToString(final Object entry) {
+        return (entry instanceof Method) ? ((Method) entry).toString() : ((Constructor) entry).toString();
+    }
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Class.getConstructor() finds only the entry point (if any) _exactly_ matching the specified argument types. Our implmentation can decide between several
+     * imperfect matches, using the same search algorithm as the Java compiler.
+     * 
+     * Note that all constructors are static by definition, so isStaticReference is true.
+     * 
+     * @exception NoSuchMethodException if constructor not found.
+     */
+    static public Constructor getConstructor(final Class targetClass, final Class[] argTypes) throws SecurityException, NoSuchMethodException {
+        return (Constructor) getEntryPoint(targetClass, null, argTypes, true);
     }
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Search for entry point, per Java Language Spec 1.0 as amended, verified by comparison against compiler behavior.
+     *
+     * @param targetClass       Class object for the class to be queried.
+     * @param methodName        Name of method to invoke, or null for constructor. Only Public methods will be accepted.
+     * @param argTypes          Classes of intended arguments. Note that primitives must be specified via their TYPE equivalents, rather than as their wrapper
+     *                          classes -- Integer.TYPE rather than Integer. "null" may be passed in as an indication that you intend to invoke the method with
+     *                          a literal null argument and therefore can accept any object type in this position.
+     * @param isStaticReference If true, and if the target is a Class object, only static methods will be accepted as valid matches.
+     *
+     * @return a Method or Constructor of the appropriate signature
+     *
+     * @exception SecurityException     if security violation
+     * @exception NoSuchMethodException if no such method
+     */
+    static private Object getEntryPoint(final Class targetClass, final String methodName, final Class[] argTypes, final boolean isStaticReference)
+            throws SecurityException, NoSuchMethodException {
+        // 15.11.1: OBTAIN STARTING CLASS FOR SEARCH
+        Object m = null;
+
+        // 15.11.2 DETERMINE ARGUMENT SIGNATURE
+        // (Passed in as argTypes array.)
+
+        // Shortcut: If an exact match exists, return it.
+        try {
+            if (methodName != null) {
+                m = targetClass.getMethod(methodName, argTypes);
+                if (isStaticReference && !Modifier.isStatic(entryGetModifiers(m))) {
+                    throw new NoSuchMethodException(callToString(targetClass, methodName, argTypes, isStaticReference) + " resolved to instance " + m);
+                }
+                return m;
+            } else {
+                return targetClass.getConstructor(argTypes);
+            }
+
+        } catch (final NoSuchMethodException e) {
+            // no-args has no alternatives!
+            if (argTypes == null || argTypes.length == 0) {
+                throw new NoSuchMethodException(callToString(targetClass, methodName, argTypes, isStaticReference) + " not found.");
+            }
+            // Else fall through.
+        }
+
+        // Well, _that_ didn't work. Time to search for the Most Specific
+        // matching function. NOTE that conflicts are possible!
+
+        // 15.11.2.1 ACCESSIBLE: We apparently need to gather from two
+        // sources to be sure we have both instance and static methods.
+        Object[] methods;
+        if (methodName != null) {
+            methods = targetClass.getMethods();
+        } else {
+            methods = targetClass.getConstructors();
+        }
+        if (0 == methods.length) {
+            throw new NoSuchMethodException("No methods!");
+        }
 
-    // Well, _that_ didn't work. Time to search for the Most Specific
-    // matching function. NOTE that conflicts are possible!
-
-    // 15.11.2.1 ACCESSIBLE: We apparently need to gather from two
-    // sources to be sure we have both instance and static methods.
-    Object[] methods;
-    if(methodName!=null)
-      {
-        methods=targetClass.getMethods();
-      }
-    else
-      {
-        methods=targetClass.getConstructors();
-      }
-    if(0==methods.length)
-      {
-        throw new NoSuchMethodException("No methods!");
-      }
-
-    final MoreSpecific best=new MoreSpecific();
-    for(int i=0;i<methods.length;++i)
-      {
-        final Object mi=methods[i];
-        if (
+        final MoreSpecific best = new MoreSpecific();
+        for (int i = 0; i < methods.length; ++i) {
+            final Object mi = methods[i];
+            if (
             // 15.11.2.1 ACCESSIBLE: Method is public.
-            Modifier.isPublic(entryGetModifiers(mi))
-            &&
+            Modifier.isPublic(entryGetModifiers(mi)) &&
             // 15.11.2.1 APPLICABLE: Right method name (or c'tor)
-            (methodName==null || entryGetName(mi).equals(methodName) )
-            &&
-            // 15.11.2.1 APPLICABLE: Parameters match arguments
-            areMethodConvertable(entryGetParameterTypes(mi),argTypes)
-             ) {
-            // 15.11.2.2 MORE SPECIFIC displace less specific.
-              best.addItem(mi);
+                    (methodName == null || entryGetName(mi).equals(methodName)) &&
+                    // 15.11.2.1 APPLICABLE: Parameters match arguments
+                    areMethodConvertable(entryGetParameterTypes(mi), argTypes)) {
+                // 15.11.2.2 MORE SPECIFIC displace less specific.
+                best.addItem(mi);
+            }
         }
-      }
 
-    // May throw NoSuchMethodException; we pass in info needed to
-    // create a useful exception
-    m=best.getMostSpecific(targetClass,methodName,argTypes,isStaticReference);
+        // May throw NoSuchMethodException; we pass in info needed to
+        // create a useful exception
+        m = best.getMostSpecific(targetClass, methodName, argTypes, isStaticReference);
+
+        // 15.11.3 APPROPRIATE: Class invocation can call only static
+        // methods. Note that the defined order of evaluation permits a
+        // call to be resolved to an inappropriate method and then
+        // rejected, rather than finding the best of the appropriate
+        // methods.
+        //
+        // Constructors are never static, so we don't test them.
+        if (m == null) {
+            throw new NoSuchMethodException(callToString(targetClass, methodName, argTypes, isStaticReference) + " -- no signature match");
+        }
 
-    // 15.11.3 APPROPRIATE: Class invocation can call only static
-    // methods. Note that the defined order of evaluation permits a
-    // call to be resolved to an inappropriate method and then
-    // rejected, rather than finding the best of the appropriate
-    // methods.
-    //
-    // Constructors are never static, so we don't test them.
-    if(m==null)
-      {
-        throw new NoSuchMethodException (callToString(targetClass,
-                                                      methodName,
-                                                      argTypes,
-                                                      isStaticReference)+
-                                         " -- no signature match");
-      }
-
-    if( methodName!=null &&
-        isStaticReference &&
-        !Modifier.isStatic(entryGetModifiers(m)) )
-      {
-        throw new NoSuchMethodException (callToString(targetClass,
-                                                      methodName,
-                                                      argTypes,
-                                                      isStaticReference)+
-                                         " resolved to instance: "+m);
-      }
-
-    return m;
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /* Class.getMethod() finds only the entry point (if any) _exactly_
-    matching the specified argument types. Our implmentation can
-    decide between several imperfect matches, using the same search
-    algorithm as the Java compiler.
-
-    This version more closely resembles Class.getMethod() -- we always
-    ask the Class for the method. It differs in testing for
-    appropriateness before returning the method; if the query is
-    being made via a static reference, only static methods will be
-    found and returned. */
-  static public Method getMethod(final Class target,final String methodName,
-                                 final Class[] argTypes,final boolean isStaticReference)
-       throws SecurityException, NoSuchMethodException
-  {
-    return (Method)getEntryPoint(target,methodName,argTypes,isStaticReference);
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Class.getMethod() finds only the entry point (if any) _exactly_
-   * matching the specified argument types. Our implmentation can
-   * decide between several imperfect matches, using the same search
-   * algorithm as the Java compiler.
-   *
-   * This version emulates the compiler behavior by allowing lookup to
-   * be performed against either a class or an instance -- classname.foo()
-   * must be a static method call, instance.foo() can invoke either static
-   * or instance methods.
-   *
-   * @param target     object on which call is to be made
-   * @param methodName name of method I'm lookin' for
-   * @param argTypes   array of argument types of method
-   *
-   * @return the desired method
-   *
-   * @exception SecurityException     if security violation
-   * @exception NoSuchMethodException if no such method
-   */
-  static public Method getMethod(final Object target,final String methodName,
-                                 final Class[] argTypes)
-       throws SecurityException, NoSuchMethodException
-  {
-    final boolean staticRef=target instanceof Class;
-    return getMethod( staticRef ? (Class)target : target.getClass(),
-                      methodName,argTypes,staticRef);
-  }
-  /** Determine whether a given type can accept assignments of another
-    type. Note that class.isAssignable() is _not_ a complete test!
-    (This method is not needed by getMethod() or getConstructor(), but
-    is provided as a convenience for other users.)
-
-    parm: The type given in the method's signature.
-    arg: The type we want to pass in.
-
-    Legal ASSIGNMENT CONVERSIONS (5.2) are METHOD CONVERSIONS (5.3)
-    plus implicit narrowing of int to byte, short or char.  */
-  static private boolean isAssignmentConvertable(final Class parm,final Class arg)
-  {
-    return
-      (arg.equals(Integer.TYPE) &&
-       (parm.equals(Byte.TYPE) ||
-        parm.equals(Short.TYPE) ||
-        parm.equals(Character.TYPE)
-         )
-        ) ||
-      isMethodConvertable(parm,arg);
-  }
-  /** Determine whether a given method parameter type can accept
-    arguments of another type.
-
-    parm: The type given in the method's signature.
-    arg: The type we want to pass in.
-
-    Legal METHOD CONVERSIONS (5.3) are Identity, Widening Primitive
-    Conversion, or Widening Reference Conversion. NOTE that this is a
-    subset of the legal ASSIGNMENT CONVERSIONS (5.2) -- in particular,
-    we can't implicitly narrow int to byte, short or char.
-
-    SPECIAL CASE: In order to permit invoking methods with literal
-    "null" values, setting the arg Class to null will be taken as a
-    request to match any Class type. POSSIBLE PROBLEM: This may match
-    a primitive type, which really should not accept a null value... but
-    I'm not sure how best to distinguish those, short of enumerating them
-    */
-  static private boolean isMethodConvertable(Class parm, Class arg)
-  {
-    if (parm.equals(arg)) {
-        return true;
-    }
+        if (methodName != null && isStaticReference && !Modifier.isStatic(entryGetModifiers(m))) {
+            throw new NoSuchMethodException(callToString(targetClass, methodName, argTypes, isStaticReference) + " resolved to instance: " + m);
+        }
 
-    // Accept any type EXCEPT primitives (which can't have null values).
-    if (arg == null)
-    {
-      return !parm.isPrimitive();
+        return m;
     }
-
-    // Arrays are convertable if their elements are convertable
-    // ????? Does this have to be done before isAssignableFrom, or
-    // does it successfully handle arrays of primatives?
-    while(parm.isArray())
-      {
-        if(!arg.isArray()) {
-            return false;         // Unequal array depth
-        } else
-          {
-            parm=parm.getComponentType();
-            arg=arg.getComponentType();
-          }
-      }
-    if(arg.isArray())
-     {
-        return false;             // Unequal array depth
+    //////////////////////////////////////////////////////////////////////////
+
+    /*
+     * Class.getMethod() finds only the entry point (if any) _exactly_ matching the specified argument types. Our implmentation can decide between several
+     * imperfect matches, using the same search algorithm as the Java compiler.
+     * 
+     * This version more closely resembles Class.getMethod() -- we always ask the Class for the method. It differs in testing for appropriateness before
+     * returning the method; if the query is being made via a static reference, only static methods will be found and returned.
+     */
+    static public Method getMethod(final Class target, final String methodName, final Class[] argTypes, final boolean isStaticReference)
+            throws SecurityException, NoSuchMethodException {
+        return (Method) getEntryPoint(target, methodName, argTypes, isStaticReference);
+    }
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Class.getMethod() finds only the entry point (if any) _exactly_ matching the specified argument types. Our implmentation can decide between several
+     * imperfect matches, using the same search algorithm as the Java compiler.
+     *
+     * This version emulates the compiler behavior by allowing lookup to be performed against either a class or an instance -- classname.foo() must be a static
+     * method call, instance.foo() can invoke either static or instance methods.
+     *
+     * @param target     object on which call is to be made
+     * @param methodName name of method I'm lookin' for
+     * @param argTypes   array of argument types of method
+     *
+     * @return the desired method
+     *
+     * @exception SecurityException     if security violation
+     * @exception NoSuchMethodException if no such method
+     */
+    static public Method getMethod(final Object target, final String methodName, final Class[] argTypes) throws SecurityException, NoSuchMethodException {
+        final boolean staticRef = target instanceof Class;
+        return getMethod(staticRef ? (Class) target : target.getClass(), methodName, argTypes, staticRef);
     }
 
-    // Despite its name, the 1.1.6 docs say that this function does
-    // NOT return true for all legal ASSIGNMENT CONVERSIONS
-    // (5.2):
-    //   "Specifically, this method tests whether the type
-    //   represented by the specified class can be converted
-    //   to the type represented by this Class object via
-    //   an identity conversion or via a widening reference
-    //   conversion."
-    if(parm.isAssignableFrom(arg)) {
-        return true;
+    /**
+     * Determine whether a given type can accept assignments of another type. Note that class.isAssignable() is _not_ a complete test! (This method is not
+     * needed by getMethod() or getConstructor(), but is provided as a convenience for other users.)
+     * 
+     * parm: The type given in the method's signature. arg: The type we want to pass in.
+     * 
+     * Legal ASSIGNMENT CONVERSIONS (5.2) are METHOD CONVERSIONS (5.3) plus implicit narrowing of int to byte, short or char.
+     */
+    static private boolean isAssignmentConvertable(final Class parm, final Class arg) {
+        return (arg.equals(Integer.TYPE) && (parm.equals(Byte.TYPE) || parm.equals(Short.TYPE) || parm.equals(Character.TYPE)))
+                || isMethodConvertable(parm, arg);
     }
 
-    // That leaves us the Widening Primitives case. Four possibilities:
-    // void (can only convert to void), boolean (can only convert to boolean),
-    // numeric (which are sequenced) and char (which inserts itself into the
-    // numerics by promoting to int or larger)
+    /**
+     * Determine whether a given method parameter type can accept arguments of another type.
+     * 
+     * parm: The type given in the method's signature. arg: The type we want to pass in.
+     * 
+     * Legal METHOD CONVERSIONS (5.3) are Identity, Widening Primitive Conversion, or Widening Reference Conversion. NOTE that this is a subset of the legal
+     * ASSIGNMENT CONVERSIONS (5.2) -- in particular, we can't implicitly narrow int to byte, short or char.
+     * 
+     * SPECIAL CASE: In order to permit invoking methods with literal "null" values, setting the arg Class to null will be taken as a request to match any Class
+     * type. POSSIBLE PROBLEM: This may match a primitive type, which really should not accept a null value... but I'm not sure how best to distinguish those,
+     * short of enumerating them
+     */
+    static private boolean isMethodConvertable(Class parm, Class arg) {
+        if (parm.equals(arg)) {
+            return true;
+        }
 
-    if(parm.equals(Void.TYPE) || parm.equals(Boolean.TYPE) ||
-       arg.equals(Void.TYPE) || arg.equals(Boolean.TYPE)) {
-        return false;
-    }
+        // Accept any type EXCEPT primitives (which can't have null values).
+        if (arg == null) {
+            return !parm.isPrimitive();
+        }
+
+        // Arrays are convertable if their elements are convertable
+        // ????? Does this have to be done before isAssignableFrom, or
+        // does it successfully handle arrays of primatives?
+        while (parm.isArray()) {
+            if (!arg.isArray()) {
+                return false; // Unequal array depth
+            } else {
+                parm = parm.getComponentType();
+                arg = arg.getComponentType();
+            }
+        }
+        if (arg.isArray()) {
+            return false; // Unequal array depth
+        }
+
+        // Despite its name, the 1.1.6 docs say that this function does
+        // NOT return true for all legal ASSIGNMENT CONVERSIONS
+        // (5.2):
+        // "Specifically, this method tests whether the type
+        // represented by the specified class can be converted
+        // to the type represented by this Class object via
+        // an identity conversion or via a widening reference
+        // conversion."
+        if (parm.isAssignableFrom(arg)) {
+            return true;
+        }
 
-    final Class[] primTypes={ Character.TYPE, Byte.TYPE, Short.TYPE, Integer.TYPE,
-                        Long.TYPE, Float.TYPE, Double.TYPE };
-    int parmscore,argscore;
+        // That leaves us the Widening Primitives case. Four possibilities:
+        // void (can only convert to void), boolean (can only convert to boolean),
+        // numeric (which are sequenced) and char (which inserts itself into the
+        // numerics by promoting to int or larger)
 
-    for(parmscore=0;parmscore<primTypes.length;++parmscore) {
-        if (parm.equals(primTypes[parmscore])) {
-            break;
+        if (parm.equals(Void.TYPE) || parm.equals(Boolean.TYPE) || arg.equals(Void.TYPE) || arg.equals(Boolean.TYPE)) {
+            return false;
+        }
+
+        final Class[] primTypes = { Character.TYPE, Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE };
+        int parmscore, argscore;
+
+        for (parmscore = 0; parmscore < primTypes.length; ++parmscore) {
+            if (parm.equals(primTypes[parmscore])) {
+                break;
+            }
+        }
+        if (parmscore >= primTypes.length) {
+            return false; // Off the end
         }
-    }
-    if(parmscore>=primTypes.length)
-     {
-        return false;             // Off the end
-    }
 
-    for(argscore=0;argscore<primTypes.length;++argscore) {
-        if (arg.equals(primTypes[argscore])) {
-            break;
+        for (argscore = 0; argscore < primTypes.length; ++argscore) {
+            if (arg.equals(primTypes[argscore])) {
+                break;
+            }
+        }
+        if (argscore >= primTypes.length) {
+            return false; // Off the end
         }
-    }
-    if(argscore>=primTypes.length)
-     {
-        return false;             // Off the end
-    }
 
-    // OK if ordered AND NOT char-to-smaller-than-int
-    return (argscore<parmscore && (argscore!=0 || parmscore>2) );
-  }
+        // OK if ordered AND NOT char-to-smaller-than-int
+        return (argscore < parmscore && (argscore != 0 || parmscore > 2));
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/ObjInfo.java b/src/main/java/org/apache/bsf/util/ObjInfo.java
index f26f60b..5713437 100644
--- a/src/main/java/org/apache/bsf/util/ObjInfo.java
+++ b/src/main/java/org/apache/bsf/util/ObjInfo.java
@@ -18,70 +18,53 @@
 package org.apache.bsf.util;
 
 /**
- * An <code>ObjInfo</code> object is used by a compiler to track the name and
- * type of a bean.
+ * An <code>ObjInfo</code> object is used by a compiler to track the name and type of a bean.
  */
-public class ObjInfo
-{
-     static private final String QUOTE_CHARS = "\'\"";
-     static private final String EXEC_CHARS  = "(=";
-		 public  String objName;
-		 public  Class  objClass;
+public class ObjInfo {
+    static private final String QUOTE_CHARS = "\'\"";
+    static private final String EXEC_CHARS = "(=";
+    public String objName;
+    public Class objClass;
 
-  public ObjInfo(final Class objClass, final String objName)
-  {
-	this.objClass = objClass;
-	this.objName  = objName;
-  }
-  public boolean isExecutable()
-  {
-	final char[]  chars            = objName.toCharArray();
-	char    openingChar      = ' ';
-	boolean inString         = false,
-			inEscapeSequence = false;
+    public ObjInfo(final Class objClass, final String objName) {
+        this.objClass = objClass;
+        this.objName = objName;
+    }
 
-	for (int i = 0; i < chars.length; i++)
-	{
-	  if (inEscapeSequence)
-	  {
-		inEscapeSequence = false;
-	  }
-	  else if (QUOTE_CHARS.indexOf(chars[i]) != -1)
-	  {
-		if (!inString)
-		{
-		  openingChar = chars[i];
-		  inString = true;
-		}
-		else
-		{
-		  if (chars[i] == openingChar)
-		  {
-			inString = false;
-		  }
-		}
-	  }
-	  else if (EXEC_CHARS.indexOf(chars[i]) != -1)
-	  {
-		if (!inString)
-		{
-		  return true;
-		}
-	  }
-	  else if (inString && chars[i] == '\\')
-	  {
-		inEscapeSequence = true;
-	  }
-	}
+    public boolean isExecutable() {
+        final char[] chars = objName.toCharArray();
+        char openingChar = ' ';
+        boolean inString = false, inEscapeSequence = false;
 
-	return false;
-  }
-  public boolean isValueReturning()
-  {
-	return (objClass != void.class && objClass != Void.class);
-  }
-  public String toString()
-  {
-	return StringUtils.getClassName(objClass) + " " + objName;
-  }
+        for (int i = 0; i < chars.length; i++) {
+            if (inEscapeSequence) {
+                inEscapeSequence = false;
+            } else if (QUOTE_CHARS.indexOf(chars[i]) != -1) {
+                if (!inString) {
+                    openingChar = chars[i];
+                    inString = true;
+                } else {
+                    if (chars[i] == openingChar) {
+                        inString = false;
+                    }
+                }
+            } else if (EXEC_CHARS.indexOf(chars[i]) != -1) {
+                if (!inString) {
+                    return true;
+                }
+            } else if (inString && chars[i] == '\\') {
+                inEscapeSequence = true;
+            }
+        }
+
+        return false;
+    }
+
+    public boolean isValueReturning() {
+        return (objClass != void.class && objClass != Void.class);
+    }
+
+    public String toString() {
+        return StringUtils.getClassName(objClass) + " " + objName;
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/ObjectRegistry.java b/src/main/java/org/apache/bsf/util/ObjectRegistry.java
index 73a0fb8..b11418c 100644
--- a/src/main/java/org/apache/bsf/util/ObjectRegistry.java
+++ b/src/main/java/org/apache/bsf/util/ObjectRegistry.java
@@ -20,42 +20,43 @@ package org.apache.bsf.util;
 import java.util.Hashtable;
 
 /**
- * The <em>ObjectRegistry</em> is used to do name-to-object reference lookups.
- * If an <em>ObjectRegistry</em> is passed as a constructor argument, then this
- * <em>ObjectRegistry</em> will be a cascading registry: when a lookup is
- * invoked, it will first look in its own table for a name, and if it's not
- * there, it will cascade to the parent <em>ObjectRegistry</em>.
- * All registration is always local. [??]
+ * The <em>ObjectRegistry</em> is used to do name-to-object reference lookups. If an <em>ObjectRegistry</em> is passed as a constructor argument, then this
+ * <em>ObjectRegistry</em> will be a cascading registry: when a lookup is invoked, it will first look in its own table for a name, and if it's not there, it
+ * will cascade to the parent <em>ObjectRegistry</em>. All registration is always local. [??]
  */
 public class ObjectRegistry {
-  Hashtable      reg    = new Hashtable ();
-  ObjectRegistry parent = null;
-
-  public ObjectRegistry () {
-  }
-  public ObjectRegistry (final ObjectRegistry parent) {
-	this.parent = parent;
-  }
-  // lookup an object: cascade up if needed
-  public Object lookup (final String name) throws IllegalArgumentException {
-	Object obj = reg.get (name);
-
-	if (obj == null && parent != null) {
-	  obj = parent.lookup (name);
-	}
-
-	if (obj == null) {
-	  throw new IllegalArgumentException ("object '" + name + "' not in registry");
-	}
-
-	return obj;
-  }
-  // register an object
-  public void register (final String name, final Object obj) {
-	reg.put (name, obj);
-  }
-  // unregister an object (silent if unknown name)
-  public void unregister (final String name) {
-	reg.remove (name);
-  }
+    Hashtable reg = new Hashtable();
+    ObjectRegistry parent = null;
+
+    public ObjectRegistry() {
+    }
+
+    public ObjectRegistry(final ObjectRegistry parent) {
+        this.parent = parent;
+    }
+
+    // lookup an object: cascade up if needed
+    public Object lookup(final String name) throws IllegalArgumentException {
+        Object obj = reg.get(name);
+
+        if (obj == null && parent != null) {
+            obj = parent.lookup(name);
+        }
+
+        if (obj == null) {
+            throw new IllegalArgumentException("object '" + name + "' not in registry");
+        }
+
+        return obj;
+    }
+
+    // register an object
+    public void register(final String name, final Object obj) {
+        reg.put(name, obj);
+    }
+
+    // unregister an object (silent if unknown name)
+    public void unregister(final String name) {
+        reg.remove(name);
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/ReflectionUtils.java b/src/main/java/org/apache/bsf/util/ReflectionUtils.java
index 38d4fdc..ba09f7f 100644
--- a/src/main/java/org/apache/bsf/util/ReflectionUtils.java
+++ b/src/main/java/org/apache/bsf/util/ReflectionUtils.java
@@ -17,7 +17,7 @@
 
 package org.apache.bsf.util;
 
-import org.apache.bsf.BSFManager;   // rgf, 20070917
+import org.apache.bsf.BSFManager; // rgf, 20070917
 
 import java.beans.BeanInfo;
 import java.beans.Beans;
@@ -44,492 +44,433 @@ import org.apache.bsf.util.type.TypeConvertor;
 import org.apache.bsf.util.type.TypeConvertorRegistry;
 
 /**
- * This file is a collection of reflection utilities. There are utilities
- * for creating beans, getting bean infos, setting/getting properties,
- * and binding events.
+ * This file is a collection of reflection utilities. There are utilities for creating beans, getting bean infos, setting/getting properties, and binding
+ * events.
  */
- /*  2007-09-21: Rony G. Flatscher, new class loading sequence:
-
-        - supplied class loader (given as an argument)
-        - Thread's context class loader
-        - BSFManager's defining class loader
-
-     2011-10-29: Rony G. Flatscher, in case an event is not found, create a
-          user-friendly error message that lists all available event names
-
-     2011-10-29: Rony G. Flatscher, make sure that the context class loader
-          is used only, if not null
+/*
+ * 2007-09-21: Rony G. Flatscher, new class loading sequence:
+ * 
+ * - supplied class loader (given as an argument) - Thread's context class loader - BSFManager's defining class loader
+ * 
+ * 2011-10-29: Rony G. Flatscher, in case an event is not found, create a user-friendly error message that lists all available event names
+ * 
+ * 2011-10-29: Rony G. Flatscher, make sure that the context class loader is used only, if not null
  */
 public class ReflectionUtils {
     // rgf, 20070921: class loaders that we might need to load classes
-    static ClassLoader bsfManagerDefinedCL=BSFManager.getDefinedClassLoader();
-
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Add an event processor as a listener to some event coming out of an
-   * object.
-   *
-   * @param source       event source
-   * @param eventSetName name of event set from event src to bind to
-   * @param processor    event processor the event should be delegated to
-   *                     when it occurs; either via processEvent or
-   *                     processExceptionableEvent.
-   *
-   * @exception IntrospectionException if unable to introspect
-   * @exception IllegalArgumentException if event set is unknown
-   * @exception IllegalAccessException if the event adapter class or
-   *            initializer is not accessible.
-   * @exception InstantiationException if event adapter instantiation fails
-   * @exception InvocationTargetException if something goes wrong while
-   *            running add event listener method
-   */
-  public static void addEventListener (final Object source, final String eventSetName,
-                       final EventProcessor processor)
-       throws IntrospectionException, IllegalArgumentException,
-              IllegalAccessException, InstantiationException,
-              InvocationTargetException {
-    // find the event set descriptor for this event
-    final BeanInfo bi = Introspector.getBeanInfo (source.getClass ());
-
-    final EventSetDescriptor[] arrESD =bi.getEventSetDescriptors ();
-    final EventSetDescriptor esd=(EventSetDescriptor) findFeatureByName ("event", eventSetName, arrESD);
-
-    if (esd == null)        // no events found, maybe a proxy from OpenOffice.org?
+    static ClassLoader bsfManagerDefinedCL = BSFManager.getDefinedClassLoader();
+
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Add an event processor as a listener to some event coming out of an object.
+     *
+     * @param source       event source
+     * @param eventSetName name of event set from event src to bind to
+     * @param processor    event processor the event should be delegated to when it occurs; either via processEvent or processExceptionableEvent.
+     *
+     * @exception IntrospectionException    if unable to introspect
+     * @exception IllegalArgumentException  if event set is unknown
+     * @exception IllegalAccessException    if the event adapter class or initializer is not accessible.
+     * @exception InstantiationException    if event adapter instantiation fails
+     * @exception InvocationTargetException if something goes wrong while running add event listener method
+     */
+    public static void addEventListener(final Object source, final String eventSetName, final EventProcessor processor)
+            throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InstantiationException, InvocationTargetException {
+        // find the event set descriptor for this event
+        final BeanInfo bi = Introspector.getBeanInfo(source.getClass());
+
+        final EventSetDescriptor[] arrESD = bi.getEventSetDescriptors();
+        final EventSetDescriptor esd = (EventSetDescriptor) findFeatureByName("event", eventSetName, arrESD);
+
+        if (esd == null) // no events found, maybe a proxy from OpenOffice.org?
         {
-          String errMsg="event set '" + eventSetName +"' unknown for source type '" + source.getClass () + "': ";
-          if (arrESD.length==0)     // no event sets found in class!
-          {
-              errMsg=errMsg+"class does not implement any event methods following Java's event pattern!";
-          }
-          else
-          {
-              // errMsg=errMsg+"class defines the following event set(s): {";
-              errMsg=errMsg+"class defines the following event set(s): ";
-
-              // sort ESD by Name
-              final TreeSet ts=new TreeSet(new Comparator () {
-                          public int    compare(final Object o1, final Object o2) {return ((EventSetDescriptor)o1).getName().compareToIgnoreCase(((EventSetDescriptor)o2).getName());}
-                          public boolean equals(final Object o1, final Object o2) {return ((EventSetDescriptor)o1).getName().equalsIgnoreCase   (((EventSetDescriptor)o2).getName());}
-                         });
-
-              for (int i=0;i<arrESD.length;i++)
-              {
-                  ts.add(arrESD[i]);
-              }
-              final Iterator it=ts.iterator();    // get iterator
-
-              int i=0;
-              while (it.hasNext())          // iterate in sorted order
-              {
-                  final EventSetDescriptor tmpESD=(EventSetDescriptor) it.next();
-
-                  if (i>0)
-                  {
-                      errMsg=errMsg+", ";
-                  }
-                  errMsg=errMsg+"\n\t"+'\''+tmpESD.getName()+"'={";  // event set name
+            String errMsg = "event set '" + eventSetName + "' unknown for source type '" + source.getClass() + "': ";
+            if (arrESD.length == 0) // no event sets found in class!
+            {
+                errMsg = errMsg + "class does not implement any event methods following Java's event pattern!";
+            } else {
+                // errMsg=errMsg+"class defines the following event set(s): {";
+                errMsg = errMsg + "class defines the following event set(s): ";
+
+                // sort ESD by Name
+                final TreeSet ts = new TreeSet(new Comparator() {
+                    public int compare(final Object o1, final Object o2) {
+                        return ((EventSetDescriptor) o1).getName().compareToIgnoreCase(((EventSetDescriptor) o2).getName());
+                    }
+
+                    public boolean equals(final Object o1, final Object o2) {
+                        return ((EventSetDescriptor) o1).getName().equalsIgnoreCase(((EventSetDescriptor) o2).getName());
+                    }
+                });
+
+                for (int i = 0; i < arrESD.length; i++) {
+                    ts.add(arrESD[i]);
+                }
+                final Iterator it = ts.iterator(); // get iterator
+
+                int i = 0;
+                while (it.hasNext()) // iterate in sorted order
+                {
+                    final EventSetDescriptor tmpESD = (EventSetDescriptor) it.next();
+
+                    if (i > 0) {
+                        errMsg = errMsg + ", ";
+                    }
+                    errMsg = errMsg + "\n\t" + '\'' + tmpESD.getName() + "'={"; // event set name
 
                     // iterate over listener methods and display their names in sorted order
-                  final Method[] m =tmpESD.getListenerMethods();
-                  final TreeSet tsM=new TreeSet(new Comparator () {
-                          public int    compare(final Object o1, final Object o2) {return ((Method)o1).getName().compareToIgnoreCase(((Method)o2).getName());}
-                          public boolean equals(final Object o1, final Object o2) {return ((Method)o1).getName().equalsIgnoreCase   (((Method)o2).getName());}
-                         });
-
-                  for (int j=0;j<m.length;j++)
-                  {
-                      tsM.add(m[j]);
-                  }
-                  final Iterator itM=tsM.iterator();
-
-                  int j=0;
-                  while (itM.hasNext())
-                  {
-                      if (j>0)
-                      {
-                          errMsg=errMsg+',';
-                      }
-                      errMsg=errMsg+'\''+((Method) itM.next()).getName()+'\'';
-                      j++;
-                  }
-                  errMsg=errMsg+'}';    // close event method set
-                  i++;
-              }
-
-              errMsg=errMsg+".";       // close set of event sets
-          }
-          throw new IllegalArgumentException (errMsg);
-    }
+                    final Method[] m = tmpESD.getListenerMethods();
+                    final TreeSet tsM = new TreeSet(new Comparator() {
+                        public int compare(final Object o1, final Object o2) {
+                            return ((Method) o1).getName().compareToIgnoreCase(((Method) o2).getName());
+                        }
+
+                        public boolean equals(final Object o1, final Object o2) {
+                            return ((Method) o1).getName().equalsIgnoreCase(((Method) o2).getName());
+                        }
+                    });
+
+                    for (int j = 0; j < m.length; j++) {
+                        tsM.add(m[j]);
+                    }
+                    final Iterator itM = tsM.iterator();
+
+                    int j = 0;
+                    while (itM.hasNext()) {
+                        if (j > 0) {
+                            errMsg = errMsg + ',';
+                        }
+                        errMsg = errMsg + '\'' + ((Method) itM.next()).getName() + '\'';
+                        j++;
+                    }
+                    errMsg = errMsg + '}'; // close event method set
+                    i++;
+                }
+
+                errMsg = errMsg + "."; // close set of event sets
+            }
+            throw new IllegalArgumentException(errMsg);
+        }
 
-    // get the class object for the event
-    final Class listenerType=esd.getListenerType(); // get ListenerType class object from EventSetDescriptor
+        // get the class object for the event
+        final Class listenerType = esd.getListenerType(); // get ListenerType class object from EventSetDescriptor
 
-    // find an event adapter class of the right type
-    final Class adapterClass = EventAdapterRegistry.lookup (listenerType);
-    if (adapterClass == null) {
-      throw new IllegalArgumentException ("event adapter for listener type " +
-                          "'" + listenerType + "' (eventset " +
-                          "'" + eventSetName + "') unknown");
-    }
+        // find an event adapter class of the right type
+        final Class adapterClass = EventAdapterRegistry.lookup(listenerType);
+        if (adapterClass == null) {
+            throw new IllegalArgumentException("event adapter for listener type " + "'" + listenerType + "' (eventset " + "'" + eventSetName + "') unknown");
+        }
 
-    // create the event adapter and give it the event processor
-    final EventAdapter adapter = (EventAdapter) adapterClass.newInstance ();
-    adapter.setEventProcessor (processor);
-
-    // bind the adapter to the source bean
-    Method addListenerMethod;
-    Object[] args;
-    if (eventSetName.equals ("propertyChange") ||
-        eventSetName.equals ("vetoableChange")) {
-      // In Java 1.2, beans may have direct listener adding methods
-      // for property and vetoable change events which take the
-      // property name as a filter to be applied at the event source.
-      // The filter property of the event processor should be used
-      // in this case to support the source-side filtering.
-      //
-      // ** TBD **: the following two lines need to change appropriately
-          addListenerMethod = esd.getAddListenerMethod ();
-      args = new Object[] {adapter};
-    }
-        else
-        {
-          addListenerMethod = esd.getAddListenerMethod ();
-      args = new Object[] {adapter};
+        // create the event adapter and give it the event processor
+        final EventAdapter adapter = (EventAdapter) adapterClass.newInstance();
+        adapter.setEventProcessor(processor);
+
+        // bind the adapter to the source bean
+        Method addListenerMethod;
+        Object[] args;
+        if (eventSetName.equals("propertyChange") || eventSetName.equals("vetoableChange")) {
+            // In Java 1.2, beans may have direct listener adding methods
+            // for property and vetoable change events which take the
+            // property name as a filter to be applied at the event source.
+            // The filter property of the event processor should be used
+            // in this case to support the source-side filtering.
+            //
+            // ** TBD **: the following two lines need to change appropriately
+            addListenerMethod = esd.getAddListenerMethod();
+            args = new Object[] { adapter };
+        } else {
+            addListenerMethod = esd.getAddListenerMethod();
+            args = new Object[] { adapter };
+        }
+        addListenerMethod.invoke(source, args);
     }
-    addListenerMethod.invoke (source, args);
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Create a bean using given class loader and using the appropriate
-   * constructor for the given args of the given arg types.
-
-   * @param cld       the class loader to use. If null, Class.forName is used.
-   * @param className name of class to instantiate
-   * @param argTypes  array of argument types
-   * @param args      array of arguments
-   *
-   * @return the newly created bean
-   *
-   * @exception ClassNotFoundException    if class is not loaded
-   * @exception NoSuchMethodException     if constructor can't be found
-   * @exception InstantiationException    if class can't be instantiated
-   * @exception IllegalAccessException    if class is not accessible
-   * @exception IllegalArgumentException  if argument problem
-   * @exception InvocationTargetException if constructor excepted
-   * @exception IOException               if I/O error in beans.instantiate
-   */
-  public static Bean createBean (final ClassLoader cld, final String className,
-                 final Class[] argTypes, final Object[] args)
-       throws ClassNotFoundException, NoSuchMethodException,
-              InstantiationException, IllegalAccessException,
-              IllegalArgumentException, InvocationTargetException,
-              IOException {
-    if (argTypes != null) {
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Create a bean using given class loader and using the appropriate constructor for the given args of the given arg types.
+     * 
+     * @param cld       the class loader to use. If null, Class.forName is used.
+     * @param className name of class to instantiate
+     * @param argTypes  array of argument types
+     * @param args      array of arguments
+     *
+     * @return the newly created bean
+     *
+     * @exception ClassNotFoundException    if class is not loaded
+     * @exception NoSuchMethodException     if constructor can't be found
+     * @exception InstantiationException    if class can't be instantiated
+     * @exception IllegalAccessException    if class is not accessible
+     * @exception IllegalArgumentException  if argument problem
+     * @exception InvocationTargetException if constructor excepted
+     * @exception IOException               if I/O error in beans.instantiate
+     */
+    public static Bean createBean(final ClassLoader cld, final String className, final Class[] argTypes, final Object[] args) throws ClassNotFoundException,
+            NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException {
+        if (argTypes != null) {
 
             // if class loader given, use that one, else try
             // the Thread's context class loader (if set) and then
             // the BSFMananger defining class loader
-          Class cl=null;
-          ClassNotFoundException exCTX=null;
+            Class cl = null;
+            ClassNotFoundException exCTX = null;
 
 // -----------------------------
-          if (cld != null) {    // class loader supplied as argument
-              try {     // CL passed as argument
-                  cl=cld.loadClass(className);
-              }
-              catch (final ClassNotFoundException e02) {
-                  exCTX=e02;
-              }
-          }
-
-          if (cl==null) {
-              // load context class loader, only use it, if not null
-              final ClassLoader tccl=Thread.currentThread().getContextClassLoader();
-              if (tccl!=null) {
-                  try {         // CTXCL
-                          cl=tccl.loadClass(className);
-                      }
-                  catch (final ClassNotFoundException e01) {}
-              }
-          }
-
-          if (cl==null) {   // class not loaded yet
-                    // defined CL
-              if (cld != bsfManagerDefinedCL) {   // if not used already, attempt to load
-                  cl=bsfManagerDefinedCL.loadClass(className);
-              }
-              else {    // classloader was already used, hence re-throw exception
-                  throw exCTX;      // re-throw very first exception
-              }
-          }
+            if (cld != null) { // class loader supplied as argument
+                try { // CL passed as argument
+                    cl = cld.loadClass(className);
+                } catch (final ClassNotFoundException e02) {
+                    exCTX = e02;
+                }
+            }
+
+            if (cl == null) {
+                // load context class loader, only use it, if not null
+                final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+                if (tccl != null) {
+                    try { // CTXCL
+                        cl = tccl.loadClass(className);
+                    } catch (final ClassNotFoundException e01) {
+                    }
+                }
+            }
+
+            if (cl == null) { // class not loaded yet
+                // defined CL
+                if (cld != bsfManagerDefinedCL) { // if not used already, attempt to load
+                    cl = bsfManagerDefinedCL.loadClass(className);
+                } else { // classloader was already used, hence re-throw exception
+                    throw exCTX; // re-throw very first exception
+                }
+            }
 // -----------------------------
 
-      final Constructor c = MethodUtils.getConstructor (cl, argTypes);
-      return new Bean (cl, c.newInstance (args));
-    } else {
-      // create the bean with no args constructor
-      final Object obj = Beans.instantiate (cld, className);
-      return new Bean (obj.getClass (), obj);
-    }
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Create a bean using given class loader and using the appropriate
-   * constructor for the given args. Figures out the arg types and
-   * calls above.
-
-   * @param cld       the class loader to use. If null, Class.forName is used.
-   * @param className name of class to instantiate
-   * @param args      array of arguments
-   *
-   * @return the newly created bean
-   *
-   * @exception ClassNotFoundException    if class is not loaded
-   * @exception NoSuchMethodException     if constructor can't be found
-   * @exception InstantiationException    if class can't be instantiated
-   * @exception IllegalAccessException    if class is not accessible
-   * @exception IllegalArgumentException  if argument problem
-   * @exception InvocationTargetException if constructor excepted
-   * @exception IOException               if I/O error in beans.instantiate
-   */
-  public static Bean createBean (final ClassLoader cld, final String className, final Object[] args)
-       throws ClassNotFoundException, NoSuchMethodException,
-              InstantiationException, IllegalAccessException,
-              IllegalArgumentException, InvocationTargetException,
-              IOException {
-    Class[] argTypes = null;
-    if (args != null) {
-      argTypes = new Class[args.length];
-      for (int i = 0; i < args.length; i++) {
-        argTypes[i] = (args[i] != null) ? args[i].getClass () : null;
-      }
-    }
-    return createBean (cld, className, argTypes, args);
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * locate the item in the fds array whose name is as given. returns
-   * null if not found.
-   */
-  private static
-  FeatureDescriptor findFeatureByName (final String featureType, final String name,
-                       final FeatureDescriptor[] fds) {
-    for (int i = 0; i < fds.length; i++) {
-      if (name.equals (fds[i].getName())) {
-        return fds[i];
-      }
+            final Constructor c = MethodUtils.getConstructor(cl, argTypes);
+            return new Bean(cl, c.newInstance(args));
+        } else {
+            // create the bean with no args constructor
+            final Object obj = Beans.instantiate(cld, className);
+            return new Bean(obj.getClass(), obj);
+        }
     }
-    return null;
-  }
-
-  public static Bean getField (final Object target, final String fieldName)
-      throws IllegalArgumentException, IllegalAccessException {
-    // This is to handle how we do static fields.
-    final Class targetClass = (target instanceof Class)
-                        ? (Class) target
-                        : target.getClass ();
-
-    try {
-      final Field f = targetClass.getField (fieldName);
-      final Class fieldType = f.getType ();
-
-      // Get the value and return it.
-      final Object value = f.get (target);
-      return new Bean (fieldType, value);
-    } catch (final NoSuchFieldException e) {
-      throw new IllegalArgumentException ("field '" + fieldName + "' is " +
-                          "unknown for '" + target + "'");
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Create a bean using given class loader and using the appropriate constructor for the given args. Figures out the arg types and calls above.
+     * 
+     * @param cld       the class loader to use. If null, Class.forName is used.
+     * @param className name of class to instantiate
+     * @param args      array of arguments
+     *
+     * @return the newly created bean
+     *
+     * @exception ClassNotFoundException    if class is not loaded
+     * @exception NoSuchMethodException     if constructor can't be found
+     * @exception InstantiationException    if class can't be instantiated
+     * @exception IllegalAccessException    if class is not accessible
+     * @exception IllegalArgumentException  if argument problem
+     * @exception InvocationTargetException if constructor excepted
+     * @exception IOException               if I/O error in beans.instantiate
+     */
+    public static Bean createBean(final ClassLoader cld, final String className, final Object[] args) throws ClassNotFoundException, NoSuchMethodException,
+            InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException {
+        Class[] argTypes = null;
+        if (args != null) {
+            argTypes = new Class[args.length];
+            for (int i = 0; i < args.length; i++) {
+                argTypes[i] = (args[i] != null) ? args[i].getClass() : null;
+            }
+        }
+        return createBean(cld, className, argTypes, args);
     }
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Get a property of a bean.
-   *
-   * @param target    the object whose prop is to be gotten
-   * @param propName  name of the property to set
-   * @param index     index to get (if property is indexed)
-   *
-   * @exception IntrospectionException if unable to introspect
-   * @exception IllegalArgumentException if problems with args: if the
-   *            property is unknown, or if the property is given an index
-   *            when its not, or if the property is not writeable, or if
-   *            the given value cannot be assigned to the it (type mismatch).
-   * @exception IllegalAccessException if read method is not accessible
-   * @exception InvocationTargetException if read method excepts
-   */
-  public static Bean getProperty (final Object target, final String propName,
-                  final Integer index)
-       throws IntrospectionException, IllegalArgumentException,
-              IllegalAccessException, InvocationTargetException {
-    // find the property descriptor
-    final BeanInfo bi = Introspector.getBeanInfo (target.getClass ());
-    final PropertyDescriptor pd = (PropertyDescriptor)
-      findFeatureByName ("property", propName, bi.getPropertyDescriptors ());
-    if (pd == null) {
-      throw new IllegalArgumentException ("property '" + propName + "' is " +
-                          "unknown for '" + target + "'");
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * locate the item in the fds array whose name is as given. returns null if not found.
+     */
+    private static FeatureDescriptor findFeatureByName(final String featureType, final String name, final FeatureDescriptor[] fds) {
+        for (int i = 0; i < fds.length; i++) {
+            if (name.equals(fds[i].getName())) {
+                return fds[i];
+            }
+        }
+        return null;
     }
 
-    // get read method and type of property
-    Method rm;
-    Class propType;
-    if (index != null) {
-      // if index != null, then property is indexed - pd better be so too
-      if (!(pd instanceof IndexedPropertyDescriptor)) {
-        throw new IllegalArgumentException ("attempt to get non-indexed " +
-                            "property '" + propName +
-                            "' as being indexed");
-      }
-      final IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
-      rm = ipd.getIndexedReadMethod ();
-      propType = ipd.getIndexedPropertyType ();
-    } else {
-      rm = pd.getReadMethod ();
-      propType = pd.getPropertyType ();
-    }
+    public static Bean getField(final Object target, final String fieldName) throws IllegalArgumentException, IllegalAccessException {
+        // This is to handle how we do static fields.
+        final Class targetClass = (target instanceof Class) ? (Class) target : target.getClass();
 
-    if (rm == null) {
-      throw new IllegalArgumentException ("property '" + propName +
-                          "' is not readable");
-    }
+        try {
+            final Field f = targetClass.getField(fieldName);
+            final Class fieldType = f.getType();
 
-    // now get the value
-    Object propVal = null;
-    if (index != null) {
-      propVal = rm.invoke (target, new Object[] {index});
-    } else {
-      propVal = rm.invoke (target, null);
+            // Get the value and return it.
+            final Object value = f.get(target);
+            return new Bean(fieldType, value);
+        } catch (final NoSuchFieldException e) {
+            throw new IllegalArgumentException("field '" + fieldName + "' is " + "unknown for '" + target + "'");
+        }
     }
-    return new Bean (propType, propVal);
-  }
-  public static void setField (final Object target, final String fieldName, final Bean value,
-                   final TypeConvertorRegistry tcr)
-      throws IllegalArgumentException, IllegalAccessException {
-    // This is to handle how we do static fields.
-    final Class targetClass = (target instanceof Class)
-                        ? (Class) target
-                        : target.getClass ();
-
-    try {
-      final Field f = targetClass.getField (fieldName);
-      final Class fieldType = f.getType ();
-
-      // type convert the value if necessary
-      Object fieldVal = null;
-      boolean okeydokey = true;
-      if (fieldType.isAssignableFrom (value.type)) {
-        fieldVal = value.value;
-      } else if (tcr != null) {
-        final TypeConvertor cvtor = tcr.lookup (value.type, fieldType);
-        if (cvtor != null) {
-          fieldVal = cvtor.convert (value.type, fieldType, value.value);
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Get a property of a bean.
+     *
+     * @param target   the object whose prop is to be gotten
+     * @param propName name of the property to set
+     * @param index    index to get (if property is indexed)
+     *
+     * @exception IntrospectionException    if unable to introspect
+     * @exception IllegalArgumentException  if problems with args: if the property is unknown, or if the property is given an index when its not, or if the
+     *                                      property is not writeable, or if the given value cannot be assigned to the it (type mismatch).
+     * @exception IllegalAccessException    if read method is not accessible
+     * @exception InvocationTargetException if read method excepts
+     */
+    public static Bean getProperty(final Object target, final String propName, final Integer index)
+            throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+        // find the property descriptor
+        final BeanInfo bi = Introspector.getBeanInfo(target.getClass());
+        final PropertyDescriptor pd = (PropertyDescriptor) findFeatureByName("property", propName, bi.getPropertyDescriptors());
+        if (pd == null) {
+            throw new IllegalArgumentException("property '" + propName + "' is " + "unknown for '" + target + "'");
+        }
+
+        // get read method and type of property
+        Method rm;
+        Class propType;
+        if (index != null) {
+            // if index != null, then property is indexed - pd better be so too
+            if (!(pd instanceof IndexedPropertyDescriptor)) {
+                throw new IllegalArgumentException("attempt to get non-indexed " + "property '" + propName + "' as being indexed");
+            }
+            final IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
+            rm = ipd.getIndexedReadMethod();
+            propType = ipd.getIndexedPropertyType();
         } else {
-          okeydokey = false;
+            rm = pd.getReadMethod();
+            propType = pd.getPropertyType();
         }
-      } else {
-        okeydokey = false;
-      }
-      if (!okeydokey) {
-        throw new IllegalArgumentException ("unable to assign '" + value.value +
-                            "' to field '" + fieldName + "'");
-      }
-
-      // now set the value
-      f.set (target, fieldVal);
-    } catch (final NoSuchFieldException e) {
-      throw new IllegalArgumentException ("field '" + fieldName + "' is " +
-                          "unknown for '" + target + "'");
-    }
-  }
-  //////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Set a property of a bean to a given value.
-   *
-   * @param target    the object whose prop is to be set
-   * @param propName  name of the property to set
-   * @param index     index to set (if property is indexed)
-   * @param value     the property value
-   * @param valueType the type of the above (needed when its null)
-   * @param tcr       type convertor registry to use to convert value type to
-   *                  property type if necessary
-   *
-   * @exception IntrospectionException if unable to introspect
-   * @exception IllegalArgumentException if problems with args: if the
-   *            property is unknown, or if the property is given an index
-   *            when its not, or if the property is not writeable, or if
-   *            the given value cannot be assigned to the it (type mismatch).
-   * @exception IllegalAccessException if write method is not accessible
-   * @exception InvocationTargetException if write method excepts
-   */
-  public static void setProperty (final Object target, final String propName,
-                  final Integer index, final Object value,
-                  final Class valueType, final TypeConvertorRegistry tcr)
-       throws IntrospectionException, IllegalArgumentException,
-              IllegalAccessException, InvocationTargetException {
-    // find the property descriptor
-    final BeanInfo bi = Introspector.getBeanInfo (target.getClass ());
-    final PropertyDescriptor pd = (PropertyDescriptor)
-      findFeatureByName ("property", propName, bi.getPropertyDescriptors ());
-    if (pd == null) {
-      throw new IllegalArgumentException ("property '" + propName + "' is " +
-                          "unknown for '" + target + "'");
-    }
 
-    // get write method and type of property
-    Method wm;
-    Class propType;
-    if (index != null) {
-      // if index != null, then property is indexed - pd better be so too
-      if (!(pd instanceof IndexedPropertyDescriptor)) {
-        throw new IllegalArgumentException ("attempt to set non-indexed " +
-                            "property '" + propName +
-                                            "' as being indexed");
-      }
-      final IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
-      wm = ipd.getIndexedWriteMethod ();
-      propType = ipd.getIndexedPropertyType ();
-    } else {
-      wm = pd.getWriteMethod ();
-      propType = pd.getPropertyType ();
-    }
+        if (rm == null) {
+            throw new IllegalArgumentException("property '" + propName + "' is not readable");
+        }
 
-    if (wm == null) {
-      throw new IllegalArgumentException ("property '" + propName +
-                          "' is not writeable");
+        // now get the value
+        Object propVal = null;
+        if (index != null) {
+            propVal = rm.invoke(target, new Object[] { index });
+        } else {
+            propVal = rm.invoke(target, null);
+        }
+        return new Bean(propType, propVal);
     }
 
-    // type convert the value if necessary
-    Object propVal = null;
-    boolean okeydokey = true;
-    if (propType.isAssignableFrom (valueType)) {
-      propVal = value;
-    } else if (tcr != null) {
-      final TypeConvertor cvtor = tcr.lookup (valueType, propType);
-      if (cvtor != null) {
-        propVal = cvtor.convert (valueType, propType, value);
-      } else {
-        okeydokey = false;
-      }
-    } else {
-      okeydokey = false;
-    }
-    if (!okeydokey) {
-      throw new IllegalArgumentException ("unable to assign '" + value +
-                          "' to property '" + propName + "'");
+    public static void setField(final Object target, final String fieldName, final Bean value, final TypeConvertorRegistry tcr)
+            throws IllegalArgumentException, IllegalAccessException {
+        // This is to handle how we do static fields.
+        final Class targetClass = (target instanceof Class) ? (Class) target : target.getClass();
+
+        try {
+            final Field f = targetClass.getField(fieldName);
+            final Class fieldType = f.getType();
+
+            // type convert the value if necessary
+            Object fieldVal = null;
+            boolean okeydokey = true;
+            if (fieldType.isAssignableFrom(value.type)) {
+                fieldVal = value.value;
+            } else if (tcr != null) {
+                final TypeConvertor cvtor = tcr.lookup(value.type, fieldType);
+                if (cvtor != null) {
+                    fieldVal = cvtor.convert(value.type, fieldType, value.value);
+                } else {
+                    okeydokey = false;
+                }
+            } else {
+                okeydokey = false;
+            }
+            if (!okeydokey) {
+                throw new IllegalArgumentException("unable to assign '" + value.value + "' to field '" + fieldName + "'");
+            }
+
+            // now set the value
+            f.set(target, fieldVal);
+        } catch (final NoSuchFieldException e) {
+            throw new IllegalArgumentException("field '" + fieldName + "' is " + "unknown for '" + target + "'");
+        }
     }
+    //////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Set a property of a bean to a given value.
+     *
+     * @param target    the object whose prop is to be set
+     * @param propName  name of the property to set
+     * @param index     index to set (if property is indexed)
+     * @param value     the property value
+     * @param valueType the type of the above (needed when its null)
+     * @param tcr       type convertor registry to use to convert value type to property type if necessary
+     *
+     * @exception IntrospectionException    if unable to introspect
+     * @exception IllegalArgumentException  if problems with args: if the property is unknown, or if the property is given an index when its not, or if the
+     *                                      property is not writeable, or if the given value cannot be assigned to the it (type mismatch).
+     * @exception IllegalAccessException    if write method is not accessible
+     * @exception InvocationTargetException if write method excepts
+     */
+    public static void setProperty(final Object target, final String propName, final Integer index, final Object value, final Class valueType,
+            final TypeConvertorRegistry tcr) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+        // find the property descriptor
+        final BeanInfo bi = Introspector.getBeanInfo(target.getClass());
+        final PropertyDescriptor pd = (PropertyDescriptor) findFeatureByName("property", propName, bi.getPropertyDescriptors());
+        if (pd == null) {
+            throw new IllegalArgumentException("property '" + propName + "' is " + "unknown for '" + target + "'");
+        }
+
+        // get write method and type of property
+        Method wm;
+        Class propType;
+        if (index != null) {
+            // if index != null, then property is indexed - pd better be so too
+            if (!(pd instanceof IndexedPropertyDescriptor)) {
+                throw new IllegalArgumentException("attempt to set non-indexed " + "property '" + propName + "' as being indexed");
+            }
+            final IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
+            wm = ipd.getIndexedWriteMethod();
+            propType = ipd.getIndexedPropertyType();
+        } else {
+            wm = pd.getWriteMethod();
+            propType = pd.getPropertyType();
+        }
+
+        if (wm == null) {
+            throw new IllegalArgumentException("property '" + propName + "' is not writeable");
+        }
 
-    // now set the value
-    if (index != null) {
-      wm.invoke (target, new Object[] {index, propVal});
-    } else {
-      wm.invoke (target, new Object[] {propVal});
+        // type convert the value if necessary
+        Object propVal = null;
+        boolean okeydokey = true;
+        if (propType.isAssignableFrom(valueType)) {
+            propVal = value;
+        } else if (tcr != null) {
+            final TypeConvertor cvtor = tcr.lookup(valueType, propType);
+            if (cvtor != null) {
+                propVal = cvtor.convert(valueType, propType, value);
+            } else {
+                okeydokey = false;
+            }
+        } else {
+            okeydokey = false;
+        }
+        if (!okeydokey) {
+            throw new IllegalArgumentException("unable to assign '" + value + "' to property '" + propName + "'");
+        }
+
+        // now set the value
+        if (index != null) {
+            wm.invoke(target, new Object[] { index, propVal });
+        } else {
+            wm.invoke(target, new Object[] { propVal });
+        }
     }
-  }
 }
-
diff --git a/src/main/java/org/apache/bsf/util/ScriptSymbolTable.java b/src/main/java/org/apache/bsf/util/ScriptSymbolTable.java
index a978387..eab2485 100644
--- a/src/main/java/org/apache/bsf/util/ScriptSymbolTable.java
+++ b/src/main/java/org/apache/bsf/util/ScriptSymbolTable.java
@@ -20,25 +20,22 @@ package org.apache.bsf.util;
 import java.util.Hashtable;
 
 /**
- * An <code>ScriptSymbolTable</code> object is used by a <code>CodeBuffer</code>
- * object to implement nested scopes.
+ * An <code>ScriptSymbolTable</code> object is used by a <code>CodeBuffer</code> object to implement nested scopes.
  */
-class ScriptSymbolTable extends Hashtable
-{
+class ScriptSymbolTable extends Hashtable {
     private final Hashtable parentTable;
 
-    ScriptSymbolTable(final Hashtable parentTable)
-  {
-    this.parentTable = parentTable;
-  }
-  public synchronized Object get(final Object key)
-  {
-    Object ret = super.get(key);
-
-    if (ret == null && parentTable != null) {
-        ret = parentTable.get(key);
+    ScriptSymbolTable(final Hashtable parentTable) {
+        this.parentTable = parentTable;
     }
 
-    return ret;
-  }
+    public synchronized Object get(final Object key) {
+        Object ret = super.get(key);
+
+        if (ret == null && parentTable != null) {
+            ret = parentTable.get(key);
+        }
+
+        return ret;
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/StringUtils.java b/src/main/java/org/apache/bsf/util/StringUtils.java
index d4a872a..e35c2b9 100644
--- a/src/main/java/org/apache/bsf/util/StringUtils.java
+++ b/src/main/java/org/apache/bsf/util/StringUtils.java
@@ -34,392 +34,335 @@ import java.util.Vector;
 /**
  * Deals with strings (probably need to elaborate some more).
  */
-public class StringUtils
-{
-  public static final String lineSeparator =
-    System.getProperty("line.separator", "\n");
-  public static final String lineSeparatorStr = cleanString(lineSeparator);
-
-  public static String classNameToVarName(String className)
-  {
-    // Might represent an array.
-    int arrayDim = 0;
-
-    while (className.endsWith("[]"))
-    {
-      className = className.substring(0, className.length() - 2);
-      arrayDim++;
-    }
+public class StringUtils {
+    public static final String lineSeparator = System.getProperty("line.separator", "\n");
+    public static final String lineSeparatorStr = cleanString(lineSeparator);
 
-    final int    iLastPeriod = className.lastIndexOf('.');
-    String varName     = Introspector.decapitalize(
-                                         iLastPeriod != -1
-                                         ? className.substring(iLastPeriod + 1)
-                                         : className);
+    public static String classNameToVarName(String className) {
+        // Might represent an array.
+        int arrayDim = 0;
 
-    if (arrayDim > 0)
-    {
-      varName += "_" + arrayDim + "D";
-    }
+        while (className.endsWith("[]")) {
+            className = className.substring(0, className.length() - 2);
+            arrayDim++;
+        }
+
+        final int iLastPeriod = className.lastIndexOf('.');
+        String varName = Introspector.decapitalize(iLastPeriod != -1 ? className.substring(iLastPeriod + 1) : className);
 
-    return getValidIdentifierName(varName);
-  }
-  // Ensure that escape sequences are passed through properly.
-  public static String cleanString(final String str)
-  {
-    if (str == null) {
-        return null;
-    } else
-    {
-      final char[]       charArray = str.toCharArray();
-      final StringBuffer sBuf      = new StringBuffer();
-
-      for (int i = 0; i < charArray.length; i++) {
-        switch (charArray[i])
-        {
-          case '\"' : sBuf.append("\\\"");
-					  break;
-		  case '\\' : sBuf.append("\\\\");
-					  break;
-		  case '\n' : sBuf.append("\\n");
-					  break;
-		  case '\r' : sBuf.append("\\r");
-					  break;
-		  default   : sBuf.append(charArray[i]);
-					  break;
-		}
+        if (arrayDim > 0) {
+            varName += "_" + arrayDim + "D";
+        }
+
+        return getValidIdentifierName(varName);
     }
 
-	  return sBuf.toString();
-	}
-  }
-  /**
-   * Get a string consisting of <code>numberOfChars</code> theChars.
-   *
-   * @return a string consisting of <code>numberOfChars</code> theChars.
-   */
-  public static String getChars(final int numberOfChars, final char theChar)
-  {
-	if (numberOfChars <= 0) {
-        return "";
+    // Ensure that escape sequences are passed through properly.
+    public static String cleanString(final String str) {
+        if (str == null) {
+            return null;
+        } else {
+            final char[] charArray = str.toCharArray();
+            final StringBuffer sBuf = new StringBuffer();
+
+            for (int i = 0; i < charArray.length; i++) {
+                switch (charArray[i]) {
+                case '\"':
+                    sBuf.append("\\\"");
+                    break;
+                case '\\':
+                    sBuf.append("\\\\");
+                    break;
+                case '\n':
+                    sBuf.append("\\n");
+                    break;
+                case '\r':
+                    sBuf.append("\\r");
+                    break;
+                default:
+                    sBuf.append(charArray[i]);
+                    break;
+                }
+            }
+
+            return sBuf.toString();
+        }
     }
 
-	final StringBuffer sRet = new StringBuffer(numberOfChars);
+    /**
+     * Get a string consisting of <code>numberOfChars</code> theChars.
+     *
+     * @return a string consisting of <code>numberOfChars</code> theChars.
+     */
+    public static String getChars(final int numberOfChars, final char theChar) {
+        if (numberOfChars <= 0) {
+            return "";
+        }
+
+        final StringBuffer sRet = new StringBuffer(numberOfChars);
+
+        for (int i = 0; i < numberOfChars; i++) {
+            sRet.append(theChar);
+        }
 
-	for (int i = 0; i < numberOfChars; i++) {
-        sRet.append(theChar);
+        return sRet.toString();
     }
 
-	return sRet.toString();
-  }
-  /*
-	This method will return the correct name for a class object representing
-	a primitive, a single instance of a class, as well as n-dimensional arrays
-	of primitives or instances. This logic is needed to handle the string returned
-	from Class.getName(). If the class object represents a single instance (or
-	a primitive), Class.getName() returns the fully-qualified name of the class
-	and no further work is needed. However, if the class object represents an
-	array (of n dimensions), Class.getName() returns a Descriptor (the Descriptor
-	grammar is defined in section 4.3 of the Java VM Spec). This method will
-	parse the Descriptor if necessary.
-  */
-  public static String getClassName(final Class targetClass)
-  {
-	final String className = targetClass.getName();
-
-	return targetClass.isArray() ? parseDescriptor(className) : className;
-  }
-  public static String getCommaListFromVector(final Vector sourceVector)
-  {
-	final StringBuffer strBuf = new StringBuffer();
-
-	for (int i = 0; i < sourceVector.size(); i++)
-	{
-	  strBuf.append((i > 0 ? ", " : "") +
-					sourceVector.elementAt(i));
-	}
-
-	return strBuf.toString();
-  }
-  /*
-	Returns a Reader for reading from the specified resource, if the resource
-	points to a stream.
-  */
-  public static Reader getContentAsReader(final URL url) throws SecurityException,
-														  IllegalArgumentException,
-														  IOException
-  {
-	if (url == null)
-	{
-	  throw new IllegalArgumentException("URL cannot be null.");
-	}
-
-	try
-	{
-	  final Object content = url.getContent();
-
-	  if (content == null)
-	  {
-		throw new IllegalArgumentException("No content.");
-	  }
-
-	  if (content instanceof InputStream)
-	  {
-		final Reader in = new InputStreamReader((InputStream)content);
-
-		if (in.ready())
-		{
-		  return in;
-		}
-		else
-		{
-		  throw new FileNotFoundException();
-		}
-	  }
-	  else
-	  {
-		throw new IllegalArgumentException((content instanceof String)
-										   ? (String)content
-										   : "This URL points to a: " +
-											 StringUtils.getClassName(content.getClass()));
-	  }
-	}
-	catch (final SecurityException e)
-	{
-	  throw new SecurityException("Your JVM's SecurityManager has disallowed this.");
-	}
-	catch (final FileNotFoundException e)
-	{
-	  throw new FileNotFoundException("This file was not found: " + url);
-	}
-  }
-  /*
-	Shorthand for: IOUtils.getStringFromReader(getContentAsReader(url)).
-  */
-  public static String getContentAsString(final URL url) throws SecurityException,
-														  IllegalArgumentException,
-														  IOException
-  {
-	return IOUtils.getStringFromReader(getContentAsReader(url));
-  }
-  // Handles multi-line strings.
-  public static String getSafeString(final String scriptStr)
-  {
-	final BufferedReader in           = new BufferedReader(new StringReader(scriptStr));
-	final StringBuffer   strBuf       = new StringBuffer();
-	String         tempLine,
-				   previousLine = null;
-
-	try
-	{
-	  while ((tempLine = in.readLine()) != null)
-	  {
-		if (previousLine != null)
-		{
-		  strBuf.append("\"" + previousLine + lineSeparatorStr + "\" +" +
-						lineSeparator);
-		}
-
-		previousLine = cleanString(tempLine);
-	  }
-	}
-	catch (final IOException e)
-	{
-	}
-
-	strBuf.append("\"" + (previousLine != null ? previousLine : "") + "\"" +
-				  lineSeparator);
-
-	return strBuf.toString();
-  }
-  /*
-  */
-  public static URL getURL(final URL contextURL, final String spec) throws MalformedURLException
-  {
-	return getURL(contextURL, spec, 1);
-  }
-  /*
-	The recursiveDepth argument is used to insure that the algorithm gives up
-	after hunting 2 levels up in the contextURL's path.
-  */
-  private static URL getURL(final URL contextURL, final String spec, final int recursiveDepth)
-                                                  throws MalformedURLException
-  {
-    URL url = null;
-
-    try
-    {
-      url = new URL(contextURL, spec);
-
-      try
-      {
-        url.openStream();
-      }
-      catch (final IOException ioe1)
-      {
-        throw new MalformedURLException("This file was not found: " + url);
-      }
+    /*
+     * This method will return the correct name for a class object representing a primitive, a single instance of a class, as well as n-dimensional arrays of
+     * primitives or instances. This logic is needed to handle the string returned from Class.getName(). If the class object represents a single instance (or a
+     * primitive), Class.getName() returns the fully-qualified name of the class and no further work is needed. However, if the class object represents an array
+     * (of n dimensions), Class.getName() returns a Descriptor (the Descriptor grammar is defined in section 4.3 of the Java VM Spec). This method will parse
+     * the Descriptor if necessary.
+     */
+    public static String getClassName(final Class targetClass) {
+        final String className = targetClass.getName();
+
+        return targetClass.isArray() ? parseDescriptor(className) : className;
     }
-    catch (final MalformedURLException e1)
-    {
-      url = new URL("file", "", spec);
-
-      try
-      {
-        url.openStream();
-      }
-      catch (final IOException ioe2)
-      {
-        if (contextURL != null)
-        {
-          final String contextFileName = contextURL.getFile();
-          final String parentName      = new File(contextFileName).getParent();
-
-          if (parentName != null && recursiveDepth < 3)
-          {
-            return getURL(new URL("file", "", parentName + '/'),
-                          spec,
-                          recursiveDepth + 1);
-          }
+
+    public static String getCommaListFromVector(final Vector sourceVector) {
+        final StringBuffer strBuf = new StringBuffer();
+
+        for (int i = 0; i < sourceVector.size(); i++) {
+            strBuf.append((i > 0 ? ", " : "") + sourceVector.elementAt(i));
         }
 
-        throw new MalformedURLException("This file was not found: " + url);
-      }
+        return strBuf.toString();
     }
 
-    return url;
-  }
-  public static String getValidIdentifierName(final String identifierName)
-  {
-    if (identifierName == null || identifierName.length() == 0) {
-        return null;
+    /*
+     * Returns a Reader for reading from the specified resource, if the resource points to a stream.
+     */
+    public static Reader getContentAsReader(final URL url) throws SecurityException, IllegalArgumentException, IOException {
+        if (url == null) {
+            throw new IllegalArgumentException("URL cannot be null.");
+        }
+
+        try {
+            final Object content = url.getContent();
+
+            if (content == null) {
+                throw new IllegalArgumentException("No content.");
+            }
+
+            if (content instanceof InputStream) {
+                final Reader in = new InputStreamReader((InputStream) content);
+
+                if (in.ready()) {
+                    return in;
+                } else {
+                    throw new FileNotFoundException();
+                }
+            } else {
+                throw new IllegalArgumentException(
+                        (content instanceof String) ? (String) content : "This URL points to a: " + StringUtils.getClassName(content.getClass()));
+            }
+        } catch (final SecurityException e) {
+            throw new SecurityException("Your JVM's SecurityManager has disallowed this.");
+        } catch (final FileNotFoundException e) {
+            throw new FileNotFoundException("This file was not found: " + url);
+        }
     }
 
-    final StringBuffer strBuf = new StringBuffer();
+    /*
+     * Shorthand for: IOUtils.getStringFromReader(getContentAsReader(url)).
+     */
+    public static String getContentAsString(final URL url) throws SecurityException, IllegalArgumentException, IOException {
+        return IOUtils.getStringFromReader(getContentAsReader(url));
+    }
 
-    final char[] chars = identifierName.toCharArray();
+    // Handles multi-line strings.
+    public static String getSafeString(final String scriptStr) {
+        final BufferedReader in = new BufferedReader(new StringReader(scriptStr));
+        final StringBuffer strBuf = new StringBuffer();
+        String tempLine, previousLine = null;
+
+        try {
+            while ((tempLine = in.readLine()) != null) {
+                if (previousLine != null) {
+                    strBuf.append("\"" + previousLine + lineSeparatorStr + "\" +" + lineSeparator);
+                }
+
+                previousLine = cleanString(tempLine);
+            }
+        } catch (final IOException e) {
+        }
 
-    strBuf.append(Character.isJavaIdentifierStart(chars[0])
-                  ? chars[0]
-                  : '_'
-                 );
+        strBuf.append("\"" + (previousLine != null ? previousLine : "") + "\"" + lineSeparator);
 
-    for (int i = 1; i < chars.length; i++)
-    {
-      strBuf.append(Character.isJavaIdentifierPart(chars[i])
-                    ? chars[i]
-                    : '_'
-                   );
+        return strBuf.toString();
     }
 
-    return strBuf.toString();
-  }
-  public static boolean isValidIdentifierName(final String identifierName)
-  {
-    if (identifierName == null || identifierName.length() == 0) {
-        return false;
+    /*
+    */
+    public static URL getURL(final URL contextURL, final String spec) throws MalformedURLException {
+        return getURL(contextURL, spec, 1);
     }
 
-    final char[] chars = identifierName.toCharArray();
+    /*
+     * The recursiveDepth argument is used to insure that the algorithm gives up after hunting 2 levels up in the contextURL's path.
+     */
+    private static URL getURL(final URL contextURL, final String spec, final int recursiveDepth) throws MalformedURLException {
+        URL url = null;
+
+        try {
+            url = new URL(contextURL, spec);
+
+            try {
+                url.openStream();
+            } catch (final IOException ioe1) {
+                throw new MalformedURLException("This file was not found: " + url);
+            }
+        } catch (final MalformedURLException e1) {
+            url = new URL("file", "", spec);
+
+            try {
+                url.openStream();
+            } catch (final IOException ioe2) {
+                if (contextURL != null) {
+                    final String contextFileName = contextURL.getFile();
+                    final String parentName = new File(contextFileName).getParent();
+
+                    if (parentName != null && recursiveDepth < 3) {
+                        return getURL(new URL("file", "", parentName + '/'), spec, recursiveDepth + 1);
+                    }
+                }
+
+                throw new MalformedURLException("This file was not found: " + url);
+            }
+        }
 
-    if (!Character.isJavaIdentifierStart(chars[0])) {
-        return false;
+        return url;
     }
 
-    for (int i = 1; i < chars.length; i++) {
-        if (!Character.isJavaIdentifierPart(chars[i])) {
-            return false;
+    public static String getValidIdentifierName(final String identifierName) {
+        if (identifierName == null || identifierName.length() == 0) {
+            return null;
         }
-    }
 
-    return true;
-  }
-  public static boolean isValidPackageName(final String packageName)
-  {
-    if (packageName == null) {
-        return false;
-    } else if (packageName.length() == 0) {
-        // Empty is ok.
-          return true;
-    }
+        final StringBuffer strBuf = new StringBuffer();
 
-    final StringTokenizer strTok = new StringTokenizer(packageName, ".", true);
+        final char[] chars = identifierName.toCharArray();
 
-    // Should have an odd number of tokens (including '.' delimiters).
-    if (strTok.countTokens() % 2 != 1) {
-        return false;
-    }
+        strBuf.append(Character.isJavaIdentifierStart(chars[0]) ? chars[0] : '_');
 
-    // Must start with a valid identifier name.
-    if (!isValidIdentifierName(strTok.nextToken())) {
-        return false;
+        for (int i = 1; i < chars.length; i++) {
+            strBuf.append(Character.isJavaIdentifierPart(chars[i]) ? chars[i] : '_');
+        }
+
+        return strBuf.toString();
     }
 
-    // ... followed by 0 or more of ".ValidIdentifier".
-    while (strTok.hasMoreTokens())
-    {
-      // Must be a '.'.
-      if (!strTok.nextToken().equals(".")) {
-        return false;
+    public static boolean isValidIdentifierName(final String identifierName) {
+        if (identifierName == null || identifierName.length() == 0) {
+            return false;
+        }
+
+        final char[] chars = identifierName.toCharArray();
+
+        if (!Character.isJavaIdentifierStart(chars[0])) {
+            return false;
+        }
+
+        for (int i = 1; i < chars.length; i++) {
+            if (!Character.isJavaIdentifierPart(chars[i])) {
+                return false;
+            }
+        }
+
+        return true;
     }
 
-      // Must be a valid identifier name.
-      if (strTok.hasMoreTokens())
-      {
+    public static boolean isValidPackageName(final String packageName) {
+        if (packageName == null) {
+            return false;
+        } else if (packageName.length() == 0) {
+            // Empty is ok.
+            return true;
+        }
+
+        final StringTokenizer strTok = new StringTokenizer(packageName, ".", true);
+
+        // Should have an odd number of tokens (including '.' delimiters).
+        if (strTok.countTokens() % 2 != 1) {
+            return false;
+        }
+
+        // Must start with a valid identifier name.
         if (!isValidIdentifierName(strTok.nextToken())) {
             return false;
         }
-      } else {
-        return false;
-    }
-    }
 
-    return true;
-  }
-  /*
-    See the comment above for getClassName(targetClass)...
-  */
-  private static String parseDescriptor(final String className)
-  {
-    final char[] classNameChars = className.toCharArray();
-    int    arrayDim       = 0;
-    int    i              = 0;
-
-    while (classNameChars[i] == '[')
-    {
-      arrayDim++;
-      i++;
-    }
+        // ... followed by 0 or more of ".ValidIdentifier".
+        while (strTok.hasMoreTokens()) {
+            // Must be a '.'.
+            if (!strTok.nextToken().equals(".")) {
+                return false;
+            }
+
+            // Must be a valid identifier name.
+            if (strTok.hasMoreTokens()) {
+                if (!isValidIdentifierName(strTok.nextToken())) {
+                    return false;
+                }
+            } else {
+                return false;
+            }
+        }
 
-    final StringBuffer classNameBuf = new StringBuffer();
-
-    switch (classNameChars[i++])
-    {
-      case 'B' : classNameBuf.append("byte");
-                 break;
-      case 'C' : classNameBuf.append("char");
-                 break;
-      case 'D' : classNameBuf.append("double");
-                 break;
-      case 'F' : classNameBuf.append("float");
-                 break;
-      case 'I' : classNameBuf.append("int");
-                 break;
-      case 'J' : classNameBuf.append("long");
-                 break;
-      case 'S' : classNameBuf.append("short");
-                 break;
-      case 'Z' : classNameBuf.append("boolean");
-                 break;
-      case 'L' : classNameBuf.append(classNameChars,
-                                     i, classNameChars.length - i - 1);
-                 break;
+        return true;
     }
 
-    for (i = 0; i < arrayDim; i++) {
-        classNameBuf.append("[]");
-    }
+    /*
+     * See the comment above for getClassName(targetClass)...
+     */
+    private static String parseDescriptor(final String className) {
+        final char[] classNameChars = className.toCharArray();
+        int arrayDim = 0;
+        int i = 0;
+
+        while (classNameChars[i] == '[') {
+            arrayDim++;
+            i++;
+        }
+
+        final StringBuffer classNameBuf = new StringBuffer();
+
+        switch (classNameChars[i++]) {
+        case 'B':
+            classNameBuf.append("byte");
+            break;
+        case 'C':
+            classNameBuf.append("char");
+            break;
+        case 'D':
+            classNameBuf.append("double");
+            break;
+        case 'F':
+            classNameBuf.append("float");
+            break;
+        case 'I':
+            classNameBuf.append("int");
+            break;
+        case 'J':
+            classNameBuf.append("long");
+            break;
+        case 'S':
+            classNameBuf.append("short");
+            break;
+        case 'Z':
+            classNameBuf.append("boolean");
+            break;
+        case 'L':
+            classNameBuf.append(classNameChars, i, classNameChars.length - i - 1);
+            break;
+        }
 
-    return classNameBuf.toString();
-  }
+        for (i = 0; i < arrayDim; i++) {
+            classNameBuf.append("[]");
+        }
+
+        return classNameBuf.toString();
+    }
 }
diff --git a/src/main/java/org/apache/bsf/util/cf/CFDriver.java b/src/main/java/org/apache/bsf/util/cf/CFDriver.java
index b122d95..d25611d 100644
--- a/src/main/java/org/apache/bsf/util/cf/CFDriver.java
+++ b/src/main/java/org/apache/bsf/util/cf/CFDriver.java
@@ -29,171 +29,134 @@ import java.io.Writer;
 /**
  * This is an example of how a <code>CodeFormatter</code> bean can be used.
  * <p>
- * The CFDriver is a stand-alone tool that will instantiate a
- * <code>CodeFormatter</code> bean, configure it according to your
- * command-line arguments, and invoke the formatting. Since the
- * default source of input is <code>stdin</code>, and the default
- * target for output is <code>stdout</code>, a <code>CFDriver</code>
+ * The CFDriver is a stand-alone tool that will instantiate a <code>CodeFormatter</code> bean, configure it according to your command-line arguments, and invoke
+ * the formatting. Since the default source of input is <code>stdin</code>, and the default target for output is <code>stdout</code>, a <code>CFDriver</code>
  * can also be used as a filter.
  *
  * @see CodeFormatter
  *
  * @version 1.0
  */
-public class CFDriver
-{
+public class CFDriver {
     /**
      * Not used.
      */
-    public CFDriver()
-  {
-  }
-  /**
-    * A driver for <code>CodeFormatter</code>.
-    *<p>
-    * Usage:
-    *<code><pre>
-    *  java org.apache.cf.CFDriver [args]
-    *<p>
-    *    args:
-    *<p>
-    *      [-in      fileName]   default: &lt;STDIN&gt;
-    *      [-out     fileName]   default: &lt;STDOUT&gt;
-    *      [-maxLine   length]   default: 74
-    *      [-step        size]   default: 2
-    *      [-delim      group]   default: (+
-    *      [-sdelim     group]   default: ,
-    *</pre></code>
-    */
-    public static void main(final String[] argv)
-  {
-    if (argv.length % 2 == 0)
-    {
-      String        inFile  = null,
-                    outFile = null,
-                    maxLine = null,
-                    indStep = null,
-                    delim   = null,
-                    sDelim  = null;
-      Reader        in      = null;
-        Writer        out     = null;
-      final CodeFormatter cf      = new CodeFormatter();
-
-      for (int i = 0; i < argv.length; i += 2)
-      {
-        if (argv[i].startsWith("-i")) {
-            inFile = argv[i + 1];
-        } else if (argv[i].startsWith("-o")) {
-            outFile = argv[i + 1];
-        } else if (argv[i].startsWith("-m")) {
-            maxLine = argv[i + 1];
-        } else if (argv[i].startsWith("-st")) {
-            indStep = argv[i + 1];
-        } else if (argv[i].startsWith("-d")) {
-            delim = argv[i + 1];
-        } else if (argv[i].startsWith("-sd")) {
-            sDelim = argv[i + 1];
-        }
-      }
+    public CFDriver() {
+    }
 
-      if (inFile != null)
-      {
-        try
-        {
-          in = new FileReader(inFile);
-        }
-        catch (final FileNotFoundException e)
-        {
-          printError("Cannot open input file: " + inFile);
+    /**
+     * A driver for <code>CodeFormatter</code>.
+     * <p>
+     * Usage: <code><pre>
+     *  java org.apache.cf.CFDriver [args]
+     *<p>
+     *    args:
+     *<p>
+     *      [-in      fileName]   default: &lt;STDIN&gt;
+     *      [-out     fileName]   default: &lt;STDOUT&gt;
+     *      [-maxLine   length]   default: 74
+     *      [-step        size]   default: 2
+     *      [-delim      group]   default: (+
+     *      [-sdelim     group]   default: ,
+     *</pre></code>
+     */
+    public static void main(final String[] argv) {
+        if (argv.length % 2 == 0) {
+            String inFile = null, outFile = null, maxLine = null, indStep = null, delim = null, sDelim = null;
+            Reader in = null;
+            Writer out = null;
+            final CodeFormatter cf = new CodeFormatter();
 
-          return;
-        }
-      }
-      else
-      {
-        in = new InputStreamReader(System.in);
-      }
-
-      if (outFile != null)
-      {
-        try
-        {
-          out = new FileWriter(outFile);
-        }
-        catch (final IOException e)
-        {
-          printError("Cannot open output file: " + outFile);
+            for (int i = 0; i < argv.length; i += 2) {
+                if (argv[i].startsWith("-i")) {
+                    inFile = argv[i + 1];
+                } else if (argv[i].startsWith("-o")) {
+                    outFile = argv[i + 1];
+                } else if (argv[i].startsWith("-m")) {
+                    maxLine = argv[i + 1];
+                } else if (argv[i].startsWith("-st")) {
+                    indStep = argv[i + 1];
+                } else if (argv[i].startsWith("-d")) {
+                    delim = argv[i + 1];
+                } else if (argv[i].startsWith("-sd")) {
+                    sDelim = argv[i + 1];
+                }
+            }
 
-          return;
-        }
-      }
-      else
-      {
-        out = new OutputStreamWriter(System.out);
-      }
-
-        if (maxLine != null)
-      {
-        try
-        {
-            cf.setMaxLineLength(Integer.parseInt(maxLine));
-        }
-        catch (final NumberFormatException nfe)
-        {
-            printError("Not a valid integer: " + maxLine);
+            if (inFile != null) {
+                try {
+                    in = new FileReader(inFile);
+                } catch (final FileNotFoundException e) {
+                    printError("Cannot open input file: " + inFile);
 
-            return;
-        }
-      }
+                    return;
+                }
+            } else {
+                in = new InputStreamReader(System.in);
+            }
 
-      if (indStep != null)
-      {
-        try
-        {
-          cf.setIndentationStep(Integer.parseInt(indStep));
-        }
-        catch (final NumberFormatException nfe)
-        {
-          printError("Not a valid integer: " + indStep);
+            if (outFile != null) {
+                try {
+                    out = new FileWriter(outFile);
+                } catch (final IOException e) {
+                    printError("Cannot open output file: " + outFile);
 
-          return;
-        }
-      }
+                    return;
+                }
+            } else {
+                out = new OutputStreamWriter(System.out);
+            }
 
-        if (delim != null) {
-            cf.setDelimiters(delim);
-        }
+            if (maxLine != null) {
+                try {
+                    cf.setMaxLineLength(Integer.parseInt(maxLine));
+                } catch (final NumberFormatException nfe) {
+                    printError("Not a valid integer: " + maxLine);
+
+                    return;
+                }
+            }
+
+            if (indStep != null) {
+                try {
+                    cf.setIndentationStep(Integer.parseInt(indStep));
+                } catch (final NumberFormatException nfe) {
+                    printError("Not a valid integer: " + indStep);
+
+                    return;
+                }
+            }
 
-        if (sDelim != null) {
-            cf.setStickyDelimiters(sDelim);
+            if (delim != null) {
+                cf.setDelimiters(delim);
+            }
+
+            if (sDelim != null) {
+                cf.setStickyDelimiters(sDelim);
+            }
+
+            cf.formatCode(in, out);
+        } else {
+            printHelp();
         }
+    }
+
+    private static void printError(final String errMsg) {
+        System.err.println("ERROR: " + errMsg);
+    }
 
-        cf.formatCode(in, out);
-    } else {
-        printHelp();
+    private static void printHelp() {
+        System.out.println("Usage:");
+        System.out.println();
+        System.out.println("  java " + CFDriver.class.getName() + " [args]");
+        System.out.println();
+        System.out.println("    args:");
+        System.out.println();
+        System.out.println("      [-in      fileName]   default: <STDIN>");
+        System.out.println("      [-out     fileName]   default: <STDOUT>");
+        System.out.println("      [-maxLine   length]   default: " + CodeFormatter.DEFAULT_MAX);
+        System.out.println("      [-step        size]   default: " + CodeFormatter.DEFAULT_STEP);
+        System.out.println("      [-delim      group]   default: " + CodeFormatter.DEFAULT_DELIM);
+        System.out.println("      [-sdelim     group]   default: " + CodeFormatter.DEFAULT_S_DELIM);
     }
-  }
-    private static void printError(final String errMsg)
-  {
-    System.err.println("ERROR: " + errMsg);
-  }
-    private static void printHelp()
-  {
-    System.out.println("Usage:");
-    System.out.println();
-    System.out.println("  java " + CFDriver.class.getName() + " [args]");
-    System.out.println();
-    System.out.println("    args:");
-    System.out.println();
-    System.out.println("      [-in      fileName]   default: <STDIN>");
-    System.out.println("      [-out     fileName]   default: <STDOUT>");
-    System.out.println("      [-maxLine   length]   default: " +
-                       CodeFormatter.DEFAULT_MAX);
-    System.out.println("      [-step        size]   default: " +
-                       CodeFormatter.DEFAULT_STEP);
-    System.out.println("      [-delim      group]   default: " +
-                       CodeFormatter.DEFAULT_DELIM);
-    System.out.println("      [-sdelim     group]   default: " +
-                       CodeFormatter.DEFAULT_S_DELIM);
-  }
 }
diff --git a/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java b/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
index 3384fda..164a95d 100644
--- a/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
+++ b/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
@@ -27,350 +27,305 @@ import org.apache.bsf.util.IndentWriter;
 import org.apache.bsf.util.StringUtils;
 
 /**
- * A <code>CodeFormatter</code> bean is used to format raw Java code. It
- * indents, word-wraps, and replaces tab characters with an amount of space
- * characters equal to the size of the <code>indentationStep</code> property.
- * To create and use a <code>CodeFormatter</code>, you simply instantiate a
- * new <code>CodeFormatter</code> bean, and invoke
- * <code>formatCode(Reader source, Writer target)</code> with appropriate
- * arguments.
+ * A <code>CodeFormatter</code> bean is used to format raw Java code. It indents, word-wraps, and replaces tab characters with an amount of space characters
+ * equal to the size of the <code>indentationStep</code> property. To create and use a <code>CodeFormatter</code>, you simply instantiate a new
+ * <code>CodeFormatter</code> bean, and invoke <code>formatCode(Reader source, Writer target)</code> with appropriate arguments.
  *
  * @version 1.0
  */
-public class CodeFormatter
-{
-  /**
-   * The default maximum line length.
-   */
-  public static final int     DEFAULT_MAX      = 74;
-  /**
-   * The default size of the indentation step.
-   */
-  public static final int     DEFAULT_STEP     = 2;
-  /**
-   * The default set of delimiters.
-   */
-  public static final String  DEFAULT_DELIM    = "(+";
-  /**
-   * The default set of sticky delimiters.
-   */
-  public static final String  DEFAULT_S_DELIM  = ",";
-
-  // Configurable Parameters
-  private             int     maxLineLength    = DEFAULT_MAX;
-  private             int     indentationStep  = DEFAULT_STEP;
-  private             String  delimiters       = DEFAULT_DELIM;
-  private             String  stickyDelimiters = DEFAULT_S_DELIM;
-
-  // Global Variables
-  private             int     indent;
-  private             int     hangingIndent;
-  private             int     origIndent;
-  private             boolean inCPP_Comment;
-
-  private void addTok(final StringBuffer targetBuf, final StringBuffer tokBuf,
-                      final IndentWriter out)
-  {
-    final int tokLength    = tokBuf.length(),
-        targetLength = targetBuf.length();
-
-    if (indent + targetLength + tokLength > maxLineLength)
-    {
-      if (targetLength == 0)
-      {
-        out.println(indent, tokBuf.toString());
-        indent = hangingIndent;
-        targetBuf.setLength(0);
-
-        return;
-      }
-      else
-      {
-        out.println(indent, targetBuf.toString().trim());
-        indent = hangingIndent;
-        targetBuf.setLength(0);
-      }
+public class CodeFormatter {
+    /**
+     * The default maximum line length.
+     */
+    public static final int DEFAULT_MAX = 74;
+    /**
+     * The default size of the indentation step.
+     */
+    public static final int DEFAULT_STEP = 2;
+    /**
+     * The default set of delimiters.
+     */
+    public static final String DEFAULT_DELIM = "(+";
+    /**
+     * The default set of sticky delimiters.
+     */
+    public static final String DEFAULT_S_DELIM = ",";
+
+    // Configurable Parameters
+    private int maxLineLength = DEFAULT_MAX;
+    private int indentationStep = DEFAULT_STEP;
+    private String delimiters = DEFAULT_DELIM;
+    private String stickyDelimiters = DEFAULT_S_DELIM;
+
+    // Global Variables
+    private int indent;
+    private int hangingIndent;
+    private int origIndent;
+    private boolean inCPP_Comment;
+
+    private void addTok(final StringBuffer targetBuf, final StringBuffer tokBuf, final IndentWriter out) {
+        final int tokLength = tokBuf.length(), targetLength = targetBuf.length();
+
+        if (indent + targetLength + tokLength > maxLineLength) {
+            if (targetLength == 0) {
+                out.println(indent, tokBuf.toString());
+                indent = hangingIndent;
+                targetBuf.setLength(0);
+
+                return;
+            } else {
+                out.println(indent, targetBuf.toString().trim());
+                indent = hangingIndent;
+                targetBuf.setLength(0);
+            }
+        }
+
+        targetBuf.append(tokBuf.toString());
     }
 
-    targetBuf.append(tokBuf.toString());
-  }
-  /**
-   * Formats the code read from <code>source</code>, and writes the formatted
-   * code to <code>target</code>.
-   *
-   * @param source where to read the unformatted code from.
-   * @param target where to write the formatted code to.
-   */
-  public void formatCode(final Reader source, final Writer target)
-  {
-    String         line;
-    final BufferedReader in  = new BufferedReader(source);
-    final IndentWriter   out = new IndentWriter(new BufferedWriter(target), true);
-
-    try
-    {
-      origIndent    = 0;
-      inCPP_Comment = false;
-
-      while ((line = in.readLine()) != null)
-      {
-        line = line.trim();
-
-        if (line.length() > 0)
-        {
-          indent        = origIndent;
-          hangingIndent = indent + indentationStep;
-          printLine(line, out);
-        } else {
-            out.println();
+    /**
+     * Formats the code read from <code>source</code>, and writes the formatted code to <code>target</code>.
+     *
+     * @param source where to read the unformatted code from.
+     * @param target where to write the formatted code to.
+     */
+    public void formatCode(final Reader source, final Writer target) {
+        String line;
+        final BufferedReader in = new BufferedReader(source);
+        final IndentWriter out = new IndentWriter(new BufferedWriter(target), true);
+
+        try {
+            origIndent = 0;
+            inCPP_Comment = false;
+
+            while ((line = in.readLine()) != null) {
+                line = line.trim();
+
+                if (line.length() > 0) {
+                    indent = origIndent;
+                    hangingIndent = indent + indentationStep;
+                    printLine(line, out);
+                } else {
+                    out.println();
+                }
+            }
+        } catch (final IOException e) {
+            e.printStackTrace();
         }
-      }
     }
-    catch (final IOException e)
-    {
-      e.printStackTrace();
+
+    /**
+     * Gets the set of delimiters.
+     *
+     * @return the set of delimiters.
+     * @see #setDelimiters
+     */
+    public String getDelimiters() {
+        return delimiters;
+    }
+
+    /**
+     * Gets the size of the indentation step.
+     *
+     * @return the size of the indentation step.
+     * @see #setIndentationStep
+     */
+    public int getIndentationStep() {
+        return indentationStep;
+    }
+
+    /**
+     * Gets the maximum line length.
+     *
+     * @return the maximum line length.
+     * @see #setMaxLineLength
+     */
+    public int getMaxLineLength() {
+        return maxLineLength;
+    }
+
+    /**
+     * Gets the set of sticky delimiters.
+     *
+     * @return the set of sticky delimiters.
+     * @see #setStickyDelimiters
+     */
+    public String getStickyDelimiters() {
+        return stickyDelimiters;
     }
-  }
-  /**
-   * Gets the set of delimiters.
-   *
-   * @return the set of delimiters.
-   * @see #setDelimiters
-   */
-  public String getDelimiters()
-  {
-    return delimiters;
-  }
-  /**
-   * Gets the size of the indentation step.
-   *
-   * @return the size of the indentation step.
-   * @see #setIndentationStep
-   */
-  public int getIndentationStep()
-  {
-    return indentationStep;
-  }
-  /**
-   * Gets the maximum line length.
-   *
-   * @return the maximum line length.
-   * @see #setMaxLineLength
-   */
-  public int getMaxLineLength()
-  {
-    return maxLineLength;
-  }
-  /**
-   * Gets the set of sticky delimiters.
-   *
-   * @return the set of sticky delimiters.
-   * @see #setStickyDelimiters
-   */
-  public String getStickyDelimiters()
-  {
-    return stickyDelimiters;
-  }
-  private void printLine(final String line, final IndentWriter out)
-  {
-    final char[]       source           = line.toCharArray();
-    char         ch;
-    char         quoteChar        = ' ';
-    boolean      inEscapeSequence = false;
-    boolean      inString         = false;
-    final StringBuffer tokBuf           = new StringBuffer(),
-                 targetBuf        = new StringBuffer(hangingIndent + line.length());
-
-    for (int i = 0; i < source.length; i++)
-    {
-      ch = source[i];
-
-      if (inEscapeSequence)
-      {
-        tokBuf.append(ch);
-        inEscapeSequence = false;
-      }
-      else
-      {
-        if (inString)
-        {
-          switch (ch)
-          {
-            case '\\' :
-              tokBuf.append('\\');
-              inEscapeSequence = true;
-              break;
-            case '\'' :
-			case '\"' :
-			  tokBuf.append(ch);
-
-			  if (ch == quoteChar)
-			  {
-				addTok(targetBuf, tokBuf, out);
-				tokBuf.setLength(0);
-				inString = false;
-			  }
-			  break;
-			case 9 :  // pass thru tab characters...
-			  tokBuf.append(ch);
-			  break;
-			default :
-			  if (ch > 31) {
+
+    private void printLine(final String line, final IndentWriter out) {
+        final char[] source = line.toCharArray();
+        char ch;
+        char quoteChar = ' ';
+        boolean inEscapeSequence = false;
+        boolean inString = false;
+        final StringBuffer tokBuf = new StringBuffer(), targetBuf = new StringBuffer(hangingIndent + line.length());
+
+        for (int i = 0; i < source.length; i++) {
+            ch = source[i];
+
+            if (inEscapeSequence) {
                 tokBuf.append(ch);
-            }
-			  break;
-		  }
-		}
-		else  // !inString
-		{
-		  if (inCPP_Comment)
-		  {
-			tokBuf.append(ch);
-
-			if (ch == '/' && i > 0 && source[i - 1] == '*') {
-                inCPP_Comment = false;
-            }
-		  }
-		  else
-		  {
-			switch (ch)
-			{
-			  case '/' :
-				tokBuf.append(ch);
-
-				if (i > 0 && source[i - 1] == '/')
-				{
-				  final String tokStr = tokBuf.append(source,
-												i + 1,
-												source.length - (i + 1)).toString();
-
-				  out.println(indent, targetBuf.append(tokStr).toString());
-
-				  return;
-				}
-				break;
-			  case '*' :
-				tokBuf.append(ch);
-
-				if (i > 0 && source[i - 1] == '/') {
-                    inCPP_Comment = true;
-                }
-				break;
-			  case '\'' :
-			  case '\"' :
-				addTok(targetBuf, tokBuf, out);
-				tokBuf.setLength(0);
-				tokBuf.append(ch);
-				quoteChar = ch;
-				inString  = true;
-				break;
-			  case 9 :  // replace tab characters...
-				tokBuf.append(StringUtils.getChars(indentationStep, ' '));
-				break;
-			  case '{' :
-				tokBuf.append(ch);
-				origIndent += indentationStep;
-				break;
-			  case '}' :
-				tokBuf.append(ch);
-				origIndent -= indentationStep;
-
-				if (i == 0) {
-                    indent = origIndent;
-                }
-				break;
-			  default :
-				if (ch > 31)
-				{
-				  if (delimiters.indexOf(ch) != -1)
-				  {
-					addTok(targetBuf, tokBuf, out);
-					tokBuf.setLength(0);
-					tokBuf.append(ch);
-				  }
-				  else if (stickyDelimiters.indexOf(ch) != -1)
-				  {
-					tokBuf.append(ch);
-					addTok(targetBuf, tokBuf, out);
-					tokBuf.setLength(0);
-				  } else {
-                    tokBuf.append(ch);
+                inEscapeSequence = false;
+            } else {
+                if (inString) {
+                    switch (ch) {
+                    case '\\':
+                        tokBuf.append('\\');
+                        inEscapeSequence = true;
+                        break;
+                    case '\'':
+                    case '\"':
+                        tokBuf.append(ch);
+
+                        if (ch == quoteChar) {
+                            addTok(targetBuf, tokBuf, out);
+                            tokBuf.setLength(0);
+                            inString = false;
+                        }
+                        break;
+                    case 9: // pass thru tab characters...
+                        tokBuf.append(ch);
+                        break;
+                    default:
+                        if (ch > 31) {
+                            tokBuf.append(ch);
+                        }
+                        break;
+                    }
+                } else // !inString
+                {
+                    if (inCPP_Comment) {
+                        tokBuf.append(ch);
+
+                        if (ch == '/' && i > 0 && source[i - 1] == '*') {
+                            inCPP_Comment = false;
+                        }
+                    } else {
+                        switch (ch) {
+                        case '/':
+                            tokBuf.append(ch);
+
+                            if (i > 0 && source[i - 1] == '/') {
+                                final String tokStr = tokBuf.append(source, i + 1, source.length - (i + 1)).toString();
+
+                                out.println(indent, targetBuf.append(tokStr).toString());
+
+                                return;
+                            }
+                            break;
+                        case '*':
+                            tokBuf.append(ch);
+
+                            if (i > 0 && source[i - 1] == '/') {
+                                inCPP_Comment = true;
+                            }
+                            break;
+                        case '\'':
+                        case '\"':
+                            addTok(targetBuf, tokBuf, out);
+                            tokBuf.setLength(0);
+                            tokBuf.append(ch);
+                            quoteChar = ch;
+                            inString = true;
+                            break;
+                        case 9: // replace tab characters...
+                            tokBuf.append(StringUtils.getChars(indentationStep, ' '));
+                            break;
+                        case '{':
+                            tokBuf.append(ch);
+                            origIndent += indentationStep;
+                            break;
+                        case '}':
+                            tokBuf.append(ch);
+                            origIndent -= indentationStep;
+
+                            if (i == 0) {
+                                indent = origIndent;
+                            }
+                            break;
+                        default:
+                            if (ch > 31) {
+                                if (delimiters.indexOf(ch) != -1) {
+                                    addTok(targetBuf, tokBuf, out);
+                                    tokBuf.setLength(0);
+                                    tokBuf.append(ch);
+                                } else if (stickyDelimiters.indexOf(ch) != -1) {
+                                    tokBuf.append(ch);
+                                    addTok(targetBuf, tokBuf, out);
+                                    tokBuf.setLength(0);
+                                } else {
+                                    tokBuf.append(ch);
+                                }
+                            }
+                            break;
+                        }
+                    }
                 }
-				}
-				break;
-			}
-		  }
-		}
-	  }
-	}
-
-	if (tokBuf.length() > 0) {
-        addTok(targetBuf, tokBuf, out);
+            }
+        }
+
+        if (tokBuf.length() > 0) {
+            addTok(targetBuf, tokBuf, out);
+        }
+
+        final String lastLine = targetBuf.toString().trim();
+
+        if (lastLine.length() > 0) {
+            out.println(indent, lastLine);
+        }
+    }
+
+    /**
+     * Sets the set of delimiters; default set is <code>"(+"</code>.
+     * <p>
+     * Each character represents one delimiter. If a line is ready to be word-wrapped and a delimiter is encountered, the delimiter will appear as the <em>first
+     * character on the following line</em>. A quotation mark, <code>"</code> or <code>'</code>, opening a string is always a delimiter, whether you specify it
+     * or not.
+     *
+     * @param newDelimiters the new set of delimiters.
+     * @see #getDelimiters
+     */
+    public void setDelimiters(final String newDelimiters) {
+        delimiters = newDelimiters;
     }
 
-	final String lastLine = targetBuf.toString().trim();
+    /**
+     * Sets the size of the indentation step; default size is <code>2</code>.
+     * <p>
+     * This is the number of spaces that lines will be indented (when appropriate).
+     *
+     * @param newIndentationStep the new size of the indentation step.
+     * @see #getIndentationStep
+     */
+    public void setIndentationStep(final int newIndentationStep) {
+        indentationStep = (newIndentationStep < 0 ? 0 : newIndentationStep);
+    }
+
+    /**
+     * Sets the (desired) maximum line length; default length is <code>74</code>.
+     * <p>
+     * If a token is longer than the requested maximum line length, then the line containing that token will obviously be longer than the desired maximum.
+     *
+     * @param newMaxLineLength the new maximum line length.
+     * @see #getMaxLineLength
+     */
+    public void setMaxLineLength(final int newMaxLineLength) {
+        maxLineLength = (newMaxLineLength < 0 ? 0 : newMaxLineLength);
+    }
 
-	if (lastLine.length() > 0) {
-        out.println(indent, lastLine);
+    /**
+     * Sets the set of sticky delimiters; default set is <code>","</code>.
+     * <p>
+     * Each character represents one sticky delimiter. If a line is ready to be word-wrapped and a sticky delimiter is encountered, the sticky delimiter will
+     * appear as the <em>last character on the current line</em>. A quotation mark, <code>"</code> or <code>'</code>, closing a string is always a sticky
+     * delimiter, whether you specify it or not.
+     *
+     * @param newStickyDelimiters the new set of sticky delimiters.
+     * @see #getStickyDelimiters
+     */
+    public void setStickyDelimiters(final String newStickyDelimiters) {
+        stickyDelimiters = newStickyDelimiters;
     }
-  }
-  /**
-   * Sets the set of delimiters; default set is <code>"(+"</code>.
-   * <p>
-   * Each character represents one delimiter. If a line is ready to be
-   * word-wrapped and a delimiter is encountered, the delimiter will
-   * appear as the <em>first character on the following line</em>.
-   * A quotation mark, <code>"</code> or <code>'</code>, opening a string
-   * is always a delimiter, whether you specify it or not.
-   *
-   * @param newDelimiters the new set of delimiters.
-   * @see #getDelimiters
-   */
-  public void setDelimiters(final String newDelimiters)
-  {
-    delimiters = newDelimiters;
-  }
-  /**
-   * Sets the size of the indentation step; default size is <code>2</code>.
-   * <p>
-   * This is the number of spaces that lines will be indented (when appropriate).
-   *
-   * @param newIndentationStep the new size of the indentation step.
-   * @see #getIndentationStep
-   */
-  public void setIndentationStep(final int newIndentationStep)
-  {
-    indentationStep = (newIndentationStep < 0 ? 0 : newIndentationStep);
-  }
-  /**
-   * Sets the (desired) maximum line length; default length is
-   * <code>74</code>.
-   * <p>
-   * If a token is longer than the requested maximum line length,
-   * then the line containing that token will obviously be longer
-   * than the desired maximum.
-   *
-   * @param newMaxLineLength the new maximum line length.
-   * @see #getMaxLineLength
-   */
-  public void setMaxLineLength(final int newMaxLineLength)
-  {
-    maxLineLength = (newMaxLineLength < 0 ? 0 : newMaxLineLength);
-  }
-  /**
-   * Sets the set of sticky delimiters; default set is <code>","</code>.
-   * <p>
-   * Each character represents one sticky delimiter. If a line is ready
-   * to be word-wrapped and a sticky delimiter is encountered, the sticky
-   * delimiter will appear as the <em>last character on the current line</em>.
-   * A quotation mark, <code>"</code> or <code>'</code>, closing a string
-   * is always a sticky delimiter, whether you specify it or not.
-   *
-   * @param newStickyDelimiters the new set of sticky delimiters.
-   * @see #getStickyDelimiters
-   */
-  public void setStickyDelimiters(final String newStickyDelimiters)
-  {
-	stickyDelimiters = newStickyDelimiters;
-  }
 }
diff --git a/src/main/java/org/apache/bsf/util/event/EventAdapter.java b/src/main/java/org/apache/bsf/util/event/EventAdapter.java
index cdd5ef6..7481eeb 100644
--- a/src/main/java/org/apache/bsf/util/event/EventAdapter.java
+++ b/src/main/java/org/apache/bsf/util/event/EventAdapter.java
@@ -18,17 +18,13 @@
 package org.apache.bsf.util.event;
 
 /**
- * <em>EventAdapter</em> is the interface that all event adapters must
- * implement in order to work with the automatic event adapter generation
- * model. This interface requires that the adapter implement a method
- * that allows setting the event processor delegated to process the event
- * after the adapter has received the event from the event source. The
... 4116 lines suppressed ...


(commons-bsf) 02/02: Replace internal StringBuffer with StringBuilder

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bsf.git

commit b766a6b91d652832a7629c3e79d759d7188fac4a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 10 10:36:06 2023 -0500

    Replace internal StringBuffer with StringBuilder
---
 src/changes/changes.xml                                      |  7 ++++---
 src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java    |  2 +-
 src/main/java/org/apache/bsf/engines/java/JavaEngine.java    |  2 +-
 .../java/org/apache/bsf/engines/jython/JythonEngine.java     |  4 ++--
 src/main/java/org/apache/bsf/util/EngineUtils.java           |  2 +-
 src/main/java/org/apache/bsf/util/MethodUtils.java           |  4 ++--
 src/main/java/org/apache/bsf/util/StringUtils.java           | 12 ++++++------
 src/main/java/org/apache/bsf/util/cf/CodeFormatter.java      |  4 ++--
 8 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b0f223b..f755c98 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,9 +24,10 @@
   </properties>
   <body>
     <release version="2.5.0" date="YYY-MM-DD" description="TBD.">
-      <!-- FIXES -->
-      <!-- ADDS -->
-      <!-- UPDATES -->
+      <!-- FIX -->
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Replace internal StringBuffer with StringBuilder.</action>
+      <!-- ADD -->
+      <!-- UPDATS -->
       <action type="update" dev="ggregory" due-to="Gary Gregory">Bump actions/cache from 2 to current.</action>
       <action type="update" dev="ggregory" due-to="Gary Gregory">Bump actions/checkout 2.3.4 to current.</action>
       <action type="update" dev="ggregory" due-to="Gary Gregory">Bump actions/setup-java from 1.4.3 to current.</action>
diff --git a/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java b/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
index 325d613..1be1b09 100644
--- a/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
+++ b/src/main/java/org/apache/bsf/engines/jacl/JaclEngine.java
@@ -47,7 +47,7 @@ public class JaclEngine extends BSFEngineImpl {
      * @param args   an array of arguments to be passed to the extension, which may be either Vectors of Nodes, or Strings.
      */
     public Object call(final Object obj, final String method, final Object[] args) throws BSFException {
-        final StringBuffer tclScript = new StringBuffer(method);
+        final StringBuilder tclScript = new StringBuilder(method);
         if (args != null) {
             for (int i = 0; i < args.length; i++) {
                 tclScript.append(" ");
diff --git a/src/main/java/org/apache/bsf/engines/java/JavaEngine.java b/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
index 82cce45..a5e91b2 100644
--- a/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
+++ b/src/main/java/org/apache/bsf/engines/java/JavaEngine.java
@@ -168,7 +168,7 @@ public class JavaEngine extends BSFEngineImpl {
                 int startpoint = script.indexOf(placeholder);
                 int endpoint;
                 if (startpoint >= 0) {
-                    final StringBuffer changed = new StringBuffer();
+                    final StringBuilder changed = new StringBuilder();
                     for (; startpoint >= 0; startpoint = script.indexOf(placeholder, startpoint)) {
                         changed.setLength(0); // Reset for 2nd pass or later
                         if (startpoint > 0) {
diff --git a/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java b/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
index 8517dbd..1abd2a8 100644
--- a/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
+++ b/src/main/java/org/apache/bsf/engines/jython/JythonEngine.java
@@ -94,7 +94,7 @@ public class JythonEngine extends BSFEngineImpl {
              * We wrapper the original script in a function definition, and evaluate the function. A hack, no question, but it allows apply() to pretend to work
              * on Jython.
              */
-            final StringBuffer script = new StringBuffer(byteify(funcBody.toString()));
+            final StringBuilder script = new StringBuilder(byteify(funcBody.toString()));
             int index = 0;
             script.insert(0, "def bsf_temp_fn():\n");
 
@@ -227,7 +227,7 @@ public class JythonEngine extends BSFEngineImpl {
     private String byteify(final String orig) {
         // Ugh. Jython likes to be fed bytes, rather than the input string.
         final ByteArrayInputStream bais = new ByteArrayInputStream(orig.getBytes());
-        final StringBuffer s = new StringBuffer();
+        final StringBuilder s = new StringBuilder();
         int c;
 
         while ((c = bais.read()) >= 0) {
diff --git a/src/main/java/org/apache/bsf/util/EngineUtils.java b/src/main/java/org/apache/bsf/util/EngineUtils.java
index ec83126..ccceb00 100644
--- a/src/main/java/org/apache/bsf/util/EngineUtils.java
+++ b/src/main/java/org/apache/bsf/util/EngineUtils.java
@@ -296,7 +296,7 @@ public class EngineUtils {
                 return "V";
             }
         } else {
-            final StringBuffer sb = new StringBuffer("L");
+            final StringBuilder sb = new StringBuilder("L");
             sb.append(cl.getName());
             sb.append(";");
             return sb.toString().replace('.', '/');
diff --git a/src/main/java/org/apache/bsf/util/MethodUtils.java b/src/main/java/org/apache/bsf/util/MethodUtils.java
index 6839cdd..4a352fc 100644
--- a/src/main/java/org/apache/bsf/util/MethodUtils.java
+++ b/src/main/java/org/apache/bsf/util/MethodUtils.java
@@ -82,7 +82,7 @@ public class MethodUtils {
                 return firstElement();
             }
             if (size() > 1) {
-                final StringBuffer buf = new StringBuffer();
+                final StringBuilder buf = new StringBuilder();
                 final Enumeration e = elements();
                 buf.append(e.nextElement());
                 while (e.hasMoreElements()) {
@@ -116,7 +116,7 @@ public class MethodUtils {
      * Internal subroutine for getEntryPoint(): Format arguments as a string describing the function being searched for. Used in verbose exceptions.
      */
     private static String callToString(final Class targetClass, final String methodName, final Class[] argTypes, final boolean isStaticReference) {
-        final StringBuffer buf = new StringBuffer();
+        final StringBuilder buf = new StringBuilder();
         if (isStaticReference) {
             buf.append("static ");
         }
diff --git a/src/main/java/org/apache/bsf/util/StringUtils.java b/src/main/java/org/apache/bsf/util/StringUtils.java
index e35c2b9..d17c6fd 100644
--- a/src/main/java/org/apache/bsf/util/StringUtils.java
+++ b/src/main/java/org/apache/bsf/util/StringUtils.java
@@ -63,7 +63,7 @@ public class StringUtils {
             return null;
         } else {
             final char[] charArray = str.toCharArray();
-            final StringBuffer sBuf = new StringBuffer();
+            final StringBuilder sBuf = new StringBuilder();
 
             for (int i = 0; i < charArray.length; i++) {
                 switch (charArray[i]) {
@@ -99,7 +99,7 @@ public class StringUtils {
             return "";
         }
 
-        final StringBuffer sRet = new StringBuffer(numberOfChars);
+        final StringBuilder sRet = new StringBuilder(numberOfChars);
 
         for (int i = 0; i < numberOfChars; i++) {
             sRet.append(theChar);
@@ -122,7 +122,7 @@ public class StringUtils {
     }
 
     public static String getCommaListFromVector(final Vector sourceVector) {
-        final StringBuffer strBuf = new StringBuffer();
+        final StringBuilder strBuf = new StringBuilder();
 
         for (int i = 0; i < sourceVector.size(); i++) {
             strBuf.append((i > 0 ? ", " : "") + sourceVector.elementAt(i));
@@ -175,7 +175,7 @@ public class StringUtils {
     // Handles multi-line strings.
     public static String getSafeString(final String scriptStr) {
         final BufferedReader in = new BufferedReader(new StringReader(scriptStr));
-        final StringBuffer strBuf = new StringBuffer();
+        final StringBuilder strBuf = new StringBuilder();
         String tempLine, previousLine = null;
 
         try {
@@ -241,7 +241,7 @@ public class StringUtils {
             return null;
         }
 
-        final StringBuffer strBuf = new StringBuffer();
+        final StringBuilder strBuf = new StringBuilder();
 
         final char[] chars = identifierName.toCharArray();
 
@@ -327,7 +327,7 @@ public class StringUtils {
             i++;
         }
 
-        final StringBuffer classNameBuf = new StringBuffer();
+        final StringBuilder classNameBuf = new StringBuilder();
 
         switch (classNameChars[i++]) {
         case 'B':
diff --git a/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java b/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
index 164a95d..74186f6 100644
--- a/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
+++ b/src/main/java/org/apache/bsf/util/cf/CodeFormatter.java
@@ -63,7 +63,7 @@ public class CodeFormatter {
     private int origIndent;
     private boolean inCPP_Comment;
 
-    private void addTok(final StringBuffer targetBuf, final StringBuffer tokBuf, final IndentWriter out) {
+    private void addTok(final StringBuilder targetBuf, final StringBuilder tokBuf, final IndentWriter out) {
         final int tokLength = tokBuf.length(), targetLength = targetBuf.length();
 
         if (indent + targetLength + tokLength > maxLineLength) {
@@ -160,7 +160,7 @@ public class CodeFormatter {
         char quoteChar = ' ';
         boolean inEscapeSequence = false;
         boolean inString = false;
-        final StringBuffer tokBuf = new StringBuffer(), targetBuf = new StringBuffer(hangingIndent + line.length());
+        final StringBuilder tokBuf = new StringBuilder(), targetBuf = new StringBuilder(hangingIndent + line.length());
 
         for (int i = 0; i < source.length; i++) {
             ch = source[i];