From dc58e31e00b8fc943df42b0129bae0ba622ec558 Mon Sep 17 00:00:00 2001 From: hhpatel14 Date: Tue, 19 Nov 2024 21:14:31 -0500 Subject: [PATCH] Update parsing method to generate correct tree --- .../jboss/tools/intellij/windup/cli/RulesetParser.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jboss/tools/intellij/windup/cli/RulesetParser.java b/src/main/java/org/jboss/tools/intellij/windup/cli/RulesetParser.java index 4a69380..82d98c6 100644 --- a/src/main/java/org/jboss/tools/intellij/windup/cli/RulesetParser.java +++ b/src/main/java/org/jboss/tools/intellij/windup/cli/RulesetParser.java @@ -1,6 +1,7 @@ package org.jboss.tools.intellij.windup.cli; import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.jboss.tools.intellij.windup.model.WindupConfiguration.*; @@ -22,6 +23,9 @@ public static List parseRuleset(String resultFilePath) { currentThread.setContextClassLoader(jacksonClassLoader); ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); + // Configure to ignore unknown properties + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + File yamlFile = new File(resultFilePath); List ruleSets = objectMapper.readValue( yamlFile, new TypeReference>(){} @@ -78,9 +82,9 @@ public static void parseIncidents (List rulesets, W String input = inputs.get(0); String filePath = incident.getUri();; incident.ruleId = entry.getKey(); - String absolutePath = filePath.substring(filePath.indexOf("/source-code") + "/source-code".length()); - // System.out.println("input: " + input); - // System.out.println("Absolute path: "+input + absolutePath); + //System.out.println("-----------filePath-------------: " + filePath); + String absolutePath = filePath.substring(filePath.indexOf("/opt/input/source") + "/opt/input/source".length()); + // System.out.println("------------------ Absolute path -------------: " + input + absolutePath); incident.file = input + absolutePath; incident.setUri(input + absolutePath); // System.out.println("File path of the incidents: " + incident.file);