aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp/java/sun/applet/PluginMain.java
diff options
context:
space:
mode:
authorAndrew John Hughes <[email protected]>2010-12-03 00:30:45 +0000
committerAndrew John Hughes <[email protected]>2010-12-03 00:30:45 +0000
commit8ddaf6d039146a442d35a7a31bfd48b061d456ff (patch)
tree023d91ea69877ae494e83bc01711c26c2ba41245 /plugin/icedteanp/java/sun/applet/PluginMain.java
parentcad9500675e6a5dd9600a55fbe6dcb9523d23609 (diff)
Fix warnings produced by NetX and the plugin (both Java and C++).
2010-12-01 Andrew John Hughes <[email protected]> * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCachedResource(URL,Version,UpdatePolicy)): Use toURI().toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheURL(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (destroy()): Suppress deprecated warning from use of thread.stop(). Only use when interrupt() has already been tried. * netx/net/sourceforge/jnlp/runtime/Boot.java: (getFile()): Use toURI.toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources()): Likewise. * netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java: (askUser(String,int,String,String)): Use getPassword() to retrieve a character array directly. Fix overrunning line. * netx/net/sourceforge/jnlp/tools/JarSigner.java: Remove unused IdentityScope variable, scope. * netx/net/sourceforge/nanoxml/XMLElement.java: (scanWhitespace(StringBuffer)): Don't fallthrough. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Fix warnings where std::string is used in printf rather than char* by invoking c_str on these strings. * plugin/icedteanp/java/netscape/javascript/JSException.java: (JSException()): Mark with @Deprecated annotation. (JSException(String)): Likewise. (JSException(String,String,int,String,int)): Likewise. * plugin/icedteanp/java/netscape/javascript/JSObject.java: (JSObject(String)): Remove redundant cast. (getWindow(Applet)): Likewise. * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java: (contexts): Initialise properly with generic typing. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: (getMatchingMethod(Object[]): Add missing generic type to Class instances. (getMatchingConstructor(Object[])): Likewise. (getCostAndCastedObject(Object,Class<?>)): Likewise. (getMatchingMethods(Class<?>,String,int)): Likewise. (getMatchingConstructors(Class<?>,int)): Likewise. (getNum(String,Class<?>)): Likewise. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (parseCall(String,ClassLoader,Class<V>)): Use c.cast rather than (V). (handleMessage(int,String,AccessControlContext,String)): Add missing generic type to Class instances. Remove redundant casts. (prepopulateField(int,String)): Add missing generic type to Class instance. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (createPanel(PluginStreamHandler,int,long,URL,Hashtable<String,String>)): Add missing generic types on Hashtable and PrivilegedAction. (initEventQueue(AppletPanel)): Add missing generic type to PrivilegedAction. (splitSeparator(String,String)): Use an ArrayList rather than Vector to avoid locking and use generic types. (requests): Initialise properly with generic typing. (applets): Likewise. (appletStateChanged(AppletEvent)): Use setSize and getPreferredSize. (handleMessage(int,String)): Remove redundant casts. (audioClips): Add generic types. (getAudioClip): Remove redundant cast. (imageRefs): Add generic types. (getCachedImageRef(URL)): Remove redundant cast. (appletPanels): Add generic types. (getApplets()): Likewise. (getStream(String)): Mark with @Override. (getStreamKeys()): Likewise. (systemParam): Add generic types. (printTag(PrintStream,Hashtable<String,String>)): Likewise. Remove redundant casts. (updateAtts()): Use getSize() and getInsets(). Use Integer.valueOf(). (appletReload()): Add generic types to PrivilegedAction. (scanIdentifier(int[],Reader)): Use StringBuilder to avoid unnecessary locking. (skipComment(int[],Reader)): Likewise. (scanTag(int[],Reader)): Likewise. Add generic types. (parse(int,long,String,String,Reader,URL)): Use PrivilegedExceptionAction to avoid catching and rethrowing the exception manually. Add generic types. (parse(int,long,String,String,Reader,URL,PrintStream,PluginAppletPanelFactory)): Add generic types. Remove unnecessary casts. Fix overlong lines. * plugin/icedteanp/java/sun/applet/PluginMain.java: (init()): Add generic types. Remove unnecessary cast. * plugin/icedteanp/java/sun/applet/PluginObjectStore.java: (objects): Initialise properly with generic typing. (counts): Likewise. (identifiers): Likewise. * plugin/icedteanp/java/sun/applet/PluginProxySelector.java: (get(Object)): Suppress unchecked warning arising from cast to K.
Diffstat (limited to 'plugin/icedteanp/java/sun/applet/PluginMain.java')
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginMain.java190
1 files changed, 95 insertions, 95 deletions
diff --git a/plugin/icedteanp/java/sun/applet/PluginMain.java b/plugin/icedteanp/java/sun/applet/PluginMain.java
index 6c83ffd..6c4b1f4 100644
--- a/plugin/icedteanp/java/sun/applet/PluginMain.java
+++ b/plugin/icedteanp/java/sun/applet/PluginMain.java
@@ -88,136 +88,136 @@ public class PluginMain
public static final String PLUGIN_STDERR_FILE = "java.stderr";
public static final String PLUGIN_STDOUT_FILE = "java.stdout";
- final boolean redirectStreams = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG");
- static PluginStreamHandler streamHandler;
-
- // This is used in init(). Getting rid of this is desirable but depends
+ final boolean redirectStreams = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG");
+ static PluginStreamHandler streamHandler;
+
+ // This is used in init(). Getting rid of this is desirable but depends
// on whether the property that uses it is necessary/standard.
public static final String theVersion = System.getProperty("java.version");
-
+
private PluginAppletSecurityContext securityContext;
/**
* The main entry point into AppletViewer.
*/
public static void main(String args[])
- throws IOException
+ throws IOException
{
if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
System.err.println("Invalid pipe names provided. Refusing to proceed.");
System.exit(1);
}
- try {
- PluginMain pm = new PluginMain(args[0], args[1]);
- } catch (Exception e) {
- e.printStackTrace();
- System.err.println("Something very bad happened. I don't know what to do, so I am going to exit :(");
- System.exit(1);
- }
+ try {
+ PluginMain pm = new PluginMain(args[0], args[1]);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err.println("Something very bad happened. I don't know what to do, so I am going to exit :(");
+ System.exit(1);
+ }
}
public PluginMain(String inPipe, String outPipe) {
-
- connect(inPipe, outPipe);
+
+ connect(inPipe, outPipe);
// must be called before JNLPRuntime.initialize()
JNLPRuntime.setRedirectStreams(redirectStreams);
- securityContext = new PluginAppletSecurityContext(0);
- securityContext.prePopulateLCClasses();
- securityContext.setStreamhandler(streamHandler);
- AppletSecurityContextManager.addContext(0, securityContext);
+ securityContext = new PluginAppletSecurityContext(0);
+ securityContext.prePopulateLCClasses();
+ securityContext.setStreamhandler(streamHandler);
+ AppletSecurityContextManager.addContext(0, securityContext);
- PluginAppletViewer.setStreamhandler(streamHandler);
- PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory());
+ PluginAppletViewer.setStreamhandler(streamHandler);
+ PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory());
- init();
+ init();
- // Streams set. Start processing.
- streamHandler.startProcessing();
+ // Streams set. Start processing.
+ streamHandler.startProcessing();
}
- public void connect(String inPipe, String outPipe) {
- try {
- streamHandler = new PluginStreamHandler(new FileInputStream(inPipe), new FileOutputStream(outPipe));
- PluginDebug.debug("Streams initialized");
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- private static void init() {
- Properties avProps = new Properties();
-
- // ADD OTHER RANDOM PROPERTIES
- // XXX 5/18 need to revisit why these are here, is there some
- // standard for what is available?
-
- // Standard browser properties
- avProps.put("browser", "sun.applet.AppletViewer");
- avProps.put("browser.version", "1.06");
- avProps.put("browser.vendor", "Sun Microsystems Inc.");
- avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion);
-
- // Define which packages can be extended by applets
- // XXX 5/19 probably not needed, not checked in AppletSecurity
- avProps.put("package.restrict.definition.java", "true");
- avProps.put("package.restrict.definition.sun", "true");
-
- // Define which properties can be read by applets.
- // A property named by "key" can be read only when its twin
- // property "key.applet" is true. The following ten properties
- // are open by default. Any other property can be explicitly
- // opened up by the browser user by calling appletviewer with
- // -J-Dkey.applet=true
- avProps.put("java.version.applet", "true");
- avProps.put("java.vendor.applet", "true");
- avProps.put("java.vendor.url.applet", "true");
- avProps.put("java.class.version.applet", "true");
- avProps.put("os.name.applet", "true");
- avProps.put("os.version.applet", "true");
- avProps.put("os.arch.applet", "true");
- avProps.put("file.separator.applet", "true");
- avProps.put("path.separator.applet", "true");
- avProps.put("line.separator.applet", "true");
-
- avProps.put("javaplugin.nodotversion", "160_17");
- avProps.put("javaplugin.version", "1.6.0_17");
- avProps.put("javaplugin.vm.options", "");
-
- // Read in the System properties. If something is going to be
- // over-written, warn about it.
- Properties sysProps = System.getProperties();
- for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) {
- String key = (String) e.nextElement();
- String val = (String) sysProps.getProperty(key);
- avProps.setProperty(key, val);
- }
-
- // INSTALL THE PROPERTY LIST
- System.setProperties(avProps);
-
- // plug in a custom authenticator and proxy selector
- boolean installAuthenticator = Boolean.valueOf(JNLPRuntime.getConfiguration()
- .getProperty(DeploymentConfiguration.KEY_SECURITY_INSTALL_AUTHENTICATOR));
- if (installAuthenticator) {
- Authenticator.setDefault(new JNLPAuthenticator());
- }
+ public void connect(String inPipe, String outPipe) {
+ try {
+ streamHandler = new PluginStreamHandler(new FileInputStream(inPipe), new FileOutputStream(outPipe));
+ PluginDebug.debug("Streams initialized");
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+ private static void init() {
+ Properties avProps = new Properties();
+
+ // ADD OTHER RANDOM PROPERTIES
+ // XXX 5/18 need to revisit why these are here, is there some
+ // standard for what is available?
+
+ // Standard browser properties
+ avProps.put("browser", "sun.applet.AppletViewer");
+ avProps.put("browser.version", "1.06");
+ avProps.put("browser.vendor", "Sun Microsystems Inc.");
+ avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion);
+
+ // Define which packages can be extended by applets
+ // XXX 5/19 probably not needed, not checked in AppletSecurity
+ avProps.put("package.restrict.definition.java", "true");
+ avProps.put("package.restrict.definition.sun", "true");
+
+ // Define which properties can be read by applets.
+ // A property named by "key" can be read only when its twin
+ // property "key.applet" is true. The following ten properties
+ // are open by default. Any other property can be explicitly
+ // opened up by the browser user by calling appletviewer with
+ // -J-Dkey.applet=true
+ avProps.put("java.version.applet", "true");
+ avProps.put("java.vendor.applet", "true");
+ avProps.put("java.vendor.url.applet", "true");
+ avProps.put("java.class.version.applet", "true");
+ avProps.put("os.name.applet", "true");
+ avProps.put("os.version.applet", "true");
+ avProps.put("os.arch.applet", "true");
+ avProps.put("file.separator.applet", "true");
+ avProps.put("path.separator.applet", "true");
+ avProps.put("line.separator.applet", "true");
+
+ avProps.put("javaplugin.nodotversion", "160_17");
+ avProps.put("javaplugin.version", "1.6.0_17");
+ avProps.put("javaplugin.vm.options", "");
+
+ // Read in the System properties. If something is going to be
+ // over-written, warn about it.
+ Properties sysProps = System.getProperties();
+ for (Enumeration<?> e = sysProps.propertyNames(); e.hasMoreElements(); ) {
+ String key = (String) e.nextElement();
+ String val = sysProps.getProperty(key);
+ avProps.setProperty(key, val);
+ }
+
+ // INSTALL THE PROPERTY LIST
+ System.setProperties(avProps);
+
+ // plug in a custom authenticator and proxy selector
+ boolean installAuthenticator = Boolean.valueOf(JNLPRuntime.getConfiguration()
+ .getProperty(DeploymentConfiguration.KEY_SECURITY_INSTALL_AUTHENTICATOR));
+ if (installAuthenticator) {
+ Authenticator.setDefault(new JNLPAuthenticator());
+ }
// override the proxy selector set by JNLPRuntime
ProxySelector.setDefault(new PluginProxySelector());
-
+
CookieManager ckManager = new PluginCookieManager();
CookieHandler.setDefault(ckManager);
- }
+ }
static boolean messageAvailable() {
- return streamHandler.messageAvailable();
+ return streamHandler.messageAvailable();
}
static String getMessage() {
- return streamHandler.getMessage();
+ return streamHandler.getMessage();
}
-
+
}