From e344ced87b261314c1cfeca175a9c29d0f3b5dcb Mon Sep 17 00:00:00 2001 From: laura Date: Sat, 9 Sep 2023 18:45:03 +0200 Subject: [PATCH] add inputCodes --- .../runner/ArDoCoForInconsistencyDetection.java | 15 ++++++++------- .../core/execution/runner/ArDoCoForLiSSA.java | 17 +++++++++-------- ...CoForSadSamCodeTraceabilityLinkRecovery.java | 3 +-- ...ArDoCoForSadSamTraceabilityLinkRecovery.java | 15 ++++++++------- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/pipeline/pipeline-id/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForInconsistencyDetection.java b/pipeline/pipeline-id/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForInconsistencyDetection.java index fe79d4f73..9c09a7500 100644 --- a/pipeline/pipeline-id/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForInconsistencyDetection.java +++ b/pipeline/pipeline-id/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForInconsistencyDetection.java @@ -5,6 +5,8 @@ import java.io.IOException; import java.util.Map; +import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,7 +16,6 @@ import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator; import edu.kit.kastel.mcse.ardoco.core.execution.ArDoCo; import edu.kit.kastel.mcse.ardoco.core.inconsistency.InconsistencyChecker; -import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent; import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator; import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent; import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction; @@ -26,10 +27,10 @@ public ArDoCoForInconsistencyDetection(String projectName) { super(projectName); } - public void setUp(File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType, Map additionalConfigs, + public void setUp(File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType, File inputCode, Map additionalConfigs, File outputDir) { try { - definePipeline(inputText, inputModelArchitecture, inputArchitectureModelType, additionalConfigs); + definePipeline(inputText, inputModelArchitecture, inputArchitectureModelType, inputCode, additionalConfigs); } catch (IOException e) { logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause()); isSetUp = false; @@ -40,8 +41,8 @@ public void setUp(File inputText, File inputModelArchitecture, ArchitectureModel } public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType, - Map additionalConfigs, String outputDirectory) { - setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs, new File(outputDirectory)); + String inputCodeLocation, Map additionalConfigs, String outputDirectory) { + setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation), additionalConfigs, new File(outputDirectory)); } /** @@ -53,7 +54,7 @@ public void setUp(String inputTextLocation, String inputArchitectureModelLocatio * @param additionalConfigs the additional configs * @throws IOException When one of the input files cannot be accessed/loaded */ - private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map additionalConfigs) + private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map additionalConfigs) throws IOException { ArDoCo arDoCo = getArDoCo(); var dataRepository = arDoCo.getDataRepository(); @@ -64,7 +65,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite DataRepositoryHelper.putInputText(dataRepository, text); arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository)); - arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository)); + arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository)); arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(ConnectionGenerator.get(additionalConfigs, dataRepository)); diff --git a/pipeline/pipeline-lissa/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForLiSSA.java b/pipeline/pipeline-lissa/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForLiSSA.java index a797dc7ad..4fba84447 100644 --- a/pipeline/pipeline-lissa/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForLiSSA.java +++ b/pipeline/pipeline-lissa/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/ArDoCoForLiSSA.java @@ -5,6 +5,8 @@ import java.io.IOException; import java.util.Map; +import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,7 +16,6 @@ import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator; import edu.kit.kastel.mcse.ardoco.core.execution.ArDoCo; import edu.kit.kastel.mcse.ardoco.core.inconsistency.InconsistencyChecker; -import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent; import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator; import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent; import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction; @@ -31,9 +32,9 @@ public ArDoCoForLiSSA(String projectName) { } public void setUp(File diagramDirectory, File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType, - Map additionalConfigs, File outputDir) { + File inputCode, Map additionalConfigs, File outputDir) { try { - definePipeline(diagramDirectory, inputText, inputModelArchitecture, inputArchitectureModelType, additionalConfigs); + definePipeline(diagramDirectory, inputText, inputModelArchitecture, inputArchitectureModelType, inputCode, additionalConfigs); } catch (IOException e) { logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause()); isSetUp = false; @@ -44,9 +45,9 @@ public void setUp(File diagramDirectory, File inputText, File inputModelArchitec } public void setUp(String diagramDirectory, String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType, - Map additionalConfigs, String outputDirectory) { - setUp(new File(diagramDirectory), new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs, - new File(outputDirectory)); + String inputCodeLocation, Map additionalConfigs, String outputDirectory) { + setUp(new File(diagramDirectory), new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation), + additionalConfigs, new File(outputDirectory)); } /** @@ -60,7 +61,7 @@ public void setUp(String diagramDirectory, String inputTextLocation, String inpu * @throws IOException When one of the input files cannot be accessed/loaded */ private void definePipeline(File diagramDirectory, File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, - Map additionalConfigs) throws IOException { + File inputCode, Map additionalConfigs) throws IOException { ArDoCo arDoCo = getArDoCo(); var dataRepository = arDoCo.getDataRepository(); var text = CommonUtilities.readInputText(inputText); @@ -72,7 +73,7 @@ private void definePipeline(File diagramDirectory, File inputText, File inputArc arDoCo.addPipelineStep(DiagramRecognition.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository)); - arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository)); + arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository)); arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(ConnectionGenerator.get(additionalConfigs, dataRepository)); diff --git a/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamCodeTraceabilityLinkRecovery.java b/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamCodeTraceabilityLinkRecovery.java index 0f3da2ddf..c230a63ea 100644 --- a/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamCodeTraceabilityLinkRecovery.java +++ b/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamCodeTraceabilityLinkRecovery.java @@ -16,7 +16,6 @@ import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator; import edu.kit.kastel.mcse.ardoco.core.execution.runner.ArDoCoRunner; import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent; -import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent; import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator; import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent; import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction; @@ -54,7 +53,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite DataRepositoryHelper.putInputText(dataRepository, text); arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository)); - arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository)); + arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository)); arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository)); arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository)); diff --git a/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamTraceabilityLinkRecovery.java b/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamTraceabilityLinkRecovery.java index 7fa703635..56ef0ebd5 100644 --- a/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamTraceabilityLinkRecovery.java +++ b/pipeline/pipeline-tlr/src/main/java/edu/kit/kastel/mcse/ardoco/core/execution/ArDoCoForSadSamTraceabilityLinkRecovery.java @@ -5,6 +5,8 @@ import java.io.IOException; import java.util.Map; +import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,7 +15,6 @@ import edu.kit.kastel.mcse.ardoco.core.common.util.DataRepositoryHelper; import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator; import edu.kit.kastel.mcse.ardoco.core.execution.runner.ArDoCoRunner; -import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent; import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator; import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent; import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction; @@ -25,10 +26,10 @@ public ArDoCoForSadSamTraceabilityLinkRecovery(String projectName) { super(projectName); } - public void setUp(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map additionalConfigs, + public void setUp(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map additionalConfigs, File outputDir) { try { - definePipeline(inputText, inputArchitectureModel, architectureModelType, additionalConfigs); + definePipeline(inputText, inputArchitectureModel, architectureModelType, inputCode, additionalConfigs); } catch (IOException e) { logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause()); isSetUp = false; @@ -38,12 +39,12 @@ public void setUp(File inputText, File inputArchitectureModel, ArchitectureModel isSetUp = true; } - public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType, + public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType, String inputCodeLocation, Map additionalConfigs, String outputDirectory) { - setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs, new File(outputDirectory)); + setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation), additionalConfigs, new File(outputDirectory)); } - private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map additionalConfigs) + private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map additionalConfigs) throws IOException { var dataRepository = this.getArDoCo().getDataRepository(); var text = CommonUtilities.readInputText(inputText); @@ -53,7 +54,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite DataRepositoryHelper.putInputText(dataRepository, text); this.getArDoCo().addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository)); - this.getArDoCo().addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository)); + this.getArDoCo().addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository)); this.getArDoCo().addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository)); this.getArDoCo().addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository));