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

Redundant condition and assignment in java.net.URI

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      1. Assignment `ru.host = child.host;` is duplicated and hence redundant in
      java.net.URI#resolve(java.net.URI, java.net.URI)
      https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/URI.java#L2210
      2. Condition `q > p` is always `true`, because it just bellow inverse check
      ```
                      if (q <= p)
                          break;
      ```
      https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/URI.java#L3493

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aturbanov Andrey Turbanov
              Reporter:
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: