hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject hadoop git commit: HADOOP-14485. Redundant 'final' modifier in try-with-resources statement. Contributed by wenxin he.
Date Tue, 06 Jun 2017 15:15:07 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 855e0477b -> 19ef3a81f


HADOOP-14485. Redundant 'final' modifier in try-with-resources statement. Contributed by wenxin
he.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/19ef3a81
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/19ef3a81
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/19ef3a81

Branch: refs/heads/trunk
Commit: 19ef3a81f8b90579b4a7a95839d0c3ebdd56349c
Parents: 855e047
Author: Brahma Reddy Battula <brahma@apache.org>
Authored: Tue Jun 6 23:11:47 2017 +0800
Committer: Brahma Reddy Battula <brahma@apache.org>
Committed: Tue Jun 6 23:11:47 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/example/ITUseMiniCluster.java     | 8 ++++----
 .../src/test/java/org/apache/hadoop/ipc/TestIPC.java         | 2 +-
 .../org/apache/hadoop/metrics2/lib/TestRollingAverages.java  | 2 +-
 .../test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java | 2 +-
 .../org/apache/hadoop/hdfs/server/balancer/TestBalancer.java | 2 +-
 .../hdfs/server/datanode/TestDataNodeFaultInjector.java      | 2 +-
 .../apache/hadoop/yarn/client/api/impl/TestYarnClient.java   | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
----------------------------------------------------------------------
diff --git a/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
b/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
index 3f560d0..5fcbe13 100644
--- a/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
+++ b/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
@@ -82,7 +82,7 @@ public class ITUseMiniCluster {
 
   @Test
   public void useHdfsFileSystem() throws IOException {
-    try (final FileSystem fs = cluster.getFileSystem()) {
+    try (FileSystem fs = cluster.getFileSystem()) {
       simpleReadAfterWrite(fs);
     }
   }
@@ -94,10 +94,10 @@ public class ITUseMiniCluster {
       throw new IOException("Mkdirs failed to create " +
           TEST_PATH);
     }
-    try (final FSDataOutputStream out = fs.create(path)) {
+    try (FSDataOutputStream out = fs.create(path)) {
       out.writeUTF(TEXT);
     }
-    try (final FSDataInputStream in = fs.open(path)) {
+    try (FSDataInputStream in = fs.open(path)) {
       final String result = in.readUTF();
       Assert.assertEquals("Didn't read back text we wrote.", TEXT, result);
     }
@@ -105,7 +105,7 @@ public class ITUseMiniCluster {
 
   @Test
   public void useWebHDFS() throws IOException, URISyntaxException {
-    try (final FileSystem fs = WebHdfsTestUtil.getWebHdfsFileSystem(
+    try (FileSystem fs = WebHdfsTestUtil.getWebHdfsFileSystem(
         cluster.getConfiguration(0), WebHdfsConstants.WEBHDFS_SCHEME)) {
       simpleReadAfterWrite(fs);
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
index 611000d..1d47473 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
@@ -1425,7 +1425,7 @@ public class TestIPC {
   }
 
   private void checkVersionMismatch() throws IOException {
-    try (final ServerSocket listenSocket = new ServerSocket()) {
+    try (ServerSocket listenSocket = new ServerSocket()) {
       listenSocket.bind(null);
       InetSocketAddress addr =
           (InetSocketAddress) listenSocket.getLocalSocketAddress();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestRollingAverages.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestRollingAverages.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestRollingAverages.java
index 44202e7..6ea3d26 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestRollingAverages.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestRollingAverages.java
@@ -42,7 +42,7 @@ public class TestRollingAverages {
   public void testRollingAveragesEmptyRollover() throws Exception {
     final MetricsRecordBuilder rb = mockMetricsRecordBuilder();
     /* 5s interval and 2 windows */
-    try (final RollingAverages rollingAverages =
+    try (RollingAverages rollingAverages =
              new RollingAverages(5000, 2)) {
       /* Check it initially */
       rollingAverages.snapshot(rb, true);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java
index 3d4cc72..d631b68 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMiniDFSCluster.java
@@ -254,7 +254,7 @@ public class TestMiniDFSCluster {
   @Test
   public void testClusterNoStorageTypeSetForDatanodes() throws IOException {
     final Configuration conf = new HdfsConfiguration();
-    try (final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
+    try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
         .numDataNodes(3).build()) {
       cluster.waitActive();
       ArrayList<DataNode> dataNodes = cluster.getDataNodes();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java
index dd28914..016a233 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java
@@ -1847,7 +1847,7 @@ public class TestBalancer {
     for(int i = 0; i < lengths.length; i++) {
       final long size = lengths[i];
       final Path p = new Path("/file" + i + "_size" + size);
-      try(final OutputStream out = dfs.create(p)) {
+      try(OutputStream out = dfs.create(p)) {
         for(int j = 0; j < size; j++) {
           out.write(j);
         }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFaultInjector.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFaultInjector.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFaultInjector.java
index fe65429..1507844 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFaultInjector.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFaultInjector.java
@@ -153,7 +153,7 @@ public class TestDataNodeFaultInjector {
       cluster.waitActive();
 
       final FileSystem fs = cluster.getFileSystem();
-      try (final FSDataOutputStream out = fs
+      try (FSDataOutputStream out = fs
           .create(new Path(baseDir, "test.data"), (short) 2)) {
         out.write(0x31);
         out.hflush();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19ef3a81/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
index 9adc187..7d7272a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
@@ -303,7 +303,7 @@ public class TestYarnClient {
     int pollIntervalMs = 1000;
     conf.setLong(YarnConfiguration.YARN_CLIENT_APP_SUBMISSION_POLL_INTERVAL_MS,
         pollIntervalMs);
-    try (final YarnClient client = new MockYarnClient()) {
+    try (YarnClient client = new MockYarnClient()) {
       client.init(conf);
       client.start();
       // Submit the application and then interrupt it while its waiting


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message