File tree Expand file tree Collapse file tree
src/main/java/ch/unibas/dmi/dbis/chronos/agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,16 +29,23 @@ of this software and associated documentation files (the "Software"), to deal
2929import java .io .PrintWriter ;
3030import java .io .UnsupportedEncodingException ;
3131import java .nio .charset .StandardCharsets ;
32+ import java .util .List ;
3233import java .util .Map ;
3334import java .util .Properties ;
35+ import kong .unirest .json .JSONArray ;
3436import kong .unirest .json .JSONObject ;
3537
3638class Utils {
3739
3840 static void saveResults ( final Properties executionResults , final File resultsJsonFile ) throws IllegalStateException {
3941 JSONObject resultsJsonObject = new JSONObject ();
4042 for ( Map .Entry <Object , Object > result : executionResults .entrySet () ) {
41- resultsJsonObject .put ( result .getKey ().toString (), result .getValue ().toString () );
43+ Object obj = result .getValue ();
44+ if ( obj instanceof List <?> ) {
45+ resultsJsonObject .put ( result .getKey ().toString (), new JSONArray ( (List <?>) obj ) );
46+ } else {
47+ resultsJsonObject .put ( result .getKey ().toString (), obj .toString () );
48+ }
4249 }
4350
4451 try ( PrintWriter out = new PrintWriter ( resultsJsonFile , StandardCharsets .UTF_8 .name () ) ) {
You can’t perform that action at this time.
0 commit comments