]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GridBagLayout.java (getLayoutDimensions): Return array of two zero-length int arrays...
authorTom Fitzsimmons <fitzsim@redhat.com>
Fri, 14 Nov 2003 22:44:29 +0000 (22:44 +0000)
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>
Fri, 14 Nov 2003 22:44:29 +0000 (22:44 +0000)
2003-11-14  Tom Fitzsimmons  <fitzsim@redhat.com>

* java/awt/GridBagLayout.java (getLayoutDimensions): Return array of two
zero-length int arrays when layoutInfo is null.
(getLayoutWeights): Return array of two zero-length double arrays when
layoutInfo is null.

From-SVN: r73622

libjava/ChangeLog
libjava/java/awt/GridBagLayout.java

index 03cc2fa2a16226e167c72226634ed5b20aa8e8a5..96510a5c43070e4cfad72a3fdb9542630ccc778e 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-14  Tom Fitzsimmons  <fitzsim@redhat.com>
+
+       * java/awt/GridBagLayout.java (getLayoutDimensions): Return array of two
+       zero-length int arrays when layoutInfo is null.
+       (getLayoutWeights): Return array of two zero-length double arrays when
+       layoutInfo is null.
+
 2003-11-13  Tom Tromey  <tromey@redhat.com>
 
        * jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to
index dd49a1cf905d31f33680a11138bc470e360af665..7572c1d1d565e114bb9003fcf2c16b5e55f9df70 100644 (file)
@@ -229,10 +229,15 @@ public class GridBagLayout
      */
     public int[][] getLayoutDimensions ()
     {
+       int[][] result = new int [2][];
        if (layoutInfo == null)
-           return new int [2][];
+         {
+           result[0] = new int[0];
+           result[1] = new int[0];
+
+           return result;
+         }
 
-       int[][] result = new int [2][];
        result [0] = new int [layoutInfo.cols];
        System.arraycopy (layoutInfo.colWidths, 0, result [0], 0, layoutInfo.cols);
        result [1] = new int [layoutInfo.rows];
@@ -242,10 +247,15 @@ public class GridBagLayout
 
     public double[][] getLayoutWeights ()
     {
-       if (layoutInfo == null)
-           return new double [2][];
-      
        double[][] result = new double [2][];
+       if (layoutInfo == null)
+         {
+           result[0] = new double[0];
+           result[1] = new double[0];
+
+           return result;
+         }
+
        result [0] = new double [layoutInfo.cols];
        System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols);
        result [1] = new double [layoutInfo.rows];