ifndef NoAWT static void cancelTimer(javax.swing.Timer timer) { if (timer != null) timer.stop(); } endifndef static void cancelTimer(java.util.Timer timer) { if (timer != null) timer.cancel(); } static void cancelTimer(O o) { if (o instanceof java.util.Timer) cancelTimer((java.util.Timer) o); ifndef NoAWT else if (o instanceof javax.swing.Timer) cancelTimer((javax.swing.Timer) o); endifndef else if (o instanceof AutoCloseable) pcall { ((AutoCloseable) o).close(); } }