]> source.dussan.org Git - vaadin-framework.git/commitdiff
Code cleanup
authorArtur Signell <artur@vaadin.com>
Tue, 20 Mar 2012 12:44:06 +0000 (14:44 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 13:28:07 +0000 (15:28 +0200)
src/com/vaadin/ui/AbstractComponent.java

index 4d12e0ed27564cf96adfc63b0854f5649a9e47f0..ad91f342bada127210a47f0152d03ca58e0dec25 100644 (file)
@@ -438,14 +438,16 @@ public abstract class AbstractComponent implements Component, MethodEventSource
      * @see com.vaadin.ui.Component#setVisible(boolean)
      */
     public void setVisible(boolean visible) {
-        if (getState().isVisible() != visible) {
-            getState().setVisible(visible);
-            requestRepaint();
-            if (getParent() != null) {
-                // Must always repaint the parent (at least the hierarchy) when
-                // visibility of a child component changes.
-                getParent().requestRepaint();
-            }
+        if (getState().isVisible() == visible) {
+            return;
+        }
+
+        getState().setVisible(visible);
+        requestRepaint();
+        if (getParent() != null) {
+            // Must always repaint the parent (at least the hierarchy) when
+            // visibility of a child component changes.
+            getParent().requestRepaint();
         }
     }