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

Invalid comparison of boxing primitives #182

Open
eribeiro opened this issue Dec 30, 2016 · 0 comments
Open

Invalid comparison of boxing primitives #182

eribeiro opened this issue Dec 30, 2016 · 0 comments

Comments

@eribeiro
Copy link

The line below is comparing two Integer objects. This can lead to bugs, so either use .equals() or do something along the lines of if (dimensions.get(i).intValue() != other.dimensions.get(i)) to force the comparison of unboxed primitives (the JVM will unbox other.dimensions.get(i)).

if (dimensions.get(i) != other.dimensions.get(i))

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