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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: