Revision: 558
Author: allain.lalonde
Date: Fri Jul 24 07:31:51 2009
Log: Removing unnecessary null checks in removeInputListeners.

Javadocs for Swing APIs explicitly declare that null may be passed and that  
no action will be taken when you do so.
http://code.google.com/p/piccolo2d/source/detail?r=558

Modified:
  /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java

=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java        
 
Fri Jul 24 07:18:27 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java        
 
Fri Jul 24 07:31:51 2009
@@ -590,19 +590,11 @@
       * those events to piccolo.
       */
      protected void removeInputSources() {
-        if (mouseListener != null) {
-            removeMouseListener(mouseListener);
-        }
-        if (mouseMotionListener != null) {
-            removeMouseMotionListener(mouseMotionListener);
-        }
-        if (mouseWheelListener != null) {
-            removeMouseWheelListener(mouseWheelListener);
-        }
-        if (keyEventPostProcessor != null) {
-             
FocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(keyEventPostProcessor);
-        }
-
+        removeMouseListener(mouseListener);
+        removeMouseMotionListener(mouseMotionListener);
+        removeMouseWheelListener(mouseWheelListener);
+         
FocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(keyEventPostProcessor);
+
          mouseListener = null;
          mouseMotionListener = null;
          mouseWheelListener = null;

--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to