public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots){
  if (!taskListener.isEmpty()) {
    for (    JCCompilationUnit unit : roots) {
      TaskEvent e=new TaskEvent(TaskEvent.Kind.ENTER,unit);
      taskListener.started(e);
    }
  }
  enter.main(roots);
  if (!taskListener.isEmpty()) {
    for (    JCCompilationUnit unit : roots) {
      TaskEvent e=new TaskEvent(TaskEvent.Kind.ENTER,unit);
      taskListener.finished(e);
    }
  }
  if (needRootClasses || sourceOutput || stubOutput) {
    ListBuffer<JCClassDecl> cdefs=new ListBuffer<>();
    for (    JCCompilationUnit unit : roots) {
      for (List<JCTree> defs=unit.defs; defs.nonEmpty(); defs=defs.tail) {
        if (defs.head instanceof JCClassDecl)         cdefs.append((JCClassDecl)defs.head);
      }
    }
    rootClasses=cdefs.toList();
  }
  for (  JCCompilationUnit unit : roots) {
    inputFiles.add(unit.sourcefile);
  }
  return roots;
}

public List < JCCompilationUnit > enterTrees ( List < JCCompilationUnit > roots ) { if ( ! taskListener . isEmpty ( ) ) { for ( JCCompilationUnit unit : roots ) { TaskEvent e = new TaskEvent ( TaskEvent . Kind . ENTER , unit ) ; taskListener . started ( e ) ; } } enter . main ( roots ) ; if ( ! taskListener . isEmpty ( ) ) { for ( JCCompilationUnit unit : roots ) { TaskEvent e = new TaskEvent ( TaskEvent . Kind . ENTER , unit ) ; taskListener . finished ( e ) ; } } if ( needRootClasses || sourceOutput || stubOutput ) { ListBuffer < JCClassDecl > cdefs = new ListBuffer < > ( ) ; for ( JCCompilationUnit unit : roots ) { for ( List < JCTree > defs = unit . defs ; defs . nonEmpty ( ) ; defs = defs . tail ) { if ( defs . head instanceof JCClassDecl ) cdefs . append ( ( JCClassDecl ) defs . head ) ; } } rootClasses = cdefs . toList ( ) ; } for ( JCCompilationUnit unit : roots ) { inputFiles . add ( unit . sourcefile ) ; } return roots ; }
enter the symbols found in a list of parse trees . as a side - effect , this puts elements on the " todo " list . also stores a list of all top level classes in rootclasses .
