< prev index next >

src/share/classes/javax/swing/DebugGraphicsInfo.java

Print this page
rev 1527 : 6727662: Code improvement and warnings removing from swing packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: malenkov

@@ -35,20 +35,20 @@
   */
 class DebugGraphicsInfo {
     Color                flashColor = Color.red;
     int                  flashTime = 100;
     int                  flashCount = 2;
-    Hashtable            componentToDebug;
+    Hashtable<JComponent, Integer> componentToDebug;
     JFrame               debugFrame = null;
     java.io.PrintStream  stream = System.out;
 
     void setDebugOptions(JComponent component, int debug) {
         if (debug == 0) {
             return;
         }
         if (componentToDebug == null) {
-            componentToDebug = new Hashtable();
+            componentToDebug = new Hashtable<JComponent, Integer>();
         }
         if (debug > 0) {
             componentToDebug.put(component, new Integer(debug));
         } else {
             componentToDebug.remove(component);

@@ -57,11 +57,11 @@
 
     int getDebugOptions(JComponent component) {
         if (componentToDebug == null) {
             return 0;
         } else {
-            Integer integer = (Integer)componentToDebug.get(component);
+            Integer integer = componentToDebug.get(component);
 
             return integer == null ? 0 : integer.intValue();
         }
     }
 
< prev index next >