Blame SOURCES/libformula-1.1.3-remove-commons-logging.patch

860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java	2021-02-23 14:41:06.962127389 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java	2021-02-23 14:48:18.016328356 +0000
860819
@@ -19,8 +19,7 @@
860819
 
860819
 import java.io.Serializable;
860819
 
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
+import java.util.logging.Logger;
860819
 import org.pentaho.reporting.libraries.formula.lvalues.LValue;
860819
 import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair;
860819
 import org.pentaho.reporting.libraries.formula.parser.FormulaParseException;
860819
@@ -40,7 +39,7 @@
860819
  */
860819
 public class Formula implements Serializable, Cloneable
860819
 {
860819
-  private static final Log logger = LogFactory.getLog(Formula.class);
860819
+  private static final Logger logger = Logger.getLogger(Formula.class.getName());
860819
   private LValue rootReference;
860819
   private static final long serialVersionUID = -1176925812499923546L;
860819
 
860819
@@ -105,7 +104,7 @@
860819
       final Type type = typeValuePair.getType();
860819
       if (type.isFlagSet(Type.ERROR_TYPE))
860819
       {
860819
-        logger.debug("Error: " + typeValuePair.getValue());
860819
+        logger.config("Error: " + typeValuePair.getValue());
860819
       }
860819
       else if (type.isFlagSet(Type.ARRAY_TYPE))
860819
       {
860819
@@ -131,7 +130,7 @@
860819
     }
860819
     catch (Exception e)
860819
     {
860819
-      logger.warn("Evaluation failed unexpectedly: ", e);
860819
+      logger.warning("Evaluation failed unexpectedly: " + e);
860819
       return new TypeValuePair(ErrorType.TYPE, LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
860819
     }
860819
   }
860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java	2021-02-23 14:41:06.980127564 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java	2021-02-23 14:48:29.995445103 +0000
860819
@@ -25,9 +25,7 @@
860819
 import org.pentaho.reporting.libraries.base.util.HashNMap;
860819
 import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
860819
 import org.pentaho.reporting.libraries.base.config.Configuration;
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
-
860819
+import java.util.logging.Logger;
860819
 
860819
 /**
860819
  * Creation-Date: 02.11.2006, 12:48:32
860819
@@ -36,7 +34,7 @@
860819
  */
860819
 public class DefaultFunctionRegistry implements FunctionRegistry
860819
 {
860819
-  private static final Log logger = LogFactory.getLog(DefaultFunctionRegistry.class);
860819
+  private static final Logger logger = Logger.getLogger(DefaultFunctionRegistry.class.getName());
860819
   
860819
   private static final String FUNCTIONS_PREFIX = "org.pentaho.reporting.libraries.formula.functions.";
860819
   private static final String[] EMPTY_ARRAY = new String[0];
860819
@@ -72,7 +70,7 @@
860819
       final Function function = createFunction(aName);
860819
       if (function == null)
860819
       {
860819
-        logger.debug ("There is no such function: " + aName);
860819
+        logger.config ("There is no such function: " + aName);
860819
       }
860819
       else
860819
       {
860819
@@ -132,7 +130,7 @@
860819
         (functionClass, DefaultFunctionRegistry.class, Function.class);
860819
     if (function == null)
860819
     {
860819
-      logger.debug ("There is no such function: " + name);
860819
+      logger.config ("There is no such function: " + name);
860819
     }
860819
     else
860819
     {
860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java	2021-02-23 14:41:06.983127594 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java	2021-02-23 14:48:54.904687864 +0000
860819
@@ -27,8 +27,7 @@
860819
 import org.pentaho.reporting.libraries.formula.typing.Type;
860819
 import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType;
860819
 import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType;
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
+import java.util.logging.Logger;
860819
 
860819
 /**
860819
  * This function returns true if the parameter is of error and not of error type NA.
860819
@@ -37,7 +36,7 @@
860819
  */
860819
 public class IsErrFunction implements Function
860819
 {
860819
-  private static final Log logger = LogFactory.getLog(IsErrFunction.class); 
860819
+  private static final Logger logger = Logger.getLogger(IsErrFunction.class.getName());
860819
   private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
860819
   private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
860819
   private static final long serialVersionUID = 6749192734608313367L;
860819
@@ -61,7 +60,7 @@
860819
 
860819
       if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
860819
       {
860819
-        logger.warn ("Passing errors around is deprecated. Throw exceptions instead.");
860819
+        logger.warning("Passing errors around is deprecated. Throw exceptions instead.");
860819
         final ErrorValue na = (ErrorValue) value;
860819
         if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA)
860819
         {
860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java	2021-02-23 14:41:06.984127603 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java	2021-02-23 14:49:05.917795194 +0000
860819
@@ -27,8 +27,7 @@
860819
 import org.pentaho.reporting.libraries.formula.typing.Type;
860819
 import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType;
860819
 import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType;
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
+import java.util.logging.Logger;
860819
 
860819
 /**
860819
  * This function returns true if the parameter is of error type NA.
860819
@@ -39,7 +38,7 @@
860819
 {
860819
   private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
860819
   private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
860819
-  private static final Log logger = LogFactory.getLog(IsNaFunction.class);
860819
+  private static final Logger logger = Logger.getLogger(IsNaFunction.class.getName());
860819
   private static final long serialVersionUID = 1205462839536368718L;
860819
 
860819
   public IsNaFunction()
860819
@@ -61,7 +60,7 @@
860819
 
860819
       if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
860819
       {
860819
-        logger.warn ("Passing errors around is deprecated. Throw exceptions instead.");
860819
+        logger.warning("Passing errors around is deprecated. Throw exceptions instead.");
860819
         final ErrorValue na = (ErrorValue) value;
860819
         if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA)
860819
         {
860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java	2021-02-23 14:41:06.988127642 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java	2021-02-23 14:50:26.354579111 +0000
860819
@@ -17,8 +17,8 @@
860819
 
860819
 package org.pentaho.reporting.libraries.formula.lvalues;
860819
 
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
+import java.util.logging.Level;
860819
+import java.util.logging.Logger;
860819
 import org.pentaho.reporting.libraries.formula.EvaluationException;
860819
 import org.pentaho.reporting.libraries.formula.FormulaContext;
860819
 import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
860819
@@ -44,7 +44,7 @@
860819
  */
860819
 public class FormulaFunction extends AbstractLValue
860819
 {
860819
-  private static final Log logger = LogFactory.getLog(FormulaFunction.class);
860819
+  private static final Logger logger = Logger.getLogger(FormulaFunction.class.getName());
860819
 
860819
   private static class FormulaParameterCallback implements ParameterCallback
860819
   {
860819
@@ -74,9 +74,9 @@
860819
         final TypeValuePair converted = typeRegistry.convertTo(paramType, result);
860819
         if (converted == null)
860819
         {
860819
-          if (logger.isDebugEnabled())
860819
+          if (logger.isLoggable(Level.CONFIG))
860819
           {
860819
-            logger.debug("Failed to evaluate parameter " + pos + " on function " + function);
860819
+            logger.config("Failed to evaluate parameter " + pos + " on function " + function);
860819
           }
860819
           throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE);
860819
         }
860819
@@ -228,7 +228,7 @@
860819
     }
860819
     catch (Exception e)
860819
     {
860819
-      logger.error("Unexpected exception while evaluating", e);
860819
+      logger.severe("Unexpected exception while evaluating: " + e);
860819
       throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
860819
     }
860819
   }
860819
diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java
860819
--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java	2021-02-23 14:41:06.961127380 +0000
860819
+++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java	2021-02-23 14:47:11.376678905 +0000
860819
@@ -35,8 +35,7 @@
860819
 import java.util.Locale;
860819
 import java.util.Collection;
860819
 
860819
-import org.apache.commons.logging.Log;
860819
-import org.apache.commons.logging.LogFactory;
860819
+import java.util.logging.Logger;
860819
 import org.pentaho.reporting.libraries.base.config.Configuration;
860819
 import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
860819
 import org.pentaho.reporting.libraries.formula.EvaluationException;
860819
@@ -66,7 +65,7 @@
860819
  */
860819
 public class DefaultTypeRegistry implements TypeRegistry
860819
 {
860819
-  private static final Log logger = LogFactory.getLog(DefaultTypeRegistry.class);
860819
+  private static final Logger logger = Logger.getLogger(DefaultTypeRegistry.class.getName());
860819
 
860819
   private static class ArrayConverterCallback implements ArrayCallback
860819
   {
860819
@@ -599,7 +598,7 @@
860819
       }
860819
       else
860819
       {
860819
-        logger.warn("Assertation failure: Type declared to be a sequence, but no sequence found inside.");
860819
+        logger.warning("Assertation failure: Type declared to be a sequence, but no sequence found inside.");
860819
         throw TypeConversionException.getInstance();
860819
       }
860819
     }
860819
@@ -612,7 +611,7 @@
860819
       }
860819
       else
860819
       {
860819
-        logger.warn("Assertation failure: Type declared to be array, but no array callback found inside.");
860819
+        logger.warning("Assertation failure: Type declared to be array, but no array callback found inside.");
860819
         throw TypeConversionException.getInstance();
860819
       }
860819
     }
860819
@@ -651,7 +650,7 @@
860819
       }
860819
       else
860819
       {
860819
-        logger.warn("Assertation failure: Type declared to be array, but no array callback found inside.");
860819
+        logger.warning("Assertation failure: Type declared to be array, but no array callback found inside.");
860819
         throw TypeConversionException.getInstance();
860819
       }
860819
     }