From e589ec876037b21ad395e5e91b7272aa15a840e9 Mon Sep 17 00:00:00 2001 From: bdaniel Date: Fri, 18 Feb 2011 04:29:00 +0000 Subject: Commit patch for TUSCANY-3836 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1071882 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sca-java-2.x/trunk/modules/builder') diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java index 1c958f70d4..c4dd9b4182 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java +++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java @@ -39,6 +39,7 @@ import org.apache.tuscany.sca.assembly.builder.BuilderContext; import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.PolicySubject; import org.w3c.dom.Document; @@ -67,6 +68,11 @@ public class PolicyAppliesToBuilderImpl extends PolicyAttachmentBuilderImpl { public Composite build(Composite composite, BuilderContext context) throws CompositeBuilderException { try { + + Definitions definitions = context.getDefinitions(); + if (definitions == null || (definitions.getPolicySets().isEmpty() && definitions.getExternalAttachments().isEmpty()) ) { + return composite; + } // create a DOM for the Domain Composite Infoset Document document = saveAsDOM(composite); -- cgit v1.2.3