Renaming a temporary variable causes NPE

Issue #555 resolved
Stacey Beard created an issue

Problem

Trying to rename a temporary variable causes TouchCORE to crash with a Null Pointer Exception.

Steps to reproduce

  1. Create a new project with at least one class containing at least one operation.
  2. Open the operation’s message view.
  3. Create an assignment, and choose the green plus for a new assignment (of any type).
  4. Select the assignment and click Rename property.

Actual result

Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.NullPointerException
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at ca.mcgill.sel.commons.emf.util.EMFEditUtil.getFeatureText(EMFEditUtil.java:91)
at ca.mcgill.sel.ram.ui.views.handler.impl.TextViewHandler.keyboardOpened(TextViewHandler.java:39)
at ca.mcgill.sel.ram.ui.views.message.handler.impl.AssignToHandler.keyboardOpened(AssignToHandler.java:248)
at ca.mcgill.sel.ram.ui.views.TextView.keyboardOpened(TextView.java:201)

Expected result

Renaming a variable assignment should not cause TouchCORE to crash.

Environment & Version

Windows 10 Home 1909

TouchCORE version:

Comments (2)

  1. Jörg Kienzle

    Removed all remaining wrong uses of CORE_NAMED_ELEMENT for RAM-related model elements and replaced the occurrences with NAMED_ELEMENT. This should now be resolved.

  2. Log in to comment