bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/27930] New: DefaultStyledDocument.insert(int, ElementSpec[])


From: audriusa at bluewin dot ch
Subject: [Bug swing/27930] New: DefaultStyledDocument.insert(int, ElementSpec[]) fails with more than one member in array.
Date: 7 Jun 2006 13:10:10 -0000

DefaultStyledDocument.insert(int, ElementSpec[]) fails with more than one
member in array with the following exception:

Exception during event dispatch:
java.lang.AssertionError: BadLocationException should not be thrown here. p0 =
31, p1 = 41
   at javax.swing.text.GlyphView.getText(GlyphView.java:728)
   at
javax.swing.text.GlyphView$DefaultGlyphPainter.getSpan(GlyphView.java:387)   at
javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:565)
   at javax.swing.text.View.getMinimumSpan(View.java:183)
   at javax.swing.text.BoxView.updateChildRequirements(BoxView.java:949)
   at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:483)
   at javax.swing.text.BoxView.updateRequirements(BoxView.java:973)
   at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:343)
   at
javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:600)
   at javax.swing.text.BoxView.updateRequirements(BoxView.java:973)
   at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:343)
   at javax.swing.text.BoxView.updateChildRequirements(BoxView.java:949)
   at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:483)
   at javax.swing.text.BoxView.updateRequirements(BoxView.java:973)
   at javax.swing.text.BoxView.getPreferredSpan(BoxView.java:307)
   at
javax.swing.plaf.basic.BasicTextUI$RootView.getPreferredSpan(BasicTextUI.java:240)
   at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:880)
   at javax.swing.JComponent.getPreferredSize(JComponent.java:1333)
   at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:697)
   at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:337)
   at java.awt.Container.layout(Container.java:539)
   at java.awt.Container.doLayout(Container.java:528)
   at java.awt.Container.validateTree(Container.java:615)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validateTree(Container.java:624)
   at java.awt.Container.validate(Container.java:565)
   at java.awt.Window.show(Window.java:325)
   at java.awt.Component.show(Component.java:934)
   at java.awt.Component.setVisible(Component.java:884)
   at gnu.classpath.examples.swing.TextDemo$1.run(TextDemo.java:166)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:200)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:465)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:95)
Caused by: javax.swing.text.BadLocationException: the where argument cannot be
greater than the content length
   at javax.swing.text.GapContent.getChars(GapContent.java:415)
   at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:537)
   at javax.swing.text.GlyphView.getText(GlyphView.java:723)
   ...36 more

The call succeeds and the content is inserted if the passed array contains only
one element. In this case, multiple subsequent calls also succeed, so it would
be possible to write a trivial workaround. This, however, may not be effective.

This method is protected, but it call be called from the overridden classes and
may be later used in HTMLDocument.


-- 
           Summary: DefaultStyledDocument.insert(int, ElementSpec[]) fails
                    with more than one member in array.
           Product: classpath
           Version: 0.92
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: swing
        AssignedTo: roman at kennke dot org
        ReportedBy: audriusa at bluewin dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27930





reply via email to

[Prev in Thread] Current Thread [Next in Thread]