@Override public void scanFile(JavaFileScannerContext context) { JavaTree.CompilationUnitTreeImpl tree = (JavaTree.CompilationUnitTreeImpl) context.getTree(); currentPackage = PackageDeclarationTreeImpl.packageNameAsString(tree.packageDeclaration()).replace('.', '/'); currentFile = context.getFile(); currentClassKey.clear(); parent.clear(); anonymousInnerClassCounter.clear(); suppressWarningLines.clear(); scan(tree); }
public CompilationUnitTreeImpl(@Nullable ExpressionTree packageName, List<ImportTree> imports, List<Tree> types, List<AnnotationTree> packageAnnotations, List<AstNode> children) { super(Kind.COMPILATION_UNIT); this.packageName = packageName; this.imports = Preconditions.checkNotNull(imports); this.types = Preconditions.checkNotNull(types); this.packageAnnotations = Preconditions.checkNotNull(packageAnnotations); for (AstNode child : children) { addChild(child); } }
@Override public void scanFile(JavaFileScannerContext context) { JavaTree.CompilationUnitTreeImpl tree = (JavaTree.CompilationUnitTreeImpl) context.getTree(); currentPackage = tree.packageNameAsString().replace('.', '/'); currentFile = context.getFile(); currentClassKey.clear(); parent.clear(); anonymousInnerClassCounter.clear(); suppressWarningLines.clear(); scan(tree); }
return new CompilationUnitTreeImpl( packageDeclaration.orNull(), (List) importDeclarations.or(ImmutableList.<ImportTreeImpl>of()),
public void visitFile(@Nullable Tree parsedTree) { semanticModel = null; CompilationUnitTree tree = new JavaTree.CompilationUnitTreeImpl(null, new ArrayList<>(), new ArrayList<>(), null, null); boolean fileParsed = parsedTree != null; if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) {
public void visitFile(@Nullable Tree parsedTree) { semanticModel = null; CompilationUnitTree tree = new JavaTree.CompilationUnitTreeImpl(null, Lists.<ImportClauseTree>newArrayList(), Lists.<Tree>newArrayList(), null); boolean fileParsed = parsedTree != null; if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) {
public CompilationUnitTreeImpl newCompilationUnit( JavaTree spacing, Optional<PackageDeclarationTree> packageDeclaration, Optional<List<ImportClauseTree>> importDeclarations, Optional<ModuleDeclarationTree> moduleDeclaration, Optional<List<Tree>> typeDeclarations, InternalSyntaxToken eof) { ImmutableList.Builder<ImportClauseTree> imports = ImmutableList.builder(); if (importDeclarations.isPresent()) { for (ImportClauseTree child : importDeclarations.get()) { imports.add(child); } } ImmutableList.Builder<Tree> types = ImmutableList.builder(); if (typeDeclarations.isPresent()) { for (Tree child : typeDeclarations.get()) { types.add(child); } } return new CompilationUnitTreeImpl( packageDeclaration.orNull(), imports.build(), types.build(), moduleDeclaration.orNull(), eof); }
public CompilationUnitTreeImpl newCompilationUnit( JavaTree spacing, Optional<PackageDeclarationTree> packageDeclaration, Optional<List<ImportClauseTree>> importDeclarations, Optional<List<Tree>> typeDeclarations, InternalSyntaxToken eof) { ImmutableList.Builder<ImportClauseTree> imports = ImmutableList.builder(); if (importDeclarations.isPresent()) { for (ImportClauseTree child : importDeclarations.get()) { imports.add(child); } } ImmutableList.Builder<Tree> types = ImmutableList.builder(); if (typeDeclarations.isPresent()) { for (Tree child : typeDeclarations.get()) { types.add(child); } } return new CompilationUnitTreeImpl( packageDeclaration.orNull(), imports.build(), types.build(), eof); }
public CompilationUnitTreeImpl newCompilationUnit( JavaTree spacing, Optional<PackageDeclarationTree> packageDeclaration, Optional<List<ImportClauseTree>> importDeclarations, Optional<ModuleDeclarationTree> moduleDeclaration, Optional<List<Tree>> typeDeclarations, InternalSyntaxToken eof) { ImmutableList.Builder<ImportClauseTree> imports = ImmutableList.builder(); if (importDeclarations.isPresent()) { for (ImportClauseTree child : importDeclarations.get()) { imports.add(child); } } ImmutableList.Builder<Tree> types = ImmutableList.builder(); if (typeDeclarations.isPresent()) { for (Tree child : typeDeclarations.get()) { types.add(child); } } return new CompilationUnitTreeImpl( packageDeclaration.orNull(), imports.build(), types.build(), moduleDeclaration.orNull(), eof); }
public void visitFile(@Nullable Tree parsedTree) { semanticModel = null; CompilationUnitTree tree = new JavaTree.CompilationUnitTreeImpl(null, new ArrayList<>(), new ArrayList<>(), null, null); boolean fileParsed = parsedTree != null; if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) {
@Override public void scanFile(JavaFileScannerContext context) { JavaTree.CompilationUnitTreeImpl tree = (JavaTree.CompilationUnitTreeImpl) context.getTree(); currentPackage = PackageDeclarationTreeImpl.packageNameAsString(tree.packageDeclaration()).replace('.', '/'); currentFile = context.getFile(); currentClassKey.clear(); parent.clear(); anonymousInnerClassCounter.clear(); scan(tree); }
@Override public void scanFile(JavaFileScannerContext context) { JavaTree.CompilationUnitTreeImpl tree = (JavaTree.CompilationUnitTreeImpl) context.getTree(); currentPackage = PackageDeclarationTreeImpl.packageNameAsString(tree.packageDeclaration()).replace('.', '/'); currentFile = context.getFile(); currentClassKey.clear(); parent.clear(); anonymousInnerClassCounter.clear(); scan(tree); }