private void testFragment(ASTNode node) { VariableDeclarationFragment fragment = getFragment(node); setASTObject(fragment); } private VariableDeclarationFragment getFragment(ASTNode node) { QuickVisitor visitor = new QuickVisitor(); List nodes = visitor.quickVisit(node); if (nodes != null && nodes.size() > 0) { for (ASTNode i : nodes) { if (i instanceof VariableDeclarationFragment) { VariableDeclarationFragment temp = (VariableDeclarationFragment) i; return temp; } } } return null; }