Details

      Description

      Descriptors have a name, Descriptor.getDescriptorName, the DescriptorAsset should be a NamedAsset and use this name as default.

        Gliffy Diagrams

          Activity

          Hide
          alrubinger Andrew Rubinger added a comment -

          Great 1st issue for new contributors.

          Show
          alrubinger Andrew Rubinger added a comment - Great 1st issue for new contributors.
          Hide
          iapazmino Iván Pazmiño added a comment -

          Hi, I just want to make sure I understood.
          To fix this I would change DescriptorAsset to implement NamedAsset instead of Asset. Then, add a string field called name in DescriptorAsset which will be assigned with descriptor.getName() in the constructor. Finally add getter and setter for the new name field in DescriptorAsset.
          If so, please honor me with the assignment.

          Show
          iapazmino Iván Pazmiño added a comment - Hi, I just want to make sure I understood. To fix this I would change DescriptorAsset to implement NamedAsset instead of Asset. Then, add a string field called name in DescriptorAsset which will be assigned with descriptor.getName() in the constructor. Finally add getter and setter for the new name field in DescriptorAsset. If so, please honor me with the assignment.
          Hide
          alrubinger Andrew Rubinger added a comment -

          Ivan:

          Bingo. It's all yours. Make it so, and ping back here with a pull request.

          Though in terms of implementation, I'd instead take a Descriptor in the ctor, and NamedAsset:getName() would delegate to the instance var descriptor.getName(). So no extra String member required; hang onto the whole Descriptor I think.

          https://cla.jboss.org < Apply to the ShrinkWrap project
          http://community.jboss.org/docs/DOC-14304 < Dev Instructions

          Show
          alrubinger Andrew Rubinger added a comment - Ivan: Bingo. It's all yours. Make it so, and ping back here with a pull request. Though in terms of implementation, I'd instead take a Descriptor in the ctor, and NamedAsset:getName() would delegate to the instance var descriptor.getName(). So no extra String member required; hang onto the whole Descriptor I think. https://cla.jboss.org < Apply to the ShrinkWrap project http://community.jboss.org/docs/DOC-14304 < Dev Instructions
          Hide
          alrubinger Andrew Rubinger added a comment -

          And also: A simple test case somewhere. Everything gets tested.

          Show
          alrubinger Andrew Rubinger added a comment - And also: A simple test case somewhere. Everything gets tested.
          Hide
          iapazmino Iván Pazmiño added a comment -

          Hello Andrew,

          The changes were made and commited into my fork github.com/iapazmino/shrinkwrap, and the following files were affected:

          modified: extension-descriptors/pom.xml
          The pom was referencing to the 0.1.2 version of descriptors, but compilation failed because the method getDescriptorName was not available. This was fixed changing to the current version 0.1.5-SNAPSHOT

          modified: extension-descriptors/src/main/java/org/jboss/shrinkwrap/api/descriptors/DescriptorAsset.java
          The method public String getName() was implemented delegating to the descriptor instance

          modified: extension-descriptors/src/test/java/org/jboss/shrinkwrap/api/descriptors/DescriptorAssetTestCase.java
          Two test cases were added to ensure name is not changed. The first one makes an instance of descriptor providing a name; the second uses the default name.

          Show
          iapazmino Iván Pazmiño added a comment - Hello Andrew, The changes were made and commited into my fork github.com/iapazmino/shrinkwrap, and the following files were affected: modified: extension-descriptors/pom.xml The pom was referencing to the 0.1.2 version of descriptors, but compilation failed because the method getDescriptorName was not available. This was fixed changing to the current version 0.1.5-SNAPSHOT modified: extension-descriptors/src/main/java/org/jboss/shrinkwrap/api/descriptors/DescriptorAsset.java The method public String getName() was implemented delegating to the descriptor instance modified: extension-descriptors/src/test/java/org/jboss/shrinkwrap/api/descriptors/DescriptorAssetTestCase.java Two test cases were added to ensure name is not changed. The first one makes an instance of descriptor providing a name; the second uses the default name.
          Show
          alrubinger Andrew Rubinger added a comment - Upstream: https://github.com/shrinkwrap/shrinkwrap/commit/581bd23ebb824e167fae2c0ab0db655699ffd215 https://github.com/shrinkwrap/shrinkwrap/commit/d585752a680669d98b47d5e6ae639da144d07f4c

            People

            • Assignee:
              iapazmino Iván Pazmiño
              Reporter:
              aslak Aslak Knutsen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development