You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2017/06/06 18:32:35 UTC
[5/6] geode git commit: GEODE-3023: spotless
GEODE-3023: spotless
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d987f12e
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d987f12e
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d987f12e
Branch: refs/heads/feature/GEODE-3023
Commit: d987f12e4f2fd3bc483d7c467c7718a3e13ba6ed
Parents: 0ae36b9
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Tue Jun 6 11:01:32 2017 -0700
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue Jun 6 11:01:32 2017 -0700
----------------------------------------------------------------------
.../internal/tcpserver/TcpServer.java | 15 ++++---
.../tcpserver/TCPServerSSLJUnitTest.java | 45 +++++++++-----------
.../internal/tcpserver/TcpServerJUnitTest.java | 24 ++++-------
.../geode/internal/net/DelaySocketCreator.java | 26 +++++------
4 files changed, 50 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/d987f12e/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java
index a4c6532..d6c6ff3 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java
@@ -68,6 +68,7 @@ import javax.net.ssl.SSLException;
* <p>
* This code was factored out of GossipServer.java to allow multiple handlers to share the same
* gossip server port.
+ *
* @since GemFire 5.7
*/
public class TcpServer {
@@ -141,8 +142,8 @@ public class TcpServer {
}
public TcpServer(int port, InetAddress bind_address, Properties sslConfig,
- DistributionConfigImpl cfg, TcpHandler handler, PoolStatHelper poolHelper,
- ThreadGroup threadGroup, String threadName) {
+ DistributionConfigImpl cfg, TcpHandler handler, PoolStatHelper poolHelper,
+ ThreadGroup threadGroup, String threadName) {
this.port = port;
this.bind_address = bind_address;
this.handler = handler;
@@ -173,7 +174,7 @@ public class TcpServer {
}
private static PooledExecutorWithDMStats createExecutor(PoolStatHelper poolHelper,
- final ThreadGroup threadGroup) {
+ final ThreadGroup threadGroup) {
ThreadFactory factory = new ThreadFactory() {
private final AtomicInteger threadNum = new AtomicInteger();
@@ -190,7 +191,7 @@ public class TcpServer {
}
public void restarting(InternalDistributedSystem ds, InternalCache cache,
- ClusterConfigurationService sharedConfig) throws IOException {
+ ClusterConfigurationService sharedConfig) throws IOException {
this.shuttingDown = false;
this.handler.restarting(ds, cache, sharedConfig);
startServerThread();
@@ -262,6 +263,7 @@ public class TcpServer {
/**
* Returns the value of the bound port. If the server was initialized with a port of 0 indicating
* that any ephemeral port should be used, this method will return the actual bound port.
+ *
* @return the locator's tcp/ip port. This will be zero if the locator hasn't been started.
*/
public int getPort() {
@@ -351,7 +353,9 @@ public class TcpServer {
+ (sock.getInetAddress().getHostAddress() + ":" + sock.getPort()), e);
return;
}
- System.err.println(SimpleDateFormat.getTimeInstance().format(new Date(System.currentTimeMillis()))+" ---- UDO: TcpServer.processRequest...."+sock.toString());
+ System.err
+ .println(SimpleDateFormat.getTimeInstance().format(new Date(System.currentTimeMillis()))
+ + " ---- UDO: TcpServer.processRequest...." + sock.toString());
int gossipVersion = readGossipVersion(sock, input);
short versionOrdinal;
@@ -511,6 +515,7 @@ public class TcpServer {
/**
* Returns GossipVersion for older Gemfire versions.
+ *
* @return gossip version
*/
public static int getGossipVersionForOrdinal(short ordinal) {
http://git-wip-us.apache.org/repos/asf/geode/blob/d987f12e/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
index 0851392..25e98fa 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
@@ -1,18 +1,16 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
*/
package org.apache.geode.distributed.internal.tcpserver;
@@ -102,7 +100,7 @@ public class TCPServerSSLJUnitTest {
createTcpClientConnection();
- } catch (LocatorCancelException e){
+ } catch (LocatorCancelException e) {
// we catching the LocatorCancelException. Expected to have the exception thrown
}
@@ -116,8 +114,8 @@ public class TCPServerSSLJUnitTest {
private Properties getSSLConfigurationProperties() {
Properties sslProperties = new Properties();
- sslProperties
- .setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
+ sslProperties.setProperty(SSL_ENABLED_COMPONENTS,
+ SecurableCommunicationChannel.LOCATOR.getConstant());
sslProperties.setProperty(SSL_KEYSTORE,
TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
sslProperties.setProperty(SSL_TRUSTSTORE,
@@ -159,14 +157,11 @@ public class TCPServerSSLJUnitTest {
}
public void restarting(DistributedSystem ds, GemFireCache cache,
- ClusterConfigurationService sharedConfig) {
- }
+ ClusterConfigurationService sharedConfig) {}
- public void endRequest(Object request, long startTime) {
- }
+ public void endRequest(Object request, long startTime) {}
- public void endResponse(Object request, long startTime) {
- }
+ public void endResponse(Object request, long startTime) {}
}
@@ -176,9 +171,8 @@ public class TCPServerSSLJUnitTest {
private List<Integer> recordedSocketsTimeouts = new ArrayList<>();
public DummyTcpServer(int port, InetAddress bind_address, Properties sslConfig,
- DistributionConfigImpl cfg,
- TcpHandler handler,
- PoolStatHelper poolHelper, ThreadGroup threadGroup, String threadName) {
+ DistributionConfigImpl cfg, TcpHandler handler, PoolStatHelper poolHelper,
+ ThreadGroup threadGroup, String threadName) {
super(port, bind_address, sslConfig, cfg, handler, poolHelper, threadGroup, threadName);
if (cfg == null) {
cfg = new DistributionConfigImpl(sslConfig);
@@ -190,8 +184,7 @@ public class TCPServerSSLJUnitTest {
protected SocketCreator getSocketCreator() {
if (this.socketCreator == null) {
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- SSLConfig
- sslConfig =
+ SSLConfig sslConfig =
SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.LOCATOR);
this.socketCreator = new DelaySocketCreator(sslConfig, recordedSocketsTimeouts);
}
http://git-wip-us.apache.org/repos/asf/geode/blob/d987f12e/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerJUnitTest.java
index 05fc302..eda0641 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerJUnitTest.java
@@ -181,14 +181,11 @@ public class TcpServerJUnitTest {
}
public void restarting(DistributedSystem ds, GemFireCache cache,
- ClusterConfigurationService sharedConfig) {
- }
+ ClusterConfigurationService sharedConfig) {}
- public void endRequest(Object request, long startTime) {
- }
+ public void endRequest(Object request, long startTime) {}
- public void endResponse(Object request, long startTime) {
- }
+ public void endResponse(Object request, long startTime) {}
}
@@ -200,8 +197,7 @@ public class TcpServerJUnitTest {
this.latch = latch;
}
- public void init(TcpServer tcpServer) {
- }
+ public void init(TcpServer tcpServer) {}
public Object processRequest(Object request) throws IOException {
Boolean delay = (Boolean) request;
@@ -215,18 +211,14 @@ public class TcpServerJUnitTest {
return delay;
}
- public void shutDown() {
- }
+ public void shutDown() {}
public void restarting(DistributedSystem ds, GemFireCache cache,
- ClusterConfigurationService sharedConfig) {
- }
+ ClusterConfigurationService sharedConfig) {}
- public void endRequest(Object request, long startTime) {
- }
+ public void endRequest(Object request, long startTime) {}
- public void endResponse(Object request, long startTime) {
- }
+ public void endResponse(Object request, long startTime) {}
}
private/* GemStoneAddition */ static class SimpleStats implements PoolStatHelper {
http://git-wip-us.apache.org/repos/asf/geode/blob/d987f12e/geode-core/src/test/java/org/apache/geode/internal/net/DelaySocketCreator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/DelaySocketCreator.java b/geode-core/src/test/java/org/apache/geode/internal/net/DelaySocketCreator.java
index ce518b1..bfff90b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/net/DelaySocketCreator.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/DelaySocketCreator.java
@@ -1,18 +1,16 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
*/
package org.apache.geode.internal.net;
@@ -41,5 +39,7 @@ public class DelaySocketCreator extends SocketCreator {
throw new SSLException("This is a test SSLException");
}
- public List<Integer> getSocketSoTimeouts() { return socketSoTimeouts; }
+ public List<Integer> getSocketSoTimeouts() {
+ return socketSoTimeouts;
+ }
}