Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-684

Why use assert rather than throwing an Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: