mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -417,6 +417,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
|
||||
|
||||
private static void duplicateHighlighters(MarkupModel to, MarkupModel from, int offset, TextRange textRange) {
|
||||
for (RangeHighlighter rangeHighlighter : from.getAllHighlighters()) {
|
||||
if (!rangeHighlighter.isValid()) continue;
|
||||
final int localOffset = textRange.getStartOffset();
|
||||
final int start = Math.max(rangeHighlighter.getStartOffset(), localOffset) - localOffset;
|
||||
final int end = Math.min(rangeHighlighter.getEndOffset(), textRange.getEndOffset()) - localOffset;
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.intellij.ui.TitledBorderWithMnemonic;
|
||||
import com.intellij.ui.TreeSpeedSearch;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.treeStructure.Tree;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
@@ -869,7 +870,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider {
|
||||
}
|
||||
|
||||
public void clearSelection() {
|
||||
if (myHighlighter != null && Arrays.asList(myEditor.getMarkupModel().getAllHighlighters()).contains(myHighlighter)) {
|
||||
if (myHighlighter != null && ArrayUtil.contains(myHighlighter, myEditor.getMarkupModel().getAllHighlighters())) {
|
||||
myHighlighter.dispose();
|
||||
myHighlighter = null;
|
||||
}
|
||||
|
||||
+1
@@ -788,6 +788,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
}
|
||||
|
||||
for (final RangeHighlighter highlighter : myEditor.getDocument().getMarkupModel(project).getAllHighlighters()) {
|
||||
if (!highlighter.isValid()) continue;
|
||||
addGutterIconRenderer(highlighter.getGutterIconRenderer(), highlighter.getStartOffset(), result);
|
||||
}
|
||||
return ContainerUtil.concat(result.values());
|
||||
|
||||
@@ -126,7 +126,7 @@ public class Assertion extends Assert {
|
||||
compareAll(expected.toArray(), actual);
|
||||
}
|
||||
|
||||
public void compareUnordered(Object[] expected, Collection actual) {
|
||||
public static void compareUnordered(Object[] expected, Collection actual) {
|
||||
assertEquals(expected.length, actual.size());
|
||||
for (Object exp : expected) {
|
||||
assertTrue(actual.contains(exp));
|
||||
@@ -142,11 +142,11 @@ public class Assertion extends Assert {
|
||||
//compareAll(expectedList, actualList);
|
||||
}
|
||||
|
||||
public void compareUnordered(Collection expected, Collection actual) {
|
||||
public static void compareUnordered(Collection expected, Collection actual) {
|
||||
compareUnordered(expected.toArray(), actual);
|
||||
}
|
||||
|
||||
public void compareUnordered(Collection expected, Object[] actual) {
|
||||
public static void compareUnordered(Collection expected, Object[] actual) {
|
||||
compareUnordered(expected, new ArrayList(Arrays.asList(actual)));
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ public class Assertion extends Assert {
|
||||
count(number, Arrays.asList(objects));
|
||||
}
|
||||
|
||||
public void compareUnordered(Object[] expected, Object[] actual) {
|
||||
public static void compareUnordered(Object[] expected, Object[] actual) {
|
||||
compareUnordered(expected, new HashSet(Arrays.asList(actual)));
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class Assertion extends Assert {
|
||||
compareAll(new int[]{element}, actual);
|
||||
}
|
||||
|
||||
public void size(int size, Collection collection) {
|
||||
public static void size(int size, Collection collection) {
|
||||
if (collection.size() != size) {
|
||||
System.err.println("Expected: " + size + " actual: " + collection.size());
|
||||
}
|
||||
@@ -268,7 +268,7 @@ public class Assertion extends Assert {
|
||||
}
|
||||
}
|
||||
|
||||
public <T> int countOccurences(Collection<T> collection, T item) {
|
||||
public static <T> int countOccurences(Collection<T> collection, T item) {
|
||||
int counter = 0;
|
||||
for (T obj : collection) {
|
||||
if (Comparing.equal(item, obj)) counter++;
|
||||
@@ -280,7 +280,7 @@ public class Assertion extends Assert {
|
||||
containsAll(collection, Arrays.asList(subArray));
|
||||
}
|
||||
|
||||
public void size(int size, Object[] objects) {
|
||||
public static void size(int size, Object[] objects) {
|
||||
size(size, Arrays.asList(objects));
|
||||
}
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ public abstract class MavenDomTestCase extends MavenImportingTestCase {
|
||||
RangeHighlighter[] highlighters = editor.getMarkupModel().getAllHighlighters();
|
||||
List<HighlightInfo> actual = new ArrayList<HighlightInfo>();
|
||||
for (RangeHighlighter each : highlighters) {
|
||||
if (!each.isValid()) continue;
|
||||
int offset = each.getStartOffset();
|
||||
PsiElement element = getTestPsiFile(file).findElementAt(offset);
|
||||
element = PsiTreeUtil.getParentOfType(element, XmlTag.class);
|
||||
|
||||
Reference in New Issue
Block a user