bolerio / seco

Advanced Scripting IDE for JVM based languages.
28 stars 4 forks source link

NPE on syntax handling during startup #43

Open bolerio opened 7 years ago

bolerio commented 7 years ago

Sometimes at startup I get the following exception. I've observed other similar case where TokenMarker.context seems to be null. I have multiple notebooks opened in a "simple UI mode", and it seems like a race condition of some sort because if I just kill Seco and start again, it works.

java.lang.NullPointerException
    at seco.notebook.syntax.TokenMarker.markKeyword(TokenMarker.java:664)
    at seco.notebook.syntax.TokenMarker.markTokens(TokenMarker.java:198)
    at seco.notebook.syntax.ChunkCache.markTokens(ChunkCache.java:373)
    at seco.notebook.syntax.ChunkCache.lineToChunkList(ChunkCache.java:337)
    at seco.notebook.syntax.ChunkCache.updateChunksUpTo(ChunkCache.java:262)
    at seco.notebook.syntax.ChunkCache.getLineInfo(ChunkCache.java:116)
    at seco.notebook.view.GlyphPainter0.getWidth(GlyphPainter0.java:64)
    at seco.notebook.view.GlyphPainter0.getSpan(GlyphPainter0.java:51)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:592)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:732)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:233)
    at javax.swing.text.ParagraphView.calculateMinorAxisRequirements(ParagraphView.java:717)
    at seco.notebook.view.CellParagraphView.calculateMinorAxisRequirements(CellParagraphView.java:70)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
    at seco.notebook.view.CellParagraphView.getMinimumSpan(CellParagraphView.java:128)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903)
    at seco.notebook.view.InputCellView.calculateMinorAxisRequirements(InputCellView.java:58)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
    at seco.notebook.view.HidableBoxView.getMinimumSpan(HidableBoxView.java:54)
    at javax.swing.text.BoxView.calculateMajorAxisRequirements(BoxView.java:871)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:930)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
    at seco.notebook.view.HidableBoxView.getMinimumSpan(HidableBoxView.java:54)
    at seco.notebook.view.CellBoxView.getMinimumSpan(CellBoxView.java:112)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
    at seco.notebook.view.HidableBoxView.getMinimumSpan(HidableBoxView.java:54)
    at seco.notebook.view.WholeCellView.getMinimumSpan(WholeCellView.java:118)
    at javax.swing.text.BoxView.calculateMajorAxisRequirements(BoxView.java:871)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:930)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
    at seco.notebook.view.HidableBoxView.getMinimumSpan(HidableBoxView.java:54)
    at seco.notebook.view.CellBoxView.getMinimumSpan(CellBoxView.java:112)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:343)
    at javax.swing.text.BoxView.layout(BoxView.java:708)
    at javax.swing.text.BoxView.setSize(BoxView.java:397)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1722)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:917)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
    at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1332)
    at seco.notebook.NotebookUI.getPreferredSize(NotebookUI.java:796)
    at javax.swing.JViewport.getViewSize(JViewport.java:999)
    at javax.swing.plaf.basic.BasicScrollPaneUI.syncScrollPaneWithViewport(BasicScrollPaneUI.java:278)
    at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:1033)
    at javax.swing.JViewport.fireStateChanged(JViewport.java:1369)
    at javax.swing.JViewport.setView(JViewport.java:969)
    at javax.swing.JScrollPane.setViewportView(JScrollPane.java:1007)
    at seco.gui.visual.NBUIVisual.bind(NBUIVisual.java:73)
    at seco.gui.visual.TabbedPaneVisual.addChild(TabbedPaneVisual.java:71)
    at seco.gui.visual.TabbedPaneVisual.bind(TabbedPaneVisual.java:44)
    at seco.gui.StandaloneFrame.getJTabbedPane(StandaloneFrame.java:82)
    at seco.gui.StandaloneFrame.initFrame(StandaloneFrame.java:65)
    at seco.ThisNiche.initGUIController(ThisNiche.java:85)
    at seco.boot.NicheBootListener.handle(NicheBootListener.java:34)
    at org.hypergraphdb.event.HGDefaultEventManager.dispatch(HGDefaultEventManager.java:75)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:378)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:211)
    at org.hypergraphdb.HGEnvironment.get(HGEnvironment.java:112)
    at org.hypergraphdb.HGEnvironment.get(HGEnvironment.java:130)
    at seco.boot.Main.go(Main.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at seco.boot.StartMeUp.main(StartMeUp.java:91)