@Override public void scanFile(JavaFileScannerContext context) { if (context.fileParsed()) { CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() == null && cut.packageDeclaration() == null && cut.types().isEmpty()) { context.addIssueOnFile(this, "This file has 0 lines of code."); } } }
@Override public void scanFile(JavaFileScannerContext context) { if (context.fileParsed()) { CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() == null && cut.packageDeclaration() == null && cut.types().isEmpty()) { context.addIssueOnFile(this, "This file has 0 lines of code."); } } }
@Override public void scanFile(JavaFileScannerContext context) { if (context.fileParsed()) { CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() == null && cut.packageDeclaration() == null) { context.addIssueOnFile(this, "Move this file to a named package."); } } }
@Override public void scanFile(JavaFileScannerContext context) { if (context.fileParsed()) { CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() == null && cut.packageDeclaration() == null) { context.addIssueOnFile(this, "Move this file to a named package."); } } }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { scan(tree.packageDeclaration()); scan(tree.imports()); scan(tree.types()); scan(tree.moduleDeclaration()); }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { scan(tree.packageDeclaration()); scan(tree.imports()); scan(tree.types()); scan(tree.moduleDeclaration()); }
CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() != null) {
CompilationUnitTree cut = context.getTree(); if (cut.moduleDeclaration() != null) {