Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-4668

Fix positive random int generation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • None
    • 1.2.0
    • Command Line Client
    • None

    Description

      According to java spec

      Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE

      So,

      Math.abs(rnd.nextInt())

      might return negative value

      To generate positive random int value we can use

      rnd.nextInt(Integer.MAX_VALUE)

      Integer.MAX_VALUE will be excluded btw

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              apivovarov Alexander Pivovarov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: