diff --git a/src/net/i2p/itoopie/gui/SettingsFrame.java b/src/net/i2p/itoopie/gui/SettingsFrame.java index cb934e715..9270e4f07 100644 --- a/src/net/i2p/itoopie/gui/SettingsFrame.java +++ b/src/net/i2p/itoopie/gui/SettingsFrame.java @@ -72,8 +72,7 @@ public class SettingsFrame extends TabLogoPanel { - private static final Log _log = LogFactory.getLog(SettingsFrame.class); - private static Boolean instanceShown = false; + private final Log _log = LogFactory.getLog(SettingsFrame.class); // ConnectPanel private JTextField txtRouterIP; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java index f24506fe6..5eb87ee19 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java @@ -16,7 +16,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class GetEcho { - private final static Log _log = LogFactory.getLog(GetEcho.class); @SuppressWarnings("unchecked") public static String execute(String str) @@ -34,8 +33,10 @@ public class GetEcho { Map inParams = (HashMap) resp.getResult(); return (String) inParams.get("Result"); } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(GetEcho.class); _log.error("GetEcho failed.", e); } catch (InvalidParametersException e) { + Log _log = LogFactory.getLog(GetEcho.class); _log.error("Remote host rejected provided parameters: " + req.toJSON().toJSONString()); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetI2PControl.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetI2PControl.java index a8911d9a4..cd877196b 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetI2PControl.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetI2PControl.java @@ -20,8 +20,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class GetI2PControl { - private final static Log _log = LogFactory.getLog(GetI2PControl.class); - public static EnumMap execute(I2P_CONTROL ... settings) throws InvalidPasswordException, JSONRPC2SessionException{ @@ -58,8 +56,10 @@ public class GetI2PControl { return new EnumMap(I2P_CONTROL.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(GetI2PControl.class); _log.error("getI2PControl failed.", e); } catch (InvalidParametersException e) { + Log _log = LogFactory.getLog(GetI2PControl.class); _log.error("getI2PControl was rejected by remote host as invalid.", e); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java index 23b3b4234..34d92bfa6 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java @@ -22,7 +22,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class GetNetworkSetting { - private final static Log _log = LogFactory.getLog(GetNetworkSetting.class); public static EnumMap execute(NETWORK_SETTING ... options) throws InvalidPasswordException, JSONRPC2SessionException{ @@ -61,8 +60,10 @@ public class GetNetworkSetting { return new EnumMap(NETWORK_SETTING.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(GetNetworkSetting.class); _log.error("getNetworkInfo failed.", e); } catch (InvalidParametersException e) { + Log _log = LogFactory.getLog(GetNetworkSetting.class); _log.error("Remote host rejected provided parameters: " + req.toJSON().toJSONString()); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java index e3438d561..c8625a860 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java @@ -17,7 +17,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class GetRateStat{ - private final static Log _log = LogFactory.getLog(GetRateStat.class); @SuppressWarnings("unchecked") public static Double execute(String stat, long period) @@ -42,6 +41,7 @@ public class GetRateStat{ Double dbl = (Double) inParams.get("Result"); return dbl; } catch (ClassCastException e){ + Log _log = LogFactory.getLog(GetRateStat.class); _log.debug("Error: Tried to cast a BigDecimal as Double"); } try { @@ -49,9 +49,11 @@ public class GetRateStat{ Double dbl = bigNum.doubleValue(); return dbl; } catch (ClassCastException e){ + Log _log = LogFactory.getLog(GetRateStat.class); _log.debug("Error: Tried to cast a double as a BigDecimal"); } }catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(GetRateStat.class); _log.error("getRateStat failed.", e); } return new Double(0); diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetRouterInfo.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetRouterInfo.java index 65a4c639d..6a78b15d5 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetRouterInfo.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetRouterInfo.java @@ -23,7 +23,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class GetRouterInfo { - private final static Log _log = LogFactory.getLog(GetRouterInfo.class); private static HashMap enumMap; public static enum NETWORK_STATUS{ @@ -89,8 +88,10 @@ public class GetRouterInfo { return new EnumMap(ROUTER_INFO.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(GetRouterInfo.class); _log.error("getRouterInfo failed.", e); } catch (InvalidParametersException e) { + Log _log = LogFactory.getLog(GetRouterInfo.class); _log.error("Remote host rejected provided parameters: " + req.toJSON().toJSONString()); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/SetI2PControl.java b/src/net/i2p/itoopie/i2pcontrol/methods/SetI2PControl.java index 39548f0b9..6a933e8f5 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/SetI2PControl.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/SetI2PControl.java @@ -20,8 +20,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class SetI2PControl { - private final static Log _log = LogFactory.getLog(SetI2PControl.class); - public static EnumMap execute(Map settings) throws InvalidPasswordException, JSONRPC2SessionException, InvalidParametersException{ @@ -59,6 +57,7 @@ public class SetI2PControl { return new EnumMap(I2P_CONTROL.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(SetI2PControl.class); _log.error("setI2PControl failed.", e); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java b/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java index e57f55166..ba94a607a 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java @@ -20,8 +20,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class SetNetworkSetting { - private final static Log _log = LogFactory.getLog(SetNetworkSetting.class); - public static EnumMap execute(Map settings) throws InvalidPasswordException, JSONRPC2SessionException, InvalidParametersException{ @@ -59,6 +57,7 @@ public class SetNetworkSetting { return new EnumMap(NETWORK_SETTING.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(SetNetworkSetting.class); _log.error("setNetworkInfo failed.", e); } return null; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/SetRouterManager.java b/src/net/i2p/itoopie/i2pcontrol/methods/SetRouterManager.java index 43eca3391..4f0a814d4 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/SetRouterManager.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/SetRouterManager.java @@ -22,8 +22,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; public class SetRouterManager { - private final static Log _log = LogFactory.getLog(SetRouterManager.class); - public static EnumMap execute(Map commands) throws InvalidPasswordException, JSONRPC2SessionException{ @@ -63,8 +61,10 @@ public class SetRouterManager { return new EnumMap(ROUTER_MANAGER.class); } } catch (UnrecoverableFailedRequestException e) { + Log _log = LogFactory.getLog(SetRouterManager.class); _log.error("setRouterManager failed.", e); } catch (InvalidParametersException e) { + Log _log = LogFactory.getLog(SetRouterManager.class); _log.error("Remote host rejected provided parameters: " + req.toJSON().toJSONString()); } return null; diff --git a/src/net/i2p/itoopie/security/CertificateHelper.java b/src/net/i2p/itoopie/security/CertificateHelper.java index 4bdde6120..31a90e5e1 100644 --- a/src/net/i2p/itoopie/security/CertificateHelper.java +++ b/src/net/i2p/itoopie/security/CertificateHelper.java @@ -23,18 +23,13 @@ import org.apache.commons.logging.LogFactory; public class CertificateHelper { - private static Log _log; - - static { - _log = LogFactory.getLog(CertificateHelper.class); - } - public static X509Certificate certFromBase64(String base64){ try { CertificateFactory cf = CertificateFactory.getInstance(CertificateManager.DEFAULT_CERT_SPI); byte[] bytes = Base64.decode(base64); return (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(bytes)); } catch (CertificateException e) { + Log _log = LogFactory.getLog(CertificateHelper.class); _log.fatal("Unable to load service interface provider, " + CertificateManager.DEFAULT_CERT_SPI + " used for reading base64 encoded certificates", e);