Redundant condition and assignment in java.net.URI

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P5
    • 18
    • Affects Version/s: 17
    • Component/s: core-libs
    • None
    • b19

      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

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

              Created:
              Updated:
              Resolved: