commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r824620 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java
Date Tue, 13 Oct 2009 07:19:57 GMT
Author: henrib
Date: Tue Oct 13 07:19:57 2009
New Revision: 824620

URL: http://svn.apache.org/viewvc?rev=824620&view=rev
Log:
Reverted main to original author intended behavior

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java?rev=824620&r1=824619&r2=824620&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/Main.java Tue Oct 13 07:19:57
2009
@@ -29,7 +29,6 @@
  * @since 2.0
  */
 public class Main {
-
     /**
      * Test application for Jexl
      * 
@@ -45,24 +44,24 @@
         JexlEngine engine = new JexlEngine();
         JexlContext context = new HashMapContext();
         context.getVars().put("args", args);
-        try {
-            if (args.length == 1) {
-                Script script = engine.createScript(new File(args[0]));
-                Object value = script.execute(context);
-                System.out.println("Return value: " + value);
-            } else {
-                BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
-                String line;
-                System.out.print("> ");
-                while (null != (line = console.readLine())) {
+        if (args.length == 1) {
+            Script script = engine.createScript(new File(args[0]));
+            Object value = script.execute(context);
+            System.out.println("Return value: " + value);
+        } else {
+            BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
+            String line;
+            System.out.print("> ");
+            while (null != (line = console.readLine())) {
+                try {
                     Expression expression = engine.createExpression(line);
                     Object value = expression.evaluate(context);
                     System.out.println("Return value: " + value);
                     System.out.print("> ");
+                } catch (JexlException e) {
+                    System.out.println(e.getLocalizedMessage());
                 }
             }
-        } catch (JexlException e) {
-            System.out.println(e.getLocalizedMessage());
         }
     }
 }



Mime
View raw message