Menu

#340 NPE when following a marker

1.0
closed-fixed
5
2009-10-06
2009-07-20
No

In a fresh machine, start the New Variable wizard. type "x", "x := 0", "x : INT" in each entry, then click "Add" then click "OK" without modifying the fields.

This creates several markers, one of them reads "Assignment formula missing". If the user ask to "Go to" this marker, the interface displays a NullPointerException message, with the following trace in the log:

!ENTRY org.eclipse.jface 4 2 2009-07-20 19:38:02.165
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
at org.eventb.internal.ui.eventbeditor.elementdesc.TextEditComposite.edit(TextEditComposite.java:292)
at org.eventb.internal.ui.eventbeditor.editpage.EditRow.edit(EditRow.java:142)
at org.eventb.internal.ui.eventbeditor.editpage.ElementComposite.edit(ElementComposite.java:321)
at org.eventb.internal.ui.eventbeditor.editpage.SectionComposite.edit(SectionComposite.java:529)
at org.eventb.internal.ui.eventbeditor.editpage.ElementComposite.edit(ElementComposite.java:332)
at org.eventb.internal.ui.eventbeditor.editpage.SectionComposite.edit(SectionComposite.java:529)
at org.eventb.internal.ui.eventbeditor.editpage.EditPage.edit(EditPage.java:785)
at org.eventb.internal.ui.eventbeditor.EventBEditor.edit(EventBEditor.java:725)
at org.eventb.internal.ui.eventbeditor.EventBEditor.gotoMarker(EventBEditor.java:701)
at org.eclipse.ui.ide.IDE.gotoMarker(IDE.java:403)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:1108)

Note: the wizard created an unlabelled action in the INITIALISATION event.

Discussion

  • Carine Pascal

    Carine Pascal - 2009-10-02
    • assigned_to: a_gilles --> carinepascal
     
  • Nicolas Beauger

    Nicolas Beauger - 2009-10-06
    • assigned_to: carinepascal --> nicolas_beauger
     
  • Nicolas Beauger

    Nicolas Beauger - 2009-10-06

    A first NPE originated in the NewVariableDialog that created the variable: null arguments were passed when clicking OK if initialization action were not filled, which generated a first NPE.
    Fix: if the user did not modify the initialization action in the wizard, support null arguments by avoiding creating the action.

    The second NPE is the one of the given trace, which could occur when the public edit() method was called on a non initialized composite (a field was null).
    Fix: add a guard before using the field in the edit() method.

     
  • Nicolas Beauger

    Nicolas Beauger - 2009-10-06
    • status: open --> closed-fixed
     

Log in to post a comment.