summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-30 03:49:07 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-30 03:49:07 +0000
commit482eff11e6570bec192d9ad9ab9f25641e6e35ef (patch)
tree44936b894be116ea7fba7deefe97802d2cae544c /java
parent391774bfc9714b2e5229f735508b7fad2add4c75 (diff)
Only save the composite into DOM if there is a policySet with attachTo
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@820166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
index df98ec89b7..59cfdc7393 100644
--- a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
+++ b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
@@ -118,7 +118,7 @@ public class PolicyAttachmentBuilderImpl implements CompositeBuilder {
}
}
}
- Document document = saveAsDOM(composite);
+ Document document = null;
for (PolicySet ps : definitions.getPolicySets()) {
// First calculate the applicable nodes
@@ -135,6 +135,9 @@ public class PolicyAttachmentBuilderImpl implements CompositeBuilder {
*/
XPathExpression exp = ps.getAttachToXPathExpression();
if (exp != null) {
+ if (document == null) {
+ document = saveAsDOM(composite);
+ }
NodeList nodes = (NodeList)exp.evaluate(document, XPathConstants.NODESET);
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);