Search in sources :

Example 81 with Type

use of org.sonar.plugins.java.api.semantic.Type in project sonar-java by SonarSource.

the class ExplodedGraphWalker method executeMethodInvocation.

private void executeMethodInvocation(MethodInvocationTree mit) {
    setSymbolicValueOnFields(mit);
    // unstack arguments and method identifier
    ProgramState.Pop unstack = programState.unstackValue(mit.arguments().size() + 1);
    logState(mit);
    programState = unstack.state;
    // get method behavior for method with known declaration (ie: within the same file)
    MethodBehavior methodInvokedBehavior = null;
    Symbol methodSymbol = mit.symbol();
    if (methodSymbol.isMethodSymbol()) {
        methodInvokedBehavior = behaviorCache.get((Symbol.MethodSymbol) methodSymbol);
    }
    // Enqueue additional exceptional paths corresponding to unchecked exceptions, for instance OutOfMemoryError
    enqueueUncheckedExceptionalPaths(methodSymbol);
    final SymbolicValue resultValue = constraintManager.createMethodSymbolicValue(mit, unstack.valuesAndSymbols);
    if (methodInvokedBehavior != null && methodInvokedBehavior.isComplete() && !EQUALS_METHODS.anyMatch(mit)) {
        List<SymbolicValue> invocationArguments = invocationArguments(unstack.values);
        List<Type> invocationTypes = mit.arguments().stream().map(ExpressionTree::symbolType).collect(Collectors.toList());
        Map<Type, SymbolicValue.ExceptionalSymbolicValue> thrownExceptionsByExceptionType = new HashMap<>();
        // Enqueue exceptional paths from exceptional yields
        methodInvokedBehavior.exceptionalPathYields().forEach(yield -> yield.statesAfterInvocation(invocationArguments, invocationTypes, programState, () -> thrownExceptionsByExceptionType.computeIfAbsent(yield.exceptionType(semanticModel), constraintManager::createExceptionalSymbolicValue)).forEach(psYield -> enqueueExceptionalPaths(psYield, methodSymbol, yield)));
        // Enqueue happy paths
        methodInvokedBehavior.happyPathYields().forEach(yield -> yield.statesAfterInvocation(invocationArguments, invocationTypes, programState, () -> resultValue).map(psYield -> handleSpecialMethods(psYield, mit)).forEach(psYield -> enqueueHappyPath(psYield, mit, yield)));
    } else {
        // Enqueue exceptional paths from thrown exceptions
        enqueueThrownExceptionalPaths(methodSymbol);
        // Enqueue happy paths
        programState = handleSpecialMethods(programState.stackValue(resultValue), mit);
        checkerDispatcher.executeCheckPostStatement(mit);
        clearStack(mit);
    }
}
Also used : JavaSymbol(org.sonar.java.resolve.JavaSymbol) JavaFileScanner(org.sonar.plugins.java.api.JavaFileScanner) BlockTree(org.sonar.plugins.java.api.tree.BlockTree) ExpressionUtils(org.sonar.java.model.ExpressionUtils) MethodYield(org.sonar.java.se.xproc.MethodYield) Loggers(org.sonar.api.utils.log.Loggers) IfStatementTree(org.sonar.plugins.java.api.tree.IfStatementTree) NullDereferenceCheck(org.sonar.java.se.checks.NullDereferenceCheck) SECheck(org.sonar.java.se.checks.SECheck) RedundantAssignmentsCheck(org.sonar.java.se.checks.RedundantAssignmentsCheck) MemberSelectExpressionTree(org.sonar.plugins.java.api.tree.MemberSelectExpressionTree) Map(java.util.Map) MethodMatcher(org.sonar.java.matcher.MethodMatcher) BooleanConstraint(org.sonar.java.se.constraint.BooleanConstraint) ImmutableSet(com.google.common.collect.ImmutableSet) NewArrayTree(org.sonar.plugins.java.api.tree.NewArrayTree) Collection(java.util.Collection) Set(java.util.Set) JavaTree(org.sonar.java.model.JavaTree) TypeCastTree(org.sonar.plugins.java.api.tree.TypeCastTree) Collectors(java.util.stream.Collectors) NewClassTree(org.sonar.plugins.java.api.tree.NewClassTree) Objects(java.util.Objects) List(java.util.List) Stream(java.util.stream.Stream) DebugCheck(org.sonar.java.DebugCheck) StreamConsumedCheck(org.sonar.java.se.checks.StreamConsumedCheck) AssignmentExpressionTree(org.sonar.plugins.java.api.tree.AssignmentExpressionTree) NullableAnnotationUtils.isGloballyAnnotatedParameterNonNull(org.sonar.java.se.NullableAnnotationUtils.isGloballyAnnotatedParameterNonNull) IdentifierTree(org.sonar.plugins.java.api.tree.IdentifierTree) Symbol(org.sonar.plugins.java.api.semantic.Symbol) Joiner(com.google.common.base.Joiner) ObjectConstraint(org.sonar.java.se.constraint.ObjectConstraint) NullableAnnotationUtils.isAnnotatedNonNull(org.sonar.java.se.NullableAnnotationUtils.isAnnotatedNonNull) HashMap(java.util.HashMap) Deque(java.util.Deque) ThrowStatementTree(org.sonar.plugins.java.api.tree.ThrowStatementTree) NullableAnnotationUtils.isGloballyAnnotatedParameterNullable(org.sonar.java.se.NullableAnnotationUtils.isGloballyAnnotatedParameterNullable) ArrayList(java.util.ArrayList) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) ForStatementTree(org.sonar.plugins.java.api.tree.ForStatementTree) VariableTree(org.sonar.plugins.java.api.tree.VariableTree) JavaType(org.sonar.java.resolve.JavaType) DivisionByZeroCheck(org.sonar.java.se.checks.DivisionByZeroCheck) ConstraintManager(org.sonar.java.se.constraint.ConstraintManager) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) NoWayOutLoopCheck(org.sonar.java.se.checks.NoWayOutLoopCheck) LiveVariables(org.sonar.java.cfg.LiveVariables) SymbolicValue(org.sonar.java.se.symbolicvalues.SymbolicValue) MethodBehavior(org.sonar.java.se.xproc.MethodBehavior) ArrayDimensionTree(org.sonar.plugins.java.api.tree.ArrayDimensionTree) LinkedList(java.util.LinkedList) MethodMatcherCollection(org.sonar.java.matcher.MethodMatcherCollection) LinkedHashSet(java.util.LinkedHashSet) Nullable(javax.annotation.Nullable) Logger(org.sonar.api.utils.log.Logger) UnclosedResourcesCheck(org.sonar.java.se.checks.UnclosedResourcesCheck) BinaryExpressionTree(org.sonar.plugins.java.api.tree.BinaryExpressionTree) ReturnStatementTree(org.sonar.plugins.java.api.tree.ReturnStatementTree) LiteralTree(org.sonar.plugins.java.api.tree.LiteralTree) Types(org.sonar.java.resolve.Types) Iterator(java.util.Iterator) ConditionalExpressionTree(org.sonar.plugins.java.api.tree.ConditionalExpressionTree) Tree(org.sonar.plugins.java.api.tree.Tree) Type(org.sonar.plugins.java.api.semantic.Type) ArrayAccessExpressionTree(org.sonar.plugins.java.api.tree.ArrayAccessExpressionTree) RelationalSymbolicValue(org.sonar.java.se.symbolicvalues.RelationalSymbolicValue) WhileStatementTree(org.sonar.plugins.java.api.tree.WhileStatementTree) OptionalGetBeforeIsPresentCheck(org.sonar.java.se.checks.OptionalGetBeforeIsPresentCheck) MethodInvocationTree(org.sonar.plugins.java.api.tree.MethodInvocationTree) DoWhileStatementTree(org.sonar.plugins.java.api.tree.DoWhileStatementTree) NonNullSetToNullCheck(org.sonar.java.se.checks.NonNullSetToNullCheck) CFG(org.sonar.java.cfg.CFG) SemanticModel(org.sonar.java.resolve.SemanticModel) BehaviorCache(org.sonar.java.se.xproc.BehaviorCache) Preconditions(com.google.common.base.Preconditions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) CheckForNull(javax.annotation.CheckForNull) LocksNotUnlockedCheck(org.sonar.java.se.checks.LocksNotUnlockedCheck) NullableAnnotationUtils.isAnnotatedNullable(org.sonar.java.se.NullableAnnotationUtils.isAnnotatedNullable) MethodTree(org.sonar.plugins.java.api.tree.MethodTree) HashMap(java.util.HashMap) JavaSymbol(org.sonar.java.resolve.JavaSymbol) Symbol(org.sonar.plugins.java.api.semantic.Symbol) JavaType(org.sonar.java.resolve.JavaType) Type(org.sonar.plugins.java.api.semantic.Type) MethodBehavior(org.sonar.java.se.xproc.MethodBehavior) SymbolicValue(org.sonar.java.se.symbolicvalues.SymbolicValue) RelationalSymbolicValue(org.sonar.java.se.symbolicvalues.RelationalSymbolicValue)

