harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [26/43] - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common: javax/swing/ javax/swing/border/ javax/swing/colorchooser/ javax/swing/event/ javax/swing/filechooser/ javax/swing/plaf/ javax/swing/plaf/basic/ j...
Date Sun, 26 Nov 2006 20:15:55 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_RemoveTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_RemoveTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_RemoveTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_RemoveTest.java Sun Nov 26 12:15:43 2006
@@ -21,14 +21,12 @@
 package javax.swing.text;
 
 import java.util.List;
-
 import javax.swing.event.DocumentEvent.EventType;
 import javax.swing.text.AbstractDocument.AbstractElement;
 import javax.swing.text.AbstractDocument.BranchElement;
 import javax.swing.text.AbstractDocument.Content;
 import javax.swing.text.AbstractDocument.DefaultDocumentEvent;
 import javax.swing.text.DefaultStyledDocument.ElementBuffer;
-
 import junit.framework.TestCase;
 
 /**
@@ -38,28 +36,34 @@
  */
 public class DefaultStyledDocument_ElementBuffer_RemoveTest extends TestCase {
     private DefaultStyledDocument doc;
+
     private ElementBuffer buf;
+
     private Element root;
+
     private Element paragraph;
+
     private Content content;
+
     private DefaultDocumentEvent event;
 
     private static final AttributeSet bold = DefStyledDoc_Helpers.bold;
+
     private static final AttributeSet italic = DefStyledDoc_Helpers.italic;
 
     private static final AttributeSet boldFalse;
-    private static final AttributeSet italicFalse;
 
+    private static final AttributeSet italicFalse;
     static {
         MutableAttributeSet mas = new SimpleAttributeSet(bold);
         StyleConstants.setBold(mas, false);
         boldFalse = mas;
-
         mas = new SimpleAttributeSet(italic);
         StyleConstants.setItalic(mas, false);
         italicFalse = mas;
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         doc = new DefaultStyledDocument();
@@ -67,38 +71,31 @@
         buf = new DefStyledDoc_Helpers.ElementBufferWithLogging(doc, root);
         doc.buffer = buf;
         paragraph = root.getElement(0);
-
         content = doc.getContent();
-
         content.insertString(0, "plainbolditalic\ntext");
         // Create the structure equivalent to this sequence:
         //doc.insertString(doc.getLength(), "plain", null);    // 5 chars
         //doc.insertString(doc.getLength(), "bold", bold);     // 4 chars
         //doc.insertString(doc.getLength(), "italic", italic); // 6 chars
         //doc.insertString(doc.getLength(), "\ntext", null);   // 5 chars
-
         doc.writeLock(); // Write lock needed to modify document structure
-
         Element[] leaves = new Element[4];
         leaves[0] = doc.createLeafElement(paragraph, null, 0, 5);
         leaves[1] = doc.createLeafElement(paragraph, bold, 5, 9);
         leaves[2] = doc.createLeafElement(paragraph, italic, 9, 15);
         leaves[3] = doc.createLeafElement(paragraph, null, 15, 16);
-        ((BranchElement)paragraph).replace(0, 1, leaves);
-
-        BranchElement branch = (BranchElement)doc.createBranchElement(root,
-                                                                      null);
+        ((BranchElement) paragraph).replace(0, 1, leaves);
+        BranchElement branch = (BranchElement) doc.createBranchElement(root, null);
         leaves = new Element[1];
         leaves[0] = doc.createLeafElement(branch, null, 16, 21);
         branch.replace(0, 0, leaves);
-
         branch.addAttributes(boldFalse);
         branch.addAttributes(italicFalse);
-
         // Add this branch to the root
-        ((BranchElement)root).replace(1, 0, new Element[] {branch});
+        ((BranchElement) root).replace(1, 0, new Element[] { branch });
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         doc.writeUnlock();
@@ -112,15 +109,11 @@
     public void testRemoveElementStart() throws Exception {
         final Element boldElement = paragraph.getElement(1);
         final int offset = boldElement.getStartOffset();
-        final int length = (boldElement.getEndOffset()
-                            - boldElement.getStartOffset()) / 2;
-
+        final int length = (boldElement.getEndOffset() - boldElement.getStartOffset()) / 2;
         buf.remove(offset, length, createEvent(offset, length));
-
         assertEquals(0, getEdits(event).size());
-
-        assertChildren(paragraph, new int[] {0, 5, 5, 9, 9, 15, 15, 16},
-                       new AttributeSet[] {null, bold, italic, null});
+        assertChildren(paragraph, new int[] { 0, 5, 5, 9, 9, 15, 15, 16 }, new AttributeSet[] {
+                null, bold, italic, null });
     }
 
     /**
@@ -130,16 +123,12 @@
      */
     public void testRemoveElementEnd() throws Exception {
         final Element boldElement = paragraph.getElement(1);
-        final int offset = (boldElement.getStartOffset()
-                            + boldElement.getEndOffset()) / 2;
+        final int offset = (boldElement.getStartOffset() + boldElement.getEndOffset()) / 2;
         final int length = boldElement.getEndOffset() - offset;
-
         buf.remove(offset, length, createEvent(offset, length));
-
         assertEquals(0, getEdits(event).size());
-
-        assertChildren(paragraph, new int[] {0, 5, 5, 9, 9, 15, 15, 16},
-                       new AttributeSet[] {null, bold, italic, null});
+        assertChildren(paragraph, new int[] { 0, 5, 5, 9, 9, 15, 15, 16 }, new AttributeSet[] {
+                null, bold, italic, null });
     }
 
     /**
@@ -150,17 +139,12 @@
         final Element boldElement = paragraph.getElement(1);
         final int offset = boldElement.getStartOffset();
         final int length = boldElement.getEndOffset() - offset;
-
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), paragraph, 1,
-                     new int[] {5, 9}, new int[] {});
-
-        assertChildren(paragraph, new int[] {0, 5, 9, 15, 15, 16},
-                       new AttributeSet[] {null, italic, null});
+        assertChange(edits.get(0), paragraph, 1, new int[] { 5, 9 }, new int[] {});
+        assertChildren(paragraph, new int[] { 0, 5, 9, 15, 15, 16 }, new AttributeSet[] { null,
+                italic, null });
     }
 
     /**
@@ -173,19 +157,14 @@
         final Element plainElement = paragraph.getElement(0);
         final Element boldElement = paragraph.getElement(1);
         final int offset = plainElement.getStartOffset();
-        final int length = (boldElement.getStartOffset()
-                            + boldElement.getEndOffset()) / 2 - offset;
-
+        final int length = (boldElement.getStartOffset() + boldElement.getEndOffset()) / 2
+                - offset;
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), paragraph, 0,
-                     new int[] {0, 5}, new int[] {});
-
-        assertChildren(paragraph, new int[] {5, 9, 9, 15, 15, 16},
-                       new AttributeSet[] {bold, italic, null});
+        assertChange(edits.get(0), paragraph, 0, new int[] { 0, 5 }, new int[] {});
+        assertChildren(paragraph, new int[] { 5, 9, 9, 15, 15, 16 }, new AttributeSet[] { bold,
+                italic, null });
     }
 
     /**
@@ -197,20 +176,14 @@
     public void testRemove2ElementsEnd() throws Exception {
         final Element plainElement = paragraph.getElement(0);
         final Element boldElement = paragraph.getElement(1);
-        final int offset = (plainElement.getStartOffset()
-                            + plainElement.getEndOffset()) / 2;
+        final int offset = (plainElement.getStartOffset() + plainElement.getEndOffset()) / 2;
         final int length = boldElement.getEndOffset() - offset;
-
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), paragraph, 1,
-                     new int[] {5, 9}, new int[] {});
-
-        assertChildren(paragraph, new int[] {0, 5, 9, 15, 15, 16},
-                       new AttributeSet[] {null, italic, null});
+        assertChange(edits.get(0), paragraph, 1, new int[] { 5, 9 }, new int[] {});
+        assertChildren(paragraph, new int[] { 0, 5, 9, 15, 15, 16 }, new AttributeSet[] { null,
+                italic, null });
     }
 
     /**
@@ -222,18 +195,14 @@
     public void testRemove2ElementsStartEnd() throws Exception {
         final Element plainElement = paragraph.getElement(0);
         final Element boldElement = paragraph.getElement(1);
-        final int offset = (plainElement.getStartOffset()
-                            + plainElement.getEndOffset()) / 2;
-        final int length = (boldElement.getStartOffset()
-                            + boldElement.getEndOffset()) / 2 - offset;
-
+        final int offset = (plainElement.getStartOffset() + plainElement.getEndOffset()) / 2;
+        final int length = (boldElement.getStartOffset() + boldElement.getEndOffset()) / 2
+                - offset;
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(0, edits.size());
-
-        assertChildren(paragraph, new int[] {0, 5, 5, 9, 9, 15, 15, 16},
-                       new AttributeSet[] {null, bold, italic, null});
+        assertChildren(paragraph, new int[] { 0, 5, 5, 9, 9, 15, 15, 16 }, new AttributeSet[] {
+                null, bold, italic, null });
     }
 
     /**
@@ -245,17 +214,12 @@
         final Element boldElement = paragraph.getElement(1);
         final int offset = plainElement.getStartOffset();
         final int length = boldElement.getEndOffset() - offset;
-
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), paragraph, 0,
-                     new int[] {0, 5, 5, 9}, new int[] {});
-
-        assertChildren(paragraph, new int[] {9, 15, 15, 16},
-                       new AttributeSet[] {italic, null});
+        assertChange(edits.get(0), paragraph, 0, new int[] { 0, 5, 5, 9 }, new int[] {});
+        assertChildren(paragraph, new int[] { 9, 15, 15, 16 }, new AttributeSet[] { italic,
+                null });
     }
 
     /**
@@ -268,22 +232,14 @@
     public void testRemoveParagraphBreak() throws Exception {
         final int offset = paragraph.getEndOffset() - 1;
         final int length = 1;
-
-        ((AbstractElement)paragraph).addAttributes(bold);
-
+        ((AbstractElement) paragraph).addAttributes(bold);
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), root, 0,
-                     new int[] {0, 16, 16, 21}, new int[] {0, 21});
-
-        final AbstractElement branch = (AbstractElement)root.getElement(0);
-
-        assertChildren(branch, new int[] {0, 5, 5, 9, 9, 15, 16, 21},
-                       new AttributeSet[] {null, bold, italic, null});
-
+        assertChange(edits.get(0), root, 0, new int[] { 0, 16, 16, 21 }, new int[] { 0, 21 });
+        final AbstractElement branch = (AbstractElement) root.getElement(0);
+        assertChildren(branch, new int[] { 0, 5, 5, 9, 9, 15, 16, 21 }, new AttributeSet[] {
+                null, bold, italic, null });
         assertEquals(2, branch.getAttributeCount());
         assertTrue(branch.isDefined(AttributeSet.ResolveAttribute));
         assertTrue(branch.containsAttributes(bold));
@@ -299,22 +255,14 @@
         final Element italicElement = paragraph.getElement(2);
         final int offset = italicElement.getStartOffset();
         final int length = paragraph.getEndOffset() - offset;
-
-        ((AbstractElement)paragraph).addAttributes(bold);
-
+        ((AbstractElement) paragraph).addAttributes(bold);
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), root, 0,
-                     new int[] {0, 16, 16, 21}, new int[] {0, 21});
-
-        final AbstractElement branch = (AbstractElement)root.getElement(0);
-
-        assertChildren(branch, new int[] {0, 5, 5, 9, 16, 21},
-                       new AttributeSet[] {null, bold, null});
-
+        assertChange(edits.get(0), root, 0, new int[] { 0, 16, 16, 21 }, new int[] { 0, 21 });
+        final AbstractElement branch = (AbstractElement) root.getElement(0);
+        assertChildren(branch, new int[] { 0, 5, 5, 9, 16, 21 }, new AttributeSet[] { null,
+                bold, null });
         assertEquals(2, branch.getAttributeCount());
         assertTrue(branch.isDefined(AttributeSet.ResolveAttribute));
         assertTrue(branch.containsAttributes(bold));
@@ -331,48 +279,34 @@
     public void testRemoveFullParagraph() throws Exception {
         final int offset = paragraph.getStartOffset();
         final int length = paragraph.getEndOffset() - offset;
-
-        ((AbstractElement)paragraph).addAttributes(bold);
-
+        ((AbstractElement) paragraph).addAttributes(bold);
         buf.remove(offset, length, createEvent(offset, length));
-
-        final List edits = getEdits(event);
+        final List<?> edits = getEdits(event);
         assertEquals(1, edits.size());
-
-        assertChange(edits.get(0), root, 0,
-                     new int[] {0, 16, 16, 21}, new int[] {16, 21});
-
-        final AbstractElement branch = (AbstractElement)root.getElement(0);
-
-        assertChildren(branch, new int[] {16, 21},
-                       new AttributeSet[] {null});
-
+        assertChange(edits.get(0), root, 0, new int[] { 0, 16, 16, 21 }, new int[] { 16, 21 });
+        final AbstractElement branch = (AbstractElement) root.getElement(0);
+        assertChildren(branch, new int[] { 16, 21 }, new AttributeSet[] { null });
         assertEquals(2, branch.getAttributeCount());
         assertTrue(branch.isDefined(AttributeSet.ResolveAttribute));
         assertTrue(branch.containsAttributes(bold));
     }
 
-    private static void assertChange(final Object change,
-                                     final Element element,
-                                     final int index,
-                                     final int[] removed, final int[] added) {
-        DefStyledDoc_Helpers.assertChange(change, element, index,
-                                          removed, added);
+    private static void assertChange(final Object change, final Element element,
+            final int index, final int[] removed, final int[] added) {
+        DefStyledDoc_Helpers.assertChange(change, element, index, removed, added);
     }
 
-    private static void assertChildren(final Element element,
-                                       final int[] offsets,
-                                       final AttributeSet[] attributes) {
+    private static void assertChildren(final Element element, final int[] offsets,
+            final AttributeSet[] attributes) {
         DefStyledDoc_Helpers.assertChildren(element, offsets, attributes);
     }
 
-    private DefaultDocumentEvent createEvent(final int offset,
-                                             final int length) {
+    private DefaultDocumentEvent createEvent(final int offset, final int length) {
         event = doc.new DefaultDocumentEvent(offset, length, EventType.CHANGE);
         return event;
     }
 
-    private static List getEdits(final DefaultDocumentEvent event) {
+    private static List<?> getEdits(final DefaultDocumentEvent event) {
         return DefStyledDoc_Helpers.getEdits(event);
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_Specs1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_Specs1Test.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_Specs1Test.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementBuffer_Specs1Test.java Sun Nov 26 12:15:43 2006
@@ -22,13 +22,11 @@
 
 import java.util.List;
 import java.util.Vector;
-
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.text.AbstractDocument.DefaultDocumentEvent;
 import javax.swing.text.DefaultStyledDocument.ElementBuffer;
 import javax.swing.text.DefaultStyledDocument.ElementSpec;
-
 import junit.framework.TestCase;
 
 /**
@@ -71,27 +69,33 @@
  * <p>Each test-case region currently contains four tests.
  *
  */
-public class DefaultStyledDocument_ElementBuffer_Specs1Test extends TestCase
-    implements DocumentListener {
+public class DefaultStyledDocument_ElementBuffer_Specs1Test extends TestCase implements
+        DocumentListener {
+    private DefaultStyledDocument doc;
+
+    private Element root;
 
-    private DefaultStyledDocument     doc;
-    private Element                   root;
-    private ElementBuffer             buf;
-    private ElementSpec[]             specs;
+    private ElementBuffer buf;
 
-    private DefaultDocumentEvent      insertEvent;
+    private ElementSpec[] specs;
+
+    private DefaultDocumentEvent insertEvent;
 
     private static final AttributeSet bold = DefStyledDoc_Helpers.bold;
+
     private static final AttributeSet italic = DefStyledDoc_Helpers.italic;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         doc = new DefStyledDoc_Helpers.DefStyledDocWithLogging();
         root = doc.getDefaultRootElement();
-        buf = new DefStyledDoc_Helpers.ElementBufferWithLogging(doc,
-                                                                root) {
+        buf = new DefStyledDoc_Helpers.ElementBufferWithLogging(doc, root) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public void insert(int offset, int length, ElementSpec[] spec,
-                               DefaultDocumentEvent event) {
+                    DefaultDocumentEvent event) {
                 super.insert(offset, length, specs = spec, event);
             }
         };
@@ -105,10 +109,8 @@
     public void testInsertString01() throws Exception {
         doc.insertString(0, "one", null);
         assertEquals(1, getEdits(insertEvent).size());
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 3);
     }
 
     /**
@@ -116,18 +118,14 @@
      */
     public void testInsertString02() throws Exception {
         doc.insertString(0, "one\n", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
     }
 
     /**
@@ -135,21 +133,16 @@
      */
     public void testInsertString03() throws Exception {
         doc.insertString(0, "\none", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 1, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.JoinNextDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.JoinNextDirection, 0, 3);
         /*
          * createLeaf(paragraph[0, 5], , 0, 1)
          *      New leaf containing \n in the first paragraph
@@ -172,25 +165,19 @@
      */
     public void testInsertString04() throws Exception {
         doc.insertString(0, "one\ntwo", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 1, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.JoinNextDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.JoinNextDirection, 0, 3);
     }
 
-//---------------------------------------------------------------------------
-
+    //---------------------------------------------------------------------------
     /**
      * Bold attribute on paragraph, text 'one' with no attributes, doc is empty.
      */
@@ -198,12 +185,9 @@
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one", null);
         assertEquals(1, getEdits(insertEvent).size());
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 3);
     }
 
     /**
@@ -213,22 +197,16 @@
     public void testInsertString12() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one\n", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
         /*
          * Fracture copies attributes of the paragraph:
          *
@@ -243,24 +221,18 @@
     public void testInsertString13() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "\none", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 1, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.JoinNextDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.JoinNextDirection, 0, 3);
     }
 
     /**
@@ -270,48 +242,36 @@
     public void testInsertString14() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one\ntwo", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 1, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.JoinPreviousDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.JoinNextDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.JoinNextDirection, 0, 3);
     }
 
-//---------------------------------------------------------------------------
-
+    //---------------------------------------------------------------------------
     /**
      * Bold attribute on character, text 'one' with no attributes, doc is empty.
      */
     public void testInsertString21() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(2, edits.size());
-
         assertChange(edits.get(1), root.getElement(0), 1, 2);
-
         Element charElem = doc.getCharacterElement(0);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
         /*
          * createLeaf(paragraph[0, 4], , 0, 3)
          *      The word 'one'
@@ -327,29 +287,22 @@
     public void testInsertString22() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one\n", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
         /*
          * While copying elements with fracture, it will copy leaf attributes:
          *
@@ -365,36 +318,28 @@
     public void testInsertString23() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "\none", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(0, charElem.getStartOffset());
         assertEquals(1, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(1);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(1, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
         /*
          * createLeaf(paragraph[0, 5], , 0, 1)
          * createBranch(section[0, 5], * resolver=**AttributeSet** )
@@ -410,59 +355,45 @@
     public void testInsertString24() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one\ntwo", null);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(4);
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(4, charElem.getStartOffset());
         assertEquals(7, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(7, charElem.getStartOffset());
         assertEquals(8, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
-//===========================================================================
-
+    //===========================================================================
     /**
      * No attributes, text 'one' with italic, doc is empty.
      */
     public void testInsertString31() throws Exception {
         doc.insertString(0, "one", italic);
-
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(2, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 2);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
     /**
@@ -470,28 +401,22 @@
      */
     public void testInsertString32() throws Exception {
         doc.insertString(0, "one\n", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
     }
 
     /**
@@ -499,36 +424,28 @@
      */
     public void testInsertString33() throws Exception {
         doc.insertString(0, "\none", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(1, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(1);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(1, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
     /**
@@ -536,60 +453,47 @@
      */
     public void testInsertString34() throws Exception {
         doc.insertString(0, "one\ntwo", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(4);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(7, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(7, charElem.getStartOffset());
         assertEquals(8, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
-//---------------------------------------------------------------------------
-
+    //---------------------------------------------------------------------------
     /**
      * Bold attribute on paragraph, text 'one' with italic, doc is empty.
      */
     public void testInsertString41() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(2, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 2);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
     /**
@@ -598,32 +502,24 @@
     public void testInsertString42() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one\n", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
         /*
          * Fracture copies attributes of the paragraph:
          *
@@ -637,39 +533,30 @@
     public void testInsertString43() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "\none", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(1, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(1);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(1, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
     /**
@@ -678,63 +565,48 @@
     public void testInsertString44() throws Exception {
         doc.setParagraphAttributes(0, 1, bold, false);
         doc.insertString(0, "one\ntwo", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         assertTrue(root.getElement(0).getAttributes().containsAttributes(bold));
         assertTrue(root.getElement(1).getAttributes().containsAttributes(bold));
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(4);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(7, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertEquals(0, charElem.getAttributes().getAttributeCount());
         assertEquals(7, charElem.getStartOffset());
         assertEquals(8, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
-//---------------------------------------------------------------------------
-
+    //---------------------------------------------------------------------------
     /**
      * Bold attribute on character, text 'one' with italic, doc is empty.
      */
     public void testInsertString51() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(2, edits.size());
-
         assertChange(edits.get(1), root.getElement(0), 1, 2);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
-
         assertEquals(1, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
         /*
          * createLeaf(paragraph[0, 4], , 0, 3)
          *      The word 'one'
@@ -749,29 +621,22 @@
     public void testInsertString52() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one\n", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(3, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(3, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
         /*
          * While copying elements with fracture, it will copy leaf attributes:
          *
@@ -786,36 +651,28 @@
     public void testInsertString53() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "\none", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(1, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(1);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(1, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(5, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 1);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 1);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
         /*
          * createLeaf(paragraph[0, 5], , 0, 1)
          * createBranch(section[0, 5], resolver=**AttributeSet** )
@@ -830,50 +687,41 @@
     public void testInsertString54() throws Exception {
         doc.setCharacterAttributes(0, 1, bold, false);
         doc.insertString(0, "one\ntwo", italic);
-        List edits = getEdits(insertEvent);
+        List<?> edits = getEdits(insertEvent);
         assertEquals(4, edits.size());
         assertChange(edits.get(1), root.getElement(0), 1, 1);
         assertChange(edits.get(2), root.getElement(1), 0, 1);
         assertChange(edits.get(3), root, 0, 1);
-
         Element charElem = doc.getCharacterElement(0);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(0, charElem.getStartOffset());
         assertEquals(4, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(4);
         assertTrue(charElem.getAttributes().isEqual(italic));
         assertEquals(4, charElem.getStartOffset());
         assertEquals(7, charElem.getEndOffset());
-
         charElem = doc.getCharacterElement(doc.getLength());
         assertTrue(charElem.getAttributes().isEqual(bold));
         assertEquals(7, charElem.getStartOffset());
         assertEquals(8, charElem.getEndOffset());
-
         assertEquals(4, specs.length);
-        assertSpec(specs[0], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 4);
-        assertSpec(specs[1], ElementSpec.EndTagType,
-                   ElementSpec.OriginateDirection, 0, 0);
-        assertSpec(specs[2], ElementSpec.StartTagType,
-                   ElementSpec.JoinFractureDirection, 0, 0);
-        assertSpec(specs[3], ElementSpec.ContentType,
-                   ElementSpec.OriginateDirection, 0, 3);
+        assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 4);
+        assertSpec(specs[1], ElementSpec.EndTagType, ElementSpec.OriginateDirection, 0, 0);
+        assertSpec(specs[2], ElementSpec.StartTagType, ElementSpec.JoinFractureDirection, 0, 0);
+        assertSpec(specs[3], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, 3);
     }
 
     private static void assertChange(final Object object, final Element element,
-                                     final int removed, int added) {
+            final int removed, int added) {
         DefStyledDoc_Helpers.assertChange(object, element, removed, added);
     }
 
     private static void assertSpec(final ElementSpec spec, final short type,
-                                   final short direction, final int offset,
-                                   final int length) {
+            final short direction, final int offset, final int length) {
         DefStyledDoc_Helpers.assertSpec(spec, type, direction, offset, length);
     }
 
-    private static Vector getEdits(final DefaultDocumentEvent event) {
+    private static Vector<?> getEdits(final DefaultDocumentEvent event) {
         return DefStyledDoc_Helpers.getEdits(event);
     }
 
@@ -881,7 +729,7 @@
     }
 
     public void insertUpdate(DocumentEvent e) {
-        insertEvent = (DefaultDocumentEvent)e;
+        insertEvent = (DefaultDocumentEvent) e;
     }
 
     public void removeUpdate(DocumentEvent e) {



Mime
View raw message