mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-242875 NPE on clicking on Coverage results on gutter
Dispose message bus connection before setting myPopupManager to null GitOrigin-RevId: 9f86bf6c18539471ea6417444bb6f67e2f203c93
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f4e451f973
commit
b4eceba7a8
+2
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.actionSystem.ex;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public interface AnActionListener {
|
||||
@Topic.AppLevel
|
||||
Topic<AnActionListener> TOPIC = new Topic<>(AnActionListener.class, Topic.BroadcastDirection.TO_DIRECT_CHILDREN, true);
|
||||
|
||||
default void beforeActionPerformed(@NotNull AnAction action, @NotNull DataContext dataContext, @NotNull AnActionEvent event) {
|
||||
|
||||
+9
-12
@@ -200,7 +200,6 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
@NotNull Dimension minimumSize) {
|
||||
|
||||
ActionButton actionButton = new ActionButton(action, presentation, place, minimumSize) {
|
||||
|
||||
@Override
|
||||
public void updateIcon() {
|
||||
super.updateIcon();
|
||||
@@ -299,7 +298,6 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
public void mouseExited(MouseEvent event) {
|
||||
myPopupManager.scheduleHide();
|
||||
}
|
||||
|
||||
});
|
||||
smallIconLabel.setOpaque(false);
|
||||
smallIconLabel.setBackground(new JBColor(() -> myEditor.getColorsScheme().getDefaultBackground()));
|
||||
@@ -336,7 +334,7 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
});
|
||||
myStatusUpdates = new MergingUpdateQueue(getClass().getName(), 50, true, MergingUpdateQueue.ANY_COMPONENT, resourcesDisposable);
|
||||
|
||||
myErrorStripeMarkersModel = new ErrorStripeMarkersModel(myEditor);
|
||||
myErrorStripeMarkersModel = new ErrorStripeMarkersModel(myEditor, resourcesDisposable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -593,7 +591,8 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
float rowRatio = (float)visualLine /(myEditor.getVisibleLineCount() - 1);
|
||||
int y = myRowAdjuster != 0 ? (int)(rowRatio * myEditor.getVerticalScrollBar().getHeight()) : me.getY();
|
||||
me = new MouseEvent(me.getComponent(), me.getID(), me.getWhen(), me.getModifiers(), me.getX(), y, me.getClickCount(), me.isPopupTrigger());
|
||||
@@ -781,6 +780,9 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
Disposer.dispose((Disposable)myErrorStripeRenderer);
|
||||
}
|
||||
myErrorStripeRenderer = renderer;
|
||||
if (renderer instanceof Disposable) {
|
||||
Disposer.register(resourcesDisposable, (Disposable)renderer);
|
||||
}
|
||||
//try to not cancel tooltips here, since it is being called after every writeAction, even to the console
|
||||
//HintManager.getInstance().getTooltipController().cancelTooltips();
|
||||
}
|
||||
@@ -792,12 +794,9 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
myErrorStripeMarkersModel.dispose();
|
||||
disposeErrorPanel();
|
||||
Disposer.dispose(resourcesDisposable);
|
||||
|
||||
if (myErrorStripeRenderer instanceof Disposable) {
|
||||
Disposer.dispose((Disposable)myErrorStripeRenderer);
|
||||
}
|
||||
disposeErrorPanel();
|
||||
|
||||
statusToolbar.getComponent().removeComponentListener(toolbarComponentListener);
|
||||
((JBScrollPane)myEditor.getScrollPane()).setStatusComponent(null);
|
||||
@@ -810,8 +809,6 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
myPopupManager = null;
|
||||
extensionActions.clear();
|
||||
|
||||
Disposer.dispose(resourcesDisposable);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -1333,7 +1330,7 @@ public final class EditorMarkupModelImpl extends MarkupModelImpl
|
||||
return getErrorPanel() != null;
|
||||
}
|
||||
|
||||
private static class BasicTooltipRendererProvider implements ErrorStripTooltipRendererProvider {
|
||||
private static final class BasicTooltipRendererProvider implements ErrorStripTooltipRendererProvider {
|
||||
@Override
|
||||
public TooltipRenderer calcTooltipRenderer(final @NotNull Collection<? extends RangeHighlighter> highlighters) {
|
||||
LineTooltipRenderer bigRenderer = null;
|
||||
|
||||
+10
-12
@@ -1,13 +1,10 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.editor.impl;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.ex.ErrorStripeEvent;
|
||||
import com.intellij.openapi.editor.ex.ErrorStripeListener;
|
||||
import com.intellij.openapi.editor.ex.MarkupIterator;
|
||||
import com.intellij.openapi.editor.ex.RangeHighlighterEx;
|
||||
import com.intellij.openapi.editor.ex.*;
|
||||
import com.intellij.openapi.editor.impl.event.MarkupModelListener;
|
||||
import com.intellij.openapi.editor.markup.HighlighterTargetArea;
|
||||
import com.intellij.openapi.editor.markup.RangeHighlighter;
|
||||
@@ -25,7 +22,7 @@ import java.util.NoSuchElementException;
|
||||
/**
|
||||
* A mirror of highlighters which should be rendered on the error stripe.
|
||||
*/
|
||||
class ErrorStripeMarkersModel {
|
||||
final class ErrorStripeMarkersModel {
|
||||
private static final Logger LOG = Logger.getInstance(ErrorStripeMarkersModel.class);
|
||||
|
||||
private final EditorImpl myEditor;
|
||||
@@ -37,16 +34,17 @@ class ErrorStripeMarkersModel {
|
||||
|
||||
private Disposable myActiveDisposable;
|
||||
|
||||
ErrorStripeMarkersModel(@NotNull EditorImpl editor) {
|
||||
ErrorStripeMarkersModel(@NotNull EditorImpl editor, @NotNull Disposable parentDisposable) {
|
||||
myEditor = editor;
|
||||
myTree = new ErrorStripeRangeMarkerTree(myEditor.getDocument());
|
||||
myTreeForLines = new ErrorStripeRangeMarkerTree(myEditor.getDocument());
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
myTree.dispose(myEditor.getDocument());
|
||||
myTreeForLines.dispose(myEditor.getDocument());
|
||||
setActive(false);
|
||||
Disposer.register(parentDisposable, () -> {
|
||||
DocumentEx document = myEditor.getDocument();
|
||||
myTree.dispose(document);
|
||||
myTreeForLines.dispose(document);
|
||||
setActive(false);
|
||||
});
|
||||
}
|
||||
|
||||
void setActive(boolean value) {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.editor.impl;
|
||||
|
||||
import com.intellij.codeInsight.hint.HintManagerImpl;
|
||||
@@ -44,7 +44,7 @@ import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class InspectionPopupManager {
|
||||
final class InspectionPopupManager {
|
||||
private static final int DELTA_X = 6;
|
||||
private static final int DELTA_Y = 6;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user