mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup, notnull
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.execution.filters;
|
||||
|
||||
import com.intellij.execution.ui.ConsoleView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,7 +26,7 @@ import java.util.List;
|
||||
public abstract class TextConsoleBuilder {
|
||||
public abstract ConsoleView getConsole();
|
||||
|
||||
public abstract void addFilter(Filter filter);
|
||||
public abstract void addFilter(@NotNull Filter filter);
|
||||
|
||||
public abstract void setViewer(boolean isViewer);
|
||||
|
||||
@@ -36,7 +37,7 @@ public abstract class TextConsoleBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextConsoleBuilder filters(List<Filter> filters) {
|
||||
public TextConsoleBuilder filters(@NotNull List<Filter> filters) {
|
||||
for (Filter filter : filters) {
|
||||
addFilter(filter);
|
||||
}
|
||||
|
||||
@@ -13,16 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.execution.filters;
|
||||
|
||||
import com.intellij.execution.impl.ConsoleViewImpl;
|
||||
import com.intellij.execution.ui.ConsoleView;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.SmartList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,15 +30,15 @@ import java.util.List;
|
||||
public class TextConsoleBuilderImpl extends TextConsoleBuilder {
|
||||
private final Project myProject;
|
||||
private final GlobalSearchScope myScope;
|
||||
private final ArrayList<Filter> myFilters = new ArrayList<>();
|
||||
private final List<Filter> myFilters = new SmartList<>();
|
||||
private boolean myViewer;
|
||||
private boolean myUsePredefinedMessageFilter = true;
|
||||
|
||||
public TextConsoleBuilderImpl(final Project project) {
|
||||
public TextConsoleBuilderImpl(@NotNull Project project) {
|
||||
this(project, GlobalSearchScope.allScope(project));
|
||||
}
|
||||
|
||||
public TextConsoleBuilderImpl(@NotNull final Project project, @NotNull GlobalSearchScope scope) {
|
||||
public TextConsoleBuilderImpl(@NotNull Project project, @NotNull GlobalSearchScope scope) {
|
||||
myProject = project;
|
||||
myScope = scope;
|
||||
}
|
||||
@@ -53,17 +52,18 @@ public class TextConsoleBuilderImpl extends TextConsoleBuilder {
|
||||
return consoleView;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected ConsoleView createConsole() {
|
||||
return new ConsoleViewImpl(myProject, myScope, myViewer, myUsePredefinedMessageFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFilter(final Filter filter) {
|
||||
public void addFilter(@NotNull Filter filter) {
|
||||
myFilters.add(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextConsoleBuilder filters(List<Filter> filters) {
|
||||
public TextConsoleBuilder filters(@NotNull List<Filter> filters) {
|
||||
myFilters.addAll(filters);
|
||||
return this;
|
||||
}
|
||||
@@ -73,6 +73,7 @@ public class TextConsoleBuilderImpl extends TextConsoleBuilder {
|
||||
myViewer = isViewer;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
@@ -81,7 +82,8 @@ public class TextConsoleBuilderImpl extends TextConsoleBuilder {
|
||||
return myScope;
|
||||
}
|
||||
|
||||
protected ArrayList<Filter> getFilters() {
|
||||
@NotNull
|
||||
protected List<Filter> getFilters() {
|
||||
return myFilters;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -19,6 +19,7 @@ import com.intellij.execution.filters.TextConsoleBuilderImpl;
|
||||
import com.intellij.execution.ui.ConsoleView;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Roman.Chernyatchik
|
||||
@@ -33,6 +34,7 @@ public class TestsConsoleBuilderImpl extends TextConsoleBuilderImpl {
|
||||
setUsePredefinedMessageFilter(usePredefinedMessageFilter);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ConsoleView createConsole() {
|
||||
return new TestsConsoleViewImpl(getProject(), getScope(), isViewer(), isUsePredefinedMessageFilter());
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.jetbrains.python.debugger.PyRunCythonExtensionsFilter;
|
||||
import com.jetbrains.python.run.PythonTracebackFilter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -56,7 +57,7 @@ public class PyDebugConsoleBuilder extends TextConsoleBuilder {
|
||||
return consoleView;
|
||||
}
|
||||
|
||||
public void addFilter(final Filter filter) {
|
||||
public void addFilter(@NotNull final Filter filter) {
|
||||
myFilters.add(filter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user