@Override public DefiniteAssignmentStatus visitSwitchStatement(final SwitchStatement node, final DefiniteAssignmentStatus data) { return node.getExpression().acceptVisitor(this, data); }
@Override public DefiniteAssignmentStatus visitSwitchStatement(final SwitchStatement node, final DefiniteAssignmentStatus data) { return node.getExpression().acceptVisitor(this, data); }
@Override public DefiniteAssignmentStatus visitSwitchStatement(final SwitchStatement node, final DefiniteAssignmentStatus data) { return node.getExpression().acceptVisitor(this, data); }
@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; } }
@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; } }
@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; } }
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); s.getExpression().replaceWith(newTest);
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); s.getExpression().replaceWith(newTest);
private boolean rewriteSwitch(final SwitchStatement s, final Map<Integer, Expression> mappings) { final Match m = SWITCH_INPUT.match(s.getExpression()); s.getExpression().replaceWith(newTest);
final IndexerExpression indexer = (IndexerExpression) s.getExpression(); final InvocationExpression argument = (InvocationExpression) indexer.getArgument(); final MemberReferenceExpression memberReference = (MemberReferenceExpression) argument.getTarget();
final IndexerExpression indexer = (IndexerExpression) s.getExpression(); final InvocationExpression argument = (InvocationExpression) indexer.getArgument(); final MemberReferenceExpression memberReference = (MemberReferenceExpression) argument.getTarget();
final IndexerExpression indexer = (IndexerExpression) s.getExpression(); final InvocationExpression argument = (InvocationExpression) indexer.getArgument(); final MemberReferenceExpression memberReference = (MemberReferenceExpression) argument.getTarget();
@Override public ControlFlowNode visitSwitchStatement(final SwitchStatement node, final ControlFlowNode data) { final ResolveResult constant = evaluateConstant(node.getExpression());
@Override public ControlFlowNode visitSwitchStatement(final SwitchStatement node, final ControlFlowNode data) { final ResolveResult constant = evaluateConstant(node.getExpression());
final Expression test = node.getExpression(); final Match m = SWITCH_INPUT.match(test);
final Expression test = node.getExpression(); final Match m = SWITCH_INPUT.match(test);
final Expression test = node.getExpression(); final Match m = SWITCH_INPUT.match(test);
@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }
@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }
@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }