ActionCallback (@NotNull List<? extends LibraryOrderEntry> orderEntriesContainingFile) { ThreadingAssertions.assertEventDispatchThread(); ActionCallback callback = new ActionCallback(); callback.setDone(); if (!mySrcFile.isValid()) return callback; if (myLibrary != getLibraryFromOrderEntriesList(orderEntriesContainingFile)) return callback; WriteAction.run(() -> addSourceFile(mySrcFile, myLibrary)); return callback; }