Skip to content

[BUG] ActionEvent compared with == instead of .equals() in multiple files #103

@AmlanDalai

Description

@AmlanDalai

Problem

Multiple files use reference equality (==) to compare ActionEvent
objects in doAction() methods:

  • GuiPanel.java
  • LearningPanel.java
  • CreateOpenProjectGUI.java

Example from LearningPanel.java:
if (event == SAVE_BUTTON_PRESSED)
if (event == LOAD_BUTTON_PRESSED)

In Java, == checks reference identity not logical equality. This can
cause button actions to silently fail under certain JVM conditions
where a new ActionEvent instance is constructed rather than reusing
the same reference.

Additionally LearningPanel.java uses:
if (cname != "")
which is also unreliable string reference comparison — should be
!cname.isEmpty()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions