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

Replace StringBuffer with StringBuilder in RuleBasedCollator

XMLWordPrintable

    • b17
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      java.text.RuleBasedCollator is using three instances of the synchronized StringBuffer in getCollationKey(), even though that method is synchronized by itself. Please consider replacing these with unsynchronized StringBuilder instances to speed up this expensive method a bit. Also, please consider replacing calls like "primResult.append(secResult.toString())" with "primResult.append(secResult)" in this method to reduce unnecessary creation of String object.


            jlu Justin Lu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: