remove unnecessary casts (eclipse)

This commit is contained in:
zzz
2012-03-25 20:42:41 +00:00
parent ed13424913
commit 3e889d2747
59 changed files with 141 additions and 141 deletions

View File

@ -218,7 +218,7 @@ public class MetaInfo
if (l < oldTotal)
throw new InvalidBEncodingException("Huge total length");
val = (BEValue)desc.get("path");
val = desc.get("path");
if (val == null)
throw new InvalidBEncodingException("Missing path list");
List<BEValue> path_list = val.getList();
@ -244,7 +244,7 @@ public class MetaInfo
m_files.add(Collections.unmodifiableList(file));
val = (BEValue)desc.get("path.utf-8");
val = desc.get("path.utf-8");
if (val != null) {
path_list = val.getList();
path_length = path_list.size();

View File

@ -143,7 +143,7 @@ class PeerConnectionOut implements Runnable
}
}
if (m == null && !sendQueue.isEmpty()) {
m = (Message)sendQueue.remove(0);
m = sendQueue.remove(0);
//SimpleTimer.getInstance().removeEvent(m.expireEvent);
}
}

View File

@ -662,7 +662,7 @@ public class SnarkManager implements Snark.CompleteListener {
File dataDir = getDataDir();
Snark torrent = null;
synchronized (_snarks) {
torrent = (Snark)_snarks.get(filename);
torrent = _snarks.get(filename);
}
// don't hold the _snarks lock while verifying the torrent
if (torrent == null) {
@ -1132,9 +1132,9 @@ public class SnarkManager implements Snark.CompleteListener {
Snark torrent = null;
synchronized (_snarks) {
if (shouldRemove)
torrent = (Snark)_snarks.remove(filename);
torrent = _snarks.remove(filename);
else
torrent = (Snark)_snarks.get(filename);
torrent = _snarks.get(filename);
remaining = _snarks.size();
}
if (torrent != null) {

View File

@ -877,7 +877,7 @@ public class Storage
{
// First check if the piece is correct.
// Copy the array first to be paranoid.
byte[] bs = (byte[]) ba.clone();
byte[] bs = ba.clone();
int length = bs.length;
boolean correctHash = metainfo.checkPiece(piece, bs, 0, length);
if (listener != null)

View File

@ -302,7 +302,7 @@ public class I2PSnarkServlet extends DefaultServlet {
if (!msgs.isEmpty()) {
out.write("<div class=\"snarkMessages\"><ul>");
for (int i = msgs.size()-1; i >= 0; i--) {
String msg = (String)msgs.get(i);
String msg = msgs.get(i);
out.write("<li>" + msg + "</li>\n");
}
// lazy GET, lose p parameter
@ -1176,7 +1176,7 @@ public class I2PSnarkServlet extends DefaultServlet {
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
float pct;
if (isValid) {
pct = (float) (100.0 * (float) peer.completed() / meta.getPieces());
pct = (float) (100.0 * peer.completed() / meta.getPieces());
if (pct == 100.0)
out.write(_("Seed"));
else {