forked from I2P_Developers/i2p.i2p
lint redundant cast all over
This commit is contained in:
@@ -78,7 +78,7 @@ public class ConfigurationManager {
|
||||
* @return The value of a configuration: true if found, defaultValue if not found.
|
||||
*/
|
||||
public boolean getBooleanConfiguration(String arg, boolean defaultValue) {
|
||||
Boolean value = ((Boolean) booleanConfigurations.get("startWithI2P"));
|
||||
Boolean value = booleanConfigurations.get("startWithI2P");
|
||||
System.out.println(value);
|
||||
if(value != null) {
|
||||
return value;
|
||||
|
@@ -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;
|
||||
|
@@ -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)
|
||||
|
@@ -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 ? "" : "&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);
|
||||
|
@@ -78,7 +78,7 @@ public class TunnelRenderer {
|
||||
int inactive = 0;
|
||||
int displayed = 0;
|
||||
for (int i = 0; i < participating.size(); i++) {
|
||||
HopConfig cfg = (HopConfig)participating.get(i);
|
||||
HopConfig cfg = participating.get(i);
|
||||
long count = cfg.getProcessedMessagesCount();
|
||||
if (count <= 0) {
|
||||
inactive++;
|
||||
|
@@ -216,7 +216,7 @@ class PacketQueue implements SendMessageStatusListener {
|
||||
_connectionManager.getPacketHandler().displayPacket(packet, "SEND", suffix);
|
||||
if (I2PSocketManagerFull.pcapWriter != null &&
|
||||
_context.getBooleanProperty(I2PSocketManagerFull.PROP_PCAP))
|
||||
((PacketLocal)packet).logTCPDump();
|
||||
packet.logTCPDump();
|
||||
}
|
||||
|
||||
if ( (packet.getSequenceNum() == 0) && (!packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) ) {
|
||||
|
@@ -154,7 +154,7 @@ class RequestWrapper {
|
||||
{
|
||||
String result = defaultValue;
|
||||
if( multiPartRequest != null ) {
|
||||
String str = (String)cache.get( name );
|
||||
String str = cache.get(name);
|
||||
if( str != null ) {
|
||||
result = str;
|
||||
}
|
||||
|
@@ -1211,7 +1211,7 @@ public class WebMail extends HttpServlet
|
||||
for (Integer item : getCheckedItems(request)) {
|
||||
int n = item.intValue();
|
||||
for( int i = 0; i < sessionObject.attachments.size(); i++ ) {
|
||||
Attachment attachment = (Attachment)sessionObject.attachments.get( i );
|
||||
Attachment attachment = sessionObject.attachments.get(i);
|
||||
if( attachment.hashCode() == n ) {
|
||||
sessionObject.attachments.remove( i );
|
||||
break;
|
||||
|
@@ -290,7 +290,7 @@ public class MultiPartRequest
|
||||
{
|
||||
String key = line.substring(0,c).trim().toLowerCase();
|
||||
String value = line.substring(c+1,line.length()).trim();
|
||||
String ev = (String) part._headers.get(key);
|
||||
String ev = part._headers.get(key);
|
||||
part._headers.put(key,(ev!=null)?(ev+';'+value):value);
|
||||
//if(log.isDebugEnabled())log.debug(key+": "+value);
|
||||
if (key.equals("content-disposition"))
|
||||
|
Reference in New Issue
Block a user