I compare two bundles where the old version has a certain metatype file named "OSGI-INF/metatype/file1.xml" but the new bundle does not have it.
The old metatype looks like this
19.10.2018 10:49:51 *ERROR* Missing element AD in element OCD
Exception in thread "main" java.lang.NullPointerException
at net.distilledcode.tools.osgi.Comparison.toOCDMap(Comparison.java:100)
at net.distilledcode.tools.osgi.Comparison.lambda$nullSafe$12(Comparison.java:228)
at net.distilledcode.tools.osgi.Comparison.lambda$null$10(Comparison.java:220)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at net.distilledcode.tools.osgi.Comparison.lambda$tryAll$11(Comparison.java:223)
at net.distilledcode.tools.osgi.Comparison.valueOrDefault(Comparison.java:213)
at net.distilledcode.tools.osgi.Comparison.visitAsMap(Comparison.java:194)
at net.distilledcode.tools.osgi.Comparison.visitMetaType(Comparison.java:68)
at net.distilledcode.tools.osgi.Comparison.visit(Comparison.java:56)
at net.distilledcode.tools.osgi.MetadataDiff.diff(MetadataDiff.java:42)
at net.distilledcode.tools.osgi.MetadataDiff.main(MetadataDiff.java:26)
That is caused by the fact that ocds is null for metatypes not having any ADs.
Basically metatype < 1.3 didn't allow OCD not having any ADs. That was only relaxed in metatype 1.3 (OSGi R6). Unfortunately the maven-scr-plugin creates those invalid XMLs, therefore it would be nice if those edge cases could be covered as well.
I compare two bundles where the old version has a certain metatype file named "OSGI-INF/metatype/file1.xml" but the new bundle does not have it. The old metatype looks like this
The following exception is thrown then
That is caused by the fact that
ocds
isnull
for metatypes not having any ADs.Basically metatype < 1.3 didn't allow
OCD
not having anyADs
. That was only relaxed in metatype 1.3 (OSGi R6). Unfortunately the maven-scr-plugin creates those invalid XMLs, therefore it would be nice if those edge cases could be covered as well.