Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

DS 1.4 Component Property Type Annotations: Allow elements which only optionally create component properties #46

Open
kwin opened this issue Sep 30, 2020 · 1 comment
Assignees
Labels
publiccomment Public comment

Comments

@kwin
Copy link

kwin commented Sep 30, 2020

Although https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-component.property.value.coercion states

If there is no corresponding component property for a component property type method, the component property type method must:
...
Return null for String, Class, and enum.

This behaviour cannot be leveraged with annotations used on components. So if you want to use the annotation to express a specific component property to be either a String or not set at all, you cannot do that with an element of an already existing annotation (as JLS does not allow null as default value)

For a concrete use case look at https://issues.apache.org/jira/browse/SLING-2938?focusedCommentId=17199448&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17199448

@kwin kwin added the publiccomment Public comment label Sep 30, 2020
@kwin
Copy link
Author

kwin commented Sep 30, 2020

Currently it states

For component property type methods with a value of an empty array, a property element must not be generated.
(https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-ordering.generated.properties).

Would be nice to extend that to

For component property type methods with a value of an empty array or an empty string, a property element must not be generated.

@bjhargrave bjhargrave self-assigned this Sep 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
publiccomment Public comment
Projects
None yet
Development

No branches or pull requests

2 participants