aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2020-11-01 09:22:09 +0000
committerDominik Stadler <centic@apache.org>2020-11-01 09:22:09 +0000
commitd835bdef42a46f6b70baaf558e0a716914c2a2cb (patch)
treea0e5a1431acc98297c5f58515c0a9606eeeb5fce /src/testcases
parent232d734941d4a082841e42b9451f2ed1b540bf04 (diff)
downloadpoi-d835bdef42a46f6b70baaf558e0a716914c2a2cb.tar.gz
poi-d835bdef42a46f6b70baaf558e0a716914c2a2cb.zip
Fix file-handle-leaks when re-writing documents or slideshows
When replacing a directory, we should close the previous one Close some resources in tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1883038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java
index 128a86aadc..140794bca8 100644
--- a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java
+++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java
@@ -37,8 +37,8 @@ import org.junit.Test;
* Tests bugs for POIFSFileSystem
*/
public final class TestFileSystemBugs {
- private static POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
- private static POIDataSamples _ssSamples = POIDataSamples.getSpreadSheetInstance();
+ private static final POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
+ private static final POIDataSamples _ssSamples = POIDataSamples.getSpreadSheetInstance();
private List<POIFSFileSystem> openedFSs;
@@ -110,7 +110,7 @@ public final class TestFileSystemBugs {
assertTrue(entry.isDocumentEntry());
assertEquals("\u0001CompObj", entry.getName());
}
-
+
/**
* Ensure that a file with a corrupted property in the
* properties table can still be loaded, and the remaining
@@ -123,7 +123,7 @@ public final class TestFileSystemBugs {
DirectoryNode root = openSample("unknown_properties.msg");
assertEquals(42, root.getEntryCount());
}
-
+
/**
* With heavily nested documents, ensure we still re-write the same
*/