Revision: 692
Author: allain.lalonde
Date: Fri Oct  9 08:10:29 2009
Log: Hunting FindBugs in Core.
http://code.google.com/p/piccolo2d/source/detail?r=692

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/PNode.java
  /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PRoot.java
   
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
   
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java
   
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java
   
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PerformanceTests.java

=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java        
 
Wed Aug  5 13:17:16 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java        
 
Fri Oct  9 08:10:29 2009
@@ -879,13 +879,13 @@

          final PBounds clippingRect = new PBounds(g.getClipBounds());
          clippingRect.expandNearestIntegerDimensions();
-
+
          final PBounds originalCameraBounds = getCamera().getBounds();
          final PBounds layerBounds =  
getCamera().getUnionOfLayerFullBounds();
          getCamera().setBounds(layerBounds);

          final double clipRatio = clippingRect.getWidth() /  
clippingRect.getHeight();
-        final double nodeRatio = getWidth() / getHeight();
+        final double nodeRatio = ((double)getWidth()) /  
((double)getHeight());
          final double scale;
          if (nodeRatio <= clipRatio) {
              scale = clippingRect.getHeight() / getCamera().getHeight();
=======================================
--- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java      
 
Wed Aug  5 18:13:48 2009
+++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java      
 
Fri Oct  9 08:10:29 2009
@@ -875,7 +875,7 @@
              final byte[] ser = PObjectOutputStream.toByteArray(this);
              return new ObjectInputStream(new  
ByteArrayInputStream(ser)).readObject();
          }
-        catch (final IOException e) {
+        catch (final IOException e) {
              return null;
          }
          catch (final ClassNotFoundException e) {
=======================================
--- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PRoot.java      
 
Sun Aug  2 19:48:01 2009
+++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PRoot.java      
 
Fri Oct  9 08:10:29 2009
@@ -98,7 +98,7 @@
      /**
       * The singleton instance of the default input manager.
       */
-    private PInputManager defaultInputManager;
+    private transient PInputManager defaultInputManager;

      /** The Input Sources that are registered to this node. */
      private final transient List inputSources;
=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
   
Thu Oct  8 14:01:22 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
   
Fri Oct  9 08:10:29 2009
@@ -30,6 +30,7 @@

  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
+import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;

@@ -52,11 +53,11 @@
   * @version 1.0
   * @author Jesse Grosjean
   */
-public class PActivityScheduler {
-
+public class PActivityScheduler implements Serializable {
+    private static final long serialVersionUID = 1L;
      private final PRoot root;
      private final List activities;
-    private Timer activityTimer;
+    private transient Timer activityTimer;
      private boolean activitiesChanged;
      private boolean animating;
      private final ArrayList processingActivities;
=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java
         
Fri Aug  7 12:34:23 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java
         
Fri Oct  9 08:10:29 2009
@@ -117,7 +117,7 @@
      private final JLabel label;

      /** Object that encapsulates the HTML rendering logic. */
-    private View htmlView;
+    private transient View htmlView;

      /**
       * Create an empty HTML text node with the default font and text color.
=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java    
 
Fri Oct  9 06:04:12 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java    
 
Fri Oct  9 08:10:29 2009
@@ -354,9 +354,10 @@
       * @param text text for this text node
       */
      public void setText(final String text) {
-        if (text == this.text) {
+        if ((text == null && this.text == null) || (text != null &&  
text.equals(this.text))) {
              return;
          }
+
          final String oldText = this.text;
          this.text = text == null ? DEFAULT_TEXT : text;
          lines = null;
=======================================
---  
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PerformanceTests.java
        
Tue Jul 28 12:46:54 2009
+++  
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PerformanceTests.java
        
Fri Oct  9 08:10:29 2009
@@ -222,7 +222,7 @@
          }
          log.endTest("Do fullIntersects test for " + NUMBER_NODES + "  
nodes");
      }
-
+
      public void memorySizeOfNodes() {
          final PNode[] nodes = new PNode[NUMBER_NODES];
          Runtime.getRuntime().gc();

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

Reply via email to