changeset 23667:37f0fbe26e84

8028050: Typo correction needed s/Classlaoder/Classloader/ Reviewed-by: pchelko, azvegint
author serb
date Tue, 18 Mar 2014 16:07:01 +0400
parents a54bf43b5ba9
children 98a5be057aad
files jdk/src/share/classes/sun/applet/AppletPanel.java jdk/src/share/classes/sun/applet/AppletViewer.java
diffstat 2 files changed, 57 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java	Tue Mar 18 14:48:47 2014 +0400
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java	Tue Mar 18 16:07:01 2014 +0400
@@ -28,23 +28,16 @@
 import java.applet.*;
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.image.ColorModel;
-import java.awt.image.MemoryImageSource;
 import java.io.*;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.net.InetAddress;
 import java.net.JarURLConnection;
-import java.net.MalformedURLException;
 import java.net.SocketPermission;
 import java.net.URL;
-import java.net.UnknownHostException;
 import java.security.*;
 import java.util.*;
-import java.util.Collections;
 import java.util.Locale;
-import java.util.WeakHashMap;
 import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.EmbeddedFrame;
@@ -149,7 +142,9 @@
     abstract protected String getJarFiles();
     abstract protected String getSerializedObject();
 
+    @Override
     abstract public int    getWidth();
+    @Override
     abstract public int    getHeight();
     abstract public boolean hasInitialFocus();
 
@@ -185,6 +180,7 @@
         handler = new Thread(appletGroup, this, "thread " + nm);
         // set the context class loader for this thread
         AccessController.doPrivileged(new PrivilegedAction() {
+                @Override
                 public Object run() {
                     handler.setContextClassLoader(loader);
                     return null;
@@ -237,6 +233,7 @@
     /**
      * Minimum size
      */
+    @Override
     public Dimension minimumSize() {
         return new Dimension(defaultAppletSize.width,
                              defaultAppletSize.height);
@@ -245,6 +242,7 @@
     /**
      * Preferred size
      */
+    @Override
     public Dimension preferredSize() {
         return new Dimension(currentAppletSize.width,
                              currentAppletSize.height);
@@ -369,6 +367,7 @@
      *
      *
      */
+    @Override
     public void run() {
 
         Thread curThread = Thread.currentThread();
@@ -451,6 +450,7 @@
                       try {
                           final AppletPanel p = this;
                           Runnable r = new Runnable() {
+                              @Override
                               public void run() {
                                   p.validate();
                               }
@@ -481,6 +481,7 @@
                           final AppletPanel p = this;
                           final Applet a = applet;
                           Runnable r = new Runnable() {
+                              @Override
                               public void run() {
                                   p.validate();
                                   a.setVisible(true);
@@ -516,6 +517,7 @@
                     try {
                         final Applet a = applet;
                         Runnable r = new Runnable() {
+                            @Override
                             public void run() {
                                 a.setVisible(false);
                             }
@@ -575,6 +577,7 @@
                     try {
                         final Applet a = applet;
                         Runnable r = new Runnable() {
+                            @Override
                             public void run() {
                                 remove(a);
                             }
@@ -629,10 +632,13 @@
      */
     private Component getMostRecentFocusOwnerForWindow(Window w) {
         Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() {
+                @Override
                 public Object run() {
                     Method meth = null;
                     try {
-                        meth = KeyboardFocusManager.class.getDeclaredMethod("getMostRecentFocusOwner", new Class[] {Window.class});
+                        meth = KeyboardFocusManager.class.getDeclaredMethod(
+                                "getMostRecentFocusOwner",
+                                new Class[]{Window.class});
                         meth.setAccessible(true);
                     } catch (Exception e) {
                         // Must never happen
@@ -881,6 +887,7 @@
     /**
      * Return true when the applet has been started.
      */
+    @Override
     public boolean isActive() {
         return status == APPLET_START;
     }
@@ -890,6 +897,7 @@
     /**
      * Is called when the applet wants to be resized.
      */
+    @Override
     public void appletResize(int width, int height) {
         currentAppletSize.width = width;
         currentAppletSize.height = height;
@@ -905,17 +913,20 @@
         final AppletPanel ap = this;
         if (appEvtQ != null){
             appEvtQ.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(),
-                                                  new Runnable(){
-                                                      public void run(){
-                                                          if(ap != null)
-                                                          {
-                                                              ap.dispatchAppletEvent(APPLET_RESIZE, currentSize);
+                                                  new Runnable() {
+                                                      @Override
+                                                      public void run() {
+                                                          if (ap != null) {
+                                                              ap.dispatchAppletEvent(
+                                                                      APPLET_RESIZE,
+                                                                      currentSize);
                                                           }
                                                       }
                                                   }));
         }
     }
 
+    @Override
     public void setBounds(int x, int y, int width, int height) {
         super.setBounds(x, y, width, height);
         currentAppletSize.width = width;
@@ -967,7 +978,7 @@
     public String getClassLoaderCacheKey()
     {
         /**
-         * Fixed #4501142: Classlaoder sharing policy doesn't
+         * Fixed #4501142: Classloader sharing policy doesn't
          * take "archive" into account. This will be overridden
          * by Java Plug-in.                     [stanleyh]
          */
@@ -1013,6 +1024,7 @@
                 getAccessControlContext(codebase);
             c = (AppletClassLoader)
                 AccessController.doPrivileged(new PrivilegedAction() {
+                        @Override
                         public Object run() {
                             AppletClassLoader ac = createClassLoader(codebase);
                             /* Should the creation of the classloader be
@@ -1056,6 +1068,7 @@
 
         PermissionCollection perms = (PermissionCollection)
             AccessController.doPrivileged(new PrivilegedAction() {
+                    @Override
                     public Object run() {
                         Policy p = java.security.Policy.getPolicy();
                         if (p != null) {
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java	Tue Mar 18 14:48:47 2014 +0400
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java	Tue Mar 18 16:07:01 2014 +0400
@@ -33,21 +33,17 @@
 import javax.print.attribute.*;
 import java.applet.*;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.net.SocketPermission;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import sun.awt.SunToolkit;
 import sun.awt.AppContext;
-import java.lang.ref.WeakReference;
 
 /**
  * A frame to show the applet tag in.
  */
 @SuppressWarnings("serial") // JDK-implementation class
-class TextFrame extends Frame {
+final class TextFrame extends Frame {
 
     /**
      * Create the tag frame.
@@ -66,6 +62,7 @@
         p.add(b);
 
         class ActionEventListener implements ActionListener {
+            @Override
             public void actionPerformed(ActionEvent evt) {
                 dispose();
             }
@@ -78,6 +75,7 @@
 
         WindowListener windowEventListener = new WindowAdapter() {
 
+            @Override
             public void windowClosing(WindowEvent evt) {
                 dispose();
             }
@@ -90,20 +88,22 @@
 }
 
 /**
- * Lets us construct one using unix-style one shot behaviors
+ * Lets us construct one using unix-style one shot behaviors.
  */
+final class StdAppletViewerFactory implements AppletViewerFactory {
 
-class StdAppletViewerFactory implements AppletViewerFactory
-{
+    @Override
     public AppletViewer createAppletViewer(int x, int y,
                                            URL doc, Hashtable atts) {
         return new AppletViewer(x, y, doc, atts, System.out, this);
     }
 
+    @Override
     public MenuBar getBaseMenuBar() {
         return new MenuBar();
     }
 
+    @Override
     public boolean isStandalone() {
         return true;
     }
@@ -117,8 +117,7 @@
  *  once the JDK docs have been installed.)
  */
 @SuppressWarnings("serial") // JDK implementation class
-public class AppletViewer extends Frame implements AppletContext,
-                                                   Printable {
+public class AppletViewer extends Frame implements AppletContext, Printable {
 
     /**
      * Some constants...
@@ -148,13 +147,14 @@
 
 
     private final class UserActionListener implements ActionListener {
+        @Override
         public void actionPerformed(ActionEvent evt) {
             processUserAction(evt);
         }
     }
 
     /**
-     * Create the applet viewer
+     * Create the applet viewer.
      */
     public AppletViewer(int x, int y, URL doc, Hashtable atts,
                         PrintStream statusMsgStream, AppletViewerFactory factory) {
@@ -202,14 +202,17 @@
 
         WindowListener windowEventListener = new WindowAdapter() {
 
+            @Override
             public void windowClosing(WindowEvent evt) {
                 appletClose();
             }
 
+            @Override
             public void windowIconified(WindowEvent evt) {
                 appletStop();
             }
 
+            @Override
             public void windowDeiconified(WindowEvent evt) {
                 appletStart();
             }
@@ -224,6 +227,7 @@
                 this.frame = frame;
             }
 
+            @Override
             public void appletStateChanged(AppletEvent evt)
             {
                 AppletPanel src = (AppletPanel)evt.getSource();
@@ -371,6 +375,7 @@
     /**
      * Get an audio clip.
      */
+    @Override
     public AudioClip getAudioClip(URL url) {
         checkConnect(url);
         synchronized (audioClips) {
@@ -387,6 +392,7 @@
     /**
      * Get an image.
      */
+    @Override
     public Image getImage(URL url) {
         return getCachedImage(url);
     }
@@ -418,6 +424,7 @@
     /**
      * Get an applet by name.
      */
+    @Override
     public Applet getApplet(String name) {
         AppletSecurity security = (AppletSecurity)System.getSecurityManager();
         name = name.toLowerCase();
@@ -447,6 +454,7 @@
      * Return an enumeration of all the accessible
      * applets on this page.
      */
+    @Override
     public Enumeration getApplets() {
         AppletSecurity security = (AppletSecurity)System.getSecurityManager();
         Vector v = new Vector();
@@ -470,31 +478,37 @@
     /**
      * Ignore.
      */
+    @Override
     public void showDocument(URL url) {
     }
 
     /**
      * Ignore.
      */
+    @Override
     public void showDocument(URL url, String target) {
     }
 
     /**
      * Show status.
      */
+    @Override
     public void showStatus(String status) {
         label.setText(status);
     }
 
+    @Override
     public void setStream(String key, InputStream stream)throws IOException{
         // We do nothing.
     }
 
+    @Override
     public InputStream getStream(String key){
         // We do nothing.
         return null;
     }
 
+    @Override
     public Iterator getStreamKeys(){
         // We do nothing.
         return null;
@@ -608,7 +622,7 @@
         panel.sendEvent(AppletPanel.APPLET_DISPOSE);
 
         /**
-         * Fixed #4501142: Classlaoder sharing policy doesn't
+         * Fixed #4501142: Classloader sharing policy doesn't
          * take "archive" into account. This will be overridden
          * by Java Plug-in.                     [stanleyh]
          */
@@ -637,6 +651,7 @@
     void appletSave() {
         AccessController.doPrivileged(new PrivilegedAction() {
 
+            @Override
             public Object run() {
                 // XXX: this privileged block should be made smaller
                 // by initializing a private static variable with "user.dir"
@@ -765,6 +780,7 @@
         }
     }
 
+    @Override
     public int print(Graphics graphics, PageFormat pf, int pageIndex) {
         if (pageIndex > 0) {
             return Printable.NO_SUCH_PAGE;
@@ -829,6 +845,7 @@
 
         new Thread(new Runnable()
         {
+            @Override
             public void run()
             {
                 appletShutdown(p);
@@ -864,6 +881,7 @@
         //
         new Thread(new Runnable()
         {
+            @Override
             public void run()
             {
                 for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {