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))) {
while (true) {
JarEntry e = jis.getNextJarEntry();
if (e == null) {
break;
}
if (StringsKt.substringAfterLast(e.getName(), "/", e.getName()).equals("module-info.class")) {
if (e == null) break;
if (!FileUtilRt.extensionEquals(e.getName(), "class") ||
StringsKt.substringAfterLast(e.getName(), "/", e.getName()).equals("module-info.class")) {
continue;
}
if (resetJarTimestamps) {
e.setTime(DOS_EPOCH);
}
if (FileUtilRt.extensionEquals(e.getName(), "class")) {
stream.putNextEntry(e);
FileUtil.copy(jis, stream);
}
stream.putNextEntry(e);
FileUtil.copy(jis, stream);
}
}
}