Source:
<code>public AnalysisResult analyze(IRevision revision, RevisionResult previousResults) { AnalysisResult resultFromDiffAnalysis = previousResults.getResultFromClass(FineGrainDifftAnalyzer.class); DiffResult diffResut = (DiffResult) resultFromDiffAnalysis; String filename = diffResut.getDiffOfFiles().keySet().iterator().next().toString(); if (resultFromDiffAnalysis == null) { System.err.println("Error Diff must be executed before"); throw new IllegalArgumentException("Error: missing diff"); } String path = revision.getFolder(); Map<String, File> filePaths = processFilesPair(new File(path)); File src = filePaths.get("src"); File target = filePaths.get("target"); Option option = new Option(); option.featureOption = FeatureOption.ORIGINAL; <START> Boolean cross = false; <END> CodeDiffer codeDiffer = new CodeDiffer(false, option,cross); List<FeatureMatrix> featureMatrix = codeDiffer.runByGenerator(src, target); JsonObject jsonfile = null; if(cross) { jsonfile = genVectorsCSV(option,target,featureMatrix); } else { jsonfile = getNonCrossJSON(option,target,featureMatrix); } JsonArray filesArray = new JsonArray(); JsonObject file = new JsonObject(); JsonArray changesArray = new JsonArray(); changesArray.add(jsonfile); file.addProperty("file_name", filename); file.add("features", changesArray); filesArray.add(file); JsonObject root = new JsonObject(); root.addProperty("id", revision.getName()); root.add("files", filesArray); return (new FeaturesResult(revision, root)); }</code><technical_language>for moment NonCross, recommended avoid dead code (as line 79). option control of cross variable (and decide if execute cross not) get configuration file: ComingProperties.getPropertyBoolean("cross") default in file config-coming.properties as: cross=false Note this is fastest pass value: a more elegant solution pass cross a boolean argument, demand change methods calls</technical_language>

Target:
public AnalysisResult analyze(IRevision revision, RevisionResult previousResults) { AnalysisResult resultFromDiffAnalysis = previousResults.getResultFromClass(FineGrainDifftAnalyzer.class); DiffResult diffResut = (DiffResult) resultFromDiffAnalysis; String filename = diffResut.getDiffOfFiles().keySet().iterator().next().toString(); if (resultFromDiffAnalysis == null) { System.err.println("Error Diff must be executed before"); throw new IllegalArgumentException("Error: missing diff"); } String path = revision.getFolder(); Map<String, File> filePaths = processFilesPair(new File(path)); File src = filePaths.get("src"); File target = filePaths.get("target"); Option option = new Option(); option.featureOption = FeatureOption.ORIGINAL; Boolean cross = ComingProperties.getPropertyBoolean("cross"); CodeDiffer codeDiffer = new CodeDiffer(false, option,cross); List<FeatureMatrix> featureMatrix = codeDiffer.runByGenerator(src, target); JsonObject jsonfile = null; if(cross) { jsonfile = genVectorsCSV(option,target,featureMatrix); } else { jsonfile = getSimleP4JJSON(option,target,featureMatrix); } JsonArray filesArray = new JsonArray(); JsonObject file = new JsonObject(); JsonArray changesArray = new JsonArray(); changesArray.add(jsonfile); file.addProperty("file_name", filename); file.add("features", changesArray); filesArray.add(file); JsonObject root = new JsonObject(); root.addProperty("id", revision.getName()); root.add("files", filesArray); return (new FeaturesResult(revision, root)); }