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

Redundant condition and assignment in java.net.URI

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 18
    • 17
    • 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

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

              Created:
              Updated:
              Resolved: