harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r519091 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
Date Fri, 16 Mar 2007 18:41:15 GMT
Author: apetrenko
Date: Fri Mar 16 11:41:14 2007
New Revision: 519091

URL: http://svn.apache.org/viewvc?view=rev&rev=519091
Log:
Patch for HARMONY-3416 "[classlib][awt] Unneeded Dimension object copying in Component.minimumSize
method"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java?view=diff&rev=519091&r1=519090&r2=519091
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
Fri Mar 16 11:41:14 2007
@@ -3265,13 +3265,13 @@
         toolkit.lockAWT();
         try {
             if (isMinimumSizeSet()) {
-                return new Dimension(minimumSize);
+                return (Dimension)minimumSize.clone();
             }
             Dimension defSize = getDefaultMinimumSize();
-            if (defSize == null) {
-                defSize = (isDisplayable() ? new Dimension(1, 1) : new Dimension(w, h));
+            if (defSize != null) {
+                return (Dimension)defSize.clone();
             }
-            return new Dimension(defSize);
+            return isDisplayable()? new Dimension(1, 1) : new Dimension(w, h);
         } finally {
             toolkit.unlockAWT();
         }



Mime
View raw message