public static <T> T single(final Iterable<T> collection) { if (collection instanceof List<?>) { return single((List<T>) collection); } final Iterator<T> it = VerifyArgument.notNull(collection, "collection").iterator(); if (it.hasNext()) { final T result = it.next(); if (it.hasNext()) { throw Error.sequenceHasMultipleElements(); } return result; } throw Error.sequenceHasNoElements(); }
public static <T> T single(final Iterable<T> collection) { if (collection instanceof List<?>) { return single((List<T>) collection); } final Iterator<T> it = VerifyArgument.notNull(collection, "collection").iterator(); if (it.hasNext()) { final T result = it.next(); if (it.hasNext()) { throw Error.sequenceHasMultipleElements(); } return result; } throw Error.sequenceHasNoElements(); }
private boolean isSingleStoreBoolean(final Variable variable) { if (_singleStoreVariables.contains(variable)) { final List<ExpressionToInfer> assignments = _assignmentExpressions.get(variable); final ExpressionToInfer e = single(assignments); return matchBooleanConstant(last(e.expression.getArguments())) != null; } return false; }
public static <T> T single(final Iterable<T> collection) { if (collection instanceof List<?>) { return single((List<T>) collection); } final Iterator<T> it = VerifyArgument.notNull(collection, "collection").iterator(); if (it.hasNext()) { final T result = it.next(); if (it.hasNext()) { throw Error.sequenceHasMultipleElements(); } return result; } throw Error.sequenceHasNoElements(); }
private boolean isSingleStoreBoolean(final Variable variable) { if (_singleStoreVariables.contains(variable)) { final List<ExpressionToInfer> assignments = _assignmentExpressions.get(variable); final ExpressionToInfer e = single(assignments); return matchBooleanConstant(last(e.expression.getArguments())) != null; } return false; }
private boolean isSingleStoreBoolean(final Variable variable) { if (_singleStoreVariables.contains(variable)) { final List<ExpressionToInfer> assignments = _assignmentExpressions.get(variable); final ExpressionToInfer e = single(assignments); return matchBooleanConstant(last(e.expression.getArguments())) != null; } return false; }
public static boolean matchVariableMutation(final Node node, final Variable variable) { VerifyArgument.notNull(node, "node"); VerifyArgument.notNull(variable, "variable"); if (node instanceof Expression) { final Expression e = (Expression) node; switch (e.getCode()) { case Store: case Inc: return e.getOperand() == variable; case PreIncrement: case PostIncrement: return matchLoad(single(e.getArguments()), variable); } } return false; } }
public static boolean matchVariableMutation(final Node node, final Variable variable) { VerifyArgument.notNull(node, "node"); VerifyArgument.notNull(variable, "variable"); if (node instanceof Expression) { final Expression e = (Expression) node; switch (e.getCode()) { case Store: case Inc: return e.getOperand() == variable; case PreIncrement: case PostIncrement: return matchLoad(single(e.getArguments()), variable); } } return false; } }
match(single(args), AstCode.__New)) {
public static boolean matchVariableMutation(final Node node, final Variable variable) { VerifyArgument.notNull(node, "node"); VerifyArgument.notNull(variable, "variable"); if (node instanceof Expression) { final Expression e = (Expression) node; switch (e.getCode()) { case Store: case Inc: return e.getOperand() == variable; case PreIncrement: case PostIncrement: return matchLoad(single(e.getArguments()), variable); } } return false; } }
match(single(args), AstCode.__New)) {
match(single(args), AstCode.__New)) {
final ControlFlowNode predecessor = single(postLoopTarget.getPredecessors());
final ControlFlowNode predecessor = single(postLoopTarget.getPredecessors());
final ControlFlowNode predecessor = single(postLoopTarget.getPredecessors());
final TypeReference arrayType = single(byteCode.getArguments()).getInferredType();
final TypeReference arrayType = single(byteCode.getArguments()).getInferredType();