Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / external / jfreereport / patches / libformula-1.1.3-remove-commons-logging.patch.1
blob5a578cf56d083f6380c2189bc17141fd5b170288
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
4 @@ -19,8 +19,7 @@
5  
6  import java.io.Serializable;
7  
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;
14 @@ -40,7 +39,7 @@
15   */
16  public class Formula implements Serializable, Cloneable
17  {
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;
23 @@ -105,7 +104,7 @@
24        final Type type = typeValuePair.getType();
25        if (type.isFlagSet(Type.ERROR_TYPE))
26        {
27 -        logger.debug("Error: " + typeValuePair.getValue());
28 +        logger.config("Error: " + typeValuePair.getValue());
29        }
30        else if (type.isFlagSet(Type.ARRAY_TYPE))
31        {
32 @@ -131,7 +130,7 @@
33      }
34      catch (Exception e)
35      {
36 -      logger.warn("Evaluation failed unexpectedly: ", e);
37 +      logger.warning("Evaluation failed unexpectedly: " + e);
38        return new TypeValuePair(ErrorType.TYPE, LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
39      }
40    }
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
44 @@ -25,9 +25,7 @@
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;
53  /**
54   * Creation-Date: 02.11.2006, 12:48:32
55 @@ -36,7 +34,7 @@
56   */
57  public class DefaultFunctionRegistry implements FunctionRegistry
58  {
59 -  private static final Log logger = LogFactory.getLog(DefaultFunctionRegistry.class);
60 +  private static final Logger logger = Logger.getLogger(DefaultFunctionRegistry.class.getName());
61    
62    private static final String FUNCTIONS_PREFIX = "org.pentaho.reporting.libraries.formula.functions.";
63    private static final String[] EMPTY_ARRAY = new String[0];
64 @@ -72,7 +70,7 @@
65        final Function function = createFunction(aName);
66        if (function == null)
67        {
68 -        logger.debug ("There is no such function: " + aName);
69 +        logger.config ("There is no such function: " + aName);
70        }
71        else
72        {
73 @@ -132,7 +130,7 @@
74          (functionClass, DefaultFunctionRegistry.class, Function.class);
75      if (function == null)
76      {
77 -      logger.debug ("There is no such function: " + name);
78 +      logger.config ("There is no such function: " + name);
79      }
80      else
81      {
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
85 @@ -27,8 +27,7 @@
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;
93  /**
94   * This function returns true if the parameter is of error and not of error type NA.
95 @@ -37,7 +36,7 @@
96   */
97  public class IsErrFunction implements Function
98  {
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;
104 @@ -61,7 +60,7 @@
106        if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
107        {
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)
112          {
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
116 @@ -27,8 +27,7 @@
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;
124  /**
125   * This function returns true if the parameter is of error type NA.
126 @@ -39,7 +38,7 @@
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()
135 @@ -61,7 +60,7 @@
137        if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
138        {
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)
143          {
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
147 @@ -17,8 +17,8 @@
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;
158 @@ -44,7 +44,7 @@
159   */
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
166    {
167 @@ -74,9 +74,9 @@
168          final TypeValuePair converted = typeRegistry.convertTo(paramType, result);
169          if (converted == null)
170          {
171 -          if (logger.isDebugEnabled())
172 +          if (logger.isLoggable(Level.CONFIG))
173            {
174 -            logger.debug("Failed to evaluate parameter " + pos + " on function " + function);
175 +            logger.config("Failed to evaluate parameter " + pos + " on function " + function);
176            }
177            throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE);
178          }
179 @@ -228,7 +228,7 @@
180      }
181      catch (Exception e)
182      {
183 -      logger.error("Unexpected exception while evaluating", e);
184 +      logger.severe("Unexpected exception while evaluating: " + e);
185        throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE);
186      }
187    }
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
191 @@ -35,8 +35,7 @@
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;
201 @@ -66,7 +65,7 @@
202   */
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
209    {
210 @@ -599,7 +598,7 @@
211        }
212        else
213        {
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();
217        }
218      }
219 @@ -612,7 +611,7 @@
220        }
221        else
222        {
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();
226        }
227      }
228 @@ -651,7 +650,7 @@
229        }
230        else
231        {
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();
235        }
236      }
237 --- a/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java
238 +++ b/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java
239 @@ -17,8 +17,7 @@
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;
249 @@ -37,7 +36,7 @@
250   */
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()
258 @@ -67,7 +66,7 @@
259        value = parameters.getValue(0);
260        if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
261        {
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)
266          {