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

Performance problem when editing in a JTextArea with bidirectional characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 9
    • 7u40
    • client-libs

      FULL PRODUCT VERSION :
      1.7.0_40

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      If you look at the Java source for:

      javax.swing.text.View.forwardUpdate(ElementChange, DocumentEvent, Shape, ViewFactory)

      at some point it contains a line like:

              index0 = Math.max(index0, 0);
              index1 = Math.max((getViewCount() - 1), 0);
              for (int i = index0; i <= index1; i++) {
         ............................................

      The extra line:

              index1 = Math.max((getViewCount() - 1), 0);

      was added in one of the Java 1.7 minor bug fix releases and what it does is that when a character is pressed, the event to layout gets forwarded to all line views, inducing a very large performance problem when the document has bidirectional characters in it.

      REGRESSION. Last worked in version 7u10

      ADDITIONAL REGRESSION INFORMATION:
      1.7.0_40

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a JTextArea with about 500 lines containing bidirectional characters. Edit in it.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      None but to overwrite problem method in custom view.

            dmarkov Dmitry Markov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: