harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496246 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/text/JTextComponent.java test/api/java/common/javax/swing/text/JTextComponentTest.java
Date Mon, 15 Jan 2007 08:23:49 GMT
Author: hindessm
Date: Mon Jan 15 00:23:48 2007
New Revision: 496246

URL: http://svn.apache.org/viewvc?view=rev&rev=496246
Log:
Applying patches from "[#HARMONY-2819] [classlib][swing]
j.s.text.JTextComponent.fireCaretUpdate(null) throws unspecified NPE".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponentTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java?view=diff&rev=496246&r1=496245&r2=496246
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
Mon Jan 15 00:23:48 2007
@@ -1040,7 +1040,9 @@
         for (int i = 0; i < listeners.length; i++) {
             listeners[i].caretUpdate(ce);
         }
-        handleComposedText(ce.getDot());
+        if (ce != null) {
+            handleComposedText(ce.getDot());
+        }
     }
 
     private void handleComposedText(final int dot) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponentTest.java?view=diff&rev=496246&r1=496245&r2=496246
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponentTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponentTest.java
Mon Jan 15 00:23:48 2007
@@ -401,6 +401,12 @@
         assertEquals("1321", strOrderFireCaretUpdate);
     }
 
+    // Regression for HARMONY-2819
+    public void testFireCaretUpdateNull() throws Exception {
+        new JTextArea().fireCaretUpdate(null);
+        // no exception is expected
+    }
+
     public void testSetGetText() throws Exception {
         assertTrue(jtc.getText().equals(""));
         jtc.setText("JTextComponent");



Mime
View raw message