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

Calling SevenZFile.read() on empty SevenZArchiveEntry throws IllegalStateException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.11
    • Fix Version/s: 1.12
    • Component/s: None
    • Labels:
      None

      Description

      I'm pretty sure COMPRESS-340 breaks reading empty archive entries. When calling getNextEntry() and that entry has no content, the code jumps into the first block at line 830 (SevenZFile.class), clearing the deferredBlockStreams. When calling entry.read(...) afterwards an IllegalStateException ("No current 7z entry (call getNextEntry() first).") is thrown. IMHO, there should be another check for entry.getSize() == 0.

      This worked correctly up until 1.10.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jansohn Robin Jansohn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: