harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [9/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java Sat Nov 25 16:04:10 2006
@@ -49,7 +49,6 @@
 import java.lang.reflect.Method;
 import java.util.EventListener;
 import java.util.Locale;
-
 import javax.swing.border.Border;
 import javax.swing.border.EmptyBorder;
 import javax.swing.event.AncestorEvent;
@@ -58,20 +57,19 @@
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.basic.BasicPanelUI;
 
+@SuppressWarnings("serial")
 public class JComponentTest extends SwingTestCase {
-
     protected JComponent panel = null;
 
     protected int find(final Object[] array, final Object value) {
         int found = 0;
         if (array != null) {
-            for (int i = 0; i < array.length; i++ ){
+            for (int i = 0; i < array.length; i++) {
                 if (array[i].equals(value)) {
                     found++;
                 }
             }
         }
-
         return found;
     }
 
@@ -86,6 +84,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         panel = new JComponent() {
@@ -98,9 +97,9 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
-
         panel = null;
     }
 
@@ -141,7 +140,6 @@
         int height = 200;
         int width = 400;
         panel.setBounds(x, y, width, height);
-
         assertTrue(panel.contains(20, 50));
         assertTrue(panel.contains(width - 20, height - 50));
         assertFalse(panel.contains(width + 20, height - 50));
@@ -154,7 +152,6 @@
         int height = 200;
         int width = 400;
         panel.setBounds(x, y, width, height);
-
         assertTrue(panel.getLocation().equals(new Point(x, y)));
         assertTrue(panel.getSize().equals(new Dimension(width, height)));
     }
@@ -185,7 +182,6 @@
         panel.setBounds(newBounds);
         Rectangle boundsObtained = new Rectangle();
         boundsObtained = panel.getBounds(boundsObtained);
-
         assertEquals(newBounds, boundsObtained);
     }
 
@@ -197,7 +193,6 @@
         panel.setLocation(newLocation);
         Point pointObtained = new Point();
         pointObtained = panel.getLocation(pointObtained);
-
         assertTrue(pointObtained.equals(newLocation));
     }
 
@@ -206,16 +201,13 @@
      */
     public void testGetInsets() {
         Insets insetsObtained = panel.getInsets();
-
         assertTrue(insetsObtained.equals(new Insets(0, 0, 0, 0)));
         int top = 10;
         int left = 20;
         int bottom = 30;
         int right = 40;
-
         panel.setBorder(new EmptyBorder(top, left, bottom, right));
         insetsObtained = panel.getInsets();
-
         assertTrue(insetsObtained.equals(new Insets(top, left, bottom, right)));
     }
 
@@ -229,13 +221,10 @@
         int right = 40;
         Insets insetsForParameter = new Insets(right, bottom, left, top);
         Insets insetsObtained = panel.getInsets(insetsForParameter);
-
         assertTrue(insetsObtained.equals(new Insets(0, 0, 0, 0)));
-
         insetsForParameter = new Insets(right, bottom, left, top);
         panel.setBorder(new EmptyBorder(top, left, bottom, right));
         insetsObtained = panel.getInsets(insetsForParameter);
-
         assertTrue(insetsObtained.equals(new Insets(top, left, bottom, right)));
     }
 
@@ -247,7 +236,6 @@
         panel.setSize(newSize);
         Dimension sizeObtained = new Dimension();
         sizeObtained = panel.getSize(sizeObtained);
-
         assertTrue(newSize.equals(sizeObtained));
     }
 
@@ -256,19 +244,16 @@
      */
     public void testGetMinimumSize() {
         panel = new JLayeredPane();
-        assertEquals(new Dimension(0 ,0), panel.getMinimumSize());
-
+        assertEquals(new Dimension(0, 0), panel.getMinimumSize());
         panel = new JPanel();
         panel.setPreferredSize(new Dimension(100, 200));
-//        assertEquals(new Dimension(10 ,10), panel.getMinimumSize());
-
+        //        assertEquals(new Dimension(10 ,10), panel.getMinimumSize());
         panel = new JPanel();
         panel.setMinimumSize(new Dimension(100, 200));
-        assertEquals(new Dimension(100 ,200), panel.getMinimumSize());
-
-//        if (InternalTests.isIncluded) {
-//            assertTrue(panel.getMinimumSize() != panel.getMinimumSize());
-//        }
+        assertEquals(new Dimension(100, 200), panel.getMinimumSize());
+        //        if (InternalTests.isIncluded) {
+        //            assertTrue(panel.getMinimumSize() != panel.getMinimumSize());
+        //        }
     }
 
     /*
@@ -277,19 +262,19 @@
     public void testSetMinimumSizeDimension() {
         final Dimension minimumSize1 = new Dimension(100, 200);
         final Dimension minimumSize2 = new Dimension(200, 300);
-
         class MinimumListener implements PropertyChangeListener {
             boolean caught = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 assertTrue("minimumSize".equals(evt.getPropertyName()));
                 assertTrue(minimumSize1.equals(evt.getOldValue()));
                 assertTrue(minimumSize2.equals(evt.getNewValue()));
                 caught = true;
             }
-        };
+        }
+        ;
         panel.setMinimumSize(minimumSize1);
         assertTrue(panel.getMinimumSize().equals(minimumSize1));
-
         MinimumListener listener = new MinimumListener();
         panel.addPropertyChangeListener(listener);
         panel.setMinimumSize(minimumSize2);
@@ -303,17 +288,13 @@
     public void testGetMaximumSize() {
         panel = new JPanel();
         panel.setPreferredSize(new Dimension(100, 200));
-
         assertEquals(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE), panel.getMaximumSize());
-
         panel = new JPanel();
         panel.setMaximumSize(new Dimension(100, 200));
-
         assertEquals(new Dimension(100, 200), panel.getMaximumSize());
-
-//        if (InternalTests.isIncluded) {
-//            assertTrue(panel.getMaximumSize() != panel.getMaximumSize());
-//        }
+        //        if (InternalTests.isIncluded) {
+        //            assertTrue(panel.getMaximumSize() != panel.getMaximumSize());
+        //        }
     }
 
     /*
@@ -322,21 +303,20 @@
     public void testSetMaximumSizeDimension() {
         final Dimension maximumSize1 = new Dimension(100, 200);
         final Dimension maximumSize2 = new Dimension(200, 300);
-
         class MaximumListener implements PropertyChangeListener {
             boolean caught = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 assertTrue("maximumSize".equals(evt.getPropertyName()));
                 assertTrue(maximumSize1.equals(evt.getOldValue()));
                 assertTrue(maximumSize2.equals(evt.getNewValue()));
                 caught = true;
             }
-        };
-
+        }
+        ;
         panel.setMaximumSize(maximumSize1);
         assertTrue(maximumSize1.equals(panel.getMaximumSize()));
         MaximumListener listener = new MaximumListener();
-
         panel.addPropertyChangeListener(listener);
         panel.setMaximumSize(maximumSize2);
         assertTrue(listener.caught);
@@ -349,22 +329,17 @@
     public void testGetPreferredSize() {
         final Dimension preferredSize1 = new Dimension(100, 200);
         final Dimension preferredSize2 = new Dimension(200, 300);
-
         panel.setPreferredSize(preferredSize1);
         assertTrue(preferredSize1.equals(panel.getPreferredSize()));
         panel.setPreferredSize(preferredSize2);
         assertTrue(preferredSize2.equals(panel.getPreferredSize()));
-
         panel = new JLayeredPane();
-
-        assertEquals(new Dimension(0 ,0), panel.getPreferredSize());
-
+        assertEquals(new Dimension(0, 0), panel.getPreferredSize());
         panel.setPreferredSize(new Dimension(100, 200));
-        assertEquals(new Dimension(100 ,200), panel.getPreferredSize());
-
-//        if (InternalTests.isIncluded) {
-//            assertTrue(panel.getPreferredSize() != panel.getPreferredSize());
-//        }
+        assertEquals(new Dimension(100, 200), panel.getPreferredSize());
+        //        if (InternalTests.isIncluded) {
+        //            assertTrue(panel.getPreferredSize() != panel.getPreferredSize());
+        //        }
     }
 
     /*
@@ -373,33 +348,31 @@
     public void testSetPreferredSizeDimension() {
         final Dimension preferredSize1 = new Dimension(100, 200);
         final Dimension preferredSize2 = new Dimension(200, 300);
-
         class PreferredListener implements PropertyChangeListener {
             boolean caught = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 assertTrue("preferredSize".equals(evt.getPropertyName()));
                 assertTrue(preferredSize1.equals(evt.getOldValue()));
                 assertTrue(preferredSize2.equals(evt.getNewValue()));
                 caught = true;
             }
-        };
-
+        }
+        ;
         panel.setPreferredSize(preferredSize1);
         assertTrue(preferredSize1.equals(panel.getPreferredSize()));
-
         PreferredListener listener = new PreferredListener();
         panel.addPropertyChangeListener(listener);
         panel.setPreferredSize(preferredSize2);
         assertTrue(listener.caught);
         assertTrue(preferredSize2.equals(panel.getPreferredSize()));
-
         panel = new JLayeredPane();
-        assertEquals(new Dimension(0 ,0), panel.getPreferredSize());
-
+        assertEquals(new Dimension(0, 0), panel.getPreferredSize());
         panel.setPreferredSize(new Dimension(100, 200));
-        assertEquals(new Dimension(100 ,200), panel.getPreferredSize());
+        assertEquals(new Dimension(100, 200), panel.getPreferredSize());
     }
 
+    @SuppressWarnings("deprecation")
     public void testComputeVisibleRect() {
         JWindow window = new JWindow();
         JComponent panel1 = new JPanel();
@@ -432,7 +405,6 @@
         panel.setBorder(new EmptyBorder(10, 20, 30, 40));
         window.getContentPane().add(panel);
         window.show();
-
         Rectangle rect = new Rectangle();
         panel.computeVisibleRect(rect);
         assertEquals("visible rectangle ", new Rectangle(0, 0, 150, 150), rect);
@@ -444,6 +416,7 @@
         assertEquals("visible rectangle ", new Rectangle(0, 0, 45, 55), rect);
     }
 
+    @SuppressWarnings("deprecation")
     public void testGetVisibleRect() {
         JWindow window = new JWindow();
         JWindow window2 = new JWindow(window);
@@ -477,23 +450,23 @@
         window2.setBounds(500, 500, 100, 110);
         window2.getContentPane().add(panel4);
         window2.show();
-
         assertEquals("visible rectangle ", new Rectangle(150, 150), panel.getVisibleRect());
         assertEquals("visible rectangle ", new Rectangle(90, 100), panel1.getVisibleRect());
-        assertEquals("visible rectangle ", new Rectangle(15, 0, 90, 90), panel3.getVisibleRect());
+        assertEquals("visible rectangle ", new Rectangle(15, 0, 90, 90), panel3
+                .getVisibleRect());
         assertEquals(new Rectangle(100, 110), panel4.getVisibleRect());
-
         window.setVisible(false);
         window.setSize(10, 10);
         window.pack();
-
         assertEquals("visible rectangle ", new Rectangle(300, 300), panel.getVisibleRect());
         assertEquals("visible rectangle ", new Rectangle(100, 100), panel1.getVisibleRect());
-        assertEquals("visible rectangle ", new Rectangle(10, 0, 100, 90), panel3.getVisibleRect());
+        assertEquals("visible rectangle ", new Rectangle(10, 0, 100, 90), panel3
+                .getVisibleRect());
     }
 
     class ActionListenerDummy implements ActionListener {
         public ActionEvent eventHeard = null;
+
         String str;
 
         public ActionListenerDummy() {
@@ -521,7 +494,6 @@
         ActionListenerDummy action52 = new ActionListenerDummy("52");
         ActionListenerDummy action53 = new ActionListenerDummy("53");
         ActionListenerDummy action54 = new ActionListenerDummy("54");
-
         JComponent component1 = new JPanel();
         Component component2 = new Panel();
         JComponent component3 = new JButton("3");
@@ -529,50 +501,56 @@
         component4.getContentPane().add(component1);
         component1.add(component2);
         component1.add(component3);
-        KeyEvent event11 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_A, 'a');
-        KeyEvent event22 = new KeyEvent(component2, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_B, 'b');
-        KeyEvent event33 = new KeyEvent(component3, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_C, 'c');
-        KeyEvent event42 = new KeyEvent(component2, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_D, 'd');
-        KeyEvent event51 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER, '\n');
+        KeyEvent event11 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_A,
+                'a');
+        KeyEvent event22 = new KeyEvent(component2, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_B,
+                'b');
+        KeyEvent event33 = new KeyEvent(component3, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_C,
+                'c');
+        KeyEvent event42 = new KeyEvent(component2, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_D,
+                'd');
+        KeyEvent event51 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0,
+                KeyEvent.VK_ENTER, '\n');
         KeyStroke keyStroke1 = KeyStroke.getKeyStrokeForEvent(event11);
         KeyStroke keyStroke2 = KeyStroke.getKeyStrokeForEvent(event22);
         KeyStroke keyStroke3 = KeyStroke.getKeyStrokeForEvent(event33);
         KeyStroke keyStroke4 = KeyStroke.getKeyStrokeForEvent(event42);
         KeyStroke keyStroke5 = KeyStroke.getKeyStrokeForEvent(event51);
-
         component1.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
-        component1.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        component3.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        component1.registerKeyboardAction(action41, keyStroke4, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        component3.registerKeyboardAction(action43, keyStroke4, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        component3.registerKeyboardAction(action43, keyStroke4, JComponent.WHEN_IN_FOCUSED_WINDOW);
+        component1.registerKeyboardAction(action2, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        component3.registerKeyboardAction(action3, keyStroke3,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        component1.registerKeyboardAction(action41, keyStroke4,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        component3.registerKeyboardAction(action43, keyStroke4,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        component3.registerKeyboardAction(action43, keyStroke4,
+                JComponent.WHEN_IN_FOCUSED_WINDOW);
         component3.registerKeyboardAction(action53, keyStroke5, JComponent.WHEN_FOCUSED);
-        component1.registerKeyboardAction(action51, keyStroke5, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-
-//        component3.processKeyEvent(event1);
-//        assertFalse(event1.isConsumed());
-//
-//        event1 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_A, 'a');
-//        new JPanel().processKeyEvent(event1);
-//        assertFalse(event1.isConsumed());
-
+        component1.registerKeyboardAction(action51, keyStroke5,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        //        component3.processKeyEvent(event1);
+        //        assertFalse(event1.isConsumed());
+        //
+        //        event1 = new KeyEvent(component1, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_A, 'a');
+        //        new JPanel().processKeyEvent(event1);
+        //        assertFalse(event1.isConsumed());
         component1.processKeyEvent(event11);
         assertTrue("event1: actionPerformed called for component", action1.eventHeard != null);
         assertTrue(event11.isConsumed());
-
         action1.eventHeard = null;
         component3.processKeyEvent(event22);
         assertNull("event2: wrong actionPerformed called for parent", action1.eventHeard);
-        assertTrue("event2: right actionPerformed called for parent", action2.eventHeard != null);
+        assertTrue("event2: right actionPerformed called for parent",
+                action2.eventHeard != null);
         assertTrue(event22.isConsumed());
-
         action2.eventHeard = null;
         component3.processKeyEvent(event33);
         assertNull("event3: actionPerformed called for parent", action1.eventHeard);
         assertNull("event3: actionPerformed called for brother", action2.eventHeard);
         assertTrue("event3: actionPerformed called for component", action3.eventHeard != null);
         assertTrue(event33.isConsumed());
-
         action3.eventHeard = null;
         component3.processKeyEvent(event42);
         assertNull("event4: actionPerformed called for parent", action1.eventHeard);
@@ -581,18 +559,19 @@
         assertNull("event4: actionPerformed called for brother", action41.eventHeard);
         assertTrue("event4: actionPerformed called for brother", action43.eventHeard != null);
         assertTrue(event42.isConsumed());
-
         component3.processKeyEvent(event51);
         assertNull("event5: actionPerformed called for parent", action51.eventHeard);
         assertTrue("event5: actionPerformed called for parent", action53.eventHeard != null);
         assertTrue(event51.isConsumed());
-
         JComponent panel1 = new JPanel();
         JComponent panel2 = new JPanel();
         JTextField editor = new JTextField();
-        KeyEvent event6 = new KeyEvent(editor, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER, '\n');
-        panel1.registerKeyboardAction(action52, keyStroke5, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        panel2.registerKeyboardAction(action54, keyStroke5, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        KeyEvent event6 = new KeyEvent(editor, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER,
+                '\n');
+        panel1.registerKeyboardAction(action52, keyStroke5,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel2.registerKeyboardAction(action54, keyStroke5,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel2.add(panel1);
         panel1.add(editor);
         action52.eventHeard = null;
@@ -601,7 +580,6 @@
         assertNull("event6: actionPerformed called for parent", action52.eventHeard);
         assertTrue("event6: actionPerformed called for parent", action54.eventHeard != null);
         assertTrue(event6.isConsumed());
-
         action52.eventHeard = null;
         action54.eventHeard = null;
         event6 = new KeyEvent(editor, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER, '\n');
@@ -613,30 +591,29 @@
 
     public void testProcessKeyEvent2() {
         ActionListenerDummy action1 = new ActionListenerDummy();
-
         JComponent container = new JPanel();
         JComponent button = new JButton();
         JTextField editor = new JTextField();
-        KeyEvent event1 = new KeyEvent(editor, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER, '\n');
-        KeyEvent event2 = new KeyEvent(editor, KeyEvent.KEY_TYPED, 0, 0, KeyEvent.VK_UNDEFINED, '\n');
-        KeyEvent event3 = new KeyEvent(editor, KeyEvent.KEY_RELEASED, 0, 0, KeyEvent.VK_ENTER, '\n');
+        KeyEvent event1 = new KeyEvent(editor, KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ENTER,
+                '\n');
+        KeyEvent event2 = new KeyEvent(editor, KeyEvent.KEY_TYPED, 0, 0, KeyEvent.VK_UNDEFINED,
+                '\n');
+        KeyEvent event3 = new KeyEvent(editor, KeyEvent.KEY_RELEASED, 0, 0, KeyEvent.VK_ENTER,
+                '\n');
         KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
         button.registerKeyboardAction(action1, keyStroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
         container.add(button);
         container.add(editor);
-        Action action = (Action)editor.getActionForKeyStroke(keyStroke);
+        Action action = (Action) editor.getActionForKeyStroke(keyStroke);
         assertFalse(action.isEnabled());
         editor.processKeyEvent(event1);
         assertFalse(event1.isConsumed());
-
         editor.processKeyEvent(event2);
         assertTrue(event2.isConsumed());
-
         editor.processKeyEvent(event3);
         assertFalse(event3.isConsumed());
-
         editor.addActionListener(action1);
-        action = (Action)editor.getActionForKeyStroke(keyStroke);
+        action = (Action) editor.getActionForKeyStroke(keyStroke);
         assertFalse(action.isEnabled());
         editor.processKeyEvent(event1);
         assertFalse(event1.isConsumed());
@@ -647,9 +624,6 @@
      */
     public void testGetUIClassID() {
         JComponent component = new JComponent() {
-           ComponentUI getUI(){
-                return ui;
-           }
         };
         assertEquals("ComponentUI", component.getUIClassID());
     }
@@ -660,9 +634,8 @@
     public void testSetUI() {
         ComponentUI componentUI1 = new BasicPanelUI();
         ComponentUI componentUI2 = new BasicPanelUI();
-
         panel = new JPanel();
-        ((JPanel)panel).getUI().uninstallUI(panel);
+        ((JPanel) panel).getUI().uninstallUI(panel);
         panel.setUI(null);
         PropertyChangeController changeListener = new PropertyChangeController();
         panel.addPropertyChangeListener(changeListener);
@@ -670,11 +643,9 @@
         assertEquals(componentUI1, panel.ui);
         changeListener.checkPropertyFired(panel, "UI", null, componentUI1);
         changeListener.reset();
-
         panel.setUI(componentUI2);
         changeListener.checkPropertyFired(panel, "UI", componentUI1, componentUI2);
         changeListener.reset();
-
         panel.setUI(componentUI2);
         assertFalse(changeListener.isChanged("UI"));
     }
@@ -692,36 +663,34 @@
         panel.setEnabled(true);
         class PropertyChangeListenerFalse implements PropertyChangeListener {
             public boolean isChanged = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("enabled".equals(evt.getPropertyName()) && (evt.getNewValue() != null)) {
                     assertTrue(evt.getNewValue().equals(Boolean.FALSE));
                     isChanged = true;
                 }
             }
-        };
+        }
+        ;
         class PropertyChangeListenerTrue implements PropertyChangeListener {
-            public boolean isChanged = false;
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("enabled".equals(evt.getPropertyName()) && (evt.getNewValue() != null)) {
                     assertTrue(evt.getNewValue().equals(Boolean.TRUE));
-                    isChanged = true;
                 }
             }
-        };
+        }
+        ;
         PropertyChangeListenerFalse changeListenerFalse = new PropertyChangeListenerFalse();
         PropertyChangeListenerTrue changeListenerTrue = new PropertyChangeListenerTrue();
-
         panel.addPropertyChangeListener(changeListenerFalse);
         panel.setEnabled(false);
         assertFalse(panel.isEnabled());
         assertTrue(changeListenerFalse.isChanged);
         panel.removePropertyChangeListener(changeListenerFalse);
-
         panel.addPropertyChangeListener(changeListenerTrue);
         panel.setEnabled(true);
         assertTrue(panel.isEnabled());
         assertTrue(changeListenerFalse.isChanged);
-
         changeListenerFalse.isChanged = false;
         panel.setEnabled(true);
         assertTrue(panel.isEnabled());
@@ -749,59 +718,55 @@
         final Border border2 = BorderFactory.createEmptyBorder(10, 10, 10, 10);
         class PropertyChangeListenerBorder1 implements PropertyChangeListener {
             public boolean isChanged = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("border".equals(evt.getPropertyName()) && (evt.getNewValue() != null)) {
                     assertTrue(evt.getNewValue().equals(border1));
                     isChanged = true;
                 }
             }
-        };
+        }
+        ;
         class PropertyChangeListenerBorder2 implements PropertyChangeListener {
             public boolean isChanged = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("border".equals(evt.getPropertyName()) && (evt.getNewValue() != null)) {
                     assertTrue(evt.getNewValue().equals(border2));
                     isChanged = true;
                 }
             }
-        };
+        }
+        ;
         PropertyChangeController changeListener = new PropertyChangeController();
-
         panel.addPropertyChangeListener(changeListener);
         assertNull(panel.getBorder());
-
         Border newBorder1 = new EmptyBorder(10, 10, 10, 10);
         Border newBorder2 = new EmptyBorder(20, 20, 20, 20);
         panel.setBorder(newBorder1);
         assertSame(newBorder1, panel.getBorder());
         changeListener.checkPropertyFired(panel, "border", null, newBorder1);
         changeListener.reset();
-
         panel.setBorder(newBorder2);
         assertSame(newBorder2, panel.getBorder());
         changeListener.checkPropertyFired(panel, "border", newBorder1, newBorder2);
         changeListener.reset();
-
         panel.setBorder(newBorder2);
         assertTrue(panel.getBorder() == newBorder2);
         assertFalse(changeListener.isChanged());
         changeListener.reset();
-
         panel.setBorder(null);
         PropertyChangeListenerBorder1 changeListener1 = new PropertyChangeListenerBorder1();
         PropertyChangeListenerBorder2 changeListener2 = new PropertyChangeListenerBorder2();
-
         panel.addPropertyChangeListener(changeListener1);
         panel.setBorder(border1);
         assertTrue(panel.getBorder().equals(border1));
         assertTrue(changeListener1.isChanged);
         panel.removePropertyChangeListener(changeListener1);
-
         panel.addPropertyChangeListener(changeListener2);
         panel.setBorder(border2);
         assertTrue(panel.getBorder().equals(border2));
         assertTrue(changeListener2.isChanged);
-
         changeListener2.isChanged = false;
         panel.setBorder(border2);
         assertTrue(panel.getBorder().equals(border2));
@@ -820,11 +785,9 @@
         float value = 0.111f;
         panel.setAlignmentX(value);
         assertEquals("alignment ", value, panel.getAlignmentX(), 1e-5);
-
         value = 2.5f;
         panel.setAlignmentX(value);
         assertEquals("alignment ", 1.0f, panel.getAlignmentX(), 1e-5);
-
         value = -2.5f;
         panel.setAlignmentX(value);
         assertEquals("alignment ", 0.0f, panel.getAlignmentX(), 1e-5);
@@ -838,11 +801,9 @@
         float value = 0.111f;
         panel.setAlignmentY(value);
         assertEquals("alignment ", value, panel.getAlignmentY(), 1e-5);
-
         value = 2.5f;
         panel.setAlignmentY(value);
         assertEquals("alignment ", 1.0f, panel.getAlignmentY(), 1e-5);
-
         value = -2.5f;
         panel.setAlignmentY(value);
         assertEquals("alignment ", 0.0f, panel.getAlignmentY(), 1e-5);
@@ -854,10 +815,8 @@
     public void testEnable() {
         panel.setEnabled(true);
         assertTrue("panel is enabled now ", panel.isEnabled());
-
         panel.setEnabled(false);
         assertFalse("panel is disabled now ", panel.isEnabled());
-
         panel.setEnabled(true);
         assertTrue("panel is enabled now ", panel.isEnabled());
     }
@@ -865,10 +824,8 @@
     public void testDisable() {
         panel.setEnabled(false);
         assertFalse("panel is disabled now ", panel.isEnabled());
-
         panel.setEnabled(true);
         assertTrue("panel is enabled now ", panel.isEnabled());
-
         panel.setEnabled(false);
         assertFalse("panel is disabled now ", panel.isEnabled());
     }
@@ -884,15 +841,11 @@
     public void testFireVetoableChange() throws PropertyVetoException {
         ConcreteVetoableChangeListener changeListener = new ConcreteVetoableChangeListener();
         VetoableChangeListener[] listenersArray = null;
-
         listenersArray = panel.getVetoableChangeListeners();
         assertTrue(listenersArray != null && listenersArray.length == 0);
-
         panel.addVetoableChangeListener(changeListener);
-
         JPanel button1 = new JPanel();
         JPanel button2 = new JPanel();
-
         panel.fireVetoableChange("button", button1, button2);
         assertTrue("button".equals(changeListener.valueChangedKey));
         assertTrue(button1.equals(changeListener.valueChangedOld));
@@ -908,10 +861,10 @@
         short oldValue = 100;
         short newValue = 200;
         panel.firePropertyChange("short", oldValue, newValue);
-        changeListener.checkPropertyFired(panel, "short", new Short(oldValue), new Short(newValue));
-
+        changeListener.checkPropertyFired(panel, "short", new Short(oldValue), new Short(
+                newValue));
         changeListener.reset();
-        panel.firePropertyChange("short", (short)1, (short)1);
+        panel.firePropertyChange("short", (short) 1, (short) 1);
         assertFalse(changeListener.isChanged());
     }
 
@@ -924,8 +877,8 @@
         long oldValue = 100;
         long newValue = 200;
         panel.firePropertyChange("long", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "long", new Long(oldValue), new Long(newValue));
-
+        changeListener.checkLastPropertyFired(panel, "long", new Long(oldValue), new Long(
+                newValue));
         changeListener.reset();
         panel.firePropertyChange("int", 1L, 1L);
         assertFalse(changeListener.isChanged());
@@ -940,9 +893,9 @@
         int oldValue = 100;
         int newValue = 200;
         panel.firePropertyChange("int", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "int", new Integer(oldValue), new Integer(newValue));
+        changeListener.checkLastPropertyFired(panel, "int", new Integer(oldValue), new Integer(
+                newValue));
         changeListener.reset();
-
         panel.firePropertyChange("int", 1, 1);
         assertFalse(changeListener.isChanged());
     }
@@ -956,9 +909,9 @@
         float oldValue = 100.01f;
         float newValue = 200.01f;
         panel.firePropertyChange("float", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "float", new Float(oldValue), new Float(newValue));
+        changeListener.checkLastPropertyFired(panel, "float", new Float(oldValue), new Float(
+                newValue));
         changeListener.reset();
-
         panel.firePropertyChange("float", 1.0f, 1.0f);
         assertFalse(changeListener.isChanged());
     }
@@ -972,9 +925,9 @@
         double oldValue = 100.1;
         double newValue = 200.1;
         panel.firePropertyChange("double", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "double", new Double(oldValue), new Double(newValue));
+        changeListener.checkLastPropertyFired(panel, "double", new Double(oldValue),
+                new Double(newValue));
         changeListener.reset();
-
         panel.firePropertyChange("double", 1.0, 1);
         assertFalse(changeListener.isChanged());
     }
@@ -988,9 +941,9 @@
         char oldValue = 'a';
         char newValue = 'b';
         panel.firePropertyChange("char", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "char", new Character(oldValue), new Character(newValue));
+        changeListener.checkLastPropertyFired(panel, "char", new Character(oldValue),
+                new Character(newValue));
         changeListener.reset();
-
         panel.firePropertyChange("char", 'h', 'h');
         assertFalse(changeListener.isChanged());
     }
@@ -1004,10 +957,10 @@
         byte oldValue = 66;
         byte newValue = 13;
         panel.firePropertyChange("byte", oldValue, newValue);
-        changeListener.checkLastPropertyFired(panel, "byte", new Byte(oldValue), new Byte(newValue));
-
+        changeListener.checkLastPropertyFired(panel, "byte", new Byte(oldValue), new Byte(
+                newValue));
         changeListener.reset();
-        panel.firePropertyChange("byte", (byte)2, (byte)2);
+        panel.firePropertyChange("byte", (byte) 2, (byte) 2);
         assertFalse(changeListener.isChanged());
     }
 
@@ -1018,56 +971,54 @@
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         class ConcreteAncestorListener implements AncestorListener {
-            public void ancestorAdded(final AncestorEvent event){}
-            public void ancestorMoved(final AncestorEvent event){}
-            public void ancestorRemoved(final AncestorEvent event){}
-        };
+            public void ancestorAdded(final AncestorEvent event) {
+            }
+
+            public void ancestorMoved(final AncestorEvent event) {
+            }
+
+            public void ancestorRemoved(final AncestorEvent event) {
+            }
+        }
+        ;
         AncestorListener ancestorListener1 = new ConcreteAncestorListener();
         AncestorListener ancestorListener2 = new ConcreteAncestorListener();
-        VetoableChangeListener vetoableChangeListener = new VetoableChangeListener(){
-            public void vetoableChange(final PropertyChangeEvent evt){}
+        VetoableChangeListener vetoableChangeListener = new VetoableChangeListener() {
+            public void vetoableChange(final PropertyChangeEvent evt) {
+            }
         };
-
         EventListener[] listenersArray = null;
         removeListeners(panel, PropertyChangeListener.class);
         listenersArray = panel.getListeners(VetoableChangeListener.class);
         assertEquals(0, listenersArray.length);
         listenersArray = panel.getListeners(AncestorListener.class);
         assertEquals(0, listenersArray.length);
-
         panel.addPropertyChangeListener(changeListener1);
         panel.addVetoableChangeListener(vetoableChangeListener);
         panel.addPropertyChangeListener(changeListener2);
         panel.addPropertyChangeListener(changeListener2);
-
-
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(3, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener2);
         panel.removePropertyChangeListener(changeListener2);
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(1, listenersArray.length);
         assertTrue(changeListener1.findMe(listenersArray) == 1);
-
         panel.addAncestorListener(ancestorListener1);
         panel.addAncestorListener(ancestorListener2);
-
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(1, listenersArray.length);
         listenersArray = panel.getListeners(VetoableChangeListener.class);
         assertEquals(1, listenersArray.length);
         listenersArray = panel.getListeners(AncestorListener.class);
         assertEquals(2, listenersArray.length);
-
         panel.removeVetoableChangeListener(vetoableChangeListener);
         listenersArray = panel.getListeners(VetoableChangeListener.class);
         assertTrue(listenersArray.length == 0);
-
         panel.addAncestorListener(ancestorListener2);
-
         assertEquals("MouseListeners", 0, panel.getListeners(MouseListener.class).length);
-        panel.addMouseListener(new MouseAdapter(){});
+        panel.addMouseListener(new MouseAdapter() {
+        });
         assertEquals("MouseListeners", 1, panel.getListeners(MouseListener.class).length);
     }
 
@@ -1077,11 +1028,8 @@
     public void testGetListenersClass2() {
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
-
         EventListener[] listenersArray = null;
-
         int initialNumber = panel.getListeners(PropertyChangeListener.class).length;
-
         panel.addPropertyChangeListener(changeListener1);
         panel.addPropertyChangeListener(changeListener2);
         panel.addPropertyChangeListener(changeListener2);
@@ -1089,20 +1037,16 @@
         panel.addPropertyChangeListener("first", changeListener2);
         panel.addPropertyChangeListener("first", changeListener1);
         panel.addPropertyChangeListener("second", changeListener1);
-
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(7 + initialNumber, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener2);
         panel.removePropertyChangeListener(changeListener2);
         panel.removePropertyChangeListener(changeListener2);
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(5 + initialNumber, listenersArray.length);
-
         panel.removePropertyChangeListener("second", changeListener2);
         panel.removePropertyChangeListener("first", changeListener2);
         panel.removePropertyChangeListener("first", changeListener2);
-
         listenersArray = panel.getListeners(PropertyChangeListener.class);
         assertEquals(3 + initialNumber, listenersArray.length);
     }
