You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "M Kim (JIRA)" <ji...@apache.org> on 2015/02/16 18:35:11 UTC

[jira] [Updated] (IVY-1512) Dies in the constructor of StartRetrieveArtifactEvent

     [ https://issues.apache.org/jira/browse/IVY-1512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

M Kim updated IVY-1512:
-----------------------
    Summary: Dies in the constructor of StartRetrieveArtifactEvent  (was: Crash in the constructor of StartRetrieveArtifactEvent)

> Dies in the constructor of StartRetrieveArtifactEvent
> -----------------------------------------------------
>
>                 Key: IVY-1512
>                 URL: https://issues.apache.org/jira/browse/IVY-1512
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.4.0
>            Reporter: M Kim
>
> A NullPointerException is thrown in a constructor of StartRetrieveArtifactEvent. It crashes in addMridAttributes of IvyEvent.java.
> {code}
>     protected void addMridAttributes(ModuleRevisionId mrid) {
>         addModuleIdAttributes(mrid.getModuleId());  //NPE because mrid is null
>        //...
>     }
> {code}
> because IvyPublish$PublishArtifact.getModuleRevisionId() returns null no matter what in addArtifactAttributes method .
> {code}
>     protected void addArtifactAttributes(Artifact artifact) {
>         addMridAttributes(artifact.getModuleRevisionId()); //artifact.getModuleRevisionId() returns null from  IvyPublish$PublishArtifact.getModuleRevisionId()
>        //...
>     }
> {code} 
> <Stack Trace>
> {code}
> test(Test0)java.lang.NullPointerException
>         at org.apache.ivy.core.event.IvyEvent.addMridAttributes(IvyEvent.java:67)
>         at org.apache.ivy.core.event.retrieve.RetrieveArtifactEvent.addArtifactAttributes(RetrieveArtifactEvent.java:43)
>         at org.apache.ivy.core.event.retrieve.RetrieveArtifactEvent.<init>(RetrieveArtifactEvent.java:33)
>         at org.apache.ivy.core.event.retrieve.StartRetrieveArtifactEvent.<init>(StartRetrieveArtifactEvent.java:28)
>         at Test0.test(Test0.java:10)
> {code}
> <Test Case>
> {code}
> public void test() {
>   MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport((Artifact) new IvyPublish().createArtifact());
>   File file = new IvySetting().getDefaultCache();
>   StartRetrieveArtifactEvent event = new StartRetrieveArtifactEvent((ArtifactDownloadReport)report, file);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)