You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Xavier Hanin (JIRA)" <ji...@apache.org> on 2008/06/10 19:10:45 UTC
[jira] Resolved: (IVY-831) NPE in AbstractResolver.exists() if a
resource cannot be found
[ https://issues.apache.org/jira/browse/IVY-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xavier Hanin resolved IVY-831.
------------------------------
Resolution: Fixed
Indeed, I didn't check test code... Now the MockResolver fulfills the contract, and the Exception is clearer (quoting the resolver class name). Hence I mark this issue as resolved, feel free to reopen if you still have similar problems
> NPE in AbstractResolver.exists() if a resource cannot be found
> --------------------------------------------------------------
>
> Key: IVY-831
> URL: https://issues.apache.org/jira/browse/IVY-831
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-RC1
> Reporter: Erik-Berndt Scheper
> Assignee: Xavier Hanin
> Fix For: 2.0-RC1
>
>
> A NullPointerException occurs inAbstractResolver.exists(AbstractResolver.java:196) if a host cannot be found
> Reproducible with "ant coverage-report" behind a firewall with proxy install disabled.
> Resulting stack trace:
> {noformat}
> java.lang.NullPointerException
> at org.apache.ivy.plugins.resolver.AbstractResolver.exists(AbstractResolver.java:196)
> at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.addSourcesAndJavadocArtifactsIfPresent(PomModuleDescriptorParser.java:267)
> at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:246)
> at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:104)
> at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParserTest.testSimple(PomModuleDescriptorParserTest.java:89)
> {noformat}
> Offending code:
> {noformat}
> /**
> * Default implementation actually download the artifact Subclasses should overwrite this to
> * avoid the download
> */
> public boolean exists(Artifact artifact) {
> DownloadReport dr = download(new Artifact[] {artifact}, new DownloadOptions());
> ArtifactDownloadReport adr = dr.getArtifactReport(artifact);
> return adr.getDownloadStatus() != DownloadStatus.FAILED;
> }
> {noformat}
> If the DownloadReport instance is null, a NPE occurs
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.