osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[RSA] Creation of EndpointDescription too strict wrt objectClass property #2583

Closed bjhargrave closed 9 years ago

bjhargrave commented 10 years ago

Original bug ID: BZ#2715 From: Jan Willem Janssen <janwillem.janssen@luminis.eu> Reported version: R6

bjhargrave commented 10 years ago

Comment author: Jan Willem Janssen <janwillem.janssen@luminis.eu>

The current implementation of #verifyObjectClassProperty as defined in EndpointDescription is too strict as it only accepts arrays of string values. This while the examples in the RSA specification v1.0 use non-array values for the objectClass property (for example, see page 322 of OSGi Enterprise r5).

The #verifyObjectClassProperty method should be made more lenient when it comes to the given value: either a non-null string-value or a non-null, non-empty, array of strings should be acceptable for the objectClass property.

bjhargrave commented 10 years ago

Comment author: @bjhargrave

For a ServiceRegistration, objectClass is always a String[]. So at runtime objectClass must be a String[]. See Table 122.1 where objectClass is defined as a String[]. objectClass is never a String.

The example on pg 322:

is wrong and that is what should be fixed. It should be:

com.acme.Foo

to signify it is an array.

bjhargrave commented 10 years ago

Comment author: @bjhargrave

(In reply to BJ Hargrave from comment BZ#1)

It should be:

com.acme.Foo

to signify it is an array.

Actually, that is how to do it for a DS xml file. For the endpoint description schema, it should be:

com.acme.Foo
bjhargrave commented 10 years ago

Comment author: Jan Willem Janssen <janwillem.janssen@luminis.eu>

Indeed objectClass is an array of strings, I probably was confused by the convenience method on bundle context that accepts a single string as objectClass.

Nevertheless, the example on page 322 should be modified to reflect this.

bjhargrave commented 9 years ago

Comment author: @bosschaert

Fixed in commit da8a6fabd25a129d3f6e762726f681593662de46