void (@Nullable JComponent component) { if (component == null) return; if (isDispatchThread()) { return; } if (Boolean.TRUE.equals(component.getClientProperty(WAS_EVER_SHOWN))) { ThreadingAssertions.assertEventDispatchThread(); } else { JRootPane root = component.getRootPane(); if (root != null) { component.putClientProperty(WAS_EVER_SHOWN, Boolean.TRUE); ThreadingAssertions.assertEventDispatchThread(); } } }