cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1450635 - /cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
Date Wed, 27 Feb 2013 07:15:34 GMT
Author: dkulp
Date: Wed Feb 27 07:15:34 2013
New Revision: 1450635

URL: http://svn.apache.org/r1450635
Log:
Merged revisions 1447912 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1447912 | dkulp | 2013-02-19 12:51:47 -0800 (Tue, 19 Feb 2013) | 18 lines

  Merged revisions 1446667 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

  ........
    r1446667 | dkulp | 2013-02-15 11:14:03 -0500 (Fri, 15 Feb 2013) | 10 lines

    Merged revisions 1446658 via  git cherry-pick from
    https://svn.apache.org/repos/asf/cxf/trunk

    ........
      r1446658 | dkulp | 2013-02-15 11:05:30 -0500 (Fri, 15 Feb 2013) | 2 lines

      Check if a policy is already registered to avoid a bunch of duplicates.

    ........

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java?rev=1450635&r1=1450634&r2=1450635&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
Wed Feb 27 07:15:34 2013
@@ -185,18 +185,20 @@ public class Wsdl11AttachmentPolicyProvi
                     
                     if (Constants.isPolicyElement(e.getElementType())
                         && !StringUtils.isEmpty(uri)) {
-                        try {
-                            Policy policy = builder.getPolicy(e.getElement());
-                            String fragement = "#" + uri;
-                            registry.register(fragement, policy);
-                            if (di.getBaseURI() == null) {
-                                registry.register(Integer.toString(di.hashCode()) + fragement,
policy);
-                            } else {
-                                registry.register(di.getBaseURI() + fragement, policy);
+                        
+                        String id = (di.getBaseURI() == null ? Integer.toString(di.hashCode())
: di.getBaseURI()) 
+                                + "#" + uri;
+                        Policy policy = registry.lookup(id);
+                        if (policy == null) {
+                            try {
+                                policy = builder.getPolicy(e.getElement());
+                                String fragement = "#" + uri;
+                                registry.register(fragement, policy);
+                                registry.register(id, policy);
+                            } catch (Exception policyEx) {
+                                //ignore the policy can not be built
+                                LOG.warning("Failed to build the policy '" + uri + "':" +
policyEx.getMessage());
                             }
-                        } catch (Exception policyEx) {
-                            //ignore the policy can not be built
-                            LOG.warning("Failed to build the policy '" + uri + "':" + policyEx.getMessage());
                         }
                     }
                 }



Mime
View raw message