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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.3.0.Beta3
    • 3.3.0.Beta1
    • hibernate
    • 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', ' '));
      

      Attachments

        Activity

          People

            dgeraskov Dmitry Geraskov (Inactive)
            scabanovich Viacheslav Kabanovich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: