| Summary: | IllegalArgumentException in BundleManifestSourceLocationManager | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Gunnar Wagenknecht <gunnar> | ||||
| Component: | UI | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ankur_sharma, curtis.windatt.public, picard | ||||
| Version: | 3.7 | Flags: | ankur_sharma:
review+
|
||||
| Target Milestone: | 3.7 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Gunnar Wagenknecht
You are correct that this is from bad information in a source bundle header. We extract the name and version of the bundle that the source bundle provides source for. If the name or version does not exist, we ignore the source bundle, but if the version is invalid, we log an error. It would be good to understand what bundle is causing this problem. The bundle header is invalid, which is the purpose of the logged error. It is unfortunate that the error returned by the Version constructor doesn't say what the invalid argument was. The only option for PDE to handle this more gracefully is to ignore the bundle without logging. I figured that an incorrect header would be rare enough that a logged error would be helpful information. (In reply to comment #1) > The only option for PDE to handle this more gracefully is to ignore the bundle > without logging. I figured that an incorrect header would be rare enough that > a logged error would be helpful information. Logging a warning is ok. I just think the stack-trace isn't necessary. I also don't remember seeing the bundle name somewhere. Maybe the log message could say which bundle caused the issue? It just says "Problem processing bundle manifest source header". I just had the same issue and it took me hours to figure out that the version number from a source plugin from Orbit was incorrect.
The following easy patch would make everyone's life much easier, and can be applied easily and rapidly:
try {
version = new Version(versionEntry);
} catch (IllegalArgumentException e) {
PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader, versionEntry, currentPlugin.getName(), path.toString(), e));
}
and replace
PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader
with:
Problem processing bundle manifest source header, version: {0}, plugin: {1}, location: {2}
Thanks
Alain
Created attachment 194768 [details]
Fix
The fix provides a proper warning for the bad header. Ankur please review for RC1 inclusion. +1 Applied to HEAD Verified in I20110514-0800 |