harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495914 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/DebugGraphics.java test/api/java/common/javax/swing/DebugGraphicsTest.java
Date Sat, 13 Jan 2007 16:04:22 GMT
Author: hindessm
Date: Sat Jan 13 08:04:22 2007
New Revision: 495914

URL: http://svn.apache.org/viewvc?view=rev&rev=495914
Log:
Applying patch from "[#HARMONY-2549] [classlib][swing]
javax.swing.DebugGraphics() throws NPE".  I modified the test slightly to
let junit handle the exceptions.

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java?view=diff&rev=495914&r1=495913&r2=495914
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
Sat Jan 13 08:04:22 2007
@@ -168,7 +168,7 @@
     }
 
     public DebugGraphics(Graphics g, JComponent c) {
-        originalGraphics = g.create();
+        originalGraphics = (g == null ? null : g.create());
         component = c;
         thisNumber = debugGraphicsCount++;
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java?view=diff&rev=495914&r1=495913&r2=495914
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
Sat Jan 13 08:04:22 2007
@@ -47,4 +47,8 @@
         DebugGraphics result = (DebugGraphics) debugGraphics.create();
         assertEquals(debugGraphics.getDebugOptions(), result.getDebugOptions());
     }
+
+    public void testConstructor() throws NullPointerException {
+        new DebugGraphics();              
+    }
 }



Mime
View raw message