(String text, Throwable exc)
| 282 | } |
| 283 | |
| 284 | public static void logException(String text, Throwable exc) |
| 285 | { |
| 286 | System.runFinalization(); |
| 287 | System.gc(); |
| 288 | |
| 289 | if (SwingUtilities.isEventDispatchThread()) { |
| 290 | StringBuilder string = new StringBuilder(512); |
| 291 | |
| 292 | string.append("<html><b>"); |
| 293 | string.append(text); |
| 294 | string.append("</b><br><br>"); |
| 295 | |
| 296 | string.append("<b>"); |
| 297 | string.append(exc.toString()); |
| 298 | string.append("</b><br><br>"); |
| 299 | |
| 300 | StackTraceElement[] trace = exc.getStackTrace(); |
| 301 | int count = 0; |
| 302 | for (StackTraceElement elem : trace) { |
| 303 | string.append(elem.toString()); |
| 304 | string.append("<br>"); |
| 305 | count++; if (count == 25) { |
| 306 | break; |
| 307 | } |
| 308 | } |
| 309 | string.append("</html>"); |
| 310 | JOptionPane.showMessageDialog(mainWindow, string, "Error", 0); |
| 311 | } else if (deferredException == null) { |
| 312 | deferredText = text; |
| 313 | deferredException = exc; |
| 314 | try { |
| 315 | SwingUtilities.invokeAndWait(new Runnable() { |
| 316 | public void run() { |
| 317 | Main.logException(Main.deferredText, Main.deferredException); |
| 318 | //Main.access$102(null); |
| 319 | //Main.access$002(null); |
| 320 | } } ); |
| 321 | } |
| 322 | catch (Throwable swingException) { |
| 323 | deferredException = null; |
| 324 | deferredText = null; |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | public static void dumpData(String text, byte[] data, int offset, int length) |
| 330 | { |
no test coverage detected