You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2017/08/01 21:31:55 UTC
geode git commit: GEODE-3322: remove empty @return javadoc
Repository: geode
Updated Branches:
refs/heads/develop b218ca30b -> ab90d406b
GEODE-3322: remove empty @return javadoc
* make member fields immutable with final
* fix minor IDE warnings
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ab90d406
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ab90d406
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ab90d406
Branch: refs/heads/develop
Commit: ab90d406bab561dc3be048a2fc5af26a4e7f71ae
Parents: b218ca3
Author: Kirk Lund <kl...@apache.org>
Authored: Wed Jul 26 16:06:54 2017 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Aug 1 14:20:18 2017 -0700
----------------------------------------------------------------------
.../membership/gms/membership/HostAddress.java | 30 +++++++-------------
1 file changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/ab90d406/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
index 1acb7c0..40a482a 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
@@ -12,7 +12,6 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
-
package org.apache.geode.distributed.internal.membership.gms.membership;
import java.net.InetSocketAddress;
@@ -20,10 +19,11 @@ import java.net.InetSocketAddress;
import org.apache.commons.validator.routines.InetAddressValidator;
public class HostAddress {
- private InetSocketAddress socketInetAddress;
- private String hostname;
- private int port;
- private boolean isIpString;
+
+ private final InetSocketAddress socketInetAddress;
+ private final String hostname;
+ private final int port;
+ private final boolean isIpString;
public HostAddress(InetSocketAddress loc, String locStr) {
this.socketInetAddress = loc;
@@ -39,25 +39,19 @@ public class HostAddress {
/**
* if host is ipString then it will return the cached InetSocketAddress Otherwise it will create
* the new instance of InetSocketAddress
- *
- * @return
*/
public InetSocketAddress getSocketInetAddress() {
if (this.isIpString) {
return this.socketInetAddress;
} else {
- InetSocketAddress isa = new InetSocketAddress(hostname, this.socketInetAddress.getPort());
- return isa;
+ return new InetSocketAddress(hostname, this.socketInetAddress.getPort());
}
}
-
-
public String getHostName() {
return hostname;
}
-
public int getPort() {
return port;
}
@@ -75,11 +69,11 @@ public class HostAddress {
@Override
public int hashCode() {
- final int prime = 31;
+ int prime = 31;
int result = 1;
result = prime * result + (isIpString ? 1231 : 1237);
- result = prime * result + ((socketInetAddress == null) ? 0 : socketInetAddress.hashCode());
- result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
+ result = prime * result + (socketInetAddress == null ? 0 : socketInetAddress.hashCode());
+ result = prime * result + (hostname == null ? 0 : hostname.hashCode());
return result;
}
@@ -109,10 +103,8 @@ public class HostAddress {
@Override
public String toString() {
- return "LocatorAddress [locatorSocketInetAddress=" + socketInetAddress + ", lochostname="
- + hostname + ", isIpString=" + isIpString + "]";
+ return "LocatorAddress [socketInetAddress=" + socketInetAddress + ", hostname=" + hostname
+ + ", isIpString=" + isIpString + "]";
}
-
-
}