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

    • Bug
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: