@Test public void testFormatting() { String msg = "some string"; String formattedMsg = OpenRemoteException.format(msg); Assert.assertTrue(formattedMsg.equals(msg)); }
protected static String format(String msg, Object... params) { try { return MessageFormat.format(msg, params); } catch (Throwable t) { return msg + " [EXCEPTION MESSAGE FORMATTING ERROR: " + t.getMessage().toUpperCase() + "]"; } }
OpenRemoteException extends Exception { protected static String format(String msg, Object... params) { try { return MessageFormat.format(msg, params); } catch (Throwable t) { return msg + " [EXCEPTION MESSAGE FORMATTING ERROR: " + t.getMessage().toUpperCase() + "]"; } } }
OpenRemoteException extends Exception { protected static String format(String msg, Object... params) { try { return MessageFormat.format(msg, params); } catch (Throwable t) { return msg + " [EXCEPTION MESSAGE FORMATTING ERROR: " + t.getMessage().toUpperCase() + "]"; } } OpenRemoteException(String msg);  OpenRemoteException(String msg, Object... params);  OpenRemoteException(String msg, Throwable cause);  OpenRemoteException(String msg, Throwable cause, Object... params); }
OpenRemoteException extends Exception { protected static String format(String msg, Object... params) { try { return MessageFormat.format(msg, params); } catch (Throwable t) { return msg + " [EXCEPTION MESSAGE FORMATTING ERROR: " + t.getMessage().toUpperCase() + "]"; } } OpenRemoteException(String msg);  OpenRemoteException(String msg, Object... params);  OpenRemoteException(String msg, Throwable cause);  OpenRemoteException(String msg, Throwable cause, Object... params);  }
OpenRemoteException extends Exception { protected static String format(String msg, Object... params) { try { return MessageFormat.format(msg, params); } catch (Throwable t) { return msg + " [EXCEPTION MESSAGE FORMATTING ERROR: " + t.getMessage().toUpperCase() + "]"; } } OpenRemoteException(String msg);  OpenRemoteException(String msg, Object... params);  OpenRemoteException(String msg, Throwable cause);  OpenRemoteException(String msg, Throwable cause, Object... params);   }