From aa5887012722bb554470b5091f415659a7861e93 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sat, 10 Oct 2026 04:48:28 -0400 Subject: [PATCH] Stop ignoring errors when extracting a Checker Framework release When the release zip or its checker-javadoc.jar could not be extracted, the generator printed the ZipException and carried on. For the release zip, it then moved the zip into cf/ and failed on the missing directory with an unrelated FileNotFoundException; locally the zip in cf/ marks the release as downloaded, so later runs skip it and never create its page. For the Javadoc, it published the release without its API documentation. Let the ZipException propagate, before the zip is moved into cf/ in the first case, and close the zip files. Co-Authored-By: Claude Opus 5.5 --- .../eisop/website/EisopSiteGenerator.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/github/eisop/website/EisopSiteGenerator.java b/src/main/java/io/github/eisop/website/EisopSiteGenerator.java index f66a291e..cab48306 100644 --- a/src/main/java/io/github/eisop/website/EisopSiteGenerator.java +++ b/src/main/java/io/github/eisop/website/EisopSiteGenerator.java @@ -192,15 +192,15 @@ public static void main(String[] args) throws IOException { String assetName = String.valueOf(latestAssetsData.get("name")); String assetBaseName = assetName.substring(0, assetName.length() - 4); File unzippedFile = new File(assetBaseName); - try { - ZipFile zipFile = new ZipFile(fileTest); + // A zip that cannot be extracted must stop the run here, before the zip is moved into + // cf/: a zip in cf/ counts as published and is never extracted again. + try (ZipFile zipFile = new ZipFile(fileTest)) { if (zipFile.isEncrypted()) { - throw new RuntimeException( - "Encountered an encrypted zip file, which was not expected."); + throw new IOException( + "Encountered an encrypted zip file, which was not expected: " + + fileTest); } zipFile.extractAll(assetBaseName); - } catch (ZipException e) { - e.printStackTrace(); } FileUtils.moveFileToDirectory(fileTest, directoryPath, false); @@ -227,12 +227,9 @@ public static void main(String[] args) throws IOException { if (releaseJavadoc.exists()) { FileUtils.moveFileToDirectory(releaseJavadoc, javadocFolder, false); File unzippedJavadoc = new File(javadocFolder, "checker-javadoc.jar"); - try { - ZipFile zipFile = new ZipFile(unzippedJavadoc); + try (ZipFile zipFile = new ZipFile(unzippedJavadoc)) { zipFile.extractAll( new File(javadocFolder, "checker-javadoc").getAbsolutePath()); - } catch (ZipException e) { - e.printStackTrace(); } FileUtils.forceDelete(unzippedJavadoc); }