Skip to content

bnd-maven-plugin: (Optionally) Fail for invalid DS field injections (missing volatile, invalid final or invalid type for multiple cardinality) #2860

@kwin

Description

@kwin

According to OSGi R7 Compendium 112.3.9.1

If the field is declared with the final modifier, SCR must log an error message with the Log Service, if
present, and the field must not be modified.{quote}

and

For a dynamic reference, the field must be declared with the volatile modifier so that field value
changes made by SCR are visible to other threads. If the field is not declared with the volatile modifier,
SCR must log an error message with the Log Service, if present, and the field must not be modified.

and

For a reference with multiple cardinality, the type of the field must be Collection or List. If the field
has a different type, SCR must log an error message with the Log Service, if present, and the field
must not be modified.

All issues lead to issues at run time and should therefore already lead to an exception at build time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions