Repository navigation
Conversation
Felix applied the type of a typed attribute (name:Long=42) only for Provide-Capability, Require-Capability and Bundle-SymbolicName. Export-Package kept the value as a String, which fails ExportAnnotationsTestCase#testAttributes of the OSGi bundle annotations TCK. Import-Package, DynamicImport-Package, Require-Bundle and Fragment-Host dropped the type as well, so a list attribute there could never match a typed capability. The conversion now runs for all of these headers. A list value in a requirement header becomes one filter per element, so it matches a capability list that contains all of them. The version and specification-version check compares versions instead of strings, since version can now be typed.
Review summaryWhat it does: Typed attributes ( Verdict: The approach is sound and small, and it reuses the existing conversion code. The tests check both the parsed values and that the generated requirement matches the typed capability. CI is green on JDK 17/21/25/27. I reviewed by reading the code and did not run the build locally. No blocking issues, only the points below. Points to consider
Generated by Claude Code |
|
I will do some adjustments related to the review |
Malformed typed values, unknown attribute types and a mismatch of version and specification-version now fail with a BundleException (MANIFEST_ERROR) that names the attribute, instead of a raw NumberFormatException or IllegalArgumentException. Typed attributes are converted for R4 bundles only in Import-Package, DynamicImport-Package and Export-Package, so R3 bundles keep dropping unknown attributes with a warning. The version, specification-version and bundle-version attributes must be of type String or Version. Since the previous commit compares versions instead of strings, version="1.0" and specification-version="1.0.0" are now accepted as equal, which was rejected before. An empty list in a requirement header now only requires the attribute to be present instead of matching any capability. The list semantics are documented on SimpleFilter.convert. The attribute types are cleared after conversion, so converting a clause again does not split a list a second time. Adds tests for a single bounded version range, empty lists, values that must not match, malformed values, unknown types, R3 bundles and a typed bundle-version on Require-Bundle and Fragment-Host.
|
@paulrutter
A second review pass found one more issue, also fixed in this commit: typed attributes are now only converted for R4 bundles in |
Felix applied the type of a typed attribute (name:Long=42) only for Provide-Capability, Require-Capability and Bundle-SymbolicName. Export-Package kept the value as a String, which fails ExportAnnotationsTestCase#testAttributes of the OSGi bundle annotations TCK. Import-Package, DynamicImport-Package, Require-Bundle and Fragment-Host dropped the type as well, so a list attribute there could never match a typed capability.
The conversion now runs for all of these headers. A list value in a requirement header becomes one filter per element, so it matches a capability list that contains all of them. The version and specification-version check compares versions instead of strings, since version can now be typed.
osgi/org.osgi.annotation.bundle#24