Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of String parameter using == or != #9

Open
stp32 opened this issue Apr 7, 2024 · 0 comments
Open

Comparison of String parameter using == or != #9

stp32 opened this issue Apr 7, 2024 · 0 comments

Comments

@stp32
Copy link

stp32 commented Apr 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant