Fix various unchecked warnings

Checked type inference has changed slightly in Java 7, so many of the
suppressions are no longer necessary.

Change-Id: I73585e888b8204429ea67c8f4822d81d4dad8c46
This commit is contained in:
Dave Borowitz
2013-12-05 09:11:11 -08:00
parent 342781e181
commit 8d2ab515cb
12 changed files with 2 additions and 24 deletions

View File

@@ -46,7 +46,6 @@ class DirectChangeByCommit extends HttpServlet {
this.currentUser = currentUser;
}
@SuppressWarnings("unchecked")
@Override
protected void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {

View File

@@ -52,6 +52,7 @@ public class ForwardingRemovalListener<K, V> implements RemovalListener<K, V> {
}
}
@SuppressWarnings("unchecked")
public void onRemoval(RemovalNotification<K, V> notification) {
for (CacheRemovalListener<K, V> l : listeners) {
l.onRemoval(pluginName, cacheName, notification);

View File

@@ -188,7 +188,6 @@ public class ProjectWatch {
}
}
@SuppressWarnings("unchecked")
private boolean filterMatch(CurrentUser user, String filter)
throws OrmException, QueryParseException {
ChangeQueryBuilder qb;

View File

@@ -641,7 +641,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
return sortkey_before(sortKey);
}
@SuppressWarnings("unchecked")
@Override
protected Predicate<ChangeData> defaultField(String query)
throws QueryParseException {

View File

@@ -33,7 +33,6 @@ class CommentPredicate extends IndexPredicate<ChangeData> {
this.index = index;
}
@SuppressWarnings("unchecked")
@Override
public boolean match(ChangeData object) throws OrmException {
try {

View File

@@ -74,9 +74,7 @@ class IsWatchedByPredicate extends AndPredicate<ChangeData> {
}
if (p != null && f != null) {
@SuppressWarnings("unchecked")
Predicate<ChangeData> andPredicate = and(p, f);
r.add(andPredicate);
r.add(and(p, f));
} else if (p != null) {
r.add(p);
} else if (f != null) {

View File

@@ -37,7 +37,6 @@ class MessagePredicate extends IndexPredicate<ChangeData> {
this.index = index;
}
@SuppressWarnings("unchecked")
@Override
public boolean match(ChangeData object) throws OrmException {
try {

View File

@@ -237,7 +237,6 @@ public class QueryProcessor {
* there are more than {@code limit} matches and suggest to its own caller
* that the query could be retried with {@link #setSortkeyBefore(String)}.
*/
@SuppressWarnings("unchecked")
public List<List<ChangeData>> queryChanges(List<String> queries)
throws OrmException, QueryParseException {
final Predicate<ChangeData> visibleToMe = queryBuilder.is_visible();
@@ -423,7 +422,6 @@ public class QueryProcessor {
return limit > 0 ? Math.min(n, limit) + 1 : n + 1;
}
@SuppressWarnings("unchecked")
private Predicate<ChangeData> parseQuery(String queryString,
final Predicate<ChangeData> visibleToMe) throws QueryParseException {
Predicate<ChangeData> q = queryBuilder.parse(queryString);

View File

@@ -40,7 +40,6 @@ import org.junit.Test;
import java.util.EnumSet;
import java.util.Set;
@SuppressWarnings("unchecked")
public class IndexRewriteTest {
private FakeIndex index;
private IndexCollection indexes;

View File

@@ -49,7 +49,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testChildren() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -60,7 +59,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testChildrenUnmodifiable() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -91,7 +89,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testToString() {
final TestPredicate a = f("q", "alice");
final TestPredicate b = f("q", "bob");
@@ -101,7 +98,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testEquals() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -117,7 +113,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testHashCode() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -129,7 +124,6 @@ public class AndPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testCopy() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");

View File

@@ -49,7 +49,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testChildren() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -60,7 +59,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testChildrenUnmodifiable() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -91,7 +89,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testToString() {
final TestPredicate a = f("q", "alice");
final TestPredicate b = f("q", "bob");
@@ -101,7 +98,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testEquals() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -117,7 +113,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testHashCode() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
@@ -129,7 +124,6 @@ public class OrPredicateTest {
}
@Test
@SuppressWarnings("unchecked")
public void testCopy() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");

View File

@@ -397,7 +397,6 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
.size()])));
}
@SuppressWarnings("unchecked")
private void initMacs(final Config cfg) {
setMacFactories(filter(cfg, "mac", new HMACMD5.Factory(),
new HMACSHA1.Factory(), new HMACMD596.Factory(),