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

Clean up the unnecessary code in the method UnsharedNameTable#fromUtf

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • tools
    • b22
    • generic
    • generic

      The code, which is listed below, has two repetitive checks and needs to be cleaned up.

      location: com.sun.tools.javac.util.UnsharedNameTable#fromUtf
      ```
              while (element != null) {
                  if (element == null) {
                      break;
                  }
      ```

      we can see the `while (element != null)` have already checked the `element`. So the `if (element == null)` is redundant and unnecessary.

            gli Guoxiong Li
            gli Guoxiong Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: