On Wed, 23 Oct 2024 02:06:20 GMT, Joe Darcy <da...@openjdk.org> wrote:

> Noticed this refactoring opportunity while doing some other work in the area.

src/java.base/share/classes/java/lang/Boolean.java line 259:

> 257:     public boolean equals(Object obj) {
> 258:         if (obj instanceof Boolean b) {
> 259:             return value == b.booleanValue();

I would go even a step further and use `value` instead of `booleanValue()`, 
`intValue()` etc because there is no need to call a method to get the value.


  if (obj instanceof Boolean b) {
            return value == b.value;

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21652#discussion_r1811914553

Reply via email to