This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205537 - Can't use OSGi bundles with '-' (dash) in their name
Summary: Can't use OSGi bundles with '-' (dash) in their name
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 7.2
Hardware: PC All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-24 18:04 UTC by Tomas Pavek
Modified: 2012-01-17 16:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2011-11-24 18:04:34 UTC
In NetBeans module project producing an OSGi bundle, it is not possible to have a dependency on an OSGi bundle containing '-' char in the name. It correctly appears in project.xml, but in the built JAR's manifest (in Require-Bundle section) the dash is substituted with underscore char (e.g. oracle.javatools_nodeps instead of oracle.javatools-nodeps), which then cannot be resolved at runtime.

In a native NetBeans module, the substituted underscore is somewhat handled by the module system and it works in the end.

In OSGi bundle this does not work. A possible workaround is to avoid a dependency on the bundle all together but specify individual packages using Import-Package directly in the manifest.mf of the project.

Not sure if this should be somewhat handled by Netigso at runtime, or the manifest generation should be fixed.
Comment 1 Jaroslav Tulach 2011-12-07 18:05:59 UTC
The conversion of the dependency (from '-' to '_') should not happen when generating entries into manifest in OSGi mode, I guess.
Comment 2 Jesse Glick 2011-12-07 18:43:20 UTC
What is the symbolic name of the dependency in this case? Is there is a small test case to look at?
Comment 3 Jesse Glick 2011-12-07 19:06:50 UTC
OK, so the dependency has

  Bundle-SymbolicName: oracle.javatools-nodeps

meaning that whatever creates Require-Bundle from project.xml indeed needs to leave the symbolic name untouched (beyond removing attributes after a semicolon).
Comment 4 Jaroslav Tulach 2012-01-16 16:26:38 UTC
ergonomics#0b9154a59a3b
Comment 5 Quality Engineering 2012-01-17 16:12:01 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/0b9154a59a3b
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #205537: Search for bundle variant with '-' if the '_' one is not found