Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6356

[classlib][lang-managment] Improvements to lang-management classes from findbugs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.0M12
    • Classlib
    • None
    • all
    • Patch Available
    • Novice

    Description

      Improvements to lang-management classes from running findbugs, and exclusions list.

      Most changes are performance suggestions, e.g. Boolean.valueOf and removing new String(<existing String>), and some redundant logic, e.g. String fileNameValue = (fileName == null) ? null : new String(fileName)

      The exclude is for returning a mutable object from java.lang.management.ThreadInfo.getStackTrace(), but I checked the RI and it does the same, so I didn't make any changes:
      StackTraceElement[] stack1 = ti.getStackTrace();
      String dummyData = "dummy";
      StackTraceElement dummyElement = new StackTraceElement(dummyData, dummyData, dummyData, 0);
      stack1[0] = dummyElement;
      StackTraceElement[] stack2 = ti.getStackTrace();
      assertNotSame(stack1[0], stack2[0]); // this fails on Sun and Harmony

      Attachments

        1. lang-managment.patch
          8 kB
          Catherine Hope

        Activity

          People

            odeakin Oliver Deakin
            chope Catherine Hope
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: