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 @@ class FSImagePreTransactionalStorageInspector extends FSImageStorageInspector {
// 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 abstract class HttpOpParam<E extends Enum<E> & HttpOpParam.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 class TestQuorumJournalManagerUnit {
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 class TestAclTransformation {
.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 class TestAclTransformation {
.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 @@ public class TestCheckpoint {
}
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 class TestTransferFsImage {
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 @@ public class TestDFSHAAdmin {
}
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)