File tree 1 file changed +7
-6
lines changed
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/dns
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 24
24
import java .util .Arrays ;
25
25
import java .util .HashMap ;
26
26
import java .util .Map ;
27
+ import java .util .Objects ;
27
28
import java .util .Optional ;
28
29
29
30
import org .apache .tuweni .bytes .Bytes ;
@@ -138,16 +139,16 @@ public String toString() {
138
139
139
140
/** Override equals method to compare the RLP bytes */
140
141
@ Override
141
- public boolean equals (final Object o ) {
142
- if (this == o ) return true ;
143
- if ( o == null || getClass () != o . getClass ()) return false ;
144
- EthereumNodeRecord that = ( EthereumNodeRecord ) o ;
145
- return rlp .equals (that .rlp );
142
+ public boolean equals (Object o ) {
143
+ if (!( o instanceof EthereumNodeRecord that )) {
144
+ return false ;
145
+ }
146
+ return Objects .equals (rlp , that .rlp );
146
147
}
147
148
148
149
/** Override hashCode method to use hashCode of the RLP bytes */
149
150
@ Override
150
151
public int hashCode () {
151
- return rlp .hashCode ();
152
+ return Objects .hashCode (rlp );
152
153
}
153
154
}
You can’t perform that action at this time.
0 commit comments