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

Avoid unary minus over unsigned type in ObjectSynchronizer::dec_in_use_list_ceiling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b14

      Description

      SonarCloud complains:
        Unary minus should not be applied to an unsigned expression

      Here:

      void ObjectSynchronizer::dec_in_use_list_ceiling() {
        Atomic::add(&_in_use_list_ceiling, -AvgMonitorsPerThreadEstimate);
      }

      We can instead use Atomic::sub.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: