Combined fragment constraint field error on double click

Issue #406 resolved
Céline Bensoussan created an issue

In a combined fragment, double click on the constraint field to write a constraint or update one. Once the field is in edit mode, double clicking on it again causes the application to crash.

Caused by: java.lang.NullPointerException
    at ca.mcgill.sel.ram.ui.views.message.handler.impl.ValueSpecificationHandler.getValueFeature(ValueSpecificationHandler.java:131)
    at ca.mcgill.sel.ram.ui.views.message.handler.impl.ValueSpecificationHandler.handleChangeValue(ValueSpecificationHandler.java:61)
    at ca.mcgill.sel.ram.ui.views.message.handler.impl.ValueSpecificationHandler.processTapEvent(ValueSpecificationHandler.java:47)

Comments (6)

  1. Matthias Schoettle

    I think this is due to the fact that on editing, the data and feature of the TextView are changed, so the second time this causes problems.

  2. Matthias Schoettle

    Resolves #406: Adds a check to ensure that the data is not already being edited.

    Adds a protected method (isEditEnabled) to check whether the data is being edited already. Adds check to processTapEvent and processTapAndHoldEvent (in InteractionConstraintHandler and ExecutionStatementHandler).

    → <<cset 8255f7a831a9>>

  3. Matthias Schoettle

    References #406: Adds check to ensure current data is not being edited.

    Refactors class to only change valueContainer and feature of superclass if it is for editing the name/value of the actual value. The data and feature the view represents is instead passed along the private methods to avoid causing side effects.

    → <<cset 6a69bc792b9e>>

  4. Matthias Schoettle

    References #406: Moves saving of data and feature to when keyboard is being opened.

    The protected fields are now private so the responsible lies within the class itself. Saving of fields moved so that it doesn't interfere with simple boolean change where no keyboard is opened.

    → <<cset d1e65e38fde6>>

  5. Matthias Schoettle

    References #406: Fixes the same problem with AssignToHandler.

    Adds isEditEnabled and reduces visibility of data and feature to private. Subclasses either receive the target TextView or the data owner passed specifically.

    → <<cset bd50a65219ea>>

  6. Log in to comment