Uploaded image for project: 'ShrinkWrap Descriptors'
  1. ShrinkWrap Descriptors
  2. SHRINKDESC-20

BeansDescriptor should not fail if stream is empty

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 0.1.0
    • Fix Version/s: 0.1.4
    • Component/s: api
    • Labels:
      None
    • Affects:
      Compatibility/Configuration
    • Estimated Difficulty:
      Low

      Description

      beans.xml is permitted to be empty, in which case it simply serves to mark an archive as a bean archive. The BeansDescriptor should not choke if it tries to load an empty file.

        Gliffy Diagrams

          Activity

          Hide
          andygibson Andy Gibson added a comment -

          I've started looking at this, the JAXB unmarshaller fails on an empty stream when overall, the method should return an empty (newly created) descriptor.

          My proposal is to add functionality to look for an empty stream and if it is empty, create a new descriptor suitable for the model and return that instead. Non-empty streams will be passed off to the XML unmarshaller as is the current behavior.

          As it stands, this would be the behavior for all descriptor types, not just CDI beans.

          Show
          andygibson Andy Gibson added a comment - I've started looking at this, the JAXB unmarshaller fails on an empty stream when overall, the method should return an empty (newly created) descriptor. My proposal is to add functionality to look for an empty stream and if it is empty, create a new descriptor suitable for the model and return that instead. Non-empty streams will be passed off to the XML unmarshaller as is the current behavior. As it stands, this would be the behavior for all descriptor types, not just CDI beans.
          Hide
          alrubinger Andrew Rubinger added a comment -

          Andy provided us with a potential fix, though this has now fallen out-of-sync with the current backing model:

          https://github.com/andygibson/descriptors/commit/2a4bbd403dff44d91c5fa288549bdf0f1779ab2a

          Show
          alrubinger Andrew Rubinger added a comment - Andy provided us with a potential fix, though this has now fallen out-of-sync with the current backing model: https://github.com/andygibson/descriptors/commit/2a4bbd403dff44d91c5fa288549bdf0f1779ab2a
          Show
          alrubinger Andrew Rubinger added a comment - Upstream: https://github.com/shrinkwrap/descriptors/commit/e4ba790c2f530b2abe75ffbd7ca6b33631c348e4

            People

            • Assignee:
              andygibson Andy Gibson
              Reporter:
              dan.j.allen Dan Allen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development