]> source.dussan.org Git - poi.git/commitdiff
Allow all IndexOutOfBoundsException to have either empty message or some message
authorDominik Stadler <centic@apache.org>
Sat, 16 Dec 2023 12:09:02 +0000 (12:09 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 16 Dec 2023 12:09:02 +0000 (12:09 +0000)
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

poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java
test-data/spreadsheet/stress.xls

index 439ea627fc1ef89bac058236d701f6e662559732..2f40c13907cd504bd2dd15de5d721d9d6c9f9e1a 100644 (file)
@@ -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),
index 275bc91d8e3bce379fb74880b23398a0902538b9..686638aa5314c5470251ba8362866fa8d796b083 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