@@ -1110,24 +1054,19 @@
     public void testPutClientProperty() {
         PropertyChangeController changeListener = new PropertyChangeController();
         panel.addPropertyChangeListener(changeListener);
-
         Object value1 = "property1";
         Object value2 = "property2";
         String key1 = "value1";
-
         assertNull(panel.getClientProperty(key1));
         assertFalse("event's not fired", changeListener.isChanged());
-
         panel.putClientProperty(key1, value1);
         changeListener.checkLastPropertyFired(panel, key1, null, value1);
         assertTrue(panel.getClientProperty(key1).equals(value1));
         changeListener.reset();
-
         panel.putClientProperty(key1, value2);
         changeListener.checkLastPropertyFired(panel, key1, value1, value2);
         assertTrue(panel.getClientProperty(key1).equals(value2));
         changeListener.reset();
-
         panel.putClientProperty(key1, null);
         changeListener.checkLastPropertyFired(panel, key1, value2, null);
         assertNull(panel.getClientProperty(key1));
@@ -1143,39 +1082,32 @@
         PropertyChangeController changeListener3 = new PropertyChangeController();
         PropertyChangeController changeListener4 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         int initialNumber = panel.getPropertyChangeListeners().length;
         listenersArray = panel.getPropertyChangeListeners("first");
         assertTrue(listenersArray.length == 0);
         listenersArray = panel.getPropertyChangeListeners("second");
         assertTrue(listenersArray.length == 0);
-
         panel.addPropertyChangeListener(changeListener1);
         panel.addPropertyChangeListener("first", changeListener2);
         listenersArray = panel.getPropertyChangeListeners("first");
         assertEquals(1, listenersArray.length);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 2, listenersArray.length);
-
         panel.removePropertyChangeListener("first", changeListener1);
         listenersArray = panel.getPropertyChangeListeners("first");
         assertEquals(1, listenersArray.length);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 2, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener1);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 1, listenersArray.length);
         assertFalse(changeListener1.findMe(listenersArray) > 0);
-
         panel.removePropertyChangeListener(changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 1, listenersArray.length);
         panel.removePropertyChangeListener("first", changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber, listenersArray.length);
-
-
         panel.addPropertyChangeListener("first", changeListener1);
         panel.addPropertyChangeListener(changeListener2);
         panel.addPropertyChangeListener("second", changeListener3);
@@ -1183,25 +1115,20 @@
         panel.removePropertyChangeListener("asd", null);
         listenersArray = panel.getPropertyChangeListeners("second");
         assertEquals(1, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener1);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 4, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 3, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener4);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 2, listenersArray.length);
-
         panel.removePropertyChangeListener(changeListener3);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 2, listenersArray.length);
     }
 
-
     /*
      * Class under test for void addPropertyChangeListener(PropertyChangeListener)
      */
@@ -1209,17 +1136,14 @@
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         panel.addPropertyChangeListener(changeListener1);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(1, changeListener1.findMe(listenersArray));
         assertEquals(0, panel.listenerList.getListeners(PropertyChangeListener.class).length);
-
         panel.addPropertyChangeListener(changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(1, changeListener1.findMe(listenersArray));
         assertEquals(1, changeListener2.findMe(listenersArray));
-
         panel.addPropertyChangeListener(changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(1, changeListener1.findMe(listenersArray));
@@ -1233,15 +1157,12 @@
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         listenersArray = panel.getPropertyChangeListeners();
         int initialNumber = listenersArray.length;
-
         panel.addPropertyChangeListener(changeListener1);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 1, listenersArray.length);
         assertTrue(changeListener1.findMe(listenersArray) == 1);
-
         panel.addPropertyChangeListener(changeListener2);
         listenersArray = panel.getPropertyChangeListeners();
         assertEquals(initialNumber + 2, listenersArray.length);
@@ -1258,12 +1179,10 @@
         PropertyChangeController changeListener3 = new PropertyChangeController();
         PropertyChangeController changeListener4 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         listenersArray = panel.getPropertyChangeListeners("first");
         assertTrue(listenersArray.length == 0);
         listenersArray = panel.getPropertyChangeListeners("second");
         assertTrue(listenersArray.length == 0);
-
         panel.addPropertyChangeListener("first", changeListener1);
         panel.addPropertyChangeListener("first", changeListener2);
         listenersArray = panel.getPropertyChangeListeners("first");
@@ -1278,7 +1197,6 @@
         assertTrue(listenersArray.length == 0);
         assertFalse(changeListener1.findMe(listenersArray) > 0);
         assertFalse(changeListener2.findMe(listenersArray) > 0);
-
         panel.addPropertyChangeListener("second", changeListener2);
         panel.addPropertyChangeListener("second", changeListener3);
         panel.addPropertyChangeListener("second", changeListener4);
@@ -1290,7 +1208,6 @@
         assertTrue(changeListener2.findMe(listenersArray) == 1);
         assertFalse(changeListener3.findMe(listenersArray) > 0);
         assertTrue(changeListener4.findMe(listenersArray) == 1);
-
         panel.removePropertyChangeListener("second", changeListener2);
         panel.addPropertyChangeListener("second", changeListener3);
         listenersArray = panel.getPropertyChangeListeners("second");
@@ -1303,35 +1220,34 @@
     /*
      * Class under test for void addPropertyChangeListener(String, PropertyChangeListener)
      */
-    public void testAddPropertyChangeListenerStringPropertyChangeListener() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+    public void testAddPropertyChangeListenerStringPropertyChangeListener()
+            throws SecurityException, NoSuchMethodException, IllegalArgumentException,
+            IllegalAccessException, InvocationTargetException {
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         panel.addPropertyChangeListener("first", changeListener1);
         panel.addPropertyChangeListener("second", changeListener2);
         String oldValue = "old";
         String newValue = "new";
-
-        Method method = Component.class.getDeclaredMethod("firePropertyChange", new Class[]{String.class, Object.class, Object.class} );
+        Method method = Component.class.getDeclaredMethod("firePropertyChange", new Class[] {
+                String.class, Object.class, Object.class });
         if (method != null) {
             method.setAccessible(true);
         } else {
             fail("access error");
         }
-
-        method.invoke(panel, new Object[]{"first", oldValue, newValue});
+        method.invoke(panel, new Object[] { "first", oldValue, newValue });
         changeListener1.checkLastPropertyFired(panel, "first", oldValue, newValue);
         assertFalse("event's not fired", changeListener2.isChanged());
-
         changeListener1.reset();
         changeListener2.reset();
-        method.invoke(panel, new Object[]{"second", oldValue, newValue});
+        method.invoke(panel, new Object[] { "second", oldValue, newValue });
         changeListener2.checkLastPropertyFired(panel, "second", oldValue, newValue);
         assertFalse("event's not fired", changeListener1.isChanged());
-
         changeListener1.reset();
         changeListener2.reset();
         panel.addPropertyChangeListener("first", changeListener2);
-        method.invoke(panel, new Object[]{"first", oldValue, newValue});
+        method.invoke(panel, new Object[] { "first", oldValue, newValue });
         changeListener1.checkLastPropertyFired(panel, "first", oldValue, newValue);
         changeListener2.checkLastPropertyFired(panel, "first", oldValue, newValue);
     }
@@ -1345,19 +1261,16 @@
         PropertyChangeController changeListener3 = new PropertyChangeController();
         PropertyChangeController changeListener4 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         listenersArray = panel.getPropertyChangeListeners("first");
         assertTrue(listenersArray.length == 0);
         listenersArray = panel.getPropertyChangeListeners("second");
         assertTrue(listenersArray.length == 0);
-
         panel.addPropertyChangeListener("first", changeListener1);
         panel.addPropertyChangeListener("first", changeListener2);
         listenersArray = panel.getPropertyChangeListeners("first");
         assertTrue(listenersArray.length == 2);
         assertTrue(changeListener1.findMe(listenersArray) == 1);
         assertTrue(changeListener2.findMe(listenersArray) == 1);
-
         panel.addPropertyChangeListener("second", changeListener2);
         panel.addPropertyChangeListener("second", changeListener3);
         panel.addPropertyChangeListener("second", changeListener4);
@@ -1381,12 +1294,10 @@
         Color color = Color.RED;
         panel.setFont(font);
         panel.setForeground(color);
-
         componentGraphics = panel.getComponentGraphics(g);
         assertTrue("graphics object's created ", componentGraphics != null);
         assertEquals("graphics object's created properly", font, componentGraphics.getFont());
         assertEquals("graphics object's created properly", color, componentGraphics.getColor());
-
         panel.setDebugGraphicsOptions(DebugGraphics.FLASH_OPTION);
         componentGraphics = panel.getComponentGraphics(g);
         assertTrue("graphics object's created ", componentGraphics != null);
@@ -1399,37 +1310,36 @@
 
     public void testRemoveAncestorListener() {
         class ConcreteAncestorListener implements AncestorListener {
-            public void ancestorAdded(final AncestorEvent event){}
-            public void ancestorMoved(final AncestorEvent event){}
-            public void ancestorRemoved(final AncestorEvent event){}
-        };
+            public void ancestorAdded(final AncestorEvent event) {
+            }
+
+            public void ancestorMoved(final AncestorEvent event) {
+            }
+
+            public void ancestorRemoved(final AncestorEvent event) {
+            }
+        }
+        ;
         AncestorListener ancestorListener1 = new ConcreteAncestorListener();
         AncestorListener ancestorListener2 = new ConcreteAncestorListener();
         AncestorListener ancestorListener3 = new ConcreteAncestorListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 0);
-
         panel.addAncestorListener(ancestorListener1);
         panel.addAncestorListener(ancestorListener2);
         panel.addAncestorListener(ancestorListener2);
-
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 3);
-
         panel.removeAncestorListener(ancestorListener1);
         panel.addAncestorListener(ancestorListener3);
         panel.addAncestorListener(ancestorListener3);
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 4);
-
         panel.removeAncestorListener(ancestorListener3);
         panel.removeAncestorListener(ancestorListener3);
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 2);
-
         panel.removeAncestorListener(ancestorListener2);
         panel.removeAncestorListener(ancestorListener2);
         listenersArray = panel.getAncestorListeners();
@@ -1443,29 +1353,30 @@
 
     public void testGetAncestorListeners() {
         class ConcreteAncestorListener implements AncestorListener {
-            public void ancestorAdded(final AncestorEvent event){}
-            public void ancestorMoved(final AncestorEvent event){}
-            public void ancestorRemoved(final AncestorEvent event){}
-        };
+            public void ancestorAdded(final AncestorEvent event) {
+            }
+
+            public void ancestorMoved(final AncestorEvent event) {
+            }
+
+            public void ancestorRemoved(final AncestorEvent event) {
+            }
+        }
+        ;
         AncestorListener ancestorListener1 = new ConcreteAncestorListener();
         AncestorListener ancestorListener2 = new ConcreteAncestorListener();
         AncestorListener ancestorListener3 = new ConcreteAncestorListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = panel.getListeners(AncestorListener.class);
         assertTrue(listenersArray.length == 0);
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 0);
-
         panel.addAncestorListener(ancestorListener1);
         panel.addAncestorListener(ancestorListener2);
-
         listenersArray = panel.getListeners(AncestorListener.class);
         assertTrue(listenersArray.length == 2);
         listenersArray = panel.getAncestorListeners();
         assertTrue(listenersArray.length == 2);
-
         panel.addAncestorListener(ancestorListener3);
         panel.addAncestorListener(ancestorListener2);
         listenersArray = panel.getListeners(AncestorListener.class);
@@ -1476,42 +1387,37 @@
 
     public void testSetTransferHandler() {
         PropertyChangeController changeListener = new PropertyChangeController();
-
         panel.addPropertyChangeListener(changeListener);
-
         JComponent panel1 = new JPanel();
         JComponent panel2 = new JPanel();
         TransferHandler handler1 = new TransferHandler("1");
         TransferHandler handler2 = new TransferHandler("2");
-
         panel.setTransferHandler(handler1);
         changeListener.checkLastPropertyFired(panel, "transferHandler", null, handler1);
         assertEquals("transferHandler's set properly ", handler1, panel.getTransferHandler());
         changeListener.reset();
-
         panel.setTransferHandler(handler2);
         changeListener.checkLastPropertyFired(panel, "transferHandler", handler1, handler2);
         assertEquals("transferHandler's set properly ", handler2, panel.getTransferHandler());
         changeListener.reset();
-
         panel.setTransferHandler(handler2);
         assertFalse("event's not fired", changeListener.isChanged());
         assertEquals("transferHandler's set properly ", handler2, panel.getTransferHandler());
         changeListener.reset();
-
-        System.setProperty("suppressSwingDropSupport",  "false");
+        System.setProperty("suppressSwingDropSupport", "false");
         panel1.setTransferHandler(handler1);
         assertNotNull("DropTarget is installed ", panel1.getDropTarget());
-        assertEquals("DropTarget is installed properly ", panel1.getDropTarget().getComponent(), panel1);
+        assertEquals("DropTarget is installed properly ",
+                panel1.getDropTarget().getComponent(), panel1);
         assertEquals("transferHandler's set properly ", handler1, panel1.getTransferHandler());
-
-        System.setProperty("suppressSwingDropSupport",  "true");
+        System.setProperty("suppressSwingDropSupport", "true");
         panel2.setTransferHandler(handler2);
         if (isHarmony()) {
             assertNull("DropTarget is not installed ", panel2.getDropTarget());
         } else {
             assertNotNull("DropTarget is installed ", panel2.getDropTarget());
-            assertEquals("transferHandler's set properly ", handler2, panel2.getTransferHandler());
+            assertEquals("transferHandler's set properly ", handler2, panel2
+                    .getTransferHandler());
         }
     }
 
@@ -1520,56 +1426,63 @@
         JComponent panel2 = new JButton();
         TransferHandler handler1 = new TransferHandler("1");
         TransferHandler handler2 = new TransferHandler("1");
-
         assertNull("transferHandler is not set by default ", panel.getTransferHandler());
-
         panel1.setTransferHandler(handler1);
         assertEquals("transferHandler's set properly ", handler1, panel1.getTransferHandler());
-
         panel2.setTransferHandler(handler2);
         assertEquals("transferHandler's set properly ", handler2, panel2.getTransferHandler());
     }
 
