File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
driver/src/main/java/org/neo4j/driver/internal Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 25
25
import java .net .UnknownHostException ;
26
26
27
27
import static java .lang .String .format ;
28
+ import static java .util .Objects .requireNonNull ;
28
29
29
30
/**
30
31
* Holds a host and port pair that denotes a Bolt server address.
@@ -49,23 +50,23 @@ public BoltServerAddress( URI uri )
49
50
50
51
public BoltServerAddress ( String host , int port )
51
52
{
52
- this .host = host ;
53
+ this .host = requireNonNull ( host ) ;
53
54
this .port = port ;
54
55
}
55
56
56
57
@ Override
57
- public boolean equals ( Object obj )
58
+ public boolean equals ( Object o )
58
59
{
59
- if ( this == obj )
60
+ if ( this == o )
60
61
{
61
62
return true ;
62
63
}
63
- if ( !( obj instanceof BoltServerAddress ) )
64
+ if ( o == null || getClass () != o . getClass ( ) )
64
65
{
65
66
return false ;
66
67
}
67
- BoltServerAddress address = (BoltServerAddress ) obj ;
68
- return host .equals ( address .host ) && port == address . port ;
68
+ BoltServerAddress that = (BoltServerAddress ) o ;
69
+ return port == that . port && host .equals ( that .host );
69
70
}
70
71
71
72
@ Override
You can’t perform that action at this time.
0 commit comments