Closed
Description
Anders Wallgren opened SPR-5275 and commented
This method throws an exception if the linked exception's message is null. I've patched it locally as follow:
/**
* Build a descriptive exception message for the given JMSException,
* incorporating a linked exception's message if appropriate.
* @param ex the JMSException to build a message for
* @return the descriptive message String
* @see javax.jms.JMSException#getLinkedException()
*/
public static String buildExceptionMessage(JMSException ex) {
String message = ex.getMessage();
Exception linkedEx = ex.getLinkedException();
if (linkedEx != null && (linkedEx.getMessage() == null || message.indexOf(linkedEx.getMessage()) == -1)) {
message = message + "; nested exception is " + linkedEx;
}
return message;
}
Affects: 2.5.6
Issue Links:
- JmsException.getMessage throws NPE if a cause doesn't have a message [SPR-5332] #10005 JmsException.getMessage throws NPE if a cause doesn't have a message ("is duplicated by")
- NullPointerException in JmsException [SPR-5402] #10075 NullPointerException in JmsException ("is duplicated by")
- NullPointerException in JmsUtils.buildExceptionMessage [SPR-5785] #10455 NullPointerException in JmsUtils.buildExceptionMessage ("is duplicated by")
- NullPointerException in JmsUtils.buildExceptionMessage() [SPR-5958] #10626 NullPointerException in JmsUtils.buildExceptionMessage() ("is duplicated by")
- NullPointerException can occur from JmsUtils.buildException [SPR-6052] #10721 NullPointerException can occur from JmsUtils.buildException ("is duplicated by")
- Possible NPE in JmsUtils.buildExceptionMessage and JmsException.getMessage [SPR-5470] #10143 Possible NPE in JmsUtils.buildExceptionMessage and JmsException.getMessage ("is duplicated by")