Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullpointer in AbstractRepositoryManager#handleRemoteIndexFile #476

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -739,12 +739,21 @@ private LocationProperties loadIndexFile(URI location, IProgressMonitor monitor)
private LocationProperties handleRemoteIndexFile(URI indexFileURI, IProgressMonitor monitor) {
ByteArrayOutputStream index = new ByteArrayOutputStream();
IStatus indexFileStatus = null;
indexFileStatus = getTransport().download(indexFileURI, index, monitor);
while (indexFileStatus.getCode() == IArtifactRepository.CODE_RETRY) {
indexFileStatus = getTransport().download(indexFileURI, index, monitor);
Transport transport = getTransport();
if (transport != null) {
indexFileStatus = transport.download(indexFileURI, index, monitor);
while (indexFileStatus.getCode() == IArtifactRepository.CODE_RETRY) {
indexFileStatus = transport.download(indexFileURI, index, monitor);
}
if (indexFileStatus != null && indexFileStatus.isOK())
return LocationProperties.create(new ByteArrayInputStream(index.toByteArray()));
} else {
try (InputStream openStream = indexFileURI.toURL().openStream()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My big concern here is that this masks a severe configuration problem. A problem likely to crop up elsewhere and a problem that, if not fixed will, will disable all kinds of functionality such as proxy support. Surely if one gets the index, something downstream will fail instead.

It would seem better to fail with some kind of message about the transport not being configured available and the like cause(s) for that.

return LocationProperties.create(openStream);
} catch (IOException e) {
// nothing more to do here...
}
}
if (indexFileStatus != null && indexFileStatus.isOK())
return LocationProperties.create(new ByteArrayInputStream(index.toByteArray()));
return LocationProperties.createEmptyIndexFile();
}

Expand Down
Loading