cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject cxf git commit: [CXF-6653] NPE may result while generating a SequenceFault in WS-RM 1.1
Date Thu, 22 Oct 2015 15:42:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 7c5eda077 -> fb032c0e9


[CXF-6653] NPE may result while generating a SequenceFault in WS-RM 1.1


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fb032c0e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fb032c0e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fb032c0e

Branch: refs/heads/2.7.x-fixes
Commit: fb032c0e9235e8956cfd3104b8cfeb0b22c71eca
Parents: 7c5eda0
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Thu Oct 22 17:35:48 2015 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Thu Oct 22 17:42:00 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/fb032c0e/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
index bb150ad..70eac81 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
@@ -42,6 +42,7 @@ import org.apache.cxf.ws.rm.v200702.AckRequestedType;
 import org.apache.cxf.ws.rm.v200702.CloseSequenceType;
 import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
 import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
+import org.apache.cxf.ws.rm.v200702.DetailType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
@@ -166,16 +167,23 @@ public final class EncoderDecoder11Impl implements EncoderDecoder {
         }
         Element data = doc.getDocumentElement();
         if (data != null) {
-            flt.getDetail().getAny().add(data);
+            addDetail(flt, data);
         }
         data = sf.getExtraDetail();
         if (data != null) {
-            flt.getDetail().getAny().add(data);
+            addDetail(flt, data);
         }
         marshaller.marshal(new JAXBElement<SequenceFaultType>(fqname, SequenceFaultType.class,
flt), header);
         return header;
     }
 
+    private static void addDetail(SequenceFaultType sft, Element data) {
+        if (!sft.isSetDetail()) {
+            sft.setDetail(new DetailType());
+        }
+        sft.getDetail().getAny().add(data);
+    }
+
     public Element encodeSequenceAcknowledgement(SequenceAcknowledgement ack) throws JAXBException
{
         Document doc = DOMUtils.createDocument();
         Marshaller marshaller = getContext().createMarshaller();


Mime
View raw message