@Override public void visitCompilationUnit(CompilationUnitTree tree) { packageName = PackageUtils.packageName(tree.packageDeclaration(), "."); super.visitCompilationUnit(tree); }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { packageName = PackageUtils.packageName(tree.packageDeclaration(), "."); super.visitCompilationUnit(tree); }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { if (tree.packageDeclaration() != null) { String packageName = PackageUtils.packageName(tree.packageDeclaration(), "."); LOGGER.info("PackageName : " + packageName); } super.visitCompilationUnit(tree); }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { if (tree.packageDeclaration() != null) { String name = PackageUtils.packageName(tree.packageDeclaration(), "."); if (!pattern.matcher(name).matches()) { context.reportIssue(this, tree.packageDeclaration().packageName(), "Rename this package name to match the regular expression '" + format + "'."); } } }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { PackageDeclarationTree packageDeclaration = tree.packageDeclaration(); if (packageDeclaration != null) { String packageName = PackageUtils.packageName(packageDeclaration, File.separator); File javaFile = context.getFile(); String dir = javaFile.getParent(); if (!dir.endsWith(packageName)) { String dirWithoutDots = dir.replace(".", File.separator); String issueMessage = MessageFormat.format(MESSAGE, javaFile.getName(), packageName, dir); if (dirWithoutDots.endsWith(packageName)) { context.reportIssue(this, packageDeclaration.packageName(), issueMessage + "(Do not use dots in directory names)."); } else { context.reportIssue( this, packageDeclaration.packageName(), issueMessage + "."); } } } }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { if (tree.packageDeclaration() != null) { String name = PackageUtils.packageName(tree.packageDeclaration(), "."); if (!pattern.matcher(name).matches()) { context.reportIssue(this, tree.packageDeclaration().packageName(), "Rename this package name to match the regular expression '" + format + "'."); } } }
@Override public void visitCompilationUnit(CompilationUnitTree tree) { PackageDeclarationTree packageDeclaration = tree.packageDeclaration(); if (packageDeclaration != null) { String packageName = PackageUtils.packageName(packageDeclaration, File.separator); File javaFile = context.getFile(); String dir = javaFile.getParent(); if (!dir.endsWith(packageName)) { String dirWithoutDots = dir.replace(".", File.separator); String issueMessage = MessageFormat.format(MESSAGE, javaFile.getName(), packageName, dir); if (dirWithoutDots.endsWith(packageName)) { context.reportIssue(this, packageDeclaration.packageName(), issueMessage + "(Do not use dots in directory names)."); } else { context.reportIssue( this, packageDeclaration.packageName(), issueMessage + "."); } } } }
if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) { tree = (CompilationUnitTree) parsedTree; if (isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { try { semanticModel = SemanticModel.createFor(tree, classLoader); if (symbolicExecutionEnabled && isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { runScanner(javaFileScannerContext, new SymbolicExecutionVisitor(executableScanners, behaviorCache), AnalysisError.Kind.SE_ERROR); behaviorCache.cleanup();
if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) { tree = (CompilationUnitTree) parsedTree; if (isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { try { semanticModel = SemanticModel.createFor(tree, classLoader); if (symbolicExecutionEnabled && isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { runScanner(javaFileScannerContext, new SymbolicExecutionVisitor(executableScanners, behaviorCache), AnalysisError.Kind.SE_ERROR); behaviorCache.cleanup();
if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) { tree = (CompilationUnitTree) parsedTree; if (isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { try { semanticModel = SemanticModel.createFor(tree, getProjectClasspath()); if (symbolicExecutionEnabled && isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { new SymbolicExecutionVisitor().scanFile(javaFileScannerContext);