This is an automated email from the ASF dual-hosted git repository.

pjfanning pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 17de566ac6 TestPOIFSMiniStore: drop redundant ministore re-fetch 
(#1507)
17de566ac6 is described below

commit 17de566ac64dee14bc1c132b9b4972b9a21165b3
Author: PJ Fanning <[email protected]>
AuthorDate: Thu Oct 29 19:54:48 2026 +0000

    TestPOIFSMiniStore: drop redundant ministore re-fetch (#1507)
    
    getMiniStore() returns the same instance, so the reassignment was a no-op.
    Removing it makes ministore effectively final, so the assertThrows lambda
    can use it directly.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../java/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java 
b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java
index ef005bc665..5ee3814863 100644
--- a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java
+++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java
@@ -356,7 +356,7 @@ final class TestPOIFSMiniStore {
         assertEquals(POIFSConstants.FAT_SECTOR_BLOCK, fs.getNextBlock(1));
         assertEquals(POIFSConstants.UNUSED_BLOCK, fs.getNextBlock(2));
         // Ministore has no blocks, so can't iterate until used
-        assertThrows(IndexOutOfBoundsException.class, () -> 
fs.getMiniStore().getNextBlock(0), "Empty ministore has no blocks");
+        assertThrows(IndexOutOfBoundsException.class, () -> 
ministore.getNextBlock(0), "Empty ministore has no blocks");
 
         // Write a very small new document, will populate the ministore for us
         byte[] data = new byte[8];
@@ -374,8 +374,7 @@ final class TestPOIFSMiniStore {
         assertEquals(POIFSConstants.END_OF_CHAIN, ministore.getNextBlock(0));
         assertEquals(POIFSConstants.UNUSED_BLOCK, ministore.getNextBlock(1));
 
-        // Re-fetch the mini store, and add it a second time
-        ministore = fs.getMiniStore();
+        // Add it a second time
         fs.getRoot().createDocument("mini2", new ByteArrayInputStream(data));
 
         // Main unchanged, ministore has a second


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to