private <T,U> void doAddExplicitExtension(@NotNull final KeyedExtensionCollector<T,U> instance, @NotNull final U key, @NotNull final T object) { instance.addExplicitExtension(key, object); Disposer.register(myParentDisposable, new Disposable() { @Override public void dispose() { instance.removeExplicitExtension(key, object); } }); }
private <T,U> void doAddExplicitExtension(@Nonnull final KeyedExtensionCollector<T,U> instance, @Nonnull final U key, @Nonnull final T object) { instance.addExplicitExtension(key, object); Disposer.register(myParentDisposable, new Disposable() { @Override public void dispose() { instance.removeExplicitExtension(key, object); } }); }