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

Converter PREFIX_ field not required to be public #2984

Closed bjhargrave closed 5 years ago

bjhargrave commented 5 years ago

Original bug ID: BZ#3116 From: @timothyjward Reported version: R7

bjhargrave commented 5 years ago

Comment author: @timothyjward

The Converter specification talks about the PREFIX field in section 707.4.4.4.1 however it doesn't state that the field must be public. Obviously this is the case for annotations and interfaces, but it may not be for Java Beans. It also doesn't say what should happen if there are multiple PREFIX entries defined at different points in the hierarchy of types (e.g. super types, super interfaces, implemented interfaces...)

bjhargrave commented 5 years ago

Comment author: @bjhargrave

The PREFIX field must be a public static final String constant. A PREFIX field only applies to fields declared on the same type as the PREFIX_ field.

For annotations, this is quite simple since PREFIX_ can only be public static final and there are no super types to be concerned with.

When the PREFIX_ text was copied from the DS spec to the Converter spec, it was not sufficient expanded to deal with the other Map-like types supported by Converter such as interfaces, DTO-like types and Java Beans.

Interfaces can have super interfaces, DTO-like types and Java Beans can have super types.

In all cases, PREFIX_ fields must be a public static final String constants.

Interfaces: PREFIX fields must only apply to members declared on the same type as the PREFIX field. This allows each interface in a hierarchy to declare a PREFIX_ field which only applies to the members declared on the same interface.

DTO-like types: A PREFIX field must only apply to fields declared on the same type as the PREFIX field. This allows each type in a hierarchy to declare a PREFIX_ field which only applies to the field declared on the same type.

Java Beans: A PREFIX field must only apply to bean properties declared on the same type as the PREFIX field. This allows each type in a hierarchy to declare a PREFIX_ field which only applies to the bean properties declared on the same type.

This clarification must be made for R8. We should discuss whether this is worthy of an errata for R7.

bjhargrave commented 5 years ago

Comment author: @bjhargrave

CPEG call: David to update for R8.

bjhargrave commented 5 years ago

Comment author: @bosschaert

Fixed in the spectext in commit 1395852689107a40c53e6c992c09da5aa72bd5af

bjhargrave commented 5 years ago

Comment author: @bosschaert

Fixed