Quickfix: reformat content of cache files in Vuln Cache Proc
@@ -29,6 +29,7 @@ import eu.fasten.core.plugins.DataWriter;
import eu.fasten.core.plugins.DependencyGraphUser;
import eu.fasten.core.plugins.GraphDBReader;
import eu.fasten.core.plugins.KafkaPlugin;
+import eu.fasten.core.utils.FastenUriUtils;
import org.jooq.DSLContext;
import org.json.JSONArray;
import org.json.JSONException;
@@ -39,6 +40,7 @@ import org.pf4j.PluginWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.swing.text.Utilities;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -303,9 +305,15 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
for (var path : entry.getValue()) {
var pathJson = new JSONArray();
for (var node : path) {
+ var fullUriParsed = FastenUriUtils.parseFullFastenUri(fastenUris.get(node));
+ var partialUriParsed = FastenUriUtils.parsePartialFastenUri(fullUriParsed.get(3));
+
var jsonNode = new JSONObject();
jsonNode.put("id", node);
- jsonNode.put("fasten_uri", fastenUris.get(node));
+ jsonNode.put("package_name", fullUriParsed.get(1));
+ jsonNode.put("version", fullUriParsed.get(2));
+ jsonNode.put("class_name", partialUriParsed.get(1));
+ jsonNode.put("method_name", partialUriParsed.get(2));
pathJson.put(jsonNode);
}
pathsJson.put(pathJson);
