Minor refactoring in CompileEnvironmentUtil

This commit is contained in:
Alexander Udalov
2021-01-12 13:08:45 +01:00
committed by Alexander Udalov
parent 4374438ff1
commit 0fef890d1a
@@ -129,19 +129,17 @@ public class CompileEnvironmentUtil {
try (JarInputStream jis = new JarInputStream(new FileInputStream(jarPath))) { try (JarInputStream jis = new JarInputStream(new FileInputStream(jarPath))) {
while (true) { while (true) {
JarEntry e = jis.getNextJarEntry(); JarEntry e = jis.getNextJarEntry();
if (e == null) { if (e == null) break;
break;
} if (!FileUtilRt.extensionEquals(e.getName(), "class") ||
if (StringsKt.substringAfterLast(e.getName(), "/", e.getName()).equals("module-info.class")) { StringsKt.substringAfterLast(e.getName(), "/", e.getName()).equals("module-info.class")) {
continue; continue;
} }
if (resetJarTimestamps) { if (resetJarTimestamps) {
e.setTime(DOS_EPOCH); e.setTime(DOS_EPOCH);
} }
if (FileUtilRt.extensionEquals(e.getName(), "class")) { stream.putNextEntry(e);
stream.putNextEntry(e); FileUtil.copy(jis, stream);
FileUtil.copy(jis, stream);
}
} }
} }
} }