commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r784903 - in /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl: JexlArithmetic.java JexlEngine.java ScriptFactory.java
Date Mon, 15 Jun 2009 18:34:16 GMT
Author: grobmeier
Date: Mon Jun 15 18:34:16 2009
New Revision: 784903

URL: http://svn.apache.org/viewvc?rev=784903&view=rev
Log:
JEXL-56: removed references to wrong logging code
Contributed by Henri Biestro

Modified:
    commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
    commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java
    commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ScriptFactory.java

Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java?rev=784903&r1=784902&r2=784903&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
(original)
+++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
Mon Jun 15 18:34:16 2009
@@ -583,7 +583,7 @@
      * @param o Object to be analyzed.
      * @return true if it is a Float or a Double.
      */
-    public static boolean isFloatingPoint(final Object o) {
+    public boolean isFloatingPoint(final Object o) {
         return o instanceof Float || o instanceof Double;
     }
 
@@ -593,7 +593,7 @@
      * @param o Object to be analyzed.
      * @return true if Integer, Long, Byte, Short or Character.
      */
-    public static boolean isNumberable(final Object o) {
+    public boolean isNumberable(final Object o) {
         return o instanceof Integer
             || o instanceof Long
             || o instanceof Byte

Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java?rev=784903&r1=784902&r2=784903&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java (original)
+++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java Mon
Jun 15 18:34:16 2009
@@ -24,10 +24,8 @@
 import java.io.StringReader;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.logging.Logger;
-import java.util.logging.Level;
+import org.apache.commons.logging.*;
 
-import org.apache.commons.jexl.logging.LogManager;
 import org.apache.commons.jexl.parser.ParseException;
 import org.apache.commons.jexl.parser.Parser;
 import org.apache.commons.jexl.parser.SimpleNode;
@@ -55,7 +53,7 @@
     /**
      * The Log to which all JexlEngine messages will be logged.
      */
-    protected final Logger LOG;
+    protected final Log LOG;
     /**
      * The singleton ExpressionFactory also holds a single instance of
      * {@link Parser}.
@@ -87,10 +85,14 @@
      * @param arithmetic to allow different arithmetic behaviour
      * @param log the logger for various messages
      */
-    public JexlEngine(Uberspect uberspect, Arithmetic arithmetic, Logger log) {
+    public JexlEngine(Uberspect uberspect, Arithmetic arithmetic, Log log) {
         this.uberspect = uberspect == null? Introspector.getUberspect() : uberspect;
         this.arithmetic = arithmetic == null? new JexlArithmetic() : arithmetic;
-        this.LOG = log == null? LogManager.getLogger("org.apache.commons.jexl.JexlEngine")
: log;
+        if (log == null)
+            log = LogFactory.getLog(JexlEngine.class);
+        if (log == null)
+            throw new NullPointerException("logger can not be null");
+        this.LOG = log;
     }
     
     /**
@@ -125,8 +127,7 @@
         // Parse the Expression
         SimpleNode tree;
         synchronized (parser) {
-            if (LOG != null)
-                LOG.finest("Parsing expression: " + expr);
+            LOG.debug("Parsing expression: " + expr);
             try {
                 tree = parser.parse(new StringReader(expr));
             } catch (TokenMgrError tme) {
@@ -138,8 +139,8 @@
             }
         }
 
-        if (LOG != null && tree.jjtGetNumChildren() > 1 && LOG.isLoggable(Level.WARNING))
{
-            LOG.warning("The JEXL Expression created will be a reference"
+        if (tree.jjtGetNumChildren() > 1) {
+            LOG.warn("The JEXL Expression created will be a reference"
                 + " to the first expression from the supplied script: \""
                 + expression + "\" ");
         }
@@ -166,8 +167,7 @@
         SimpleNode script;
         // Parse the Expression
         synchronized (parser) {
-            if (LOG != null)
-                LOG.finest("Parsing script: " + cleanText);
+            LOG.debug("Parsing script: " + cleanText);
             try {
                 script = parser.parse(new StringReader(cleanText));
             } catch (TokenMgrError tme) {

Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ScriptFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ScriptFactory.java?rev=784903&r1=784902&r2=784903&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ScriptFactory.java (original)
+++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ScriptFactory.java Mon
Jun 15 18:34:16 2009
@@ -21,8 +21,6 @@
 import java.net.URL;
 
 import org.apache.commons.jexl.parser.Parser;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 
 /**
@@ -45,10 +43,6 @@
  */
 public class ScriptFactory {
 
-    /** The Log to which all ScriptFactory messages will be logged.*/
-    protected static Log log =
-        LogFactory.getLog("org.apache.commons.jexl.ScriptFactory");
-
     /**
      * The singleton ScriptFactory also holds a single instance of
      * {@link Parser}. When parsing expressions, ScriptFactory



Mime
View raw message