You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/01/13 11:08:41 UTC

svn commit: r495865 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/GridBagConstraints.java test/api/java/common/java/awt/GridBagConstraintsTest.java

Author: hindessm
Date: Sat Jan 13 02:08:41 2007
New Revision: 495865

URL: http://svn.apache.org/viewvc?view=rev&rev=495865
Log:
Applied patches from "[#HARMONY-2497] [classlib][awt]
GridBagConstraints(,,,,,,,,null,,) throws unspecified NPE while RI does not".

Added:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GridBagConstraints.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GridBagConstraints.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GridBagConstraints.java?view=diff&rev=495865&r1=495864&r2=495865
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GridBagConstraints.java (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GridBagConstraints.java Sat Jan 13 02:08:41 2007
@@ -81,7 +81,7 @@
         this.weighty = weighty;
         this.anchor = anchor;
         this.fill = fill;
-        this.insets = (Insets) insets.clone();
+        this.insets = (insets == null) ? null:(Insets) insets.clone();
         this.ipadx = ipadx;
         this.ipady = ipady;
     }

Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java?view=auto&rev=495865
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java (added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java Sat Jan 13 02:08:41 2007
@@ -0,0 +1,27 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package java.awt;
+
+import junit.framework.TestCase;
+
+public class GridBagConstraintsTest extends TestCase {
+    
+    // Regression test for JIRA HARMONY-2497
+    public void testNullInsets () { 
+        new GridBagConstraints(1,1,1,1,7.9,7.9,1,1,null,1,1); 
+     } 
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/GridBagConstraintsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native