garydgregory commented on code in PR #1461:
URL: https://github.com/apache/cxf/pull/1461#discussion_r1346119365


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java:
##########
@@ -153,13 +153,14 @@ private Map<String, String> getHeaders(Message message) {
             return result;
         }
         for (Map.Entry<String, List<Object>> entry : headers.entrySet()) {
-            if (entry.getValue().size() == 1) {
-                Object value = entry.getValue().get(0);
+            List<Object> list = entry.getValue() != null ? entry.getValue() : 
Collections.emptyList();

Review Comment:
   @reta 
   I've asked. Our internal ticket only has the following log snippet 
(redacted):
   ```
   2023-10-02T15:40:07,050 [qtp1256142210-44] DEBUG: 127.0.0.1 - 127.0.0.1 
[02/Oct/2023:03:40:07 +0200] "POST / HTTP/1.1" 200 - 
   2023-10-02T15:40:07,050 [qtp1256142210-44] DEBUG: [Header 1] Date: Mon, 02 
Oct 2023 13:40:07 GMT
   2023-10-02T15:40:07,050 [qtp1256142210-44] DEBUG: [Header 2] Content-Type: 
application/json;charset=utf-8
   2023-10-02T15:40:07,050 [qtp1256142210-44] DEBUG: ... more headers will 
added later in the pipeline.
   2023-10-02T15:40:07,269 [qtp1256142210-21] DEBUG: CXF SOAP Servlet 
[OurWSS4JInInterceptor] soapMsg: 
com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@52a09527, functionName: 
urn:redacted
   Oct 02, 2023 3:40:07 PM org.apache.cxf.phase.PhaseInterceptorChain 
doDefaultLogging
   WARNING: Interceptor for 
{http://soap.comm.server.appinterface.redacted.com/}RedactedWebServiceProviderService#{http://soap.comm.server.appinterface.redacted.com/}invoke
 has thrown exception, unwinding now
   java.lang.NullPointerException: Cannot invoke "java.util.List.size()" 
because the return value of "java.util.Map$Entry.getValue()" is null
   ...<as posted in the CXF issue>...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to