Example 82 with Type

use of org.sonar.plugins.java.api.semantic.Type in project sonar-java by SonarSource.

the class SymbolMetadataResolve method metaAnnotations.

private List<Symbol> metaAnnotations(Set<Type> knownTypes) {
    List<Symbol> result = new ArrayList<>();
    for (AnnotationInstance annotationInstance : annotations) {
        Symbol annotationSymbol = annotationInstance.symbol();
        Type annotationType = annotationSymbol.type();
        if (!knownTypes.contains(annotationType)) {
            knownTypes.add(annotationType);
            result.add(annotationSymbol);
            result.addAll(((SymbolMetadataResolve) annotationSymbol.metadata()).metaAnnotations(knownTypes));
        }
    }
    return new ArrayList<>(result);
}
Also used : Type(org.sonar.plugins.java.api.semantic.Type) Symbol(org.sonar.plugins.java.api.semantic.Symbol) ArrayList(java.util.ArrayList)

Example 83 with Type

use of org.sonar.plugins.java.api.semantic.Type in project sonar-java by SonarSource.

the class TypeAndReferenceSolver method visitTypeCast.

@Override
public void visitTypeCast(TypeCastTree tree) {
    resolveAs(tree.type(), JavaSymbol.TYP);
    resolveAs(tree.expression(), JavaSymbol.VAR);
    JavaType castType = getType(tree.type());
    Type expressionType = tree.expression().symbolType();
    if (expressionType instanceof DeferredType) {
        setInferedType(castType, (DeferredType) expressionType);
    }
    registerType(tree, castType);
}
Also used : Type(org.sonar.plugins.java.api.semantic.Type)

Example 84 with Type

use of org.sonar.plugins.java.api.semantic.Type in project sonar-java by SonarSource.

the class TypeAndReferenceSolver method visitReturnStatement.

@Override
public void visitReturnStatement(ReturnStatementTree tree) {
    super.visitReturnStatement(tree);
    ExpressionTree expression = tree.expression();
    if (expression != null && ((JavaType) expression.symbolType()).isTagged(JavaType.DEFERRED)) {
        // get owner of return (method or lambda)
        Tree parent = tree.parent();
        while (!parent.is(Tree.Kind.METHOD, Tree.Kind.LAMBDA_EXPRESSION)) {
            parent = parent.parent();
            if (parent == null) {
                throw new IllegalStateException("Return statement was unexpected here");
            }
        }
        Type infered;
        if (parent.is(Tree.Kind.METHOD)) {
            infered = ((MethodTree) parent).returnType().symbolType();
        } else {
            infered = ((LambdaExpressionTree) parent).symbolType();
        }
        setInferedType(infered, (DeferredType) expression.symbolType());
    }
}
Also used : Type(org.sonar.plugins.java.api.semantic.Type) MethodTree(org.sonar.plugins.java.api.tree.MethodTree) MemberSelectExpressionTree(org.sonar.plugins.java.api.tree.MemberSelectExpressionTree) AssignmentExpressionTree(org.sonar.plugins.java.api.tree.AssignmentExpressionTree) UnaryExpressionTree(org.sonar.plugins.java.api.tree.UnaryExpressionTree) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) BinaryExpressionTree(org.sonar.plugins.java.api.tree.BinaryExpressionTree) ConditionalExpressionTree(org.sonar.plugins.java.api.tree.ConditionalExpressionTree) ArrayAccessExpressionTree(org.sonar.plugins.java.api.tree.ArrayAccessExpressionTree) LambdaExpressionTree(org.sonar.plugins.java.api.tree.LambdaExpressionTree) AbstractTypedTree(org.sonar.java.model.AbstractTypedTree) UnionTypeTree(org.sonar.plugins.java.api.tree.UnionTypeTree) MemberSelectExpressionTree(org.sonar.plugins.java.api.tree.MemberSelectExpressionTree) ArrayTypeTree(org.sonar.plugins.java.api.tree.ArrayTypeTree) TypeTree(org.sonar.plugins.java.api.tree.TypeTree) NewArrayTree(org.sonar.plugins.java.api.tree.NewArrayTree) ContinueStatementTree(org.sonar.plugins.java.api.tree.ContinueStatementTree) ExpressionStatementTree(org.sonar.plugins.java.api.tree.ExpressionStatementTree) ParameterizedTypeTree(org.sonar.plugins.java.api.tree.ParameterizedTypeTree) TypeCastTree(org.sonar.plugins.java.api.tree.TypeCastTree) NewClassTree(org.sonar.plugins.java.api.tree.NewClassTree) AssignmentExpressionTree(org.sonar.plugins.java.api.tree.AssignmentExpressionTree) ClassTree(org.sonar.plugins.java.api.tree.ClassTree) UnaryExpressionTree(org.sonar.plugins.java.api.tree.UnaryExpressionTree) IdentifierTree(org.sonar.plugins.java.api.tree.IdentifierTree) WildcardTree(org.sonar.plugins.java.api.tree.WildcardTree) LabeledStatementTree(org.sonar.plugins.java.api.tree.LabeledStatementTree) BreakStatementTree(org.sonar.plugins.java.api.tree.BreakStatementTree) ThrowStatementTree(org.sonar.plugins.java.api.tree.ThrowStatementTree) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) ParenthesizedTree(org.sonar.plugins.java.api.tree.ParenthesizedTree) VariableTree(org.sonar.plugins.java.api.tree.VariableTree) ArrayDimensionTree(org.sonar.plugins.java.api.tree.ArrayDimensionTree) EnumConstantTree(org.sonar.plugins.java.api.tree.EnumConstantTree) MethodReferenceTree(org.sonar.plugins.java.api.tree.MethodReferenceTree) AnnotationTree(org.sonar.plugins.java.api.tree.AnnotationTree) BinaryExpressionTree(org.sonar.plugins.java.api.tree.BinaryExpressionTree) ReturnStatementTree(org.sonar.plugins.java.api.tree.ReturnStatementTree) LiteralTree(org.sonar.plugins.java.api.tree.LiteralTree) ConditionalExpressionTree(org.sonar.plugins.java.api.tree.ConditionalExpressionTree) ImportTree(org.sonar.plugins.java.api.tree.ImportTree) PrimitiveTypeTree(org.sonar.plugins.java.api.tree.PrimitiveTypeTree) TypeParameterTree(org.sonar.plugins.java.api.tree.TypeParameterTree) Tree(org.sonar.plugins.java.api.tree.Tree) ArrayAccessExpressionTree(org.sonar.plugins.java.api.tree.ArrayAccessExpressionTree) MethodInvocationTree(org.sonar.plugins.java.api.tree.MethodInvocationTree) LambdaExpressionTree(org.sonar.plugins.java.api.tree.LambdaExpressionTree) InstanceOfTree(org.sonar.plugins.java.api.tree.InstanceOfTree) MethodTree(org.sonar.plugins.java.api.tree.MethodTree)

