JetBrains / JetBrains/MPS-extensions

NPE: using editor.collapsible surrounding digram editors nested within digram.box crashes the IDE

Open
#575 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JetBrains MPS
Stars
88
Forks
60
Avg merge
1d 3h
Merged PRs (30d)
15

Description

Setup:

> Diagram Editor
> > Diagram.Box editor
>>> some editor cells
>>> collapsible cell
>>>> diagram editor

the crash is triggered by collapsing and expanding the collapsible

Stack Trace:

```
java.lang.NullPointerException
at de.itemis.mps.editor.diagram.runtime.jgraph.MPSCell.getExpectedX(MPSCell.java:90)
at de.itemis.mps.editor.diagram.runtime.jgraph.MPSCell.moveCell(MPSCell.java:132)
at de.itemis.mps.editor.diagram.runtime.jgraph.MPSCell.setStateRelativePos(MPSCell.java:102)
at de.itemis.mps.editor.diagram.runtime.jgraph.BoxBaseDCell.updateMPSCellPositions(BoxBaseDCell.java:102)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphView$1.lambda$layout$0(MyGraphView.java:59)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.lambda$withValue$0(ContextVariables.java:39)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.enterNewContext(ContextVariables.java:30)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.withValue(ContextVariables.java:37)
at de.itemis.mps.editor.diagram.runtime.jgraph.BaseDiagramECell.withContextGraph(BaseDiagramECell.java:120)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphView$1.lambda$layout$1(MyGraphView.java:57)
at de.itemis.mps.editor.diagram.runtime.model.ScalableEditorCell.withScalingDisabled(ScalableEditorCell.java:27)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphView$1.layout(MyGraphView.java:57)
at de.itemis.mps.editor.diagram.runtime.jgraph.LayoutDependencies.layoutAndRecordDependencies(LayoutDependencies.java:81)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphView.updateCellState(MyGraphView.java:49)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:597)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:559)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:612)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:559)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:612)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:559)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:612)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:559)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:612)
at com.mxgraph.view.mxGraphView.validateCellState(mxGraphView.java:559)
at com.mxgraph.view.mxGraphView.validate(mxGraphView.java:450)
at de.itemis.mps.editor.diagram.runtime.jgraph.RootDiagramECell$5.lambda$layout$0(RootDiagramECell.java:430)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.lambda$withValue$0(ContextVariables.java:39)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.enterNewContext(ContextVariables.java:30)
at de.itemis.mps.editor.diagram.runtime.ContextVariables.withValue(ContextVariables.java:37)
at de.itemis.mps.editor.diagram.runtime.jgraph.BaseDiagramECell.withContextGraph(BaseDiagramECell.java:120)
at de.itemis.mps.editor.diagram.runtime.jgraph.RootDiagramECell$5.lambda$layout$1(RootDiagramECell.java:407)
at de.itemis.mps.editor.diagram.runtime.model.ScalableEditorCell.withScalingDisabled(ScalableEditorCell.java:27)
at de.itemis.mps.editor.diagram.runtime.jgraph.RootDiagramECell$5.lambda$layout$2(RootDiagramECell.java:407)
at de.itemis.mps.editor.diagram.runtime.jgraph.JGraphModelSynchronizer.suspend(JGraphModelSynchronizer.java:172)
at de.itemis.mps.editor.diagram.runtime.jgraph.RootDiagramECell$5.layout(RootDiagramECell.java:407)
at de.itemis.mps.editor.diagram.runtime.jgraph.LayoutDependencies.layoutAndRecordDependencies(LayoutDependencies.java:81)
at de.itemis.mps.editor.diagram.runtime.jgraph.RootDiagramECell.relayoutImpl(RootDiagramECell.java:404)
at jetbrains.mps.nodeEditor.cells.EditorCell_Basic.relayout(EditorCell_Basic.java:789)
at jetbrains.mps.nodeEditor.EditorComponent.doRelayout(EditorComponent.java:1857)
at jetbrains.mps.nodeEditor.EditorComponent.relayout(EditorComponent.java:1850)
at de.itemis.mps.editor.collapsible.runtime.CollapsibleCell.setCollapsibleCollapsed(CollapsibleCell.java:248)
at de.itemis.mps.editor.diagram.runtime.jgraph.DiagramCollapsibleCell.setCollapsibleCollapsed(DiagramCollapsibleCell.java:36)
at de.itemis.mps.editor.collapsible.runtime.CollapseExpandToggleCell.toggle(CollapseExpandToggleCell.java:56)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphHandler.mousePressed(MyGraphHandler.java:87)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:288)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at de.itemis.mps.editor.diagram.runtime.jgraph.MyGraphComponent$MyGraphControl.processMouseEvent(MyGraphComponent.java:560)
at java.desktop/java.awt.Component.processEvent(Component.java:6419)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4544)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the nested Diagram Editor, Diagram.Box, and collapsible diagram setup, then collapse and expand the cell. Trace MPSCell.getExpectedX and BoxBaseDCell.updateMPSCellPositions using the reported stack trace; done means the same operation no longer throws a NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.