harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495538 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/text/PlainDocument.java test/api/java/common/javax/swing/text/PlainDocumentTest.java
Date Fri, 12 Jan 2007 10:30:13 GMT
Author: hindessm
Date: Fri Jan 12 02:30:12 2007
New Revision: 495538

URL: http://svn.apache.org/viewvc?view=rev&rev=495538
Log:
Applied patch from "[#HARMONY-1797] [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent
chng) throws unspecified NullPointerException".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainDocument.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainDocument.java?view=diff&rev=495538&r1=495537&r2=495538
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainDocument.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainDocument.java
Fri Jan 12 02:30:12 2007
@@ -150,7 +150,9 @@
 
         try {
             text = getText(offset, length);
-        } catch (final BadLocationException e) { }
+        } catch (final BadLocationException e) {
+            return;
+        }
 
         boolean hasLineBreak = text.indexOf('\n') != -1;
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java?view=diff&rev=495538&r1=495537&r2=495538
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java
Fri Jan 12 02:30:12 2007
@@ -22,6 +22,7 @@
 
 import javax.swing.BasicSwingTestCase;
 import javax.swing.event.DocumentEvent.ElementChange;
+import javax.swing.event.DocumentEvent.EventType;
 import javax.swing.text.AbstractDocument.AbstractElement;
 import javax.swing.text.AbstractDocument.BranchElement;
 import javax.swing.text.AbstractDocument.Content;
@@ -363,6 +364,14 @@
         checkOffsets(root.getElement(0), 0, 12);
         checkOffsets(root.getElement(1), 12, 18);
         checkOffsets(root.getElement(2), 18, 19);
+    }
+
+    // Regression for HARMONY-1797
+    public void testRemoveUpdate06() throws Exception {
+        doc = new PlainDocument();
+        insert = doc.new DefaultDocumentEvent(3, 13, EventType.INSERT);
+
+        doc.removeUpdate(insert); // No exception should be thrown 
     }
 
     /**



Mime
View raw message