[FELIX-4576] Bad Require-Capability generation when the SCR target filter has no parentheses
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1612595 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/resources/org/apache/felix/bundleplugin/scr.xsl b/bundleplugin/src/main/resources/org/apache/felix/bundleplugin/scr.xsl
index c233cc9..bc9caf0 100644
--- a/bundleplugin/src/main/resources/org/apache/felix/bundleplugin/scr.xsl
+++ b/bundleplugin/src/main/resources/org/apache/felix/bundleplugin/scr.xsl
@@ -68,7 +68,14 @@
</xsl:choose>
<xsl:choose>
<xsl:when test="@target">
- <xsl:value-of select="concat('filter:="(&(objectClass=', @interface, ')', @target, ')"')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with(@target, '(')">
+ <xsl:value-of select="concat('filter:="(&(objectClass=', @interface, ')', @target, ')"')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('filter:="(&(objectClass=', @interface, ')(', @target, '))"')"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('filter:="(objectClass=', @interface, ')"')"/>