diff --git a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/model/CallEdge.java b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/model/CallEdge.java new file mode 100644 index 0000000..ea74b12 --- /dev/null +++ b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/model/CallEdge.java @@ -0,0 +1,11 @@ +package click.kamil.springstatemachineexporter.analysis.model; + +import lombok.Data; + +import java.util.List; + +@Data +public class CallEdge { + private final String targetMethod; + private final List arguments; +} diff --git a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphEngine.java b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphEngine.java new file mode 100644 index 0000000..1817fa6 --- /dev/null +++ b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphEngine.java @@ -0,0 +1,11 @@ +package click.kamil.springstatemachineexporter.analysis.service; + +import click.kamil.springstatemachineexporter.analysis.model.CallChain; +import click.kamil.springstatemachineexporter.analysis.model.EntryPoint; +import click.kamil.springstatemachineexporter.analysis.model.TriggerPoint; + +import java.util.List; + +public interface CallGraphEngine { + List findChains(List entryPoints, List triggers); +} diff --git a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilder.java b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngine.java similarity index 99% rename from state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilder.java rename to state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngine.java index 9f99830..59f9a00 100644 --- a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilder.java +++ b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngine.java @@ -1,6 +1,7 @@ package click.kamil.springstatemachineexporter.analysis.service; import click.kamil.springstatemachineexporter.analysis.model.CallChain; +import click.kamil.springstatemachineexporter.analysis.model.CallEdge; import click.kamil.springstatemachineexporter.analysis.model.EntryPoint; import click.kamil.springstatemachineexporter.analysis.model.TriggerPoint; import click.kamil.springstatemachineexporter.ast.common.CodebaseContext; @@ -11,19 +12,13 @@ import org.eclipse.jdt.core.dom.*; import java.util.*; @Slf4j -public class CallGraphBuilder { +public class HeuristicCallGraphEngine implements CallGraphEngine { private final CodebaseContext context; private final ConstantResolver constantResolver; private String currentMethodFqn; private Map> graph; - @lombok.Data - private static class CallEdge { - private final String targetMethod; - private final List arguments; - } - - public CallGraphBuilder(CodebaseContext context) { + public HeuristicCallGraphEngine(CodebaseContext context) { this.context = context; this.constantResolver = new ConstantResolver(); } diff --git a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/JdtIntelligenceProvider.java b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/JdtIntelligenceProvider.java index d1b4fc4..f99989e 100644 --- a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/JdtIntelligenceProvider.java +++ b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/analysis/service/JdtIntelligenceProvider.java @@ -21,7 +21,7 @@ public class JdtIntelligenceProvider implements CodebaseIntelligenceProvider { private final GenericEventDetector eventDetector; private final SpringMvcDetector mvcDetector; private final MessagingDetector messagingDetector; - private final CallGraphBuilder callGraphBuilder; + private final CallGraphEngine callGraphEngine; private final LifecycleDetector lifecycleDetector; private final InterceptorDetector interceptorDetector; private final SpringComponentDetector componentDetector; @@ -32,7 +32,7 @@ public class JdtIntelligenceProvider implements CodebaseIntelligenceProvider { this.eventDetector = new GenericEventDetector(context, constantResolver, context.getLibraryHints()); this.mvcDetector = new SpringMvcDetector(context, constantResolver); this.messagingDetector = new MessagingDetector(context); - this.callGraphBuilder = new CallGraphBuilder(context); + this.callGraphEngine = new HeuristicCallGraphEngine(context); this.lifecycleDetector = new LifecycleDetector(context); this.interceptorDetector = new InterceptorDetector(context); this.componentDetector = new SpringComponentDetector(context); @@ -69,7 +69,7 @@ public class JdtIntelligenceProvider implements CodebaseIntelligenceProvider { @Override public List findCallChains(List entryPoints, List triggers) { log.info("JdtIntelligenceProvider searching for call chains between {} entry points and {} triggers", entryPoints.size(), triggers.size()); - return callGraphBuilder.findChains(entryPoints, triggers); + return callGraphEngine.findChains(entryPoints, triggers); } @Override diff --git a/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/InheritedEventDetectionTest.java b/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/InheritedEventDetectionTest.java index a8b1d0b..16ea03f 100644 --- a/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/InheritedEventDetectionTest.java +++ b/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/InheritedEventDetectionTest.java @@ -4,7 +4,7 @@ import click.kamil.springstatemachineexporter.analysis.model.CallChain; import click.kamil.springstatemachineexporter.analysis.model.EntryPoint; import click.kamil.springstatemachineexporter.analysis.model.TriggerPoint; import click.kamil.springstatemachineexporter.analysis.resolver.ConstantResolver; -import click.kamil.springstatemachineexporter.analysis.service.CallGraphBuilder; +import click.kamil.springstatemachineexporter.analysis.service.HeuristicCallGraphEngine; import click.kamil.springstatemachineexporter.analysis.service.GenericEventDetector; import click.kamil.springstatemachineexporter.analysis.service.SpringMvcDetector; import click.kamil.springstatemachineexporter.ast.common.CodebaseContext; @@ -76,7 +76,7 @@ public class InheritedEventDetectionTest { assertThat(tp.getEvent()).isEqualTo("event"); // Build Call Chains - CallGraphBuilder callGraphBuilder = new CallGraphBuilder(context); + HeuristicCallGraphEngine callGraphBuilder = new HeuristicCallGraphEngine(context); List chains = callGraphBuilder.findChains(entryPoints, triggers); assertThat(chains).describedAs("Should link ChildController.trigger to BaseController.send").hasSize(1); diff --git a/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilderTest.java b/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngineTest.java similarity index 95% rename from state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilderTest.java rename to state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngineTest.java index 6e651af..5d32cc6 100644 --- a/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/CallGraphBuilderTest.java +++ b/state_machine_exporter/src/test/java/click/kamil/springstatemachineexporter/analysis/service/HeuristicCallGraphEngineTest.java @@ -12,9 +12,11 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import org.junit.jupiter.api.Tag; import static org.assertj.core.api.Assertions.assertThat; -class CallGraphBuilderTest { +@Tag("heuristic_guess_paths_and_scrape_regex_replace_with_data_flow_analysis") +class HeuristicCallGraphEngineTest { @Test void shouldFindCallChainWithLambdaMethodReference(@TempDir Path tempDir) throws IOException { @@ -43,7 +45,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderService") @@ -94,7 +96,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.PersisterService") @@ -146,7 +148,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -200,7 +202,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -268,7 +270,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -322,7 +324,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -392,7 +394,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -438,7 +440,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -489,7 +491,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -547,7 +549,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -597,7 +599,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -650,7 +652,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -695,7 +697,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -747,7 +749,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -793,7 +795,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -837,7 +839,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -887,7 +889,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -933,7 +935,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder() .className("com.example.OrderController") @@ -984,7 +986,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("processOrderEvent").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("updateOrderState").event("event").build(); @@ -1017,7 +1019,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("createOrder").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("processOrderEvent").event("event").build(); @@ -1073,7 +1075,7 @@ class CallGraphBuilderTest { CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.controller.EventController").methodName("handleEvent").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.service.EventService").methodName("process").event("type").build(); @@ -1115,7 +1117,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1149,7 +1151,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1181,7 +1183,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1218,7 +1220,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1255,7 +1257,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1290,7 +1292,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1327,7 +1329,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1361,7 +1363,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1397,7 +1399,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1431,7 +1433,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1469,7 +1471,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1510,7 +1512,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1548,7 +1550,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1587,7 +1589,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1630,7 +1632,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1672,7 +1674,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1713,7 +1715,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1754,7 +1756,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1797,7 +1799,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build(); @@ -1842,7 +1844,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint ep1 = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus1").build(); EntryPoint ep2 = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus2").build(); @@ -1887,7 +1889,7 @@ class CallGraphBuilderTest { Files.writeString(tempDir.resolve("OrderConfig.java"), source); CodebaseContext context = new CodebaseContext(); context.scan(tempDir); - CallGraphBuilder builder = new CallGraphBuilder(context); + HeuristicCallGraphEngine builder = new HeuristicCallGraphEngine(context); EntryPoint entryPoint = EntryPoint.builder().className("com.example.OrderController").methodName("handleStatus").build(); TriggerPoint trigger = TriggerPoint.builder().className("com.example.OrderService").methodName("process").event("event").build();