@Override public <E> void visitCtSwitch(CtSwitch<E> switchStatement) { if (switchStatement.getSelector() == null && child instanceof CtExpression) { switchStatement.setSelector((CtExpression<E>) child); return; } if (child instanceof CtCase) { switchStatement.addCase((CtCase<E>) child); //we have all statements of the case. Update source position now child.setPosition(jdtTreeBuilder.getPositionBuilder().buildPosition((CtCase<E>) child)); return; } super.visitCtSwitch(switchStatement); }
@Override public <E> void visitCtSwitch(CtSwitch<E> switchStatement) { if (switchStatement.getSelector() == null && child instanceof CtExpression) { switchStatement.setSelector((CtExpression<E>) child); return; } if (child instanceof CtCase) { switchStatement.addCase((CtCase<E>) child); return; } super.visitCtSwitch(switchStatement); }