| Summary: | NPE in resolver breaking classpath computation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | John Arthorne <john.arthorne> | ||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | ralf, tjwatson | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | 3.7 M2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
John Arthorne
Created attachment 178186 [details]
Log file
This looks like a new regression in the resolver. Here is the code:
if (namespace == null) {
System.err.println("Could not find matching capability for " + constraint.getVersionConstraint()); //$NON-NLS-1$
// TODO log error!!
}
String constraintName = constraint.getName();
GenericCapability[] matches = constraintName == null ?
namespace.get(constraintName) :
namespace.getAllValues();
The NPE occurs on the last line, due to "namespace" being null. It is clearly checking for null on namespace just above, but it doesn't do anything about it! So, the NPE happens immediately afterwards.
running with -clean should also fix the situation. But only temporarily. Anytime a resolve operation is needed you will hit this bug again. I got a fix and testcase I will attach. Created attachment 178231 [details]
patch + test
The NPE is a side-effect of a different bug. Resolved fragments that provide capabilities must provide their capabilities from their hosts. The resolver was not handling this correctly which caused the capabilities provided by the fragments to get dropped when the resolver got initialized.
I updated the fragment test to force a re-resolve from a cached state.
Patch released. I also updated the cached state meta-data version which forces the state to be reconstructed. This should allow us to upgrade from last weeks build to this weeks build without a -clean. *** Bug 324536 has been marked as a duplicate of this bug. *** |