mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diagnostics & workaround for EA-118809 - IAE: SpeedSearchUtil.$$$reportNull$$$
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.navigation.ColoredItemPresentation;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
@@ -58,6 +59,7 @@ import java.util.regex.Pattern;
|
||||
import static com.intellij.openapi.vfs.newvfs.VfsPresentationUtil.getFileBackgroundColor;
|
||||
|
||||
public abstract class PsiElementListCellRenderer<T extends PsiElement> extends JPanel implements ListCellRenderer {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.ide.util.PsiElementListCellRenderer");
|
||||
private static final String LEFT = BorderLayout.WEST;
|
||||
private static final Pattern CONTAINER_PATTERN = Pattern.compile("(\\(in |\\()?([^)]*)(\\))?");
|
||||
|
||||
@@ -161,7 +163,10 @@ public abstract class PsiElementListCellRenderer<T extends PsiElement> extends J
|
||||
|
||||
if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color);
|
||||
|
||||
assert name != null : "Null name for PSI element " + element + " (by " + PsiElementListCellRenderer.this + ")";
|
||||
if (name == null) {
|
||||
LOG.error("Null name for PSI element " + element + " (by " + PsiElementListCellRenderer.this + ")");
|
||||
name = "Unknown";
|
||||
}
|
||||
SpeedSearchUtil.appendColoredFragmentForMatcher(name, this, nameAttributes, myMatchers.nameMatcher, bgColor, selected);
|
||||
if (!element.isValid()) {
|
||||
append(" Invalid", SimpleTextAttributes.ERROR_ATTRIBUTES);
|
||||
|
||||
Reference in New Issue
Block a user