diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java index 4186c30ed2..d6222d1168 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java @@ -26,8 +26,10 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.Set; +import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.base.util.string.FlexibleStringExpander; +import org.apache.ofbiz.service.calendar.TemporalExpressions.Frequency; /** * Generic ResourceBundle Map Wrapper, given ResourceBundle allows it to be used as a Map @@ -36,6 +38,7 @@ import org.apache.ofbiz.base.util.string.FlexibleStringExpander; @SuppressWarnings("serial") public class ResourceBundleMapWrapper implements Map, Serializable { + public static final String module = Frequency.class.getName(); protected MapStack rbmwStack; protected ResourceBundle initialResourceBundle; protected Map context; @@ -122,8 +125,8 @@ public class ResourceBundleMapWrapper implements Map, Serializab try { String str = (String) value; return FlexibleStringExpander.expandString(str, context); - } catch (Exception e) { - // Potential ClassCastException - do nothing + } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return value; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java index 099f38ea98..ee2d1e49ba 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java @@ -248,7 +248,9 @@ public final class UelUtil { try { ReadOnlyExpression other = (ReadOnlyExpression) obj; return this.object.equals(other.object); - } catch (ClassCastException e) {} + } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); + } return false; } @@ -285,7 +287,9 @@ public final class UelUtil { try { BasicValueExpression other = (BasicValueExpression) obj; return this.varName.equals(other.varName); - } catch (ClassCastException e) {} + } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); + } return false; } @Override @@ -342,7 +346,9 @@ public final class UelUtil { BasicContext elContext = (BasicContext) context; elContext.variables.put(property.toString(), val); context.setPropertyResolved(true); - } catch (ClassCastException e) {} + } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); + } } } } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java index ac64e2c7d5..48f8fc55d9 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java @@ -445,7 +445,7 @@ public class FindServices { list = it.getPartialList(start+1, viewSize); // list starts at '1' listSize = it.getResultsSizeAfterPartialList(); } catch (ClassCastException | NullPointerException | GenericEntityException e) { - Debug.logInfo("Problem getting partial list" + e,module); + Debug.logInfo("Problem getting partial list" + e, module); } result.put("listSize", listSize); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java index 82e2f82c88..8a680e9850 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java @@ -435,7 +435,9 @@ public abstract class JdbcValueHandler { Debug.logWarning("Clob java-type used for java.lang.String. Use java.lang.String java-type instead.", module); ps.setString(parameterIndex, str); return; - } catch (ClassCastException e) {} + } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); + } ps.setClob(parameterIndex, (java.sql.Clob) obj); return; } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java index bd8e821c88..8d2842f8b9 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java @@ -35,7 +35,6 @@ import com.ibm.icu.util.Calendar; */ @SuppressWarnings("serial") public class TemporalExpressions implements Serializable { - public static final String module = TemporalExpressions.class.getName(); public static final TemporalExpression NullExpression = new Null(); // Expressions are evaluated from smallest unit of time to largest. // When unit of time is the same, then they are evaluated from @@ -58,6 +57,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a range of dates. */ public static class DateRange extends TemporalExpression { + public static final String module = DateRange.class.getName(); protected final org.apache.ofbiz.base.util.DateRange range; public DateRange(Date date) { @@ -95,6 +95,7 @@ public class TemporalExpressions implements Serializable { return this.range.equals(((DateRange) obj).range); } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -135,6 +136,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a day in the month. */ public static class DayInMonth extends TemporalExpression { + public static final String module = DayInMonth.class.getName(); protected final int dayOfWeek; protected final int occurrence; @@ -207,6 +209,7 @@ public class TemporalExpressions implements Serializable { return this.dayOfWeek == that.dayOfWeek && this.occurrence == that.occurrence; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -287,6 +290,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a day of month range. */ public static class DayOfMonthRange extends TemporalExpression { + public static final String module = DayOfMonthRange.class.getName(); protected final int end; protected final int start; @@ -338,6 +342,7 @@ public class TemporalExpressions implements Serializable { return this.start == that.start && this.end == that.end; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -403,6 +408,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a day of week range. */ public static class DayOfWeekRange extends TemporalExpression { + public static final String module = DayOfWeekRange.class.getName(); protected final int end; protected final int start; @@ -456,6 +462,7 @@ public class TemporalExpressions implements Serializable { return this.start == that.start && this.end == that.end; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -543,6 +550,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a difference of two temporal expressions. */ public static class Difference extends TemporalExpression { + public static final String module = Difference.class.getName(); protected final TemporalExpression excluded; protected final TemporalExpression included; @@ -591,6 +599,7 @@ public class TemporalExpressions implements Serializable { return this.included.equals(that.included) && this.excluded.equals(that.excluded); } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -644,8 +653,9 @@ public class TemporalExpressions implements Serializable { } } - /** A temporal expression that represents a frequency. */ + /* A temporal expression that represents a frequency. */ public static class Frequency extends TemporalExpression { + public static final String module = Frequency.class.getName(); protected final int freqCount; protected final int freqType; protected final Date start; @@ -705,6 +715,7 @@ public class TemporalExpressions implements Serializable { return this.start.equals(that.start) && this.freqType == that.freqType && this.freqCount == that.freqCount; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -807,6 +818,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents an hour range. */ public static class HourRange extends TemporalExpression { + public static final String module = HourRange.class.getName(); protected final int end; protected final int start; @@ -861,6 +873,7 @@ public class TemporalExpressions implements Serializable { return this.start == that.start && this.end == that.end; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -961,6 +974,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a mathematical intersection of all of its * member expressions. */ public static class Intersection extends TemporalExpression { + public static final String module = Intersection.class.getName(); protected final Set expressionSet; public Intersection(Set expressionSet) { @@ -1020,6 +1034,7 @@ public class TemporalExpressions implements Serializable { return this.expressionSet.equals(((Intersection) obj).expressionSet); } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -1088,6 +1103,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a minute range. */ public static class MinuteRange extends TemporalExpression { + public static final String module = MinuteRange.class.getName(); protected final int end; protected final int start; @@ -1142,6 +1158,7 @@ public class TemporalExpressions implements Serializable { return this.start == that.start && this.end == that.end; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -1238,6 +1255,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a month range. */ public static class MonthRange extends TemporalExpression { + public static final String module = MonthRange.class.getName(); protected final int end; protected final int start; @@ -1291,6 +1309,7 @@ public class TemporalExpressions implements Serializable { return this.start == that.start && this.end == that.end; } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -1395,6 +1414,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that provides a substitution for an excluded temporal expression. */ public static class Substitution extends TemporalExpression { + public static final String module = Substitution.class.getName(); protected final TemporalExpression excluded; protected final TemporalExpression included; protected final TemporalExpression substitute; @@ -1452,6 +1472,7 @@ public class TemporalExpressions implements Serializable { return this.included.equals(that.included) && this.excluded.equals(that.excluded) && this.substitute.equals(that.substitute); } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false; @@ -1518,6 +1539,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a mathematical union of all of its * member expressions. */ public static class Union extends TemporalExpression { + public static final String module = Union.class.getName(); protected final Set expressionSet; public Union(Set expressionSet) { @@ -1570,6 +1592,7 @@ public class TemporalExpressions implements Serializable { return this.expressionSet.equals(((Union) obj).expressionSet); } catch (ClassCastException e) { + Debug.logInfo(e.getMessage(), module); } } return false;