diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java index 863c5d31a..91c18cfe4 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java @@ -256,9 +256,9 @@ public class I2PSocketManagerFactory { Class cls = Class.forName(classname); if (!I2PSocketManager.class.isAssignableFrom(cls)) throw new IllegalArgumentException(classname + " is not an I2PSocketManager"); - Constructor con = (Constructor) - cls.getConstructor(new Class[] {I2PAppContext.class, I2PSession.class, Properties.class, String.class}); - I2PSocketManager mgr = con.newInstance(new Object[] {context, session, opts, name}); + Constructor con = + cls.getConstructor(I2PAppContext.class, I2PSession.class, Properties.class, String.class); + I2PSocketManager mgr = (I2PSocketManager) con.newInstance(new Object[] {context, session, opts, name}); return mgr; } catch (Throwable t) { getLog().log(Log.CRIT, "Error loading " + classname, t); diff --git a/apps/routerconsole/java/src/net/i2p/router/news/NewsManager.java b/apps/routerconsole/java/src/net/i2p/router/news/NewsManager.java index 9f21bf93c..d85baadf5 100644 --- a/apps/routerconsole/java/src/net/i2p/router/news/NewsManager.java +++ b/apps/routerconsole/java/src/net/i2p/router/news/NewsManager.java @@ -64,7 +64,7 @@ public class NewsManager implements RouterApp { */ public synchronized List getEntries() { if (!_currentNews.isEmpty()) - return new ArrayList(_currentNews); + return new ArrayList(_currentNews); // load old news.xml if (_log.shouldWarn()) _log.warn("no real XML, falling back to news.xml"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java index e902e9c72..5c65011a0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java @@ -4,6 +4,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.Properties; +import net.i2p.util.LogManager; + /** * Handler to deal with form submissions from the logging config form and act * upon the values. @@ -113,7 +115,7 @@ public class ConfigLoggingHandler extends FormHandler { } if (_fileSize != null) { - int newBytes = _context.logManager().getFileSize(_fileSize); + int newBytes = LogManager.getFileSize(_fileSize); int oldBytes = _context.logManager().getFileSize(); if (newBytes > 0) { if (oldBytes != newBytes) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java index 1b2dabb3a..d4bd1d2ff 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java @@ -23,6 +23,7 @@ public abstract class FormHandler { protected RouterContext _context; protected Log _log; /** Not for multipart/form-data, will be null */ + @SuppressWarnings("rawtypes") protected Map _settings; /** Only for multipart/form-data. Warning, parameters are NOT XSS filtered */ protected RequestWrapper _requestWrapper; @@ -63,6 +64,7 @@ public abstract class FormHandler { * * @since 0.9.4 consolidated from numerous FormHandlers */ + @SuppressWarnings({"rawtypes", "unchecked"}) public void setSettings(Map settings) { _settings = new HashMap(settings); } /** diff --git a/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java index 74ce11a19..1343a88cd 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java @@ -83,6 +83,7 @@ public class LocaleWebAppHandler extends HandlerWrapper if (lang != null && lang.length() > 0 && !lang.equals("en")) { String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp"; // Do we have a servlet for the new path that isn't the catchall *.jsp? + @SuppressWarnings("rawtypes") Map.Entry servlet = _wac.getServletHandler().getHolderEntry(testPath); if (servlet != null) { String servletPath = (String) servlet.getKey(); @@ -130,7 +131,7 @@ public class LocaleWebAppHandler extends HandlerWrapper /** * Mysteriously removed from Jetty 7 */ - private void setInitParams(Map params) { + private void setInitParams(Map params) { setInitParams(_wac, params); } @@ -138,7 +139,7 @@ public class LocaleWebAppHandler extends HandlerWrapper * @since Jetty 7 */ public static void setInitParams(WebAppContext context, Map params) { - for (Map.Entry e : params.entrySet()) { + for (Map.Entry e : params.entrySet()) { context.setInitParameter((String)e.getKey(), (String)e.getValue()); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java index 608de2aea..386eb664e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java @@ -264,6 +264,7 @@ public class PluginStarter implements Runnable { * @return true on success * @throws just about anything, caller would be wise to catch Throwable */ + @SuppressWarnings("deprecation") public static boolean startPlugin(RouterContext ctx, String appName) throws Exception { Log log = ctx.logManager().getLog(PluginStarter.class); File pluginDir = new File(ctx.getConfigDir(), PLUGIN_DIR + '/' + appName); @@ -344,9 +345,11 @@ public class PluginStarter implements Runnable { if (tfiles != null) { for (int i = 0; i < tfiles.length; i++) { String name = tfiles[i].getName(); - if (tfiles[i].isDirectory() && (!Arrays.asList(STANDARD_THEMES).contains(tfiles[i]))) + if (tfiles[i].isDirectory() && (!Arrays.asList(STANDARD_THEMES).contains(tfiles[i]))) { + // deprecated ctx.router().setConfigSetting(ConfigUIHelper.PROP_THEME_PFX + name, tfiles[i].getAbsolutePath()); // we don't need to save + } } } @@ -543,7 +546,7 @@ public class PluginStarter implements Runnable { boolean deleted = FileUtil.rmdir(pluginDir, false); Properties props = pluginProperties(); - for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) { + for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) { String name = (String)iter.next(); if (name.startsWith(PREFIX + appName + '.')) iter.remove(); @@ -973,7 +976,7 @@ public class PluginStarter implements Runnable { private static void addPath(URL u) throws Exception { URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Class urlClass = URLClassLoader.class; - Method method = urlClass.getDeclaredMethod("addURL", new Class[]{URL.class}); + Method method = urlClass.getDeclaredMethod("addURL", URL.class); method.setAccessible(true); method.invoke(urlClassLoader, new Object[]{u}); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java index aab84c630..a761a5ac2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java @@ -212,14 +212,16 @@ public class TunnelRenderer { } out.write("\n"); if (in != null) { - List pending = in.listPending(); + // PooledTunnelCreatorConfig + List pending = in.listPending(); if (!pending.isEmpty()) { out.write("
" + _t("Build in progress") + ": " + pending.size() + " " + _t("inbound") + "
\n"); live += pending.size(); } } if (outPool != null) { - List pending = outPool.listPending(); + // PooledTunnelCreatorConfig + List pending = outPool.listPending(); if (!pending.isEmpty()) { out.write("
" + _t("Build in progress") + ": " + pending.size() + " " + _t("outbound") + "
\n"); live += pending.size();