mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.intellij.execution;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -11,8 +12,8 @@ import java.util.List;
|
||||
public abstract class ConsoleFolding {
|
||||
public static final ExtensionPointName<ConsoleFolding> EP_NAME = ExtensionPointName.create("com.intellij.console.folding");
|
||||
|
||||
public abstract boolean shouldFoldLine(String line);
|
||||
public abstract boolean shouldFoldLine(@NotNull String line);
|
||||
|
||||
@Nullable
|
||||
public abstract String getPlaceholderText(List<String> lines);
|
||||
public abstract String getPlaceholderText(@NotNull List<String> lines);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.intellij.execution.console;
|
||||
|
||||
import com.intellij.execution.ConsoleFolding;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,12 +16,12 @@ public class SubstringConsoleFolding extends ConsoleFolding {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldFoldLine(String line) {
|
||||
public boolean shouldFoldLine(@NotNull String line) {
|
||||
return mySettings.shouldFoldLine(line);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlaceholderText(List<String> lines) {
|
||||
public String getPlaceholderText(@NotNull List<String> lines) {
|
||||
return " <" + lines.size() + " internal calls>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1133,7 +1133,8 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
toAdd.add(region);
|
||||
return;
|
||||
}
|
||||
current = foldingForLine(EditorHyperlinkSupport.getLineText(document, line, false));
|
||||
String lineText = EditorHyperlinkSupport.getLineText(document, line, false);
|
||||
current = foldingForLine(lineText);
|
||||
if (current != null) {
|
||||
myFolding.put(line, current);
|
||||
}
|
||||
@@ -1167,7 +1168,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static ConsoleFolding foldingForLine(String lineText) {
|
||||
private static ConsoleFolding foldingForLine(@NotNull String lineText) {
|
||||
for (ConsoleFolding folding : ConsoleFolding.EP_NAME.getExtensions()) {
|
||||
if (folding.shouldFoldLine(lineText)) {
|
||||
return folding;
|
||||
@@ -1832,12 +1833,12 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldFoldLine(String line) {
|
||||
public boolean shouldFoldLine(@NotNull String line) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlaceholderText(List<String> lines) {
|
||||
public String getPlaceholderText(@NotNull List<String> lines) {
|
||||
// Is not expected to be called.
|
||||
return "<...>";
|
||||
}
|
||||
|
||||
@@ -364,7 +364,8 @@ public class EditorHyperlinkSupport {
|
||||
}
|
||||
|
||||
|
||||
public static String getLineText(Document document, int lineNumber, boolean includeEol) {
|
||||
@NotNull
|
||||
public static String getLineText(@NotNull Document document, int lineNumber, boolean includeEol) {
|
||||
int endOffset = document.getLineEndOffset(lineNumber);
|
||||
if (includeEol && endOffset < document.getTextLength()) {
|
||||
endOffset++;
|
||||
|
||||
+3
-2
@@ -16,17 +16,18 @@
|
||||
package com.intellij.testFramework;
|
||||
|
||||
import com.intellij.execution.ConsoleFolding;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FailedTestDebugLogConsoleFolding extends ConsoleFolding {
|
||||
@Override
|
||||
public boolean shouldFoldLine(String line) {
|
||||
public boolean shouldFoldLine(@NotNull String line) {
|
||||
return line.indexOf(TestLoggerFactory.FAILED_TEST_DEBUG_OUTPUT_MARKER) != -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlaceholderText(List<String> lines) {
|
||||
public String getPlaceholderText(@NotNull List<String> lines) {
|
||||
return " <DEBUG log>";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user