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

Notepad hangs up when open uigur text in gb18030 locale.

    Details

    • Subcomponent:
    • Resolved In Build:
      tiger
    • CPU:
      x86, sparc
    • OS:
      solaris_2.6, solaris_9, windows_2000, windows_xp

      Description

      ###@###.### 2002-11-05

      Exception described below is no longer reproducible in latest build, but Notepad
      hangs up when open uigur text file, it only happens in gb18030 locale (both
      on Solaris 9 and Windows w2k machine).


      hopper b14

      reproduce:

      login in s9 gb18030 locale
      java -jar Notepad.jar
      Then open attachment txt file which is uigur character for chinese, will get this exception.

      java.lang.IllegalArgumentException: bad start (0) or length (-1)
              at sun.awt.font.StandardTextSource.getSubSource(StandardTextSource.java:
      169)
              at sun.awt.font.ExtendedTextSourceLabel.getSubset(ExtendedTextSourceLabe
      l.java:748)
              at java.awt.font.TextMeasurer.makeComponentsOnRange(TextMeasurer.java:44
      2)
              at java.awt.font.TextMeasurer.makeTextLineOnRange(TextMeasurer.java:473)

              at java.awt.font.TextMeasurer.getLayout(TextMeasurer.java:606)
              at java.awt.font.LineBreakMeasurer.nextLayout(LineBreakMeasurer.java:427
      )
              at javax.swing.text.TextLayoutStrategy.createView(TextLayoutStrategy.jav
      a:197)
              at javax.swing.text.FlowView$FlowStrategy.layoutRow(FlowView.java:442)
              at javax.swing.text.TextLayoutStrategy.layoutRow(TextLayoutStrategy.java
      :109)
              at javax.swing.text.FlowView$FlowStrategy.layout(FlowView.java:398)
              at javax.swing.text.TextLayoutStrategy.layout(TextLayoutStrategy.java:92
      )
              at javax.swing.text.FlowView.layout(FlowView.java:182)
              at javax.swing.text.BoxView.setSize(BoxView.java:379)
              at javax.swing.plaf.basic.BasicTextAreaUI$PlainParagraph.setSize(BasicTe
      xtAreaUI.java:205)
              at javax.swing.text.BoxView.updateChildSizes(BoxView.java:348)
              at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:330)
              at javax.swing.text.BoxView.layout(BoxView.java:682)
              at javax.swing.text.BoxView.setSize(BoxView.java:379)
              at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:
      1598)
              at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:
      800)
              at javax.swing.JComponent.getPreferredSize(JComponent.java:1272)
              at javax.swing.JTextArea.getPreferredSize(JTextArea.java:606)
              at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
      9)
              at java.awt.Container.layout(Container.java:1017)
              at java.awt.Container.doLayout(Container.java:1007)
              at java.awt.Container.validateTree(Container.java:1089)
              at java.awt.Container.validate(Container.java:1064)
              at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
      ava:353)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
      EventQueueUtilities.java:116)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:197)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:150)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)


      But get rid of the last column(cut -f1,2 -d " " GB18030_uigur.txt > 1.txt ), then open 1.txt will ok.

      please get Notepad.jar, GB18030_uigur.txt from attachment .
      And the Notepad.java is the modify source from Demo, other part same in Demo.


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naasunw Naa Naa (Inactive)
                Reporter:
                lefan Leon Fan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: