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

Label.toString performance improvement

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b06

      Backports

        Description

        Current version of toString/paramString in the Label is not effective.
        Code:
        =====
                String str = ",align=";
                switch (alignment) {
                  case LEFT: str += "left"; break;
                  case CENTER: str += "center"; break;
                  case RIGHT: str += "right"; break;
                }
                return super.paramString() + str + ",text=" + text;
        =====
        generated to something like this:
                String s = ",align=";
                switch(alignment) {
                  case 0: s = (new StringBuilder()).append(s).append("left").toString(); break;
                  case 1: s = (new StringBuilder()).append(s).append("center").toString(); break;
                  case 2: s = (new StringBuilder()).append(s).append("right").toString(); break;
                }
                return (new StringBuilder()).append(super.paramString()).append(s).append(",text=").append(text).toString();

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                serb Sergey Bylokhov
                Reporter:
                serb Sergey Bylokhov
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: