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

BCEscapeAnalyzer::invoke checks target->is_loaded() twice

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • b15

      SonarCloud reports: Identical sub-expressions on both sides of operator "&&".

        if (target->is_loaded() && klass->is_loaded()
            && (klass->is_initialized() || (klass->is_interface() && target->holder()->is_initialized()))
            && target->is_loaded()) { // <--- here

      This code was last touched a long ago: https://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/bb33c6fdcf0d#l2.5

      ...and it would seem it went unnoticed that there is already `target->is_loaded()` check in the same condition.

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

              Created:
              Updated:
              Resolved: