jdk/src/share/classes/java/awt/Container.java
changeset 15318 607db339afcc
parent 13652 42544e68dc39
child 15506 b947efcfde08
--- a/jdk/src/share/classes/java/awt/Container.java	Tue Jan 15 21:57:47 2013 +0400
+++ b/jdk/src/share/classes/java/awt/Container.java	Wed Jan 16 17:26:41 2013 +0400
@@ -161,7 +161,7 @@
     private boolean focusTraversalPolicyProvider;
 
     // keeps track of the threads that are printing this component
-    private transient Set printingThreads;
+    private transient Set<Thread> printingThreads;
     // True if there is at least one thread that's printing this component
     private transient boolean printing = false;
 
@@ -275,7 +275,7 @@
      */
     public Container() {
     }
-
+    @SuppressWarnings({"unchecked","rawtypes"})
     void initializeFocusTraversalKeys() {
         focusTraversalKeys = new Set[4];
     }
@@ -2006,7 +2006,7 @@
             try {
                 synchronized (getObjectLock()) {
                     if (printingThreads == null) {
-                        printingThreads = new HashSet();
+                        printingThreads = new HashSet<>();
                     }
                     printingThreads.add(t);
                     printing = true;
@@ -2148,7 +2148,7 @@
      * @since 1.4
      */
     public synchronized ContainerListener[] getContainerListeners() {
-        return (ContainerListener[]) (getListeners(ContainerListener.class));
+        return getListeners(ContainerListener.class);
     }
 
     /**
@@ -2599,9 +2599,9 @@
         if (GraphicsEnvironment.isHeadless()) {
             throw new HeadlessException();
         }
-        PointerInfo pi = (PointerInfo)java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-                public Object run() {
+        PointerInfo pi = java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<PointerInfo>() {
+                public PointerInfo run() {
                     return MouseInfo.getPointerInfo();
                 }
             }
@@ -2682,7 +2682,7 @@
                                                                  y - comp.y,
                                                                  ignoreEnabled);
                 } else {
-                    comp = comp.locate(x - comp.x, y - comp.y);
+                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
                 }
                 if (comp != null && comp.visible &&
                     (ignoreEnabled || comp.enabled))
@@ -2700,7 +2700,7 @@
                                                                  y - comp.y,
                                                                  ignoreEnabled);
                 } else {
-                    comp = comp.locate(x - comp.x, y - comp.y);
+                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
                 }
                 if (comp != null && comp.visible &&
                     (ignoreEnabled || comp.enabled))
@@ -4637,7 +4637,7 @@
     private void startListeningForOtherDrags() {
         //System.out.println("Adding AWTEventListener");
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     nativeContainer.getToolkit().addAWTEventListener(
                         LightweightDispatcher.this,
@@ -4652,7 +4652,7 @@
     private void stopListeningForOtherDrags() {
         //System.out.println("Removing AWTEventListener");
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     nativeContainer.getToolkit().removeAWTEventListener(LightweightDispatcher.this);
                     return null;