本文整理了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);
}