nl-utwente-groove / code

GROOVE code base
https://groove.cs.utwente.nl
5 stars 0 forks source link

NPE when external host graph has errors #395

Closed rensink closed 7 months ago

rensink commented 11 years ago

If you load a grammar in the Simulator and try to load an external start state from a file, if said state has errors, when you click the error panel the following NPE is thrown:

Exception in GROOVE java.lang.NullPointerException at groove.gui.Simulator$3.update(Simulator.java:362) at groove.gui.list.ListPanel$2.mouseClicked(ListPanel.java:100) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.Component.processMouseEvent(Component.java:6293) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6055) at java.awt.Container.processEvent(Container.java:2039) at java.awt.Component.dispatchEventImpl(Component.java:4653) at java.awt.Container.dispatchEventImpl(Container.java:2097) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4245) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166) at java.awt.Container.dispatchEventImpl(Container.java:2083) at java.awt.Window.dispatchEventImpl(Window.java:2482) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648) at java.awt.EventQueue.access$000(EventQueue.java:84) at java.awt.EventQueue$1.run(EventQueue.java:607) at java.awt.EventQueue$1.run(EventQueue.java:605) at java.security.AccessController.doPrivileged(Native Method) [...]

Reported by: zambon

rensink commented 11 years ago

"If said state has errors": What kind of errors? I haven't been able to reproduce this for a start graph with typing errors.

Original comment by: rensink

rensink commented 11 years ago

I didn't try this one for typing errors but the exception shows up with the graph I'm attaching now. Steps I'm doing to reproduce on my machine:

Original comment by: zambon

rensink commented 11 years ago

Either you forgot the attachment or I can't find it in this interface

Original comment by: rensink

rensink commented 11 years ago

Actually it seems the interface is kind of buggy: the attachment shows in the notification email but I can't find it anywhere here...

[EDIT] OK, figured the problem, you have to post a message on the ticket root, replying to an existing message doesn't show the attachment. -_-

Original comment by: zambon

rensink commented 11 years ago

I see.

I think we should abandon the whole external start graph principle. Even if the graph is error-free, you can't see it in the graph view or edit it, and there's probably lots of small bugs (like the previous start state still being set bold in the graph list).

Do you see any reason to want to keep the external start graphs, and not just use import?

Original comment by: rensink

rensink commented 11 years ago

I agree. I guess this option should go away. Although I have a vague recollection that some of the tests may still use it. But in any case it's just a matter of modifying the test grammars if that's indeed true.

However, I think that we need some sort of 'graph visualizer' for when we want to look at graphs obtained, say, using the Generator. At the moment the two options we have for viewing an external graph is to use this option in the Simulator or use the GraphPreviewDialog. The former we want to get rid of and the second is hardly satisfactory since it can only be invoked programatically so it's out of the hands of a default user.

My feeling is that we should have a stand-alone viewer, similarly to the Imager, where we can provide some of viewing capabilities of the Simulator such as layouting and filtering of labels.

Original comment by: zambon

rensink commented 11 years ago

Original comment by: rensink

rensink commented 11 years ago

Fixed by removing the functionality in the Editor. Note that from the Generator you can run a grammar with an external start graph.

Original comment by: rensink

rensink commented 11 years ago

That should be Simulator, not Editor

Original comment by: rensink