heshanera/HealthPlus

Comparison of String parameter using == or !=

Closed this issue · 0 comments

The code in Admin.Admin.createNewUser(String, String, String, String, String, String) contains a comparison of strings using ==. This can cause unexpected behaviors in the application due to comparing references rather than contents.

To reproduce:

  • Go to Admin.Admin.createNewUser(String, String, String, String, String, String) in the src/main/java folder
  • Locate the if statement on line 343
  • Identify the use of == to compare strings

Expected: The createNewUser method should compare String parameters using the equals() method for value comparison to ensure correct behavior and avoid potential bugs related to string comparison.
Actual: == is used to compare strings which compares their references rather than their contents.