Example 85 with Type

use of org.sonar.plugins.java.api.semantic.Type in project sonar-java by SonarSource.

the class TypeAndReferenceSolver method visitMethodInvocation.

@Override
public void visitMethodInvocation(MethodInvocationTree tree) {
    MethodInvocationTreeImpl mit = (MethodInvocationTreeImpl) tree;
    Resolve.Env methodEnv = semanticModel.getEnv(tree);
    if (mit.isTypeSet() && mit.symbol().isMethodSymbol()) {
        TypeSubstitution typeSubstitution = inferedSubstitution(mit);
        List<JavaType> argTypes = getParameterTypes(tree.arguments());
        JavaSymbol.MethodJavaSymbol methodSymbol = (JavaSymbol.MethodJavaSymbol) mit.symbol();
        List<JavaType> formals = methodSymbol.parameterTypes().stream().map(t -> (JavaType) t).collect(Collectors.toList());
        List<JavaType> inferedArgTypes = resolve.resolveTypeSubstitution(formals, typeSubstitution);
        int size = inferedArgTypes.size();
        IntStream.range(0, argTypes.size()).forEach(i -> {
            JavaType arg = argTypes.get(i);
            Type formal = inferedArgTypes.get(Math.min(i, size - 1));
            if (formal != arg) {
                AbstractTypedTree argTree = (AbstractTypedTree) mit.arguments().get(i);
                argTree.setInferedType(formal);
                argTree.accept(this);
            }
        });
        List<JavaType> typeParamTypes = getParameterTypes(tree.typeArguments());
        JavaType resultType = ((MethodJavaType) mit.symbol().type()).resultType;
        // if result type is a type var defined by the method we are solving, use the target type.
        if (resultType.symbol.owner == mit.symbol()) {
            resultType = (JavaType) mit.symbolType();
        }
        inferReturnTypeFromInferedArgs(tree, methodEnv, argTypes, typeParamTypes, resultType, typeSubstitution);
        return;
    }
    scan(tree.arguments());
    scan(tree.typeArguments());
    List<JavaType> argTypes = getParameterTypes(tree.arguments());
    List<JavaType> typeParamTypes = getParameterTypes(tree.typeArguments());
    Resolve.Resolution resolution = resolveMethodSymbol(tree.methodSelect(), methodEnv, argTypes, typeParamTypes);
    JavaSymbol symbol;
    JavaType returnType;
    if (resolution == null) {
        returnType = symbols.deferedType(mit);
        symbol = Symbols.unknownSymbol;
    } else {
        symbol = resolution.symbol();
        returnType = resolution.type();
        if (symbol.isMethodSymbol()) {
            MethodJavaType methodType = (MethodJavaType) resolution.type();
            returnType = methodType.resultType;
        }
    }
    mit.setSymbol(symbol);
    if (returnType != null && returnType.isTagged(JavaType.DEFERRED)) {
        ((DeferredType) returnType).setTree(mit);
    }
    registerType(tree, returnType);
    if (resolution != null) {
        inferArgumentTypes(argTypes, resolution);
        inferReturnTypeFromInferedArgs(tree, methodEnv, argTypes, typeParamTypes, returnType, new TypeSubstitution());
    }
}
Also used : AbstractTypedTree(org.sonar.java.model.AbstractTypedTree) BaseTreeVisitor(org.sonar.plugins.java.api.tree.BaseTreeVisitor) Resolution(org.sonar.java.resolve.Resolve.Resolution) UnionTypeTree(org.sonar.plugins.java.api.tree.UnionTypeTree) MemberSelectExpressionTree(org.sonar.plugins.java.api.tree.MemberSelectExpressionTree) Map(java.util.Map) ArrayTypeTree(org.sonar.plugins.java.api.tree.ArrayTypeTree) Arguments(org.sonar.plugins.java.api.tree.Arguments) TypeTree(org.sonar.plugins.java.api.tree.TypeTree) ImmutableSet(com.google.common.collect.ImmutableSet) NewArrayTree(org.sonar.plugins.java.api.tree.NewArrayTree) ContinueStatementTree(org.sonar.plugins.java.api.tree.ContinueStatementTree) Collection(java.util.Collection) ExpressionStatementTree(org.sonar.plugins.java.api.tree.ExpressionStatementTree) JavaKeyword(org.sonar.java.ast.api.JavaKeyword) ParameterizedTypeTree(org.sonar.plugins.java.api.tree.ParameterizedTypeTree) TypeCastTree(org.sonar.plugins.java.api.tree.TypeCastTree) Collectors(java.util.stream.Collectors) NewClassTree(org.sonar.plugins.java.api.tree.NewClassTree) List(java.util.List) AssignmentExpressionTree(org.sonar.plugins.java.api.tree.AssignmentExpressionTree) ClassTree(org.sonar.plugins.java.api.tree.ClassTree) VariableTreeImpl(org.sonar.java.model.declaration.VariableTreeImpl) Optional(java.util.Optional) UnaryExpressionTree(org.sonar.plugins.java.api.tree.UnaryExpressionTree) NewClassTreeImpl(org.sonar.java.model.expression.NewClassTreeImpl) IdentifierTree(org.sonar.plugins.java.api.tree.IdentifierTree) Symbol(org.sonar.plugins.java.api.semantic.Symbol) IntStream(java.util.stream.IntStream) ParenthesizedTreeImpl(org.sonar.java.model.expression.ParenthesizedTreeImpl) WildcardTree(org.sonar.plugins.java.api.tree.WildcardTree) TypeArguments(org.sonar.plugins.java.api.tree.TypeArguments) LabeledStatementTree(org.sonar.plugins.java.api.tree.LabeledStatementTree) BreakStatementTree(org.sonar.plugins.java.api.tree.BreakStatementTree) ThrowStatementTree(org.sonar.plugins.java.api.tree.ThrowStatementTree) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) ArrayList(java.util.ArrayList) ParenthesizedTree(org.sonar.plugins.java.api.tree.ParenthesizedTree) VariableTree(org.sonar.plugins.java.api.tree.VariableTree) ImmutableList(com.google.common.collect.ImmutableList) IdentifierTreeImpl(org.sonar.java.model.expression.IdentifierTreeImpl) ConditionalExpressionTreeImpl(org.sonar.java.model.expression.ConditionalExpressionTreeImpl) ArrayDimensionTree(org.sonar.plugins.java.api.tree.ArrayDimensionTree) LambdaExpressionTreeImpl(org.sonar.java.model.expression.LambdaExpressionTreeImpl) EnumConstantTree(org.sonar.plugins.java.api.tree.EnumConstantTree) MethodReferenceTree(org.sonar.plugins.java.api.tree.MethodReferenceTree) Nullable(javax.annotation.Nullable) AnnotationTree(org.sonar.plugins.java.api.tree.AnnotationTree) BinaryExpressionTree(org.sonar.plugins.java.api.tree.BinaryExpressionTree) ReturnStatementTree(org.sonar.plugins.java.api.tree.ReturnStatementTree) LiteralTree(org.sonar.plugins.java.api.tree.LiteralTree) ConditionalExpressionTree(org.sonar.plugins.java.api.tree.ConditionalExpressionTree) ImportTree(org.sonar.plugins.java.api.tree.ImportTree) PrimitiveTypeTree(org.sonar.plugins.java.api.tree.PrimitiveTypeTree) MethodReferenceTreeImpl(org.sonar.java.model.expression.MethodReferenceTreeImpl) MethodInvocationTreeImpl(org.sonar.java.model.expression.MethodInvocationTreeImpl) TypeParameterTree(org.sonar.plugins.java.api.tree.TypeParameterTree) Tree(org.sonar.plugins.java.api.tree.Tree) Type(org.sonar.plugins.java.api.semantic.Type) ArrayAccessExpressionTree(org.sonar.plugins.java.api.tree.ArrayAccessExpressionTree) Maps(com.google.common.collect.Maps) MethodInvocationTree(org.sonar.plugins.java.api.tree.MethodInvocationTree) LambdaExpressionTree(org.sonar.plugins.java.api.tree.LambdaExpressionTree) InstanceOfTree(org.sonar.plugins.java.api.tree.InstanceOfTree) VisibleForTesting(com.google.common.annotations.VisibleForTesting) TypeArgumentListTreeImpl(org.sonar.java.model.expression.TypeArgumentListTreeImpl) CheckForNull(javax.annotation.CheckForNull) MethodTree(org.sonar.plugins.java.api.tree.MethodTree) MethodInvocationTreeImpl(org.sonar.java.model.expression.MethodInvocationTreeImpl) AbstractTypedTree(org.sonar.java.model.AbstractTypedTree) Resolution(org.sonar.java.resolve.Resolve.Resolution) Type(org.sonar.plugins.java.api.semantic.Type)

