mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] generified ComponentManager.getDisposed()
to avoid unchecked warnings on composition
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,7 +38,7 @@ public interface ComponentManager extends UserDataHolder, Disposable {
|
||||
*
|
||||
* @param name the name of the component
|
||||
* @return component with given name or null if there is no such component
|
||||
* @see com.intellij.openapi.components.NamedComponent#getComponentName()
|
||||
* @see NamedComponent#getComponentName()
|
||||
*/
|
||||
BaseComponent getComponent(@NotNull String name);
|
||||
|
||||
@@ -94,5 +94,5 @@ public interface ComponentManager extends UserDataHolder, Disposable {
|
||||
* see {@link com.intellij.openapi.application.Application#invokeLater(Runnable, Condition)} for the usage example.
|
||||
*/
|
||||
@NotNull
|
||||
Condition getDisposed();
|
||||
}
|
||||
Condition<?> getDisposed();
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -145,7 +145,7 @@ public class MockComponentManager extends UserDataHolderBase implements Componen
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Condition getDisposed() {
|
||||
public Condition<?> getDisposed() {
|
||||
return Conditions.alwaysFalse();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -370,7 +370,7 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public final Condition getDisposed() {
|
||||
public final Condition<?> getDisposed() {
|
||||
return myDisposedCondition;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public class DummyProject extends UserDataHolderBase implements Project {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Condition getDisposed() {
|
||||
public Condition<?> getDisposed() {
|
||||
return o -> isDisposed();
|
||||
}
|
||||
|
||||
@@ -186,4 +186,4 @@ public class DummyProject extends UserDataHolderBase implements Project {
|
||||
public ComponentConfig getConfig(Class componentImplementation) {
|
||||
throw new UnsupportedOperationException("Method getConfig not implemented in " + getClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user