You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/08/21 16:24:23 UTC
[I] isZipFile() does not enforce its null parameter contract [maven-jarsigner]
elharo opened a new issue, #99:
URL: https://github.com/apache/maven-jarsigner/issues/99
The Javadoc for `isZipFile()` states the parameter "must not be null", but there is no null check. Passing `null` causes `Files.newInputStream(null)` to throw NPE, which is silently caught, so `isZipFile(null)` returns `false` instead of throwing `NullPointerException` as the contract implies.
**File:** `JarSignerUtil.java:57`
**Suggested fix:** Add an explicit null check at the start of the method:
```java
public static boolean isZipFile(final File file) {
if (file == null) {
throw new NullPointerException("file");
}
// ... rest of method
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] isZipFile() does not enforce its null parameter contract [maven-jarsigner]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #99: isZipFile() does not enforce its null parameter contract
URL: https://github.com/apache/maven-jarsigner/issues/99
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org