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

Fixed #1169 : simplified the conditional logic #1170

Closed
wants to merge 1 commit into from

Conversation

sebesti0n
Copy link
Contributor

@sebesti0n sebesti0n commented Mar 13, 2024

Fixed #1169
Please make sure these boxes are checked before submitting your pull request - thanks!

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)

@sebesti0n sebesti0n changed the title Fixed #ix: simplified the conditional logic to enhance code readability Fixed #1169 : simplified the conditional logic Mar 13, 2024
return false;
}
return true;
return id.equals(other.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier code checks if id is null, wouldn't this throw a null pointer exception if id is null?

Copy link
Contributor Author

@sebesti0n sebesti0n Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id can never be null.

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your optimism, but this code's existence—although annoying—is not harming anyone and is potentially saving us from weird crashes down the road. If Java had support for nullable types I'd be more optimistic about this, but I'd rather let the original app author's code stand.

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

Successfully merging this pull request may close these issues.

refactor: Refactor Conditional Logic
3 participants