热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitNewClass()方法的使用及代码示例

本文整理了Java中org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitNewClass()方法的一些代码示例,展

本文整理了Java中org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitNewClass()方法的一些代码示例,展示了BaseTreeVisitor.visitNewClass()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BaseTreeVisitor.visitNewClass()方法的具体详情如下:
包路径:org.sonar.plugins.java.api.tree.BaseTreeVisitor
类名称:BaseTreeVisitor
方法名:visitNewClass

BaseTreeVisitor.visitNewClass介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
if (tree.equals(methodInvocationTree)) {
//stop inspection, all concerned usages have been visited.
stopInspection = true;
} else {
super.visitNewClass(tree);
}
}
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
if (tree.equals(methodInvocationTree)) {
//stop inspection, all concerned usages have been visited.
stopInspection = true;
} else {
super.visitNewClass(tree);
}
}
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
stack.push(null);
super.visitNewClass(tree);
stack.pop();
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
checkIfThrowThrowable(tree.constructorSymbol());
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
addThrownTypes(tree.constructorSymbol());
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
if (isThrowingJavaLangException(tree.constructorSymbol())) {
return;
}
super.visitNewClass(tree);
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
if (isThrowingJavaLangException(tree.constructorSymbol())) {
return;
}
super.visitNewClass(tree);
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
checkIfThrowThrowable(tree.constructorSymbol());
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
super.visitNewClass(tree);
visitMethodSymbol(tree.constructorSymbol());
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
super.visitNewClass(tree);
checkSymbol(tree.symbolType().symbol());
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
checkMethodInvocationArgument(tree.arguments(), tree.constructorSymbol());
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
if (tree.classBody() != null && tree.symbolType().isSubtypeOf(type)) {
isExtended = true;
}
super.visitNewClass(tree);
}
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
super.visitNewClass(tree);
checkSymbol(tree.symbolType().symbol());
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
super.visitNewClass(tree);
ClassTree classBody = tree.classBody();
if (classBody != null) {
TypeTree identifier = tree.identifier();
if (!useThisInstance(classBody) && !enumConstants.contains(identifier) && isSAM(classBody)) {
context.reportIssue(this, identifier, "Make this anonymous inner class a lambda" + context.getJavaVersion().java8CompatibilityMessage());
}
}
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
if (isUnorderedMap(tree.symbolType()) && hasEnumKey(tree.identifier().symbolType())) {
addIssue(tree);
} else {
super.visitNewClass(tree);
}
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
if (tree.classBody() != null && !isEnumConstantBody) {
int lines = getNumberOfLines(tree.classBody());
if (lines > max) {
context.reportIssue(this, tree.newKeyword(), tree.identifier(),
"Reduce this anonymous class number of lines from " + lines + " to at most " + max + ", or make it a named class.");
}
}
isEnumCOnstantBody= false;
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
if (tree.classBody() != null && !isEnumConstantBody) {
int lines = getNumberOfLines(tree.classBody());
if (lines > max) {
context.reportIssue(this, tree.newKeyword(), tree.identifier(),
"Reduce this anonymous class number of lines from " + lines + " to at most " + max + ", or make it a named class.");
}
}
isEnumCOnstantBody= false;
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree newClassTree) {
String newClassTypeName = newClassTree.identifier().symbolType().fullyQualifiedName();
Tree parent = newClassTree.parent();
if (parent != null && !parent.is(Tree.Kind.VARIABLE)) {
checkIfDisallowed(newClassTypeName, newClassTree);
}
super.visitNewClass(newClassTree );
}

代码示例来源:origin: org.sonarsource.java/java-checks

@Override
public void visitNewClass(NewClassTree tree) {
ClassTree classBody = tree.classBody();
if (classBody != null && tree.arguments().closeParenToken() != null) {
checkTokens(tree.arguments().closeParenToken(), classBody.openBraceToken());
}
super.visitNewClass(tree);
}

代码示例来源:origin: SonarSource/sonar-java

@Override
public void visitNewClass(NewClassTree tree) {
ClassTree classBody = tree.classBody();
if (classBody != null && tree.arguments().closeParenToken() != null) {
checkTokens(tree.arguments().closeParenToken(), classBody.openBraceToken());
}
super.visitNewClass(tree);
}

推荐阅读
author-avatar
oFoUro_877
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有