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

Clean up the unnecessary code in the method UnsharedNameTable#fromUtf

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: