[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-432) ContainerBase.shallowCopy() is broken

Vineet Reynolds (JIRA) jira-events at lists.jboss.org
Tue Nov 27 10:02:21 EST 2012


    [ https://issues.jboss.org/browse/SHRINKWRAP-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737368#comment-12737368 ] 

Vineet Reynolds commented on SHRINKWRAP-432:
--------------------------------------------

Well, it appears easy to resolve that. I've tested modified my original change locally, from:

{code:java}
if (asset != null) {
  to.add(asset, path);
}
{code}

to:

{code:java}
if (asset != null) {
  to.add(asset, path);
} else {
  to.addAsDirectory(path);
}
{code}

This retains the original directories, but I'm not sure if this (use of {{addAsDirectory}}) obeys all the semantics expected of {{shallowCopy()}}. I'll investigate this more closely.
                
> ContainerBase.shallowCopy() is broken
> -------------------------------------
>
>                 Key: SHRINKWRAP-432
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-432
>             Project: ShrinkWrap
>          Issue Type: Bug
>            Reporter: Michal Matloka
>            Assignee: Vineet Reynolds
>              Labels: starter
>             Fix For: 1.1.1
>
>
> When archive contains directories, shallow copy throws exception due to
> {noformat}
>  for (final ArchivePath path : contents.keySet()) {
>      newArchive.add(contents.get(path).getAsset(), path);
>  }
> {noformat}
> because add(...) checks
> {noformat}
> Validate.notNull(asset, "No asset was specified");
> {noformat}
> it is possible that same bug concerns also ArchiveBase.shallowCopy()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the shrinkwrap-issues mailing list