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

Avoid unary minus over unsigned type in ObjectSynchronizer::dec_in_use_list_ceiling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • b14

      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.

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

              Created:
              Updated:
              Resolved: