aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Fitzsimmons <fitzsim@redhat.com>2003-11-14 22:44:29 +0000
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>2003-11-14 22:44:29 +0000
commit5c859e1034742b0d98e732b9691add29dfb70376 (patch)
tree955f4afc5b23ffbc8e11e301d1b66cb6716e3e7e
parent8ffc2e370dfde7443cb3aa24d46359f5f9c60466 (diff)
downloadgcc-5c859e1034742b0d98e732b9691add29dfb70376.zip
gcc-5c859e1034742b0d98e732b9691add29dfb70376.tar.gz
gcc-5c859e1034742b0d98e732b9691add29dfb70376.tar.bz2
GridBagLayout.java (getLayoutDimensions): Return array of two zero-length int arrays when layoutInfo is null.
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
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/awt/GridBagLayout.java20
2 files changed, 22 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 03cc2fa..96510a5 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
index dd49a1c..7572c1d 100644
--- a/libjava/java/awt/GridBagLayout.java
+++ b/libjava/java/awt/GridBagLayout.java
@@ -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];