From c1b073625abf00e15598fead9b11d9a126d75311 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 17 Feb 2022 11:05:23 +0000 Subject: [PATCH] [bug-65887] increase default max number of records git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898149 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/record/RecordFactory.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/poi/src/main/java/org/apache/poi/hssf/record/RecordFactory.java b/poi/src/main/java/org/apache/poi/hssf/record/RecordFactory.java index e0b8d54d45..d665ba0eb9 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/RecordFactory.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/RecordFactory.java @@ -35,7 +35,17 @@ public final class RecordFactory { private static final int NUM_RECORDS = 512; // how many records we read at max by default (can be adjusted via IOUtils) - private static final int MAX_NUMBER_OF_RECORDS = 2_000_000; + //increased to 5 million due to https://bz.apache.org/bugzilla/show_bug.cgi?id=65887 + private static final int DEFAULT_MAX_NUMBER_OF_RECORDS = 5_000_000; + private static int MAX_NUMBER_OF_RECORDS = DEFAULT_MAX_NUMBER_OF_RECORDS; + + public static void setMaxNumberOfRecords(int maxNumberOfRecords) { + MAX_NUMBER_OF_RECORDS = maxNumberOfRecords; + } + + public static int getMaxNumberOfRecords() { + return MAX_NUMBER_OF_RECORDS; + } private RecordFactory() {} -- 2.39.5