Skip to content

Commit

Permalink
🥺 error messages are not jdk specs. ???
Browse files Browse the repository at this point in the history
  • Loading branch information
umjammer committed Feb 6, 2024
1 parent e8ca3e1 commit eb4d0cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/vavi/util/archive/zip/JdkZipArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void init(File file, String failsafeEncoding) throws IOException {
this.archive = new ZipFile(file, Charset.forName(encoding));
this.entries = entries();
} catch (ZipException e) {
if (failsafeEncoding != null && e.getMessage().contains("invalid CEN header (bad entry name or comment)")) {
if (failsafeEncoding != null && e.getMessage().contains("invalid CEN header")) {
Debug.println(Level.FINE, "zip reading failure by utf-8, retry using " + failsafeEncoding);
this.archive = new ZipFile(file, Charset.forName(failsafeEncoding));
this.entries = entries();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/vavi/util/archive/zip/JdkZipArchiveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void test22() throws Exception {
});
Debug.println("exception cause: " + e.getMessage());
assertInstanceOf(ZipException.class, e.getCause());
assertEquals("invalid CEN header (bad entry name or comment)", e.getCause().getMessage());
assertTrue(e.getCause().getMessage().contains("invalid CEN header"));
}

@Test
Expand Down Expand Up @@ -153,7 +153,7 @@ void test25() throws Exception {
IOException e = assertThrows(IOException.class, () -> Archives.getArchive(path.toFile()));
Debug.println("exception cause: " + e.getMessage());
assertInstanceOf(ZipException.class, e.getCause());
assertEquals("invalid CEN header (bad entry name or comment)", e.getCause().getMessage());
assertTrue(e.getCause().getMessage().contains("invalid CEN header"));
}

/** until Predicate#not release */
Expand Down

0 comments on commit eb4d0cf

Please sign in to comment.