Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 71054 invoked from network); 13 Oct 2009 07:20:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Oct 2009 07:20:29 -0000 Received: (qmail 94946 invoked by uid 500); 13 Oct 2009 07:20:28 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 94874 invoked by uid 500); 13 Oct 2009 07:20:28 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 94865 invoked by uid 99); 13 Oct 2009 07:20:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 07:20:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 07:20:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DE0B623888FF; Tue, 13 Oct 2009 07:19:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: henrib@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091013071957.DE0B623888FF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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()); } } }