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

Redundant Math.min call in Http2ClientImpl#getConnectionWindowSize

    XMLWordPrintable

    Details

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

      Description

      There is a redundant call to Math.min in method
      jdk.internal.net.http.Http2ClientImpl#getConnectionWindowSize
      https://github.com/openjdk/jdk/blob/master/src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java#L240

      int defaultValue = Math.min(Integer.MAX_VALUE,
              Math.max(streamWindow, K*K*32));

      Call of method Math.min(int, int) is redundant if one of parameters is
      known to be Integer.MAX_VALUE (or Integer.MIN_VALUE)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michaelm Michael McMahon
              Reporter:
              michaelm Michael McMahon
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: