Comment by sedro
That's another gotcha-- interning of strings and boxed primitives.
Are there linters for this sort of thing? I don't write Java much any more.
That's another gotcha-- interning of strings and boxed primitives.
Are there linters for this sort of thing? I don't write Java much any more.
> Are there linters for this sort of thing?
Yes and they're pretty good so it's rarely an issue in practice. Using == on object references will indeed usually get you yelled at by the linter.