Details
Description
Karaf feature resolver computation is prone to an error when same feature is defined in two descriptors. While it can be an user error, quite often this error is spot when feature generation is being used.
First occurrence of this error is seen in KARAF-6536 which links it with Windows and version ranges. I was able to reproduce issue with much simpler setup, validation with two feature files where one is "plain" and other is "aggregated".
Exception in thread "main" java.lang.StackOverflowError
at java.base/java.util.AbstractCollection.<init>(AbstractCollection.java:66)
at java.base/java.util.AbstractList.<init>(AbstractList.java:78)
at java.base/java.util.Collections$SingletonList.<init>(Collections.java:4837)
at java.base/java.util.Collections.singletonList(Collections.java:4823)
at org.apache.felix.utils.resource.SimpleFilter.parseSubstring(SimpleFilter.java:367)
at org.apache.felix.utils.resource.SimpleFilter.convert(SimpleFilter.java:564)
at org.apache.felix.utils.resource.RequirementImpl.getFilter(RequirementImpl.java:133)
at org.apache.felix.utils.resource.RequirementImpl.<init>(RequirementImpl.java:77)
at org.apache.felix.utils.resource.RequirementImpl.<init>(RequirementImpl.java:44)
at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:127)
at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:107)
at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:99)
at org.apache.karaf.features.internal.region.Subsystem.requireFeature(Subsystem.java:284)
at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:350)
at org.apache.karaf.features.internal.region.Subsystem.build(Subsystem.java:332)
at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:390)
at org.apache.karaf.features.internal.region.Subsystem.build(Subsystem.java:332)
at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:390)