Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Sep 16, 2024
1 parent dcbb6bf commit a79d79f
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* Licensed under MIT 2023-2024. */
package edu.kit.kastel.mcse.ardoco.core.tests.eval;

import static edu.kit.kastel.mcse.ardoco.core.tests.eval.ProjectHelper.loadFileFromResources;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -152,8 +150,7 @@ public String getCommitHash() {
*/
public File getCodeLocation(boolean acmFile) {
if (acmFile) {
// If ACM load file from resources
return loadFileFromResources(this.codeModelLocationInResources);
return ProjectHelper.loadFileFromResources(this.codeModelLocationInResources);
}

return getTemporaryCodeLocation();
Expand All @@ -179,7 +176,7 @@ public ExpectedResults getExpectedResultsForSadSamCode() {
* @see TraceLinkUtilities#createTraceLinkString(String, String)
*/
public ImmutableList<String> getSamCodeGoldStandard() {
File samCodeGoldStandardFile = loadFileFromResources(samCodeGoldStandardLocation);
File samCodeGoldStandardFile = ProjectHelper.loadFileFromResources(samCodeGoldStandardLocation);
List<String> lines = getLinesFromGoldStandardFile(samCodeGoldStandardFile);

MutableList<String> goldStandard = Lists.mutable.empty();
Expand All @@ -199,7 +196,7 @@ public ImmutableList<String> getSamCodeGoldStandard() {
* {@return all lines from the gold standard in csv format}
*/
public ImmutableList<String> getSadCodeGoldStandard() {
File sadCodeGoldStandardFile = loadFileFromResources(sadCodeGoldStandardLocation);
File sadCodeGoldStandardFile = ProjectHelper.loadFileFromResources(sadCodeGoldStandardLocation);
List<String> lines = getLinesFromGoldStandardFile(sadCodeGoldStandardFile);
return Lists.immutable.ofAll(lines);
}
Expand All @@ -212,7 +209,7 @@ private static List<String> getLinesFromGoldStandardFile(File samCodeGoldStandar
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
lines.remove(0);
lines.removeFirst();
lines = lines.stream().filter(Predicate.not(String::isBlank)).toList();
return lines;
}
Expand Down

0 comments on commit a79d79f

Please sign in to comment.