public BranchData getInstructionsData()

in src/com/intellij/rt/coverage/data/instructions/LineInstructions.java [89:122]


  public BranchData getInstructionsData(LineData line) {
    int total = 0;
    int covered = 0;

    total += myInstructions;
    if (line.getHits() > 0) covered += myInstructions;

    final JumpData[] jumps = line.getJumps();
    if (jumps != null && myJumps != null) {
      for (int i = 0; i < Math.min(jumps.length, myJumps.size()); i++) {
        final JumpData jump = jumps[i];
        final JumpInstructions jumpInstructions = myJumps.get(i);
        total += jumpInstructions.getInstructions(true) + jumpInstructions.getInstructions(false);
        if (jump.getTrueHits() > 0) covered += jumpInstructions.getInstructions(true);
        if (jump.getFalseHits() > 0) covered += jumpInstructions.getInstructions(false);
      }
    }

    final SwitchData[] switches = line.getSwitches();
    if (switches != null && mySwitches != null) {
      for (int i = 0; i < Math.min(switches.length, mySwitches.size()); i++) {
        final SwitchData switchData = switches[i];
        final SwitchInstructions switchInstructions = mySwitches.get(i);
        total += switchInstructions.getInstructions(-1);
        if (switchData.getDefaultHits() > 0) covered += switchInstructions.getInstructions(-1);
        for (int key = 0; key < switchData.getKeys().length; key++) {
          total += switchInstructions.getInstructions(key);
          if (switchData.getHits()[key] > 0) covered += switchInstructions.getInstructions(key);
        }
      }
    }

    return new BranchData(total, covered);
  }