mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added EDT assert to comply with javadoc
This commit is contained in:
@@ -27,6 +27,7 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.annotation.Annotation;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.lang.annotation.ProblemGroup;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.HighlighterColors;
|
||||
@@ -80,7 +81,7 @@ public class HighlightInfo implements Segment {
|
||||
|
||||
final int navigationShift;
|
||||
|
||||
private volatile RangeHighlighterEx highlighter;// modified in EDT only
|
||||
volatile RangeHighlighterEx highlighter;// modified in EDT only
|
||||
|
||||
public List<Pair<IntentionActionDescriptor, TextRange>> quickFixActionRanges;
|
||||
public List<Pair<IntentionActionDescriptor, RangeMarker>> quickFixActionMarkers;
|
||||
@@ -168,6 +169,7 @@ public class HighlightInfo implements Segment {
|
||||
* modified in EDT only
|
||||
*/
|
||||
public void setHighlighter(@Nullable RangeHighlighterEx highlighter) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
this.highlighter = highlighter;
|
||||
}
|
||||
|
||||
|
||||
+7
-8
@@ -28,24 +28,23 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HighlightInfoComposite extends HighlightInfo {
|
||||
class HighlightInfoComposite extends HighlightInfo {
|
||||
@NonNls private static final String LINE_BREAK = "<hr size=1 noshade>";
|
||||
|
||||
public HighlightInfoComposite(@NotNull List<HighlightInfo> infos) {
|
||||
HighlightInfoComposite(@NotNull List<HighlightInfo> infos) {
|
||||
super(null, null, infos.get(0).type, infos.get(0).startOffset, infos.get(0).endOffset, createCompositeDescription(infos),
|
||||
createCompositeTooltip(infos), infos.get(0).type.getSeverity(null), false, null, false, 0, infos.get(0).getProblemGroup(), infos.get(0).getGutterIconRenderer());
|
||||
setHighlighter(infos.get(0).getHighlighter());
|
||||
highlighter = infos.get(0).getHighlighter();
|
||||
setGroup(infos.get(0).getGroup());
|
||||
List EMPTY = ContainerUtil.emptyList();
|
||||
List<Pair<IntentionActionDescriptor, RangeMarker>> markers = EMPTY;
|
||||
List<Pair<IntentionActionDescriptor, TextRange>> ranges = EMPTY;
|
||||
List<Pair<IntentionActionDescriptor, RangeMarker>> markers = ContainerUtil.emptyList();
|
||||
List<Pair<IntentionActionDescriptor, TextRange>> ranges = ContainerUtil.emptyList();
|
||||
for (HighlightInfo info : infos) {
|
||||
if (info.quickFixActionMarkers != null) {
|
||||
if (markers == EMPTY) markers = new ArrayList<>();
|
||||
if (markers == ContainerUtil.<Pair<IntentionActionDescriptor, RangeMarker>>emptyList()) markers = new ArrayList<>();
|
||||
markers.addAll(info.quickFixActionMarkers);
|
||||
}
|
||||
if (info.quickFixActionRanges != null) {
|
||||
if (ranges == EMPTY) ranges = new ArrayList<>();
|
||||
if (ranges == ContainerUtil.<Pair<IntentionActionDescriptor, TextRange>>emptyList()) ranges = new ArrayList<>();
|
||||
ranges.addAll(info.quickFixActionRanges);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user