From fb98b75ce9d2932ed5fd7c57b0aa24f5494829f5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 10 Mar 2023 18:01:09 +0100 Subject: [PATCH] IDEMPIERE-5542 [DisplayType] - Cache issue (#1717) - Fix problem with the AbstractXLSXExporter going wild, the method getFormatString is trying to create a format with the number of digits supported by the NumberFormat, and as the MaximumIntegerDigits is not set, is trying to create a String with the default which is 2147483647 --- .../src/org/compiere/util/DisplayType.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/DisplayType.java b/org.adempiere.base/src/org/compiere/util/DisplayType.java index d719bc6669..24183b1389 100644 --- a/org.adempiere.base/src/org/compiere/util/DisplayType.java +++ b/org.adempiere.base/src/org/compiere/util/DisplayType.java @@ -638,6 +638,10 @@ public final class DisplayType } else { + format.setMaximumIntegerDigits(MAX_DIGITS); + format.setMaximumFractionDigits(MAX_FRACTION); + format.setMinimumFractionDigits(1); + //not custom type, don't have to check factory if (displayType < 1000000) return format; @@ -665,10 +669,7 @@ public final class DisplayType } s_customDisplayTypeNegativeCache.put(customTypeKey, Boolean.TRUE); } - - format.setMaximumIntegerDigits(MAX_DIGITS); - format.setMaximumFractionDigits(MAX_FRACTION); - format.setMinimumFractionDigits(1); + } return format; } // getDecimalFormat