Add a number of branches to a line.
@param lineNumber the line number that contains the branch statement.
@param numberOfBranches the number of branches to add to the record.
769979
void addBranches(int lineNumber, int numberOfBranches) {
    int lineIdx = lineNumber - 1;
    Integer currentValue = branchesInLine.get(Integer.valueOf(lineIdx));
    if (currentValue == null) {
      branchesInLine.put(lineIdx, numberOfBranches);
    } else {
      branchesInLine.put(lineIdx, currentValue + numberOfBranches);
    }
  }
425585
protected BranchCounts readBranchCounts(final BitInputStream in,
    final Bits code, final long size) throws IOException {
    final BranchCounts branchCounts = new BranchCounts(code, size);
    final CodeType currentCodeType = this.getType(code);
    long maximum = size;

    // Get terminals
    if (currentCodeType == CodeType.Unknown) {
      branchCounts.terminals = this.readTerminalCount(in, maximum);
    }
    else if (currentCodeType == CodeType.Terminal) {
      branchCounts.terminals = size;
    }
    else {
      branchCounts.terminals = 0;
    }
    maximum -= branchCounts.terminals;

    // Get zero-suffixed primary
    if (maximum > 0) {
      assert Thread.currentThread().getStackTrace().length < 100;
      branchCounts.zeroCount = this.readZeroBranchSize(in, maximum, code);
    }
    maximum -= branchCounts.zeroCount;
    branchCounts.oneCount = maximum;
    return branchCounts;
  }
10227
public void appendBranchState(int start, int end, BranchCoverageState state) {
		this.passed.put(new Range(start, end), state);
	}
334121
static void redeclareVarsInsideBranch(Node branch) {
    Collection<Node> vars = getVarsDeclaredInBranch(branch);
    if (vars.isEmpty()) {
      return;
    }

    Node parent = getAddingRoot(branch);
    for (Node nameNode : vars) {
      Node var = IR.var(
          IR.name(nameNode.getString())
              .srcref(nameNode))
          .srcref(nameNode);
      copyNameAnnotations(nameNode, var.getFirstChild());
      parent.addChildToFront(var);
    }
  }
1096984
public void addLines(Collection<TaintLocation> locations) {
        Objects.requireNonNull(detector, "locations");
        for (TaintLocation location : locations) {
            lines.add(SourceLineAnnotation.fromVisitedInstruction(
                location.getMethodDescriptor(), location.getPosition()));
        }
    }
1201938
@Override
	protected String addTableLine( String... lineEntries ) {

		StringBuilder sb = new StringBuilder();
		sb.append( "<tr>\n" );
		for( String s : lineEntries ) {
			sb.append( "\t<td>" );
			sb.append( s );
			sb.append( "</td>\n" );
		}

		sb.append( "</tr>\n" );
		return sb.toString();
	}
994667
public void setBranches(java.util.Collection<Branch> branches) {
        if (branches == null) {
            this.branches = null;
            return;
        }

        this.branches = new java.util.ArrayList<Branch>(branches);
    }
1080811
public void cloneBranch(String branch) throws Exception {
        CloneCommand cloneCommand = Git.cloneRepository()
                .setURI(repositoryUrl)
                .setDirectory(localRepo.getDirectory().getParentFile())
                .setBranchesToClone(Arrays.asList(branch))
                .setCloneAllBranches(false)
                .setBranch(branch);
        if (credentialsProvider != null)
            cloneCommand.setCredentialsProvider(credentialsProvider);
        Git git = cloneCommand.call();
        git.getRepository().close();
        git.close();
    }
623919
@Override
    public void renderBranch( PositionedText target, double x, double y,
                              Size size, Collection<Diagram.Figure> branches, boolean forward )
    {
        throw new UnsupportedOperationException( "not implemented" );
    }
474600
private static String addLineNumber(String code) {
		String[] lines = code.split("\n");
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < lines.length; i++) {
			builder.append("/* ").append(i + 1).append(" */").append(lines[i]).append("\n");
		}
		return builder.toString();
	}
1084958
def get_num_branches(self):
        
        num = {}
        for trt, branches in itertools.groupby(
                self.branches, operator.attrgetter('trt')):
            num[trt] = sum(1 for br in branches if br.effective)
        return num
640360
function addLineNumbers(src, lineOffset) {
  lineOffset = lineOffset || 0;
  ++lineOffset;

  return src.split("\n").map(function(line, ndx) {
    return (ndx + lineOffset) + ": " + line;
  }).join("\n");
}
1099980
def add_branch(steps, source_line, ruby_code = nil)
      branches << Branch.new(steps, source_line, ruby_code)
    end
804962
def _draw_line_numbers(self):
        
        if not self.line_numbers:
            return
        for p in xrange(self.maxlineno):
            n = p + self.line_number_start
            if (n % self.line_number_step) == 0:
                self._draw_linenumber(p, n)
1156065
public void addSplitsForSha1() {
        Validate.notNull(tableOperations, "tableOperations must not be null");
        String hexadecimal = "123456789abcde";
        SortedSet<Text> edgeSplits = new TreeSet<>();
        SortedSet<Text> textSplits = new TreeSet<>();
        Collection<Text> existingEdgeSplits = null;
        Collection<Text> existingTextSplits = null;
        
        try {
            existingEdgeSplits = tableOperations.listSplits(getEdgeTable());
            existingTextSplits = tableOperations.listSplits(getTextTable());
        } catch (TableNotFoundException | AccumuloSecurityException | AccumuloException e) {
            throw new D4MException("Error reading splits.", e);
        }
        
        for (byte b : hexadecimal.getBytes(charset)) {
            Text splitPoint = new Text(new byte[]{b});
            if (not(existingEdgeSplits.contains(splitPoint))) {
                edgeSplits.add(splitPoint);
            }
            if (not(existingTextSplits.contains(splitPoint))) {
                textSplits.add(splitPoint);
            }
        }

        addSplits(getEdgeTable(), edgeSplits);
        addSplits(getTextTable(), textSplits);
    }
630033
protected function checkIfLineNumberIsValid($lineNumber, $throw = true)
    {
        if (!is_int($lineNumber)) {
            $e = new InvalidLineNumberException($lineNumber, $this, 'The line number should be an integer');
        } elseif ($lineNumber < 0) {
            $e = new InvalidLineNumberException($lineNumber, $this, 'The line number should be positive');
        } elseif ($lineNumber >= $this->length) {
            $e = new InvalidLineNumberException($lineNumber, $this, 'The line number should be strictly lower than the number of lines');
        }

        if (isset($e)) {
            if ($throw) {
                throw $e;
            }

            return false;
        }

        return true;
    }
723073
protected final int getLineNumber(final String lineNumber) {
        if (StringUtils.isNotBlank(lineNumber)) {
            try {
                return Integer.parseInt(lineNumber);
            }
            catch (NumberFormatException exception) {
                // ignore and return 0
            }
        }
        return 0;
    }