You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/05/04 11:56:15 UTC
[commons-compress] 01/03: Reuse SystemUtils.IS_OS_WINDOWS
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 9148af7acef7f8df339bf50ba8ef61dc8d5902fe
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Apr 19 13:25:23 2023 -0400
Reuse SystemUtils.IS_OS_WINDOWS
---
src/test/java/org/apache/commons/compress/AbstractTestCase.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/AbstractTestCase.java b/src/test/java/org/apache/commons/compress/AbstractTestCase.java
index 69d98a39..33e1c4dc 100644
--- a/src/test/java/org/apache/commons/compress/AbstractTestCase.java
+++ b/src/test/java/org/apache/commons/compress/AbstractTestCase.java
@@ -41,6 +41,7 @@ import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.archivers.ArchiveStreamFactory;
+import org.apache.commons.lang3.SystemUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -50,9 +51,6 @@ public abstract class AbstractTestCase {
I wrap(InputStream in) throws Exception;
}
- private static final boolean ON_WINDOWS =
- System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows");
-
public static File getFile(final String path) throws IOException {
final URL url = AbstractTestCase.class.getClassLoader().getResource(path);
if (url == null) {
@@ -110,7 +108,7 @@ public abstract class AbstractTestCase {
*/
public static boolean tryHardToDelete(final File f) {
if (f != null && f.exists() && !f.delete()) {
- if (ON_WINDOWS) {
+ if (SystemUtils.IS_OS_WINDOWS) {
System.gc();
}
try {