From 0f6fa616bad5279f0e94e488eeab540e58ced4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schulthei=C3=9F?= Date: Mon, 22 Aug 2022 16:28:47 +0200 Subject: [PATCH 1/2] fix: correct identification of variability model file --- pom.xml | 2 +- .../simulation/io/kernelhaven/VariabilityModelLoader.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index b3a41f4..ad1711d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.variantsync.vevos simulation - 1.1.1 + 1.1.2 diff --git a/src/main/java/org/variantsync/vevos/simulation/io/kernelhaven/VariabilityModelLoader.java b/src/main/java/org/variantsync/vevos/simulation/io/kernelhaven/VariabilityModelLoader.java index 3448bd1..9532355 100644 --- a/src/main/java/org/variantsync/vevos/simulation/io/kernelhaven/VariabilityModelLoader.java +++ b/src/main/java/org/variantsync/vevos/simulation/io/kernelhaven/VariabilityModelLoader.java @@ -1,9 +1,6 @@ package org.variantsync.vevos.simulation.io.kernelhaven; -import de.ovgu.featureide.fm.core.base.FeatureUtils; -import de.ovgu.featureide.fm.core.base.IFeature; import de.ovgu.featureide.fm.core.base.IFeatureModel; -import de.ovgu.featureide.fm.core.base.impl.DefaultFeatureModelFactory; import net.ssehub.kernel_haven.variability_model.JsonVariabilityModelCache; import org.variantsync.functjonal.Result; import org.variantsync.vevos.simulation.io.ResourceLoader; @@ -25,7 +22,7 @@ public boolean canLoad(Path p) { @Override public Result load(Path p) { return Result.Try(() -> { - if (p.endsWith(".json")) { + if (p.toString().endsWith(".json")) { JsonVariabilityModelCache cache = new JsonVariabilityModelCache(p.getParent().toFile()); return FeatureModelUtils.FromVariabilityModel(cache.readFixed(p.toFile())); } else { From 3e739b255a5139e01b0f84268598f7e149165e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schulthei=C3=9F?= Date: Mon, 22 Aug 2022 16:29:24 +0200 Subject: [PATCH 2/2] fix: OS-specific line separators in generated variants --- src/main/java/org/variantsync/vevos/simulation/io/TextIO.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/variantsync/vevos/simulation/io/TextIO.java b/src/main/java/org/variantsync/vevos/simulation/io/TextIO.java index a83fe8f..1ba8cf8 100644 --- a/src/main/java/org/variantsync/vevos/simulation/io/TextIO.java +++ b/src/main/java/org/variantsync/vevos/simulation/io/TextIO.java @@ -19,8 +19,7 @@ // TODO: Implement readLinesAs(Path p, Function<> f) with which one can load a file into a desired format public class TextIO { - public final static String LINEBREAK = "\r\n"; - public final static String LINEBREAK_REGEX = "\\r?\\n"; + public final static String LINEBREAK = System.lineSeparator(); public static String[] readLinesAsArray(final File file) throws IOException { final LinkedList lines = new LinkedList<>();