public final JavaTokenNode getRightParenthesisToken() { return getChildByRole(Roles.RIGHT_PARENTHESIS); }
public final AstNodeCollection<SwitchSection> getSwitchSections() { return getChildrenByRole(SWITCH_SECTION_ROLE); }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof SwitchStatement) { final SwitchStatement otherStatement = (SwitchStatement) other; return !otherStatement.isNull() && getExpression().matches(otherStatement.getExpression(), match) && getSwitchSections().matches(otherStatement.getSwitchSections(), match); } return false; } }
super.visitSwitchStatement(node, data); final Statement previous = node.getPreviousStatement(); Statement next = node.getNextStatement(); final Expression input = node.getExpression(); for (final SwitchSection section : node.getSwitchSections()) { final Match m3 = CASE_BODY_PATTERN.match(section.getStatements().firstOrNullObject()); if (!tableSwitchInput.matches(tableSwitch.getExpression())) { return null; tableSwitch.getSwitchSections(), new Predicate<SwitchSection>() { @Override tableSwitch.getExpression().replaceWith(newInput); for (final SwitchSection s : tableSwitch.getSwitchSections()) { for (final CaseLabel c : s.getCaseLabels()) { if (c.getExpression() == null || c.getExpression().isNull()) { node.remove(); previous.remove();
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); for (final SwitchSection section : s.getSwitchSections()) { for (final CaseLabel caseLabel : section.getCaseLabels()) { final Expression expression = caseLabel.getExpression(); s.getExpression().replaceWith(newTest);
final SwitchStatement switchStatement = new SwitchStatement((Expression) transformExpression(testCondition, false)); switchStatement.getSwitchSections().add(section);
@Override public DefiniteAssignmentStatus visitSwitchStatement(final SwitchStatement node, final DefiniteAssignmentStatus data) { return node.getExpression().acceptVisitor(this, data); }
public final void setExpression(final Expression value) { setChildByRole(Roles.EXPRESSION, value); }
parentSwitch.getSwitchSections().insertBefore(targetSection, fallThroughSection);
super.visitSwitchStatement(node, data); final Statement previous = node.getPreviousStatement(); Statement next = node.getNextStatement(); final Expression input = node.getExpression(); for (final SwitchSection section : node.getSwitchSections()) { final Match m3 = CASE_BODY_PATTERN.match(section.getStatements().firstOrNullObject()); if (!tableSwitchInput.matches(tableSwitch.getExpression())) { return null; tableSwitch.getSwitchSections(), new Predicate<SwitchSection>() { @Override tableSwitch.getExpression().replaceWith(newInput); for (final SwitchSection s : tableSwitch.getSwitchSections()) { for (final CaseLabel c : s.getCaseLabels()) { if (c.getExpression() == null || c.getExpression().isNull()) { node.remove(); previous.remove();
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); for (final SwitchSection section : s.getSwitchSections()) { for (final CaseLabel caseLabel : section.getCaseLabels()) { final Expression expression = caseLabel.getExpression(); s.getExpression().replaceWith(newTest);
final SwitchStatement switchStatement = new SwitchStatement((Expression) transformExpression(testCondition, false)); switchStatement.getSwitchSections().add(section);
@Override public DefiniteAssignmentStatus visitSwitchStatement(final SwitchStatement node, final DefiniteAssignmentStatus data) { return node.getExpression().acceptVisitor(this, data); }
public final void setExpression(final Expression value) { setChildByRole(Roles.EXPRESSION, value); }
parentSwitch.getSwitchSections().insertBefore(targetSection, fallThroughSection);
super.visitSwitchStatement(node, data); final Statement previous = node.getPreviousStatement(); Statement next = node.getNextStatement(); final Expression input = node.getExpression(); for (final SwitchSection section : node.getSwitchSections()) { final Match m3 = CASE_BODY_PATTERN.match(section.getStatements().firstOrNullObject()); if (!tableSwitchInput.matches(tableSwitch.getExpression())) { return null; tableSwitch.getSwitchSections(), new Predicate<SwitchSection>() { @Override tableSwitch.getExpression().replaceWith(newInput); for (final SwitchSection s : tableSwitch.getSwitchSections()) { for (final CaseLabel c : s.getCaseLabels()) { if (c.getExpression() == null || c.getExpression().isNull()) { node.remove(); previous.remove();
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); for (final SwitchSection section : s.getSwitchSections()) { for (final CaseLabel caseLabel : section.getCaseLabels()) { final Expression expression = caseLabel.getExpression(); s.getExpression().replaceWith(newTest);
@Override public boolean matches(final INode other, final Match match) { if (other instanceof SwitchStatement) { final SwitchStatement otherStatement = (SwitchStatement) other; return !otherStatement.isNull() && getExpression().matches(otherStatement.getExpression(), match) && getSwitchSections().matches(otherStatement.getSwitchSections(), match); } return false; } }
public final JavaTokenNode getRightBraceToken() { return getChildByRole(Roles.RIGHT_BRACE); }
final SwitchStatement switchStatement = new SwitchStatement((Expression) transformExpression(testCondition, false)); switchStatement.getSwitchSections().add(section);