Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-11372

Hibernate Query Result view gets dramatically slow when query text has '\t' characters

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.3.0.Beta1
    • Fix Version/s: 3.3.0.Beta3
    • Component/s: hibernate
    • Labels:
      None

      Description

      EXECUTE: Open HQL Editor, and type some long query using tabs (\t) instead of usual whitespaces.
      EXECUTE: Send the query into Hibernate Query Result view.
      ASSERT: New tab folder is added to the view in 1-2 seconds even for queries as long as 1000 characters.
      ASSERT: Resize of the view goes without delays.
      FAILURE: For a query of 120 characters, including 15 \t characters, creation of new tab folder, and each subsequent resize of the view takes 7 seconds. Doubling text size increases time 8 times.

      SWT methods CTabFolderRenderer.shortenText(GC, String, int, String), TextLayout.getPreviousOffset(int,int), GC.textExtent(String,int) have poor performance for long strings with \t characters. I have created issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=374987

      Class HQLQueryPage sets tab name as

      setTabName(getQueryString().replace('\n', ' ').replace('\r', ' '));
      

      This issue may be solved by modifying it as

      setTabName(getQueryString().replace('\n', ' ').replace('\r', ' ').replace('\t', ' '));
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dgeraskov Dmitry Geraskov
                Reporter:
                scabanovich Viacheslav Kabanovich
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: