From 53cfc2cc96708a999f15cbb17f9068db4c5a49b2 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 16 Dec 2023 12:09:02 +0000 Subject: [PATCH] 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 --- .../org/apache/poi/stress/TestAllFiles.java | 5 +++-- test-data/spreadsheet/stress.xls | Bin 61952 -> 61952 bytes 2 files changed, 3 insertions(+), 2 deletions(-) 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 275bc91d8e3bce379fb74880b23398a0902538b9..686638aa5314c5470251ba8362866fa8d796b083 100644 GIT binary patch delta 251 zcmZp8!rbtLd4pASy+x2H0|?YI@Gvj}VS^xo&&0sQaFPqbXJ%k#ut4IoFt9LKs3GK8 z8CV%CD#hUDu`#eQG)N=l*%=rZ8#o|*1|~j`Iu;;i+`Kn>Zz1E!$<=3N_^v~Q7_I{$ z3(MxEXCoLDPs$?9UZkR1|~j`Iu;-n*t|D-Zz1E4$<=3N__!EB!i)@D zj3CzLrDr1;70<{b%wPoB$&KK%g3R13cV1eK$Bco&0jRfuD@U4Xa^PFx$q{dPIQAS) Tozlj2i*d3di^%4Nw+$=+DkCTa -- 2.39.5