1 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
2 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:41:06.962127389 +0000
3 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:48:18.016328356 +0000
6 import java.io.Serializable;
8 -import org.apache.commons.logging.Log;
9 -import org.apache.commons.logging.LogFactory;
10 +import java.util.logging.Logger;
11 import org.pentaho.reporting.libraries.formula.lvalues.LValue;
12 import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair;
13 import org.pentaho.reporting.libraries.formula.parser.FormulaParseException;
16 public class Formula implements Serializable, Cloneable
18 - private static final Log logger = LogFactory.getLog(Formula.class);
19 + private static final Logger logger = Logger.getLogger(Formula.class.getName());
20 private LValue rootReference;
21 private static final long serialVersionUID = -1176925812499923546L;
24 final Type type = typeValuePair.getType();
25 if (type.isFlagSet(Type.ERROR_TYPE))
27 - logger.debug("Error: " + typeValuePair.getValue());
28 + logger.config("Error: " + typeValuePair.getValue());
30 else if (type.isFlagSet(Type.ARRAY_TYPE))
36 - logger.warn("Evaluation failed unexpectedly: ", e);
37 + logger.warning("Evaluation failed unexpectedly: " + e);
38 return new TypeValuePair(ErrorType.TYPE, LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
41 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
42 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:41:06.980127564 +0000
43 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:48:29.995445103 +0000
45 import org.pentaho.reporting.libraries.base.util.HashNMap;
46 import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
47 import org.pentaho.reporting.libraries.base.config.Configuration;
48 -import org.apache.commons.logging.Log;
49 -import org.apache.commons.logging.LogFactory;
51 +import java.util.logging.Logger;
54 * Creation-Date: 02.11.2006, 12:48:32
57 public class DefaultFunctionRegistry implements FunctionRegistry
59 - private static final Log logger = LogFactory.getLog(DefaultFunctionRegistry.class);
60 + private static final Logger logger = Logger.getLogger(DefaultFunctionRegistry.class.getName());
62 private static final String FUNCTIONS_PREFIX = "org.pentaho.reporting.libraries.formula.functions.";
63 private static final String[] EMPTY_ARRAY = new String[0];
65 final Function function = createFunction(aName);
68 - logger.debug ("There is no such function: " + aName);
69 + logger.config ("There is no such function: " + aName);
74 (functionClass, DefaultFunctionRegistry.class, Function.class);
77 - logger.debug ("There is no such function: " + name);
78 + logger.config ("There is no such function: " + name);
82 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
83 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:41:06.983127594 +0000
84 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:48:54.904687864 +0000
86 import org.pentaho.reporting.libraries.formula.typing.Type;
87 import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType;
88 import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType;
89 -import org.apache.commons.logging.Log;
90 -import org.apache.commons.logging.LogFactory;
91 +import java.util.logging.Logger;
94 * This function returns true if the parameter is of error and not of error type NA.
97 public class IsErrFunction implements Function
99 - private static final Log logger = LogFactory.getLog(IsErrFunction.class);
100 + private static final Logger logger = Logger.getLogger(IsErrFunction.class.getName());
101 private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
102 private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
103 private static final long serialVersionUID = 6749192734608313367L;
106 if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
108 - logger.warn ("Passing errors around is deprecated. Throw exceptions instead.");
109 + logger.warning("Passing errors around is deprecated. Throw exceptions instead.");
110 final ErrorValue na = (ErrorValue) value;
111 if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA)
113 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
114 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:41:06.984127603 +0000
115 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:49:05.917795194 +0000
117 import org.pentaho.reporting.libraries.formula.typing.Type;
118 import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType;
119 import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType;
120 -import org.apache.commons.logging.Log;
121 -import org.apache.commons.logging.LogFactory;
122 +import java.util.logging.Logger;
125 * This function returns true if the parameter is of error type NA.
128 private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
129 private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
130 - private static final Log logger = LogFactory.getLog(IsNaFunction.class);
131 + private static final Logger logger = Logger.getLogger(IsNaFunction.class.getName());
132 private static final long serialVersionUID = 1205462839536368718L;
134 public IsNaFunction()
137 if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
139 - logger.warn ("Passing errors around is deprecated. Throw exceptions instead.");
140 + logger.warning("Passing errors around is deprecated. Throw exceptions instead.");
141 final ErrorValue na = (ErrorValue) value;
142 if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA)
144 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
145 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:41:06.988127642 +0000
146 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:50:26.354579111 +0000
149 package org.pentaho.reporting.libraries.formula.lvalues;
151 -import org.apache.commons.logging.Log;
152 -import org.apache.commons.logging.LogFactory;
153 +import java.util.logging.Level;
154 +import java.util.logging.Logger;
155 import org.pentaho.reporting.libraries.formula.EvaluationException;
156 import org.pentaho.reporting.libraries.formula.FormulaContext;
157 import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
160 public class FormulaFunction extends AbstractLValue
162 - private static final Log logger = LogFactory.getLog(FormulaFunction.class);
163 + private static final Logger logger = Logger.getLogger(FormulaFunction.class.getName());
165 private static class FormulaParameterCallback implements ParameterCallback
168 final TypeValuePair converted = typeRegistry.convertTo(paramType, result);
169 if (converted == null)
171 - if (logger.isDebugEnabled())
172 + if (logger.isLoggable(Level.CONFIG))
174 - logger.debug("Failed to evaluate parameter " + pos + " on function " + function);
175 + logger.config("Failed to evaluate parameter " + pos + " on function " + function);
177 throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE);
183 - logger.error("Unexpected exception while evaluating", e);
184 + logger.severe("Unexpected exception while evaluating: " + e);
185 throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
188 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
189 --- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:41:06.961127380 +0000
190 +++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:47:11.376678905 +0000
192 import java.util.List;
193 import java.util.Locale;
195 -import org.apache.commons.logging.Log;
196 -import org.apache.commons.logging.LogFactory;
197 +import java.util.logging.Logger;
198 import org.pentaho.reporting.libraries.base.config.Configuration;
199 import org.pentaho.reporting.libraries.base.util.IOUtils;
200 import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
203 public class DefaultTypeRegistry implements TypeRegistry
205 - private static final Log logger = LogFactory.getLog(DefaultTypeRegistry.class);
206 + private static final Logger logger = Logger.getLogger(DefaultTypeRegistry.class.getName());
208 private static class ArrayConverterCallback implements ArrayCallback
214 - logger.warn("Assertation failure: Type declared to be a sequence, but no sequence found inside.");
215 + logger.warning("Assertation failure: Type declared to be a sequence, but no sequence found inside.");
216 throw TypeConversionException.getInstance();
223 - logger.warn("Assertation failure: Type declared to be array, but no array callback found inside.");
224 + logger.warning("Assertation failure: Type declared to be array, but no array callback found inside.");
225 throw TypeConversionException.getInstance();
232 - logger.warn("Assertation failure: Type declared to be array, but no array callback found inside.");
233 + logger.warning("Assertation failure: Type declared to be array, but no array callback found inside.");
234 throw TypeConversionException.getInstance();
237 --- a/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java
238 +++ b/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java
241 package org.pentaho.reporting.libraries.formula.function.logical;
243 -import org.apache.commons.logging.Log;
244 -import org.apache.commons.logging.LogFactory;
245 +import java.util.logging.Logger;
246 import org.pentaho.reporting.libraries.formula.ErrorValue;
247 import org.pentaho.reporting.libraries.formula.EvaluationException;
248 import org.pentaho.reporting.libraries.formula.FormulaContext;
251 public class IfNaFunction implements Function
253 - private static final Log logger = LogFactory.getLog(IfNaFunction.class);
254 + private static final Logger logger = Logger.getLogger(IfNaFunction.class.getName());
255 private static final long serialVersionUID = -7517668261071087411L;
257 public IfNaFunction()
259 value = parameters.getValue(0);
260 if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
262 - logger.warn("Passing errors around is deprecated. Throw exceptions instead.");
263 + logger.warning("Passing errors around is deprecated. Throw exceptions instead.");
264 final ErrorValue na = (ErrorValue) value;
265 if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA)