cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1445745 - in /cxf/branches/2.5.x-fixes/rt/ws/policy/src: main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java
Date Wed, 13 Feb 2013 17:09:06 GMT
Author: dkulp
Date: Wed Feb 13 17:09:05 2013
New Revision: 1445745

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

........
  r1445711 | dkulp | 2013-02-13 11:26:34 -0500 (Wed, 13 Feb 2013) | 18 lines

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

  ........
    r1445375 | dkulp | 2013-02-12 16:15:57 -0500 (Tue, 12 Feb 2013) | 10 lines

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

    ........
      r1444957 | dkulp | 2013-02-11 15:47:16 -0500 (Mon, 11 Feb 2013) | 2 lines

      Returning null matches the other providers and can avoid some expensive merges

    ........

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.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/external/ExternalAttachmentProvider.java?rev=1445745&r1=1445744&r2=1445745&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java
Wed Feb 13 17:09:05 2013
@@ -83,9 +83,12 @@ public class ExternalAttachmentProvider 
 
     public Policy getEffectivePolicy(BindingFaultInfo bfi) {
         readDocument();
-        Policy p = new Policy();
+        Policy p = null;
         for (PolicyAttachment pa : attachments) {
             if (pa.appliesTo(bfi)) {
+                if (p == null) {
+                    p = new Policy();
+                }
                 p = p.merge(pa.getPolicy());
             }
         }
@@ -95,21 +98,26 @@ public class ExternalAttachmentProvider 
 
     public Policy getEffectivePolicy(BindingMessageInfo bmi) {
         readDocument();
-        Policy p = new Policy();
+        Policy p = null;
         for (PolicyAttachment pa : attachments) {
             if (pa.appliesTo(bmi)) {
+                if (p == null) {
+                    p = new Policy();
+                }
                 p = p.merge(pa.getPolicy());
             }
         }
-                
         return p;
     }
 
     public Policy getEffectivePolicy(BindingOperationInfo boi) {
         readDocument();
-        Policy p = new Policy();
+        Policy p = null;
         for (PolicyAttachment pa : attachments) {
             if (pa.appliesTo(boi)) {
+                if (p == null) {
+                    p = new Policy();
+                }
                 p = p.merge(pa.getPolicy());
             }
         }
@@ -119,9 +127,12 @@ public class ExternalAttachmentProvider 
 
     public Policy getEffectivePolicy(EndpointInfo ei) {
         readDocument();
-        Policy p = new Policy();
+        Policy p = null;
         for (PolicyAttachment pa : attachments) {
             if (pa.appliesTo(ei)) {
+                if (p == null) {
+                    p = new Policy();
+                }
                 p = p.merge(pa.getPolicy());
             }
         }
@@ -131,9 +142,12 @@ public class ExternalAttachmentProvider 
 
     public Policy getEffectivePolicy(ServiceInfo si) {
         readDocument();
-        Policy p = new Policy();
+        Policy p = null;
         for (PolicyAttachment pa : attachments) {
             if (pa.appliesTo(si)) {
+                if (p == null) {
+                    p = new Policy();
+                }
                 p = p.merge(pa.getPolicy());
             }
         }

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java?rev=1445745&r1=1445744&r2=1445745&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java
Wed Feb 13 17:09:05 2013
@@ -84,7 +84,7 @@ public class ExternalAttachmentProviderT
         BindingFaultInfo bfi = control.createMock(BindingFaultInfo.class);
         setUpAttachment(bfi, false, eap);
         control.replay();
-        assertTrue(eap.getEffectivePolicy(bfi).isEmpty());
+        assertNull(eap.getEffectivePolicy(bfi));
         control.verify();
         
         control.reset();
@@ -100,7 +100,7 @@ public class ExternalAttachmentProviderT
         BindingMessageInfo bmi = control.createMock(BindingMessageInfo.class);
         setUpAttachment(bmi, false, eap);
         control.replay();
-        assertTrue(eap.getEffectivePolicy(bmi).isEmpty());
+        assertNull(eap.getEffectivePolicy(bmi));
         control.verify();
         
         control.reset();
@@ -116,7 +116,7 @@ public class ExternalAttachmentProviderT
         ExternalAttachmentProvider eap = new ExternalAttachmentProvider();
         setUpAttachment(boi, false, eap);
         control.replay();
-        assertTrue(eap.getEffectivePolicy(boi).isEmpty());
+        assertNull(eap.getEffectivePolicy(boi));
         control.verify();
         
         control.reset();
@@ -132,7 +132,7 @@ public class ExternalAttachmentProviderT
         EndpointInfo ei = control.createMock(EndpointInfo.class);
         setUpAttachment(ei, false, eap);
         control.replay();
-        assertTrue(eap.getEffectivePolicy(ei).isEmpty());
+        assertNull(eap.getEffectivePolicy(ei));
         control.verify();
         
         control.reset();
@@ -148,7 +148,7 @@ public class ExternalAttachmentProviderT
         ServiceInfo si = control.createMock(ServiceInfo.class);
         setUpAttachment(si, false, eap);
         control.replay();
-        assertTrue(eap.getEffectivePolicy(si).isEmpty());
+        assertNull(eap.getEffectivePolicy(si));
         control.verify();
         
         control.reset();



Mime
View raw message