jdk/src/share/classes/java/awt/Dialog.java

Print this page

        

@@ -1045,13 +1045,13 @@
                     };
 
                     // if this dialog is toolkit-modal, the filter should be added
                     // to all EDTs (for all AppContexts)
                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
-                        Iterator it = AppContext.getAppContexts().iterator();
+                        Iterator<AppContext> it = AppContext.getAppContexts().iterator();
                         while (it.hasNext()) {
-                            AppContext appContext = (AppContext)it.next();
+                            AppContext appContext = it.next();
                             if (appContext == showAppContext) {
                                 continue;
                             }
                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
                             // it may occur that EDT for appContext hasn't been started yet, so

@@ -1082,13 +1082,13 @@
                     }
 
                     // if this dialog is toolkit-modal, its filter must be removed
                     // from all EDTs (for all AppContexts)
                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
-                        Iterator it = AppContext.getAppContexts().iterator();
+                        Iterator<AppContext> it = AppContext.getAppContexts().iterator();
                         while (it.hasNext()) {
-                            AppContext appContext = (AppContext)it.next();
+                            AppContext appContext = it.next();
                             if (appContext == showAppContext) {
                                 continue;
                             }
                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
                             EventDispatchThread edt = eventQueue.getDispatchThread();

@@ -1394,11 +1394,11 @@
         IdentityArrayList<Dialog> blockers = new IdentityArrayList<Dialog>();
         for (Dialog d : modalDialogs) {
             if (d.shouldBlock(this)) {
                 Window w = d;
                 while ((w != null) && (w != this)) {
-                    w = (Window)(w.getOwner_NoClientCode());
+                    w = w.getOwner_NoClientCode();
                 }
                 if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
                     blockers.add(d);
                 }
             }

@@ -1609,11 +1609,11 @@
         // in 1.5 or earlier modalityType was absent, so use "modal" instead
         if (modalityType == null) {
             setModal(modal);
         }
 
-        blockedWindows = new IdentityArrayList();
+        blockedWindows = new IdentityArrayList<>();
     }
 
     /*
      * --- Accessibility Support ---
      *