class ClassLiteralChecker extends polyglot.visit.NodeVisitor {

  private final ArrayList<Node> list;

  public ArrayList<Node> getList() {
    return list;
  }

  public ClassLiteralChecker() {
    list = new ArrayList<Node>();
  }

  public polyglot.ast.Node override(polyglot.ast.Node parent, polyglot.ast.Node n) {
    if ((n instanceof polyglot.ast.ClassDecl)
        || ((n instanceof polyglot.ast.New) && (((polyglot.ast.New) n).anonType() != null))) {
      return n;
    }
    return null;
  }

  public polyglot.visit.NodeVisitor enter(polyglot.ast.Node parent, polyglot.ast.Node n) {<FILL_FUNCTION_BODY>}
}


    if (n instanceof polyglot.ast.ClassLit) {
      polyglot.ast.ClassLit lit = (polyglot.ast.ClassLit) n;
      // only find ones where type is not primitive
      if (!lit.typeNode().type().isPrimitive()) {
        list.add(n);
      }
    }
    return enter(n);
  
<methods>public void <init>() ,public polyglot.visit.NodeVisitor begin() ,public polyglot.visit.NodeVisitor enter(polyglot.ast.Node) ,public polyglot.visit.NodeVisitor enter(polyglot.ast.Node, polyglot.ast.Node) ,public void finish() ,public void finish(polyglot.ast.Node) ,public polyglot.ast.Node leave(polyglot.ast.Node, polyglot.ast.Node, polyglot.visit.NodeVisitor) ,public polyglot.ast.Node leave(polyglot.ast.Node, polyglot.ast.Node, polyglot.ast.Node, polyglot.visit.NodeVisitor) ,public polyglot.ast.Node override(polyglot.ast.Node) ,public polyglot.ast.Node override(polyglot.ast.Node, polyglot.ast.Node) ,public java.lang.String toString() ,public polyglot.ast.Node visitEdge(polyglot.ast.Node, polyglot.ast.Node) <variables>