Bug #7062

Avoid NPE in diagram generic text element scene graph node initialization

Added by Tuukka Lehtonen 11 months ago. Updated 9 months ago.

Status:ClosedStart date:2017-03-03
Priority:4Due date:2017-03-03
Assignee:Tuukka Lehtonen% Done:

100%

Category:-Spent time:-
Target version:2017-08
Release notes:More robust generic diagram text element scene graph initialization to prevent NPE when such an element is included as part of symbol graphics.
Tags: 1.22.3, 1.28.0, 1.22.2.1
Story points-
Velocity based estimate-
ReleaseSimantics 1.28.0Release relationshipAuto

Description

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at org.simantics.g2d.element.ElementUtils.getOrCreateNode(ElementUtils.java:1165)
    at org.simantics.diagram.elements.TextElementNoBounds.getOrCreateTextNode(TextElementNoBounds.java:126)
    at org.simantics.diagram.elements.TextElementNoBounds.init(TextElementNoBounds.java:93)
    at org.simantics.diagram.adapter.CompositeImage.init(CompositeImage.java:146)
    at org.simantics.g2d.elementclass.ImageClass$ImageElementHandler.init(ImageClass.java:70)
    at org.simantics.diagram.adapter.CompositeImage.init(CompositeImage.java:117)
    at org.simantics.g2d.elementclass.ImageClass$ImageElementHandler.init(ImageClass.java:70)
    at org.simantics.g2d.diagram.participant.ElementPainter.updateElement(ElementPainter.java:777)
    at org.simantics.g2d.diagram.participant.ElementPainter.updateElement(ElementPainter.java:729)
    at org.simantics.g2d.diagram.participant.ElementPainter.update(ElementPainter.java:664)
    at org.simantics.g2d.diagram.participant.ElementPainter$3.run(ElementPainter.java:425)
    at org.simantics.g2d.diagram.participant.ElementPainter$3.run(ElementPainter.java:1)
    at org.simantics.g2d.diagram.participant.ElementPainter.updateSelfAndNeighbors(ElementPainter.java:472)
    at org.simantics.g2d.diagram.participant.ElementPainter$ElementHintListener.hintChanged(ElementPainter.java:388)
    at org.simantics.utils.datastructures.hints.AbstractHintObservable$3.run(AbstractHintObservable.java:112)
    at org.simantics.utils.datastructures.hints.HintContext.setHint(HintContext.java:113)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer$8.forDiagram(GraphToDiagramSynchronizer.java:2901)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer$AbstractDiagramUpdater.run(GraphToDiagramSynchronizer.java:2585)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer$15$1.run(GraphToDiagramSynchronizer.java:3335)
    at org.simantics.g2d.diagram.DiagramUtils.inDiagramTransaction(DiagramUtils.java:325)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer$15.execute(GraphToDiagramSynchronizer.java:3327)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer.runInState(GraphToDiagramSynchronizer.java:1003)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer.safeRunInState(GraphToDiagramSynchronizer.java:1016)
    at org.simantics.diagram.adapter.GraphToDiagramSynchronizer$15.run(GraphToDiagramSynchronizer.java:3321)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

is encountered when a symbol is created that contains generic diagram text elements as part of the symbol graphics.

Associated revisions

Revision f366bd2c
Added by Tuukka Lehtonen 11 months ago

Prevent NPE when comparing a node that is still without parent.

refs #7062

Change-Id: I13990a8db66408c1bc3cab6e4da8ba7997220c1a

Revision 33452
Added by Tuukka Lehtonen 11 months ago

Prevent NPE when comparing a node that is still without parent.

refs #7062

Change-Id: I13990a8db66408c1bc3cab6e4da8ba7997220c1a

Revision 33453
Added by Tuukka Lehtonen 11 months ago

Prevent NPE when comparing a node that is still without parent.

refs #7062

Change-Id: I13990a8db66408c1bc3cab6e4da8ba7997220c1a

Revision 4650d3fe
Added by Tuukka Lehtonen 9 months ago

Prevent NPE when comparing a node that is still without parent.

refs #7062

Change-Id: I13990a8db66408c1bc3cab6e4da8ba7997220c1a

History

#1 Updated by Tuukka Lehtonen 11 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

#2 Updated by Tuukka Lehtonen 11 months ago

  • Tags changed from 1.28.0 to 1.28.0, 1.22.2.1, 1.22.3

#3 Updated by Hannu Niemistö 11 months ago

  • Status changed from Resolved to Closed

#4 Updated by Tuukka Lehtonen 9 months ago

  • Release notes set to More robust generic diagram text element scene graph initialization to prevent NPE when such an element is included as part of symbol graphics.

Also available in: Atom PDF