4 ms·
Java's behavior feels like an almost deliberate trap, though. I have previously lost hours to bugs resulting from a refactoring that changed a value's type from
by bunderbunder 9y ago
Java's behavior feels like an almost deliberate trap, though. I have previously lost hours to bugs resulting from a refactoring that changed a value's type from int to Integer, and the resulting change in equality semantics.
- mjevans 9y agoThat seems like such an anti-feature. I'd want the compiler to issue a warning for it by default and the IDE to ship with 'warnings are errors' by default.
- bunderbunder 9y agoInstead, we have some $$$$ static analysis tool that nags me endlessly about using Optional<T> private fields, but lets using the == operator for non-primitives sail past without comment.