++
фикс падения при поиске зависимостей
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.PassState;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.PassControl;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SilentSapforPass;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.GCOV.FileGCOVJson;
|
||||
import _VisualDVM.ProjectData.SapforData.GCOV.GCOVJson;
|
||||
import _VisualDVM.ProjectData.SapforData.GCOV.LineGCOVJson;
|
||||
public class SPF_GetGCovInfo extends SilentSapforPass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
@@ -50,24 +54,44 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
|
||||
unpack(sapfor.getResult());
|
||||
}
|
||||
protected void unpack(String packed) throws Exception {
|
||||
GCOVJson allJson = Utils_.gson.fromJson(packed, GCOVJson.class);
|
||||
for (FileGCOVJson fileJson: allJson.allGCOV){
|
||||
fileJson.file = Utils_.toW(fileJson.file);
|
||||
//--
|
||||
DBProjectFile projectFile = target.db.files.get(fileJson.file);
|
||||
for (LineGCOVJson lineJson: fileJson.lines){
|
||||
if (lineJson.line > 0) {
|
||||
int v_line = lineJson.line - 1;
|
||||
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
||||
projectFile.gcov_info.add_line(v_line,
|
||||
(lineJson.execution >= 0) ? lineJson.execution : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
//завешение настроек.
|
||||
projectFile.gcov_info.setup();
|
||||
}
|
||||
/*
|
||||
String[] byFiles = packed.split("@");
|
||||
for (int z = 0; z < byFiles.length; ++z) {
|
||||
DBProjectFile cur = target.db.files.get((byFiles[z++]).replace("/", "\\"));
|
||||
DBProjectFile projectFile = target.db.files.get((byFiles[z++]).replace("/", "\\"));
|
||||
String[] inFile = byFiles[z].split(" ");
|
||||
for (int k = 0; k < (inFile.length / 2) * 2; k += 2) {
|
||||
int line = Integer.parseInt(inFile[k]);
|
||||
long execution = Long.parseLong(inFile[k + 1]);
|
||||
|
||||
if (line > 0) {
|
||||
int v_line = line - 1;
|
||||
if (!cur.gcov_info.line_info.containsKey(v_line)) {
|
||||
cur.gcov_info.add_line(v_line,
|
||||
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
||||
projectFile.gcov_info.add_line(v_line,
|
||||
(execution >= 0) ? execution : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
//завешение настроек.
|
||||
cur.gcov_info.setup();
|
||||
projectFile.gcov_info.setup();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
public void Reset() {
|
||||
|
||||
Reference in New Issue
Block a user