< prev index next >

src/java.desktop/share/classes/sun/applet/AppletPanel.java

Print this page

        

@@ -63,17 +63,10 @@
     /**
      * The applet (if loaded).
      */
     Applet applet;
 
-    /**
-     * Applet will allow initialization.  Should be
-     * set to false if loading a serialized applet
-     * that was pickled in the init=true state.
-     */
-    protected boolean doInit = true;
-
 
     /**
      * The classloader for the applet.
      */
     protected AppletClassLoader loader;

@@ -139,11 +132,10 @@
     boolean loadAbortRequest = false;
 
     /* abstract classes */
     abstract protected String getCode();
     abstract protected String getJarFiles();
-    abstract protected String getSerializedObject();
 
     @Override
     abstract public int    getWidth();
     @Override
     abstract public int    getHeight();

@@ -428,28 +420,26 @@
                       if (status != APPLET_LOAD && status != APPLET_DESTROY) {
                           showAppletStatus("notloaded");
                           break;
                       }
                       applet.resize(defaultAppletSize);
-                      if (doInit) {
+                      
                           if (PerformanceLogger.loggingEnabled()) {
                               PerformanceLogger.setTime("Applet Init");
                               PerformanceLogger.outputLog();
                           }
                           applet.init();
-                      }
+                      
 
                       //Need the default(fallback) font to be created in this AppContext
                       Font f = getFont();
                       if (f == null ||
                           "dialog".equals(f.getFamily().toLowerCase(Locale.ENGLISH)) &&
                           f.getSize() == 12 && f.getStyle() == Font.PLAIN) {
                           setFont(new Font(Font.DIALOG, Font.PLAIN, 12));
                       }
 
-                      doInit = true;    // allow restarts
-
                       // Validate the applet in event dispatch thread
                       // to avoid deadlock.
                       try {
                           final AppletPanel p = this;
                           Runnable r = new Runnable() {

@@ -784,38 +774,21 @@
         }
     }
 
     protected Applet createApplet(final AppletClassLoader loader) throws ClassNotFoundException,
                                                                          IllegalAccessException, IOException, InstantiationException, InterruptedException {
-        final String serName = getSerializedObject();
         String code = getCode();
 
-        if (code != null && serName != null) {
-            System.err.println(amh.getMessage("runloader.err"));
-//          return null;
-            throw new InstantiationException("Either \"code\" or \"object\" should be specified, but not both.");
-        }
-        if (code == null && serName == null) {
+        if (code != null) {
+            applet = (Applet)loader.loadCode(code).newInstance();
+        } else {
             String msg = "nocode";
             status = APPLET_ERROR;
             showAppletStatus(msg);
             showAppletLog(msg);
             repaint();
         }
-        if (code != null) {
-            applet = (Applet)loader.loadCode(code).newInstance();
-            doInit = true;
-        } else {
-            // serName is not null;
-            try (InputStream is = AccessController.doPrivileged(
-                    (PrivilegedAction<InputStream>)() -> loader.getResourceAsStream(serName));
-                 ObjectInputStream ois = new AppletObjectInputStream(is, loader)) {
-
-                applet = (Applet) ois.readObject();
-                doInit = false; // skip over the first init
-            }
-        }
 
         // Determine the JDK level that the applet targets.
         // This is critical for enabling certain backward
         // compatibility switch if an applet is a JDK 1.1
         // applet. [stanley.ho]
< prev index next >