Aggregations

Type (org.sonar.plugins.java.api.semantic.Type)164 Test (org.junit.Test)67 Symbol (org.sonar.plugins.java.api.semantic.Symbol)23 ExpressionTree (org.sonar.plugins.java.api.tree.ExpressionTree)23 MethodJavaSymbol (org.sonar.java.resolve.JavaSymbol.MethodJavaSymbol)18 ClassTree (org.sonar.plugins.java.api.tree.ClassTree)18 IdentifierTree (org.sonar.plugins.java.api.tree.IdentifierTree)17 MethodInvocationTree (org.sonar.plugins.java.api.tree.MethodInvocationTree)17 MethodTree (org.sonar.plugins.java.api.tree.MethodTree)17 JavaType (org.sonar.java.resolve.JavaType)16 Tree (org.sonar.plugins.java.api.tree.Tree)15 VariableTree (org.sonar.plugins.java.api.tree.VariableTree)13 MemberSelectExpressionTree (org.sonar.plugins.java.api.tree.MemberSelectExpressionTree)12 SymbolicValue (org.sonar.java.se.symbolicvalues.SymbolicValue)11 AssignmentExpressionTree (org.sonar.plugins.java.api.tree.AssignmentExpressionTree)10 ArrayList (java.util.ArrayList)9 TypeTree (org.sonar.plugins.java.api.tree.TypeTree)9 VisibleForTesting (com.google.common.annotations.VisibleForTesting)8 RelationalSymbolicValue (org.sonar.java.se.symbolicvalues.RelationalSymbolicValue)8 CompilationUnitTree (org.sonar.plugins.java.api.tree.CompilationUnitTree)8