Skip to content

Commit 2e3273f

Browse files
authored
HBASE-23646 Resolved remaining Checkstyle violations in tests of hbase-rest
Signed-off-by: Viraj Jasani <vjasani@apache.org>
1 parent 99a59cf commit 2e3273f

6 files changed

Lines changed: 474 additions & 494 deletions

File tree

hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@
3636
<suppress checks="MagicNumberCheck" files=".*Test\.java"/>
3737
<!-- Will not have a private constructor, because it is InterfaceAudience.Public -->
3838
<suppress checks="HideUtilityClassConstructor" files="org.apache.hadoop.hbase.util.ByteRangeUtils"/>
39+
<suppress checks="InnerAssignment" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
40+
<suppress checks="EmptyBlock" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
3941
</suppressions>

hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import com.sun.jersey.spi.container.servlet.ServletContainer;
3535

3636
public class HBaseRESTTestingUtility {
37-
3837
private static final Log LOG = LogFactory.getLog(HBaseRESTTestingUtility.class);
3938

4039
private int testServletPort;
@@ -62,7 +61,7 @@ public void startServletContainer(Configuration conf) throws Exception {
6261
"jetty");
6362

6463
LOG.info("configured " + ServletContainer.class.getName());
65-
64+
6665
// set up Jetty and run the embedded server
6766
server = new Server(0);
6867
server.setSendServerVersion(false);
@@ -86,17 +85,19 @@ public void startServletContainer(Configuration conf) throws Exception {
8685
// get the port
8786
testServletPort = server.getConnectors()[0].getLocalPort();
8887

89-
LOG.info("started " + server.getClass().getName() + " on port " +
88+
LOG.info("started " + server.getClass().getName() + " on port " +
9089
testServletPort);
9190
}
9291

9392
public void shutdownServletContainer() {
94-
if (server != null) try {
95-
server.stop();
96-
server = null;
97-
RESTServlet.stop();
98-
} catch (Exception e) {
99-
LOG.warn(StringUtils.stringifyException(e));
93+
if (server != null) {
94+
try {
95+
server.stop();
96+
server = null;
97+
RESTServlet.stop();
98+
} catch (Exception e) {
99+
LOG.warn(StringUtils.stringifyException(e));
100+
}
100101
}
101102
}
102103
}

0 commit comments

Comments
 (0)