Removed the debugging methods from this class.
2006-01-20 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/text/DefaultStyledDocument.java
(pad): Removed, not needed.
(printElements): Likewise.
(printEdit): Likewise.
Index: javax/swing/text/DefaultStyledDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultStyledDocument.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- javax/swing/text/DefaultStyledDocument.java 17 Jan 2006 19:57:44 -0000 1.40
+++ javax/swing/text/DefaultStyledDocument.java 20 Jan 2006 19:28:40 -0000 1.41
@@ -67,44 +67,7 @@
public class DefaultStyledDocument extends AbstractDocument
implements StyledDocument
{
- // Prints some spaces.
- // This is just debugging code that will be used temporarily.
- static void pad(int pad)
- {
- for (int i = 0; i < pad; i++)
- System.out.print(" ");
- }
-
- // Displays the Element hierarchy starting with <code>start</code>.
- // This is just debugging code that will be used temporarily.
- static void printElements (Element start, int pad)
- {
- pad(pad);
- if (pad == 0)
- System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
- + start.getEndOffset()+")");
- else if (start instanceof AbstractDocument.BranchElement)
- System.out.println ("BranchElement ("+start.getStartOffset()+", "
- + start.getEndOffset()+")");
- else
- {
- try
- {
- System.out.println ("LeafElement ("+start.getStartOffset()+", "
- + start.getEndOffset()+"): "
- + start.getAttributes().getAttributeCount() + ": "
- + start.getDocument().
- getText(start.getStartOffset(),
- start.getEndOffset() -
- start.getStartOffset()));
- }
- catch (BadLocationException ble)
- {
- }
- }
- for (int i = 0; i < start.getElementCount(); i ++)
- printElements (start.getElement(i), pad+3);
- }
+
/**
* An [EMAIL PROTECTED] UndoableEdit} that can undo attribute changes to an element.
*
@@ -1092,45 +1055,6 @@
}
/**
- * This is a debugging method. Since we don't apply changes immediately
- * this method is helpful for debugging purposes so you can tell what the
- * tree will look like after all edits are applied.
- */
- void printPendingEdits()
- {
- int size = edits.size();
- System.out.println ("PENDING EDITS");
- for (int i = 0; i < size; i++)
- {
- Edit edit = (Edit)edits.elementAt(i);
- if (edit.e.isLeaf() || edit.e.getElementCount() > 0)
- System.out.print(printElement(edit.e));
- System.out.println("starting offset: "+edit.index);
- if (edit.added != null)
- for (int k = 0; k < edit.added.size(); k ++)
- System.out.println ("added: "+printElement((Element)edit.added.elementAt(k)));
- if (edit.removed != null)
- for (int k = 0; k < edit.removed.size(); k ++)
- System.out.println ("removed: "+printElement((Element)edit.removed.elementAt(k)));
- }
- System.out.println ("END PENDING EDITS");
- }
-
- /**
- * This is a helper method for debugging. To avoid NPE we can't just
- * print BranchElements because they may have no children. So this
- * method prints Elements and handles the case of BranchElements with
- * no children.
- * @param e the Element to print
- * @return a String describing the given Element
- */
- String printElement (Element e)
- {
- if (e.isLeaf() || e.getElementCount() > 0)
- return e.toString();
- return "BranchElement with no children";
- }
- /**
* Inserts a content element into the document structure.
*
* @param tag the element spec
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches