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-6275. Fix warnings - type arguments can be inferred and redudant
local variable. (suresh)
Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -263,7 +263,7 @@ private List<File> getLatestEditsFiles() {
// the image is already current, discard edits
LOG.debug(
"Name checkpoint time is newer than edits, not loading edits.");
return Collections.<File>emptyList();
return Collections.emptyList();
}
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 Set<Long> currentlyDownloadingCheckpoints =
Collections.<Long>synchronizedSet(new HashSet<Long>());
Collections.synchronizedSet(new HashSet<Long>());
@Override
public void doGet(final HttpServletRequest request,

View File

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

View File

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

View File

@ -208,7 +208,7 @@ public void testWriteEditsOneSlow() throws Exception {
anyLong(), eq(1L), eq(1), Mockito.<byte[]>any());
// 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(
anyLong(), eq(1L), eq(1), Mockito.<byte[]>any());
stm.flush();

View File

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

View File

@ -622,11 +622,11 @@ private void doSecondaryFailsToReturnImage() throws IOException {
}
private File filePathContaining(final String substring) {
return Mockito.<File>argThat(
return Mockito.argThat(
new ArgumentMatcher<File>() {
@Override
public boolean matches(Object argument) {
String path = ((File)argument).getAbsolutePath();
String path = ((File) argument).getAbsolutePath();
return path.contains(substring);
}
});

View File

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

View File

@ -414,6 +414,6 @@ private Object runTool(String ... args) throws Exception {
}
private StateChangeRequestInfo anyReqInfo() {
return Mockito.<StateChangeRequestInfo>any();
return Mockito.any();
}
}

View File

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