Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/main/java/com/checkmarx/ast/wrapper/Execution.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.slf4j.Logger;
import java.io.*;
import java.lang.reflect.Field;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand Down Expand Up @@ -48,7 +49,9 @@ static <T> T executeCommand(List<String> arguments,
stringBuilder.append(line).append(LINE_SEPARATOR);
T parsedLine = lineParser.apply(line);
if (parsedLine != null) {
executionResult = parsedLine;
if (areAllFieldsNotNull(parsedLine)) {
executionResult = parsedLine;
}
}
}
process.waitFor();
Expand All @@ -59,6 +62,19 @@ static <T> T executeCommand(List<String> arguments,
}
}

private static boolean areAllFieldsNotNull(Object obj) {
for (Field field : obj.getClass().getDeclaredFields()) {
field.setAccessible(true);
try {
if (field.get(obj) == null) {
return false;
}
} catch (IllegalAccessException e) {
return false;
}
}
return true;
}
static String executeCommand(List<String> arguments,
Logger logger,
String directory,
Expand Down