HDFS-6275. Fix warnings - type arguments can be inferred and redudant local variable. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1589510 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2014-04-23 20:20:16 +00:00
parent 876fd8ab79
commit 7f635b8f53
11 changed files with 16 additions and 15 deletions

View File

@ -374,6 +374,9 @@ Release 2.5.0 - UNRELEASED
HDFS-6274. Cleanup javadoc warnings in HDFS code. (suresh) HDFS-6274. Cleanup javadoc warnings in HDFS code. (suresh)
HDFS-6275. Fix warnings - type arguments can be inferred and redudant
local variable. (suresh)
Release 2.4.1 - UNRELEASED Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -263,7 +263,7 @@ class FSImagePreTransactionalStorageInspector extends FSImageStorageInspector {
// the image is already current, discard edits // the image is already current, discard edits
LOG.debug( LOG.debug(
"Name checkpoint time is newer than edits, not loading edits."); "Name checkpoint time is newer than edits, not loading edits.");
return Collections.<File>emptyList(); return Collections.emptyList();
} }
return getEditsInStorageDir(latestEditsSD); return getEditsInStorageDir(latestEditsSD);

View File

@ -82,7 +82,7 @@ public class ImageServlet extends HttpServlet {
private static final String IMAGE_FILE_TYPE = "imageFile"; private static final String IMAGE_FILE_TYPE = "imageFile";
private static final Set<Long> currentlyDownloadingCheckpoints = private static final Set<Long> currentlyDownloadingCheckpoints =
Collections.<Long>synchronizedSet(new HashSet<Long>()); Collections.synchronizedSet(new HashSet<Long>());
@Override @Override
public void doGet(final HttpServletRequest request, public void doGet(final HttpServletRequest request,

View File

@ -71,8 +71,8 @@ public abstract class HttpOpParam<E extends Enum<E> & HttpOpParam.Op>
GetOpParam.Op.GETFILECHECKSUM); GetOpParam.Op.GETFILECHECKSUM);
static final List<TemporaryRedirectOp> values static final List<TemporaryRedirectOp> values
= Collections.unmodifiableList(Arrays.asList( = Collections.unmodifiableList(Arrays.asList(CREATE, APPEND, OPEN,
new TemporaryRedirectOp[]{CREATE, APPEND, OPEN, GETFILECHECKSUM})); GETFILECHECKSUM));
/** Get an object for the given op. */ /** Get an object for the given op. */
public static TemporaryRedirectOp valueOf(final Op op) { public static TemporaryRedirectOp valueOf(final Op op) {

View File

@ -75,8 +75,7 @@
} }
function get_response_err_msg(data) { function get_response_err_msg(data) {
var msg = data.RemoteException !== undefined ? data.RemoteException.message : ""; return data.RemoteException !== undefined ? data.RemoteException.message : "";
return msg;
} }
function view_file_details(path, abs_path) { function view_file_details(path, abs_path) {

View File

@ -208,7 +208,7 @@ public class TestQuorumJournalManagerUnit {
anyLong(), eq(1L), eq(1), Mockito.<byte[]>any()); anyLong(), eq(1L), eq(1), Mockito.<byte[]>any());
// And the third log not respond // And the third log not respond
SettableFuture<Void> slowLog = SettableFuture.<Void>create(); SettableFuture<Void> slowLog = SettableFuture.create();
Mockito.doReturn(slowLog).when(spyLoggers.get(2)).sendEdits( Mockito.doReturn(slowLog).when(spyLoggers.get(2)).sendEdits(
anyLong(), eq(1L), eq(1), Mockito.<byte[]>any()); anyLong(), eq(1L), eq(1), Mockito.<byte[]>any());
stm.flush(); stm.flush();

View File

@ -304,7 +304,7 @@ public class TestAclTransformation {
.add(aclEntry(DEFAULT, MASK, ALL)) .add(aclEntry(DEFAULT, MASK, ALL))
.add(aclEntry(DEFAULT, OTHER, READ)) .add(aclEntry(DEFAULT, OTHER, READ))
.build(); .build();
List<AclEntry> aclSpec = Lists.<AclEntry>newArrayList(); List<AclEntry> aclSpec = Lists.newArrayList();
assertEquals(existing, filterAclEntriesByAclSpec(existing, aclSpec)); assertEquals(existing, filterAclEntriesByAclSpec(existing, aclSpec));
} }
@ -705,7 +705,7 @@ public class TestAclTransformation {
.add(aclEntry(DEFAULT, MASK, ALL)) .add(aclEntry(DEFAULT, MASK, ALL))
.add(aclEntry(DEFAULT, OTHER, READ)) .add(aclEntry(DEFAULT, OTHER, READ))
.build(); .build();
List<AclEntry> aclSpec = Lists.<AclEntry>newArrayList(); List<AclEntry> aclSpec = Lists.newArrayList();
assertEquals(existing, mergeAclEntries(existing, aclSpec)); assertEquals(existing, mergeAclEntries(existing, aclSpec));
} }

View File

@ -622,7 +622,7 @@ public class TestCheckpoint {
} }
private File filePathContaining(final String substring) { private File filePathContaining(final String substring) {
return Mockito.<File>argThat( return Mockito.argThat(
new ArgumentMatcher<File>() { new ArgumentMatcher<File>() {
@Override @Override
public boolean matches(Object argument) { public boolean matches(Object argument) {

View File

@ -65,7 +65,7 @@ public class TestTransferFsImage {
MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf) MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
.numDataNodes(0).build(); .numDataNodes(0).build();
NNStorage mockStorage = Mockito.mock(NNStorage.class); NNStorage mockStorage = Mockito.mock(NNStorage.class);
List<File> localPath = Collections.<File>singletonList( List<File> localPath = Collections.singletonList(
new File("/xxxxx-does-not-exist/blah")); new File("/xxxxx-does-not-exist/blah"));
try { try {

View File

@ -414,6 +414,6 @@ public class TestDFSHAAdmin {
} }
private StateChangeRequestInfo anyReqInfo() { private StateChangeRequestInfo anyReqInfo() {
return Mockito.<StateChangeRequestInfo>any(); return Mockito.any();
} }
} }

View File

@ -56,8 +56,7 @@ public class TestOfflineEditsViewer {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private static ImmutableSet<FSEditLogOpCodes> skippedOps() { private static ImmutableSet<FSEditLogOpCodes> skippedOps() {
ImmutableSet.Builder<FSEditLogOpCodes> b = ImmutableSet ImmutableSet.Builder<FSEditLogOpCodes> b = ImmutableSet.builder();
.<FSEditLogOpCodes> builder();
// Deprecated opcodes // Deprecated opcodes
b.add(FSEditLogOpCodes.OP_DATANODE_ADD) b.add(FSEditLogOpCodes.OP_DATANODE_ADD)