hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject hadoop git commit: HDFS-10866. Fix Eclipse Java compile errors related to generic parameters. Contributed by Konstantin Shvachko.
Date Fri, 23 Sep 2016 21:13:55 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 74b3dd514 -> 6eb700ee7


HDFS-10866. Fix Eclipse Java compile errors related to generic parameters. Contributed by
Konstantin Shvachko.

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

Branch: refs/heads/trunk
Commit: 6eb700ee7469cd77524676d62cbd20043f111288
Parents: 74b3dd5
Author: Konstantin V Shvachko <shv@apache.org>
Authored: Fri Sep 23 11:25:15 2016 -0700
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Fri Sep 23 14:10:11 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/io/MapFile.java |  4 +--
 .../hadoop/fs/TestDelegationTokenRenewer.java   |  3 +--
 .../hadoop/hdfs/web/TestWebHdfsTokens.java      | 27 +++++++++-----------
 3 files changed, 15 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6eb700ee/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
index ee76458..96a4189 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
@@ -990,8 +990,8 @@ public class MapFile {
             reader.getKeyClass().asSubclass(WritableComparable.class),
             reader.getValueClass());
 
-      WritableComparable key = ReflectionUtils.newInstance(reader.getKeyClass()
-        .asSubclass(WritableComparable.class), conf);
+      WritableComparable<?> key = ReflectionUtils.newInstance(
+          reader.getKeyClass().asSubclass(WritableComparable.class), conf);
       Writable value = ReflectionUtils.newInstance(reader.getValueClass()
         .asSubclass(Writable.class), conf);
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6eb700ee/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java
index 6b66222..582bc31 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java
@@ -49,7 +49,6 @@ public class TestDelegationTokenRenewer {
     renewer = DelegationTokenRenewer.getInstance();
   }
   
-  @SuppressWarnings("unchecked")
   @Test
   public void testAddRemoveRenewAction() throws IOException,
       InterruptedException {
@@ -81,7 +80,7 @@ public class TestDelegationTokenRenewer {
     verify(token).cancel(eq(conf));
 
     verify(fs, never()).getDelegationToken(null);
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     
     assertEquals("FileSystem not removed from DelegationTokenRenewer", 0,
         renewer.getRenewQueueLength());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6eb700ee/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java
index 6192ad9..058f63f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java
@@ -127,7 +127,7 @@ public class TestWebHdfsTokens {
     fs.toUrl(op, null);
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).getDelegationToken(null);
-    verify(fs, never()).setDelegationToken((Token<?>)any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
   }
 
   @Test(timeout = 1000)
@@ -160,7 +160,6 @@ public class TestWebHdfsTokens {
     }
   }
   
-  @SuppressWarnings("unchecked") // for any(Token.class)
   @Test
   public void testLazyTokenFetchForWebhdfs() throws Exception {
     MiniDFSCluster cluster = null;
@@ -190,7 +189,6 @@ public class TestWebHdfsTokens {
     }
   }
   
-  @SuppressWarnings("unchecked") // for any(Token.class)
   @Test
   public void testLazyTokenFetchForSWebhdfs() throws Exception {
     MiniDFSCluster cluster = null;
@@ -298,7 +296,6 @@ public class TestWebHdfsTokens {
     }
   }
   
-  @SuppressWarnings("unchecked")
   private void validateLazyTokenFetch(final Configuration clusterConf) throws Exception{
     final String testUser = "DummyUser";
     UserGroupInformation ugi = UserGroupInformation.createUserForTesting(
@@ -316,7 +313,7 @@ public class TestWebHdfsTokens {
     fs.cancelDelegationToken(token);
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     Assert.assertNull(fs.getRenewToken());
     reset(fs);
 
@@ -326,7 +323,7 @@ public class TestWebHdfsTokens {
     verify(fs, times(1)).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, times(1)).getDelegationToken(anyString());
-    verify(fs, times(1)).setDelegationToken(any(Token.class));
+    verify(fs, times(1)).setDelegationToken(any());
     token = fs.getRenewToken();
     Assert.assertNotNull(token);      
     Assert.assertEquals(testUser, getTokenOwner(token));
@@ -338,7 +335,7 @@ public class TestWebHdfsTokens {
     verify(fs, times(1)).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     Token<?> token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertEquals(fs.getTokenKind(), token.getKind());
@@ -358,7 +355,7 @@ public class TestWebHdfsTokens {
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertEquals(fs.getTokenKind(), token.getKind());
@@ -376,7 +373,7 @@ public class TestWebHdfsTokens {
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertEquals(fs.getTokenKind(), token.getKind());
@@ -390,7 +387,7 @@ public class TestWebHdfsTokens {
     verify(fs, times(2)).getDelegationToken(); // first bad, then good
     verify(fs, times(1)).replaceExpiredDelegationToken();
     verify(fs, times(1)).getDelegationToken(null);
-    verify(fs, times(1)).setDelegationToken(any(Token.class));
+    verify(fs, times(1)).setDelegationToken(any());
     token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertNotSame(token, token2);
@@ -407,7 +404,7 @@ public class TestWebHdfsTokens {
     verify(fs, times(2)).getDelegationToken(); // first bad, then good
     verify(fs, times(1)).replaceExpiredDelegationToken();
     verify(fs, times(1)).getDelegationToken(null);
-    verify(fs, times(1)).setDelegationToken(any(Token.class));
+    verify(fs, times(1)).setDelegationToken(any());
     token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertNotSame(token, token2);
@@ -420,7 +417,7 @@ public class TestWebHdfsTokens {
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     verify(fs, times(1)).cancelDelegationToken(eq(token2));
 
     // add a token to ugi for a new fs, verify it uses that token
@@ -449,7 +446,7 @@ public class TestWebHdfsTokens {
     verify(fs, times(1)).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     token2 = fs.getRenewToken();
     Assert.assertNotNull(token2);
     Assert.assertEquals(fs.getTokenKind(), token.getKind());
@@ -469,7 +466,7 @@ public class TestWebHdfsTokens {
       verify(fs, times(1)).getDelegationToken();
       verify(fs, times(1)).replaceExpiredDelegationToken();
       verify(fs, never()).getDelegationToken(anyString());
-      verify(fs, never()).setDelegationToken(any(Token.class));
+      verify(fs, never()).setDelegationToken(any());
       token2 = fs.getRenewToken();
       Assert.assertNotNull(token2);
       Assert.assertEquals(fs.getTokenKind(), token.getKind());
@@ -482,7 +479,7 @@ public class TestWebHdfsTokens {
     verify(fs, never()).getDelegationToken();
     verify(fs, never()).replaceExpiredDelegationToken();
     verify(fs, never()).getDelegationToken(anyString());
-    verify(fs, never()).setDelegationToken(any(Token.class));
+    verify(fs, never()).setDelegationToken(any());
     verify(fs, never()).cancelDelegationToken(any(Token.class));
   } 
   


---------------------------------------------------------------------
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