-
     /*
      * Class under test for void registerKeyboardAction(ActionListener, String, KeyStroke, int)
      */
     public void testRegisterKeyboardActionActionListenerStringKeyStrokeint() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         String command1 = "new";
         String command2 = "delete";
         String command3 = "show";
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
-
-        panel.registerKeyboardAction(action3, command3, keyStroke1, JComponent.WHEN_IN_FOCUSED_WINDOW);
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
+        panel.registerKeyboardAction(action3, command3, keyStroke1,
+                JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action3);
-
         panel.registerKeyboardAction(action1, command2, keyStroke1, JComponent.WHEN_FOCUSED);
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action1);
-
-        panel.registerKeyboardAction(action1, command1, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        panel.registerKeyboardAction(action2, command2, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
+        panel.registerKeyboardAction(action1, command1, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action2, command2, keyStroke3,
+                JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke2) == action1);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action2);
-
-        panel.registerKeyboardAction(action3, command3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
+        panel.registerKeyboardAction(action3, command3, keyStroke3,
+                JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.registerKeyboardAction(null, command3, keyStroke3, JComponent.WHEN_FOCUSED);
         assertNull(panel.getActionForKeyStroke(keyStroke3));
     }
 
-    public void testProcessKeyBinding() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+    public void testProcessKeyBinding() throws IllegalArgumentException,
+            IllegalAccessException, InvocationTargetException {
         ActionListenerDummy action1 = new ActionListenerDummy();
         ActionListenerDummy action2 = new ActionListenerDummy();
         ActionListenerDummy action3 = new ActionListenerDummy();
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
         KeyStroke keyStroke4 = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0);
         KeyEvent keyEvent1 = new KeyEvent(panel, 1, 10, 0, 100, '1');
         KeyEvent keyEvent2 = new KeyEvent(panel, 2, 20, 0, 200, '2');
@@ -1578,43 +1491,47 @@
         String command1 = "command1";
         String command2 = "command2";
         String command3 = null;
-
         boolean result = false;
         panel.registerKeyboardAction(action1, command1, keyStroke1, JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action2, command2, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        panel.registerKeyboardAction(action3, command3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
+        panel.registerKeyboardAction(action2, command2, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action3, command3, keyStroke3,
+                JComponent.WHEN_IN_FOCUSED_WINDOW);
         result = panel.processKeyBinding(keyStroke1, keyEvent1, JComponent.WHEN_FOCUSED, true);
-        assertTrue(action1.eventHeard != null && action1.eventHeard.getActionCommand().equals(command1));
+        assertTrue(action1.eventHeard != null
+                && action1.eventHeard.getActionCommand().equals(command1));
         assertTrue(result);
-
         result = panel.processKeyBinding(keyStroke2, keyEvent2, JComponent.WHEN_FOCUSED, true);
         assertNull(action2.eventHeard);
         assertFalse(result);
-
-        result = panel.processKeyBinding(keyStroke2, keyEvent2, JComponent.WHEN_IN_FOCUSED_WINDOW, false);
+        result = panel.processKeyBinding(keyStroke2, keyEvent2,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, false);
         assertNull(action2.eventHeard);
         assertFalse(result);
-        result = panel.processKeyBinding(keyStroke2, keyEvent2, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        result = panel.processKeyBinding(keyStroke2, keyEvent2,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
         assertNull(action2.eventHeard);
         assertFalse(result);
-
-        result = panel.processKeyBinding(keyStroke2, keyEvent2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, false);
-        assertTrue(action2.eventHeard != null && action2.eventHeard.getActionCommand() == command2);
+        result = panel.processKeyBinding(keyStroke2, keyEvent2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, false);
+        assertTrue(action2.eventHeard != null
+                && action2.eventHeard.getActionCommand() == command2);
         assertTrue(result);
-
-        result = panel.processKeyBinding(keyStroke2, keyEvent2, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
-        assertTrue(action2.eventHeard != null && action2.eventHeard.getActionCommand() == command2);
+        result = panel.processKeyBinding(keyStroke2, keyEvent2,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        assertTrue(action2.eventHeard != null
+                && action2.eventHeard.getActionCommand() == command2);
         assertFalse(result);
-
-        result = panel.processKeyBinding(keyStroke3, keyEvent3, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
-        assertTrue(action3.eventHeard != null && action3.eventHeard.getActionCommand() == command3);
+        result = panel.processKeyBinding(keyStroke3, keyEvent3,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        assertTrue(action3.eventHeard != null
+                && action3.eventHeard.getActionCommand() == command3);
         assertTrue(result);
-
-        result = panel.processKeyBinding(keyStroke3, keyEvent3, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
-        assertTrue(action3.eventHeard != null && action3.eventHeard.getActionCommand() == command3);
+        result = panel.processKeyBinding(keyStroke3, keyEvent3,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        assertTrue(action3.eventHeard != null
+                && action3.eventHeard.getActionCommand() == command3);
         assertTrue(result);
-
         Action action = new AbstractAction() {
             public void actionPerformed(final ActionEvent e) {
             }
@@ -1622,45 +1539,52 @@
         panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keyStroke4, "asdasda");
         panel.getActionMap().put("asdasda", action);
         action.setEnabled(false);
-        result = panel.processKeyBinding(keyStroke4, keyEvent4, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        result = panel.processKeyBinding(keyStroke4, keyEvent4,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
         assertFalse(result);
-
         action.setEnabled(true);
         panel.setEnabled(false);
-        result = panel.processKeyBinding(keyStroke4, keyEvent4, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        result = panel.processKeyBinding(keyStroke4, keyEvent4,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
         assertFalse(result);
-
         panel.setEnabled(true);
         panel.setVisible(false);
-        result = panel.processKeyBinding(keyStroke4, keyEvent4, JComponent.WHEN_IN_FOCUSED_WINDOW, true);
+        result = panel.processKeyBinding(keyStroke4, keyEvent4,
+                JComponent.WHEN_IN_FOCUSED_WINDOW, true);
         assertTrue(result);
     }
 
     public void testGetActionForKeyStroke() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
-
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
         panel.registerKeyboardAction(action3, keyStroke1, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action3);
-
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action1);
-
-        panel.registerKeyboardAction(action1, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action1, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action2, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke2) == action1);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action2);
-
         panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.registerKeyboardAction(null, keyStroke3, JComponent.WHEN_FOCUSED);
         assertNull(panel.getActionForKeyStroke(keyStroke3));
-  }
+    }
 
     /*
      * Class under test for void registerKeyboardAction(ActionListener, KeyStroke, int)
@@ -1670,68 +1594,83 @@
     }
 
     public void testUnregisterKeyboardAction() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
-
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action2, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action1);
         assertTrue(panel.getActionForKeyStroke(keyStroke2) == action2);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.unregisterKeyboardAction(keyStroke1);
         assertNull(panel.getActionForKeyStroke(keyStroke1));
         assertTrue(panel.getActionForKeyStroke(keyStroke2) == action2);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.unregisterKeyboardAction(keyStroke2);
         assertNull(panel.getActionForKeyStroke(keyStroke1));
         assertNull(panel.getActionForKeyStroke(keyStroke2));
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.unregisterKeyboardAction(keyStroke3);
         assertNull(panel.getActionForKeyStroke(keyStroke1));
         assertNull(panel.getActionForKeyStroke(keyStroke2));
         assertNull(panel.getActionForKeyStroke(keyStroke3));
-
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action2, keyStroke1, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action2, keyStroke1,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.unregisterKeyboardAction(keyStroke1);
         assertNull(panel.getActionForKeyStroke(keyStroke1));
         assertTrue(panel.getActionMap().size() == 0);
     }
 
     public void testGetConditionForKeyStroke() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
         KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_ASTERISK, 0);
-
         assertTrue(panel.getConditionForKeyStroke(keyStroke1) == JComponent.UNDEFINED_CONDITION);
         assertTrue(panel.getConditionForKeyStroke(keyStroke2) == JComponent.UNDEFINED_CONDITION);
-
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getConditionForKeyStroke(keyStroke1) == JComponent.WHEN_IN_FOCUSED_WINDOW);
-        panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action1, keyStroke1,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         assertTrue(panel.getConditionForKeyStroke(keyStroke1) == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
         assertTrue(panel.getConditionForKeyStroke(keyStroke1) == JComponent.WHEN_FOCUSED);
-
         panel.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_FOCUSED);
         assertTrue(panel.getConditionForKeyStroke(keyStroke2) == JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action2, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         assertTrue(panel.getConditionForKeyStroke(keyStroke2) == JComponent.WHEN_FOCUSED);
         panel.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getConditionForKeyStroke(keyStroke2) == JComponent.WHEN_FOCUSED);
-
-        panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action3, keyStroke3,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         assertTrue(panel.getConditionForKeyStroke(keyStroke3) == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertTrue(panel.getConditionForKeyStroke(keyStroke3) == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
@@ -1740,42 +1679,47 @@
     }
 
     public void testGetRegisteredKeyStrokes() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
         KeyStroke keyStroke4 = KeyStroke.getKeyStroke(KeyEvent.VK_0, 0);
-
         KeyStroke[] strokes = panel.getRegisteredKeyStrokes();
         assertTrue(strokes != null && strokes.length == 0);
-
         panel.registerKeyboardAction(action3, keyStroke1, JComponent.WHEN_IN_FOCUSED_WINDOW);
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action1, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action1, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action2, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
         strokes = panel.getRegisteredKeyStrokes();
         assertTrue(strokes != null && strokes.length == 4);
         assertTrue(find(strokes, keyStroke1) == 2);
         assertTrue(find(strokes, keyStroke2) == 1);
         assertTrue(find(strokes, keyStroke3) == 1);
-
         panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
         strokes = panel.getRegisteredKeyStrokes();
         assertTrue(strokes != null && strokes.length == 4);
         assertTrue(find(strokes, keyStroke1) == 2);
         assertTrue(find(strokes, keyStroke2) == 1);
         assertTrue(find(strokes, keyStroke3) == 1);
-
         panel.registerKeyboardAction(null, keyStroke3, JComponent.WHEN_FOCUSED);
         strokes = panel.getRegisteredKeyStrokes();
         assertTrue(strokes != null && strokes.length == 5);
         assertTrue(find(strokes, keyStroke1) == 2);
         assertTrue(find(strokes, keyStroke2) == 1);
         assertTrue(find(strokes, keyStroke3) == 2);
-
         InputMap parentMap = new InputMap();
         parentMap.put(keyStroke4, keyStroke4);
         panel.getInputMap().setParent(parentMap);
@@ -1789,21 +1733,29 @@
     }
 
     public void testResetKeyboardActions() {
-        ActionListener action1 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action2 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
-        ActionListener action3 = new ActionListener(){ public void actionPerformed(final ActionEvent e){} };
+        ActionListener action1 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action2 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
+        ActionListener action3 = new ActionListener() {
+            public void actionPerformed(final ActionEvent e) {
+            }
+        };
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0);
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0);
-        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK);
-
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
+                InputEvent.SHIFT_DOWN_MASK);
         panel.registerKeyboardAction(action1, keyStroke1, JComponent.WHEN_FOCUSED);
-        panel.registerKeyboardAction(action2, keyStroke2, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        panel.registerKeyboardAction(action2, keyStroke2,
+                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         panel.registerKeyboardAction(action3, keyStroke3, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
         assertTrue(panel.getActionForKeyStroke(keyStroke1) == action1);
         assertTrue(panel.getActionForKeyStroke(keyStroke2) == action2);
         assertTrue(panel.getActionForKeyStroke(keyStroke3) == action3);
-
         panel.resetKeyboardActions();
         assertNull(panel.getActionForKeyStroke(keyStroke1));
         assertNull(panel.getActionForKeyStroke(keyStroke2));
@@ -1813,17 +1765,13 @@
     public void testGetRootPane() {
         JFrame mainFrame = new JFrame();
         JRootPane rootPane = new JRootPane();
-
         assertNull(panel.getRootPane());
-
         mainFrame.getContentPane().add(panel);
         assertTrue(panel.getRootPane() != null);
         assertTrue(panel.getRootPane() == mainFrame.getRootPane());
-
         rootPane.getContentPane().add(panel);
         assertTrue(panel.getRootPane() != null);
         assertTrue(panel.getRootPane() == rootPane);
-
         rootPane.getContentPane().remove(panel);
         assertNull(panel.getRootPane());
         mainFrame.dispose();
@@ -1831,15 +1779,15 @@
 
     public void testSetInputVerifier() {
         PropertyChangeController changeListener = new PropertyChangeController();
-
         panel.addPropertyChangeListener(changeListener);
-
-        InputVerifier verifier1 = new InputVerifier(){
+        InputVerifier verifier1 = new InputVerifier() {
+            @Override
             public boolean verify(final JComponent input) {
                 return false;
             }
         };
-        InputVerifier verifier2 = new InputVerifier(){
+        InputVerifier verifier2 = new InputVerifier() {
+            @Override
             public boolean verify(final JComponent input) {
                 return false;
             }
@@ -1847,33 +1795,30 @@
         panel.setInputVerifier(verifier1);
         changeListener.checkPropertyFired(panel, "inputVerifier", null, verifier1);
         changeListener.reset();
-
         panel.setInputVerifier(verifier2);
         changeListener.checkPropertyFired(panel, "inputVerifier", verifier1, verifier2);
         changeListener.reset();
-
         panel.setInputVerifier(verifier2);
         assertFalse("event's not fired", changeListener.isChanged());
         changeListener.reset();
     }
 
     public void testGetInputVerifier() {
-        InputVerifier verifier1 = new InputVerifier(){
+        InputVerifier verifier1 = new InputVerifier() {
+            @Override
             public boolean verify(final JComponent input) {
                 return false;
             }
         };
-        InputVerifier verifier2 = new InputVerifier(){
+        InputVerifier verifier2 = new InputVerifier() {
+            @Override
             public boolean verify(final JComponent input) {
                 return false;
             }
         };
-
         assertNull("There's not inputVerifier set by default", panel.getInputVerifier());
-
         panel.setInputVerifier(verifier1);
         assertEquals("InputVerifier set properly: ", verifier1, panel.getInputVerifier());
-
         panel.setInputVerifier(verifier2);
         assertEquals("InputVerifier set properly: ", verifier2, panel.getInputVerifier());
     }
@@ -1885,22 +1830,18 @@
         InputMap map1 = new InputMap();
         InputMap map2 = new InputMap();
         InputMap map3 = new ComponentInputMap(panel);
-
         panel.setInputMap(JComponent.WHEN_FOCUSED, map1);
         panel.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, map2);
         panel.setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, map3);
         assertTrue(panel.getInputMap(JComponent.WHEN_FOCUSED) == map1);
         assertTrue(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) == map2);
         assertTrue(panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) == map3);
-
         panel.setInputMap(JComponent.WHEN_FOCUSED, map2);
         panel.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, map3);
         assertTrue(panel.getInputMap(JComponent.WHEN_FOCUSED) == map2);
         assertTrue(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) == map3);
-
         panel.setInputMap(JComponent.WHEN_FOCUSED, null);
         assertNull(panel.getInputMap(JComponent.WHEN_FOCUSED));
-
         boolean isThrown = false;
         try {
             panel.setInputMap(1945, map2);
@@ -1908,7 +1849,6 @@
             isThrown = true;
         }
         assertTrue("Exception is thrown", isThrown);
-
         isThrown = false;
         try {
             panel.setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, map1);
@@ -1916,7 +1856,6 @@
             isThrown = true;
         }
         assertTrue("Exception is thrown", isThrown);
-
         if (isHarmony()) {
             isThrown = false;
             try {
@@ -1935,7 +1874,6 @@
         assertTrue(panel.getInputMap(JComponent.WHEN_FOCUSED) != null);
         assertTrue(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) != null);
         assertTrue(panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) != null);
-
         boolean isThrown = false;
         try {
             panel.getInputMap(1812);
@@ -1964,14 +1902,12 @@
         panel.setInputMap(JComponent.WHEN_FOCUSED, null);
         assertNull(panel.getInputMap(JComponent.WHEN_FOCUSED, true));
         assertNull(panel.getInputMap(JComponent.WHEN_FOCUSED, false));
-
         assertNull(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, false));
         assertNotNull(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, true));
         assertNotNull(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, false));
         panel.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
         assertNull(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, true));
         assertNull(panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, false));
-
         assertNull(panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, false));
         assertNotNull(panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, true));
         assertNotNull(panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, false));
@@ -2010,28 +1946,24 @@
         PropertyChangeController changeListener = new PropertyChangeController();
         String toolTipText1 = "toolTipText1";
         String toolTipText2 = "toolTipText2";
-
         panel.addPropertyChangeListener(changeListener);
         panel.setToolTipText(toolTipText1);
-        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY, null, toolTipText1);
+        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY, null,
+                toolTipText1);
         changeListener.reset();
-
         panel.setToolTipText(toolTipText1);
         assertFalse("event's not fired", changeListener.isChanged());
-
         panel.setToolTipText(toolTipText2);
-        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY, toolTipText1, toolTipText2);
+        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY,
+                toolTipText1, toolTipText2);
         changeListener.reset();
-
         panel.setToolTipText(null);
-        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY, toolTipText2, null);
-
+        changeListener.checkLastPropertyFired(panel, JComponent.TOOL_TIP_TEXT_KEY,
+                toolTipText2, null);
         panel.putClientProperty(JComponent.TOOL_TIP_TEXT_KEY, toolTipText1);
         assertTrue(panel.getToolTipText().equals(toolTipText1));
-
         panel.setToolTipText(toolTipText2);
         assertTrue(panel.getToolTipText().equals(toolTipText2));
-
         panel.setToolTipText(null);
         assertNull(panel.getToolTipText());
     }
@@ -2042,15 +1974,11 @@
     public void testGetToolTipText() {
         String toolTipText1 = "toolTipText1";
         String toolTipText2 = "toolTipText2";
-
         assertNull(panel.getToolTipText());
-
         panel.setToolTipText(toolTipText1);
         assertTrue(panel.getToolTipText().equals(toolTipText1));
-
         panel.setToolTipText(toolTipText2);
         assertTrue(panel.getToolTipText().equals(toolTipText2));
-
         panel.setToolTipText(null);
         assertNull(panel.getToolTipText());
     }
@@ -2062,17 +1990,13 @@
         MouseEvent event = new MouseEvent(panel, 0, 0, 0, 0, 0, 0, false);
         String toolTipText1 = "toolTipText1";
         String toolTipText2 = "toolTipText2";
-
         assertNull(panel.getToolTipText(event));
-
         panel.setToolTipText(toolTipText1);
         assertTrue(panel.getToolTipText(event).equals(toolTipText1));
         assertTrue(panel.getToolTipText(null).equals(toolTipText1));
-
         panel.setToolTipText(toolTipText2);
         assertTrue(panel.getToolTipText(event).equals(toolTipText2));
         assertTrue(panel.getToolTipText(null).equals(toolTipText2));
-
         panel.setToolTipText(null);
         assertNull(panel.getToolTipText(event));
         assertNull(panel.getToolTipText(null));
@@ -2082,7 +2006,6 @@
         int x = 100;
         int y = 200;
         MouseEvent event = new MouseEvent(panel, 0, 0, 0, x, y, 0, false);
-
         assertNull(panel.getToolTipLocation(event));
         assertNull(panel.getToolTipLocation(null));
     }
@@ -2090,16 +2013,13 @@
     public void testCreateToolTip() {
         String toolTipText1 = "toolTipText1";
         JToolTip toolTip = null;
-
         toolTip = panel.createToolTip();
         assertTrue(toolTip.getComponent() == panel);
         assertNull(toolTip.getTipText());
-
         panel.setToolTipText(toolTipText1);
         toolTip = panel.createToolTip();
         assertTrue(toolTip.getComponent() == panel);
         assertNull(toolTip.getTipText());
-
         JPanel panel2 = new JPanel();
         toolTip = panel2.createToolTip();
         assertTrue(toolTip.getComponent() == panel2);
@@ -2120,7 +2040,6 @@
         ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
         ConcreteVetoableChangeListener changeListener3 = new ConcreteVetoableChangeListener();
         VetoableChangeListener[] listenersArray = null;
-

[... 486 lines stripped ...]


Mime
View raw message