Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4387695

Semantics of Bidi.createLineBidi have changed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.3.0, 1.4.0
    • client-libs
    • None
    • 2d
    • beta
    • x86
    • generic, windows_nt

      The arguments to Bidi.createLineBidi previoulsy meant the start and end position. They now appear to mean the start and length. It appears the method was changed without updating all the callers of it, at least without updating java.awt.font.TextMeasurer, which is causing Swing's bidi support to fail. Here is the backtrace I get when switching to bidi in Stylepad, turning on the hebrew keymap, and typing a letter:

      java.lang.IllegalArgumentException: range 14 to 51 is invalid for paragraph of length 37
      at java.text.Bidi.createLineBidi(Bidi.java:259)
      at java.awt.font.TextMeasurer.makeTextLineOnRange(TextMeasurer.java:439)
      at java.awt.font.TextMeasurer.getLayout(TextMeasurer.java:566)
      at java.awt.font.LineBreakMeasurer.nextLayout(LineBreakMeasurer.java:422)
      at javax.swing.text.TextLayoutStrategy.sync(TextLayoutStrategy.java:315)
      at javax.swing.text.TextLayoutStrategy.insertUpdate(TextLayoutStrategy.java:54)
      at javax.swing.text.FlowView.loadChildren(FlowView.java:127)
      at javax.swing.text.CompositeView.setParent(CompositeView.java:125)
      at javax.swing.text.AsyncBoxView$ChildState.<init>(AsyncBoxView.java:1135)
      at javax.swing.text.AsyncBoxView.createChildState(AsyncBoxView.java:205)
      at javax.swing.text.AsyncBoxView.replace(AsyncBoxView.java:353)
      at javax.swing.text.ZoneView$Zone.load(ZoneView.java:383)
      at javax.swing.text.ZoneView$Zone.paint(ZoneView.java:522)
      at javax.swing.text.BoxView.paintChild(BoxView.java:140)
      at javax.swing.text.BoxView.paint(BoxView.java:404)
      at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1221)
      at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:543)
      at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:677)
      at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:656)
      at javax.swing.JComponent.paintComponent(JComponent.java:430)
      at javax.swing.JComponent.paint(JComponent.java:689)
      at javax.swing.JComponent.paintChildren(JComponent.java:536)
      at javax.swing.JComponent.paint(JComponent.java:698)
      at javax.swing.JViewport.paint(JViewport.java:691)
      at javax.swing.JComponent.paintChildren(JComponent.java:536)
      at javax.swing.JComponent.paint(JComponent.java:698)
      at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4298)
      at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4251)
      at javax.swing.JComponent._paintImmediately(JComponent.java:4203)
      at javax.swing.JComponent.paintImmediately(JComponent.java:4035)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:399)
      at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:120)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:421)
      at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:140)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:121)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

            dougfelt Doug Felt
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: