File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
src/main/java/com/checkmarx/ast/wrapper Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .slf4j .Logger ;
4
4
import java .io .*;
5
+ import java .lang .reflect .Field ;
5
6
import java .net .URL ;
6
7
import java .nio .charset .StandardCharsets ;
7
8
import java .nio .file .Files ;
@@ -48,7 +49,9 @@ static <T> T executeCommand(List<String> arguments,
48
49
stringBuilder .append (line ).append (LINE_SEPARATOR );
49
50
T parsedLine = lineParser .apply (line );
50
51
if (parsedLine != null ) {
51
- executionResult = parsedLine ;
52
+ if (areAllFieldsNotNull (parsedLine )) {
53
+ executionResult = parsedLine ;
54
+ }
52
55
}
53
56
}
54
57
process .waitFor ();
@@ -59,6 +62,19 @@ static <T> T executeCommand(List<String> arguments,
59
62
}
60
63
}
61
64
65
+ private static boolean areAllFieldsNotNull (Object obj ) {
66
+ for (Field field : obj .getClass ().getDeclaredFields ()) {
67
+ field .setAccessible (true );
68
+ try {
69
+ if (field .get (obj ) == null ) {
70
+ return false ;
71
+ }
72
+ } catch (IllegalAccessException e ) {
73
+ return false ;
74
+ }
75
+ }
76
+ return true ;
77
+ }
62
78
static String executeCommand (List <String > arguments ,
63
79
Logger logger ,
64
80
String directory ,
You can’t perform that action at this time.
0 commit comments