From: Dominik Stadler Date: Sat, 16 Dec 2023 12:09:02 +0000 (+0000) Subject: Allow all IndexOutOfBoundsException to have either empty message or some message X-Git-Tag: REL_5_3_0~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53cfc2cc96708a999f15cbb17f9068db4c5a49b2;p=poi.git Allow all IndexOutOfBoundsException to have either empty message or some message Newer JDKs add a more useful exception message, so we need to be a bit more lenient for these in integration tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914708 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java index 439ea627fc..2f40c13907 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java @@ -287,9 +287,10 @@ public class TestAllFiles { errPrefix + " for " + exClass + " expected message '" + exMessage + "' but had '" + actMsg + "': " + e); if (actMsg != null && - // sometimes ArrayIndexOutOfBoundsException has null-message?!? + // in newer JDK versions IndexOutOfBoundsException switch from empty message + // to more useful content // so skip the check for this type of exception if expected message is null - (exMessage != null || !ArrayIndexOutOfBoundsException.class.isAssignableFrom(exClass))) { + (exMessage != null || !IndexOutOfBoundsException.class.isAssignableFrom(exClass))) { assertNotNull(exMessage, errPrefix + "Expected message was null, but actMsg wasn't: Message: " + actMsg + ": " + e); assertTrue(actMsg.contains(exMessage), diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 275bc91d8e..686638aa53 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