Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2018-03-21 20:41:39 +0000
committermegumi.telles2018-03-23 14:27:32 +0000
commit488684afb2b16596bc5e2c95905ccb9c9bb72974 (patch)
tree5d34de5d422cc8691a3faa0a78b06feb1c11af0c
parent629cd023c34cb6abdd44ecd7fe0b85f8d13b8315 (diff)
downloadorg.eclipse.osee-488684afb2b16596bc5e2c95905ccb9c9bb72974.tar.gz
org.eclipse.osee-488684afb2b16596bc5e2c95905ccb9c9bb72974.tar.xz
org.eclipse.osee-488684afb2b16596bc5e2c95905ccb9c9bb72974.zip
refinement: Adjust lis file check
-rw-r--r--plugins/org.eclipse.osee.vcast/src/org/eclipse/osee/vcast/VCastLisFileParser.java26
1 files changed, 10 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.vcast/src/org/eclipse/osee/vcast/VCastLisFileParser.java b/plugins/org.eclipse.osee.vcast/src/org/eclipse/osee/vcast/VCastLisFileParser.java
index b68e2439880..a89d207d722 100644
--- a/plugins/org.eclipse.osee.vcast/src/org/eclipse/osee/vcast/VCastLisFileParser.java
+++ b/plugins/org.eclipse.osee.vcast/src/org/eclipse/osee/vcast/VCastLisFileParser.java
@@ -48,15 +48,9 @@ public class VCastLisFileParser implements ICoverageUnitFileContentsLoader {
String lisFilePathName = vCastDir + File.separator + lisFileName;
File lisFile = new File(lisFilePathName);
if (!lisFile.exists()) {
- String lisFileName = lisFilePathName.replace(lis, LIS);
- lisFile = new File(lisFileName);
- if (!lisFile.exists()) {
- lisFileName = lisFileName.replace("_", "");
- lisFile = new File(lisFileName);
- if (!lisFile.exists()) {
- throw new OseeArgumentException(
- String.format("VectorCast *.LIS file doesn't exist [%s]", lisFilePathName));
- }
+ if (!doesFileExist(lisFilePathName, lisFile)) {
+ throw new OseeArgumentException(
+ String.format("VectorCast *.LIS file doesn't exist [%s]", lisFilePathName));
}
}
try {
@@ -68,13 +62,13 @@ public class VCastLisFileParser implements ICoverageUnitFileContentsLoader {
}
}
- private String checkAndAdjustLisFileName(String lisFileName) {
- String lisFile = lisFileName;
- // change *.lis to *.LIS
- lisFile = lisFileName.replace(lis, LIS);
- // change something_io.2.lis to somethingio.2.lis
- lisFile = lisFileName.replace("_", "");
- return lisFile;
+ private boolean doesFileExist(String lisFilePathName, File lisFile) {
+ for (String file : lisFile.list()) {
+ if (file.equalsIgnoreCase(lisFilePathName)) {
+ return true;
+ }
+ }
+ return false;
}
public Pair<String, Boolean> getSourceCodeForLine(Integer method, Integer executionLine) {

Back to the top