harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r823761 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java
Date Sat, 10 Oct 2009 02:04:30 GMT
Author: ndbeyer
Date: Sat Oct 10 02:04:29 2009
New Revision: 823761

URL: http://svn.apache.org/viewvc?rev=823761&view=rev
Log:
remove unnecessary null check - if field were null, a NPE would have been thrown before this
point

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java?rev=823761&r1=823760&r2=823761&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ScrollStateController.java
Sat Oct 10 02:04:29 2009
@@ -272,12 +272,8 @@
         int compSize = 0;
         int adjSize = (isVertical ? scrollable.getAdjustableWidth()
                                  : scrollable.getAdjustableHeight());
-        if (comp != null) {
-            Dimension prefSize = scrollable.getSize();
-            compSize = isVertical ? prefSize.height
-                                 : prefSize.width;
-        }
-        return ((spSize < compSize) &&
-                (spOtherSize > adjSize + GAP));
+        Dimension prefSize = scrollable.getSize();
+        compSize = isVertical ? prefSize.height : prefSize.width;
+        return ((spSize < compSize) && (spOtherSize > adjSize + GAP));
     }
 }
\ No newline at end of file



Mime
View raw message