Issue Details (XML | Word | Printable)

Key: OSGI-630
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Costin Leau
Reporter: Dirk Mahler
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring OSGi

NPE in PackageAdminResolver caused by white spaces in Require-Bundle entry

Created: 08/Oct/08 11:03 AM   Updated: 05/Nov/08 04:06 AM
Component/s: CORE
Affects Version/s: 1.1.2
Fix Version/s: 1.2 M2

Time Tracking:
Not Specified

Environment: Equinox 3.4.0


 Description  « Hide
A NullPointerException In PackageAdminResolver:70 is thrown if the manifest entry Require-Bundle contains white spaces after the comma (e.g. Require-Bundle: bundleA;bundle-version="1.0.0", bundleB;bundle-version="1.0.0"). The bundle A get's resolved

The problem is the name for bundle B returned by OsgiHeaderUtils.parseRequiredBundleString() contains a white space (" bundleB") and pa.getBundles() therefore will
not find it:
String[] parsed = OsgiHeaderUtils.parseRequiredBundleString(entries[i]);
Bundle requiredBundle = pa.getBundles(parsed[0], parsed[1])[0];





 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Costin Leau added a comment - 08/Oct/08 11:27 AM
Thanks Dirk. I've checked the spec and the spaces seem to be allowed though this is not the case with ClassPath: and the package imports...
The workaround for the moment (as you've already identified) is to not use spaces.
Cheers,

Costin Leau added a comment - 08/Oct/08 01:40 PM
Hi Dirk. I've committed a fix which should be available in the next nightly build (see the related builds tag).
Let me know if it fixes your issues.