up
This commit is contained in:
@@ -345,11 +345,18 @@ public abstract class AbstractCallGraphEngine implements CallGraphEngine {
|
|||||||
sourceMethod = "inline-instantiation";
|
sourceMethod = "inline-instantiation";
|
||||||
polymorphicEvents.add(declaredType);
|
polymorphicEvents.add(declaredType);
|
||||||
} else if (exprNode instanceof ConditionalExpression cond) {
|
} else if (exprNode instanceof ConditionalExpression cond) {
|
||||||
if (cond.getThenExpression() instanceof ClassInstanceCreation cicThen) {
|
List<Expression> branches = new ArrayList<>();
|
||||||
polymorphicEvents.add(click.kamil.springstatemachineexporter.ast.common.AstUtils.extractSimpleTypeName(cicThen.getType()));
|
branches.add(cond.getThenExpression());
|
||||||
}
|
branches.add(cond.getElseExpression());
|
||||||
if (cond.getElseExpression() instanceof ClassInstanceCreation cicElse) {
|
for (Expression branch : branches) {
|
||||||
polymorphicEvents.add(click.kamil.springstatemachineexporter.ast.common.AstUtils.extractSimpleTypeName(cicElse.getType()));
|
List<Expression> tracedBranch = variableTracer.traceVariableAll(branch);
|
||||||
|
for (Expression tb : tracedBranch) {
|
||||||
|
if (tb instanceof ClassInstanceCreation cic) {
|
||||||
|
polymorphicEvents.add(click.kamil.springstatemachineexporter.ast.common.AstUtils.extractSimpleTypeName(cic.getType()));
|
||||||
|
} else {
|
||||||
|
constantExtractor.extractConstantsFromExpression(tb, polymorphicEvents);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sourceMethod = "inline-ternary";
|
sourceMethod = "inline-ternary";
|
||||||
declaredType = polymorphicEvents.isEmpty() ? null : polymorphicEvents.get(0);
|
declaredType = polymorphicEvents.isEmpty() ? null : polymorphicEvents.get(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user