[bug-69714] refactor thread-local

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1926472 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2025-06-16 12:41:33 +00:00
parent f51cff5e76
commit 779358f309

View File

@ -120,7 +120,12 @@ public final class TempFile {
}
private static TempFileCreationStrategy getStrategy() {
TempFileCreationStrategy s = threadLocalStrategy.get();
return s == null ? strategy : s;
final TempFileCreationStrategy s = threadLocalStrategy.get();
if (s == null) {
threadLocalStrategy.remove();
return strategy;
} else {
return s;
}
}
}