viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Save Snapshot NPE #366

Closed istvanrath closed 11 years ago

istvanrath commented 11 years ago

When activated on an erroneous pattern, the following NPE is thrown:


java.lang.NullPointerException
    at org.eclipse.viatra2.emf.incquery.testing.ui.handlers.SaveSnapshotHandler.saveSnapshot(SaveSnapshotHandler.java:80)
    at org.eclipse.viatra2.emf.incquery.testing.ui.handlers.SaveSnapshotHandler.execute(SaveSnapshotHandler.java:64)
abelhegedus commented 11 years ago

I think this is not an issue if #362 is fixed. Of course, if the query explorer displays an error on the element, but it is still an ObservablePatternMatcher object, then it's a problem. I'm not sure that having a "Matcher" object which is not actually connected to an engine is a good idea, but I'll put in the extra check to be sure.

ujhelyiz commented 11 years ago

A better solution would be (but that needs at least an rewrite of Query Explorer as it does not maintain this information...) to disable the contribution if the pattern is erroneous.

istvanrath commented 11 years ago

Cherry pick it into maintenance and then we can close it.

istvanrath commented 11 years ago

Sorry, I was wrong, the fix doesn't work at all. It can still be reproduced giving the following stack trace:

java.lang.NullPointerException
    at org.eclipse.viatra2.emf.incquery.testing.ui.handlers.SaveSnapshotHandler.saveSnapshot(SaveSnapshotHandler.java:82)
    at org.eclipse.viatra2.emf.incquery.testing.ui.handlers.SaveSnapshotHandler.execute(SaveSnapshotHandler.java:65)

Note the NPE is at a different line now.

abelhegedus commented 11 years ago

Please try again, I'll cherry pick it if the fix works correctly.

istvanrath commented 11 years ago

Ok, works correctly, cherry pick and close.

abelhegedus commented 11 years ago

Done, closing.