старый код пока не удален а закомментирован.
This commit is contained in:
6
.idea/workspace.xml
generated
6
.idea/workspace.xml
generated
@@ -7,10 +7,12 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforResult_json.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/ModifiedFile_json.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Visualizer_2.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Visualizer_2.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforResult_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforResult_json.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"ServerUserPassword": "mprit_2011",
|
||||
"OfferRegistrationOnStart": true,
|
||||
"Workspace": "E:\\Tests",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1750768139\\DIFF3DSYS\\v1\\v1\\v1",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\33136",
|
||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||
|
||||
@@ -13,6 +13,8 @@ import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.ProjectData.SapforData.ModifiedFile_json;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforResult_json;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -33,8 +35,6 @@ public abstract class Sapfor extends OSDComponent {
|
||||
public Vector<String> Intrinsics = new Vector<>();
|
||||
public LinkedHashMap<String, String> ModifiedFiles = new LinkedHashMap<>();
|
||||
public LinkedHashMap<String, String> OldFiles = new LinkedHashMap<>();
|
||||
int size;
|
||||
int[] sizes;
|
||||
String PID = "";
|
||||
private int errorCode;
|
||||
private String result;
|
||||
@@ -502,6 +502,21 @@ public abstract class Sapfor extends OSDComponent {
|
||||
this.predictorStats = predictorStats;
|
||||
}
|
||||
public void decodeString(String runResult) throws Exception {
|
||||
SapforResult_json resultJson = Utils_.gson.fromJson(runResult, SapforResult_json.class);
|
||||
resultJson.Print();
|
||||
//---
|
||||
setErrorCode(resultJson.errorCode);
|
||||
setOutput(resultJson.output);
|
||||
setOutputMessage(resultJson.outputMessage);
|
||||
setPredictorStats(resultJson.predictorStats);
|
||||
//--
|
||||
if (resultJson.files!=null && !resultJson.files.isEmpty()){
|
||||
for (ModifiedFile_json file: resultJson.files){
|
||||
ModifiedFiles.put(Utils_.toW(file.name), file.text);
|
||||
}
|
||||
}
|
||||
//--
|
||||
/*
|
||||
int codeIdx = runResult.indexOf(' ');
|
||||
if (codeIdx == -1) throw new PassException("Wrong input parameter");
|
||||
setErrorCode(Integer.parseInt(runResult.substring(0, codeIdx)));
|
||||
@@ -545,13 +560,12 @@ public abstract class Sapfor extends OSDComponent {
|
||||
}
|
||||
codeIdx += count;
|
||||
}
|
||||
*/
|
||||
}
|
||||
//-
|
||||
public void Command(String request_in) throws Exception {
|
||||
setErrorCode(empty_code);
|
||||
outputMessage = output = result = predictorStats = "";
|
||||
size = 0;
|
||||
sizes = null;
|
||||
ModifiedFiles.clear();
|
||||
//модификации.-------------------------------------------------------------->>>>
|
||||
decodeString(Global.visualizer_2.Command(request_in).replace((char) 1, '\n'));
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.io.PrintWriter;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
public class Visualizer_2 extends OSDComponent {
|
||||
public String PID = "";
|
||||
//</editor-fold>
|
||||
@@ -27,11 +28,15 @@ public class Visualizer_2 extends OSDComponent {
|
||||
port = port_in;
|
||||
}
|
||||
public static void UnpackVersionInfo(Component component, String packed) {
|
||||
/*
|
||||
String[] data = packed.split("\\|");
|
||||
//лишний пробел.
|
||||
String text = data[0].substring(0, data[0].length() - 1);
|
||||
component.date_text = data[1] + data[2] + data[3];
|
||||
component.version = Long.parseLong(text);
|
||||
*/
|
||||
component.version = 6666;
|
||||
component.date_text = new Date().toString();
|
||||
}
|
||||
//<editor-fold desc="компонент">
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.ProjectData.SapforData;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class ModifiedFile_json {
|
||||
@Expose
|
||||
public String name;
|
||||
@Expose
|
||||
public String text;
|
||||
}
|
||||
@@ -1,12 +1,25 @@
|
||||
package _VisualDVM.ProjectData.SapforData;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
public class SapforResult_json {
|
||||
@Expose
|
||||
public int codeIdx;
|
||||
public int errorCode;
|
||||
@Expose
|
||||
public String output;
|
||||
@Expose
|
||||
public String outputMessage;
|
||||
@Expose
|
||||
public String predictorStats;
|
||||
@Expose
|
||||
public List<ModifiedFile_json> files;
|
||||
//--
|
||||
public void Print(){
|
||||
System.out.println("------------------------------");
|
||||
System.out.println("codeIdx="+ errorCode);
|
||||
System.out.println("output="+output);
|
||||
System.out.println("outputMessage="+outputMessage);
|
||||
System.out.println("predictorStats="+predictorStats);
|
||||
System.out.println("-------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user