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

Aleksey Shipilev shade at openjdk.java.net
Mon Mar 22 16:33:57 UTC 2021


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 time 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.

-------------

Commit messages:
 - 8263985: BCEscapeAnalyzer::invoke checks target->is_loaded() twice

Changes: https://git.openjdk.java.net/jdk/pull/3127/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3127&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263985
  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3127.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3127/head:pull/3127

PR: https://git.openjdk.java.net/jdk/pull/3127


More information about the hotspot-compiler-dev mailing list