You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Jira)" <ji...@apache.org> on 2024/07/25 16:04:00 UTC
[jira] [Created] (COMPRESS-684) Why use assert rather than throwing an Exception
Sebb created COMPRESS-684:
-----------------------------
Summary: Why use assert rather than throwing an Exception
Key: COMPRESS-684
URL: https://issues.apache.org/jira/browse/COMPRESS-684
Project: Commons Compress
Issue Type: Bug
Reporter: Sebb
The code here uses assert:
[https://github.com/apache/commons-compress/blob/b6c6b1e71087ae3e31d1024069084512a243eed7/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java#L207]
This seems odd for user code, as the assert may be disabled.
It would be more usual to throw an Exception instead.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)