@Override public boolean visitVariableDefinition(VariableDefinition node) {
if (node.astVariables().size() == 1) {
return true;
}
Node parent = node.getParent();
if (!(parent instanceof VariableDeclaration || parent instanceof For)) {
return true;
}
if (parent instanceof VariableDeclaration) {
splitVariableDeclaration((VariableDeclaration)parent);
}
if (parent instanceof For) {
splitFor((For)parent, node);
}
return true;
}
private void splitVariableDeclaration(VariableDeclaration varDecl) {
VariableDefinition varDef = varDecl.astDefinition();
Node upFromDecl = varDecl.getParent();
if (!(upFromDecl instanceof Block || upFromDecl instanceof TypeBody)) {
return;
}
for (VariableDefinitionEntry varDefEntry : varDef.astVariables()) {