commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r429175 - /jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java
Date Sun, 06 Aug 2006 19:05:24 GMT
Author: rahul
Date: Sun Aug  6 12:05:23 2006
New Revision: 429175

URL: http://svn.apache.org/viewvc?rev=429175&view=rev
Log:
- Rename ScriptFactory#newScript to ScriptFactory#createNewScript for symmetry with ExpressionFactory
- Synchronize just the critical region for the parser

Modified:
    jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java

Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java?rev=429175&r1=429174&r2=429175&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java
(original)
+++ jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/ScriptFactory.java
Sun Aug  6 12:05:23 2006
@@ -96,7 +96,7 @@
      *      problem parsing the script.
      */
     public static Script createScript(String scriptText) throws Exception {
-        return getInstance().newScript(scriptText);
+        return getInstance().createNewScript(scriptText);
     }
 
     /**
@@ -152,23 +152,23 @@
      *  @return Script a new script
      *  @throws Exception for a variety of reasons - mostly malformed scripts
      */
-    protected Script newScript(String scriptText) throws Exception {
+    protected Script createNewScript(String scriptText) throws Exception {
         String cleanText = cleanScript(scriptText);
+        SimpleNode script;
         // Parse the Expression
         synchronized (parser) {
             log.debug("Parsing script: " + cleanText);
-            SimpleNode script;
             try {
                 script = parser.parse(new StringReader(cleanText));
             } catch (TokenMgrError tme) {
                 throw new ParseException(tme.getMessage());
             }
-            if (script instanceof ASTJexlScript) {
-                return new ScriptImpl(cleanText, (ASTJexlScript) script);
-            } else {
-                throw new IllegalStateException("Parsed script is not "
-                    + "an ASTJexlScript");
-            }
+        }
+        if (script instanceof ASTJexlScript) {
+            return new ScriptImpl(cleanText, (ASTJexlScript) script);
+        } else {
+            throw new IllegalStateException("Parsed script is not "
+                + "an ASTJexlScript");
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message