@Test public void testCreateFillsMessageFromCauseMessageParamWhenErrorMessageIsNull() { JMSException result = JMSExceptionSupport.create(null, new IOException(CAUSE_MESSAGE)); assertEquals(CAUSE_MESSAGE, result.getMessage()); }
public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null || message.isEmpty()) { message = cause.toString(); } } JMSException exception = new JMSException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; }
JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null || message.isEmpty()) { message = cause.toString(); } } JMSException exception = new JMSException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; } }
JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null || message.isEmpty()) { message = cause.toString(); } } JMSException exception = new JMSException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; }  }
JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null || message.isEmpty()) { message = cause.toString(); } } JMSException exception = new JMSException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; }  static JMSException create(String message, Throwable cause); static JMSException create(Throwable cause); static MessageEOFException createMessageEOFException(Throwable cause); static MessageFormatException createMessageFormatException(Throwable cause); static JMSRuntimeException createRuntimeException(Exception exception); }
JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null || message.isEmpty()) { message = cause.toString(); } } JMSException exception = new JMSException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; }  static JMSException create(String message, Throwable cause); static JMSException create(Throwable cause); static MessageEOFException createMessageEOFException(Throwable cause); static MessageFormatException createMessageFormatException(Throwable cause); static JMSRuntimeException createRuntimeException(Exception exception);  }