lint redundant cast all over

This commit is contained in:
zzz
2014-06-26 15:26:58 +00:00
parent bc99bc7206
commit ca4555c496
21 changed files with 36 additions and 38 deletions

View File

@ -194,9 +194,8 @@ public class Peer implements Comparable<Peer>
* Compares the PeerIDs.
* @deprecated unused?
*/
public int compareTo(Peer o)
public int compareTo(Peer p)
{
Peer p = (Peer)o;
int rv = peerID.compareTo(p.peerID);
if (rv == 0) {
if (_id > p._id) return 1;

View File

@ -62,7 +62,7 @@ class TrackerInfo
private TrackerInfo(Map<String, BEValue> m, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util)
throws IOException
{
BEValue reason = (BEValue)m.get("failure reason");
BEValue reason = m.get("failure reason");
if (reason != null)
{
failure_reason = reason.getString();
@ -72,13 +72,13 @@ class TrackerInfo
else
{
failure_reason = null;
BEValue beInterval = (BEValue)m.get("interval");
BEValue beInterval = m.get("interval");
if (beInterval == null)
throw new InvalidBEncodingException("No interval given");
else
interval = beInterval.getInt();
BEValue bePeers = (BEValue)m.get("peers");
BEValue bePeers = m.get("peers");
if (bePeers == null) {
peers = Collections.emptySet();
} else {
@ -93,14 +93,14 @@ class TrackerInfo
peers = p;
}
BEValue bev = (BEValue)m.get("complete");
BEValue bev = m.get("complete");
if (bev != null) try {
complete = bev.getInt();
if (complete < 0)
complete = 0;
} catch (InvalidBEncodingException ibe) {}
bev = (BEValue)m.get("incomplete");
bev = m.get("incomplete");
if (bev != null) try {
incomplete = bev.getInt();
if (incomplete < 0)

View File

@ -204,8 +204,7 @@ public class I2PSnarkServlet extends BasicServlet {
resp.sendError(404);
} else {
String base = addPaths(req.getRequestURI(), "/");
@SuppressWarnings("unchecked") // TODO-Java6: Remove cast, return type is correct
String listing = getListHTML(resource, base, true, method.equals("POST") ? (Map<String, String[]>) req.getParameterMap() : null);
String listing = getListHTML(resource, base, true, method.equals("POST") ? req.getParameterMap() : null);
if (method.equals("POST")) {
// P-R-G
sendRedirect(req, resp, "");
@ -547,7 +546,7 @@ public class I2PSnarkServlet extends BasicServlet {
String stParamStr = stParam == null ? "" : "&amp;st=" + stParam;
for (int i = 0; i < total; i++) {
Snark snark = (Snark)snarks.get(i);
Snark snark = snarks.get(i);
boolean showPeers = showDebug || "1".equals(peerParam) || Base64.encode(snark.getInfoHash()).equals(peerParam);
boolean hide = i < start || i >= start + pageSize;
displaySnark(out, snark, uri, i, stats, showPeers, isDegraded, noThinsp, showDebug, hide, stParamStr);