++
убирание джсон запакованных полей у баг репортов
This commit is contained in:
10
.idea/workspace.xml
generated
10
.idea/workspace.xml
generated
@@ -7,13 +7,17 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportRecipient/BugReportRecipient.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportRecipient/BugReportRecipientsDBTable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReportsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReportsDBTable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientJson.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientsJson.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/VisualiserSettingJson.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/VisualiserSettingsJson.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
||||
@@ -29,5 +29,4 @@ public class rDBObject extends nDBObject {
|
||||
date = r.date;
|
||||
change_date = r.change_date;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package Common;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.StableMenuItem;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -9,7 +8,6 @@ import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class Properties {
|
||||
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
|
||||
private File file = null; //файл где хранятся настройки.
|
||||
|
||||
@@ -4,7 +4,6 @@ import Common.Database.Objects.rDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||
@@ -23,10 +22,6 @@ public class BugReport extends rDBObject {
|
||||
public long visualiser_version = -1;
|
||||
public long sapfor_version = -1;
|
||||
public String comment = "";
|
||||
@Description("IGNORE")
|
||||
public String packedRecipientsJson = "";
|
||||
@Description("IGNORE")
|
||||
public String packedSettingsJson = ""; //todo вывести.
|
||||
public Vector<BugReportSetting> settings = null;
|
||||
public Vector<BugReportRecipient> recipients = null;
|
||||
public String executor = "";
|
||||
@@ -163,12 +158,6 @@ public class BugReport extends rDBObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
public VisualiserSettingsJson getSettingsJson() {
|
||||
return packedSettingsJson.isEmpty() ? new VisualiserSettingsJson() : Utils_.gson.fromJson(packedSettingsJson, VisualiserSettingsJson.class);
|
||||
}
|
||||
public SapforProperties getPropertiesJson() {
|
||||
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
|
||||
}
|
||||
public boolean canAppend(UserAccount account, TextLog log) {
|
||||
if (account.CheckRegistered(log)) {
|
||||
if (account.email.equals(sender_address) || account.email.equals(executor_address)) {
|
||||
|
||||
@@ -8,15 +8,6 @@ import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class RecipientJson {
|
||||
@Expose
|
||||
public String address;
|
||||
public RecipientJson(String addres_in) {
|
||||
address = addres_in;
|
||||
}
|
||||
public RecipientJson() {
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class RecipientsJson {
|
||||
@Expose
|
||||
public List<RecipientJson> array = new Vector<>();
|
||||
public RecipientsJson() {
|
||||
}
|
||||
public RecipientsJson(Vector<? extends Recipient> recipients) {
|
||||
array = new Vector<>();
|
||||
for (Recipient recipient : recipients)
|
||||
array.add(new RecipientJson(recipient.email));
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class VisualiserSettingJson {
|
||||
@Expose
|
||||
public String name;
|
||||
@Expose
|
||||
public String value;
|
||||
public VisualiserSettingJson() {
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class VisualiserSettingsJson {
|
||||
@Expose
|
||||
public List<VisualiserSettingJson> array = new Vector<>();
|
||||
public String getSummary() {
|
||||
SapforProperties properties = new SapforProperties(); //только для извлечения описаний.
|
||||
Vector<String> res = new Vector<>();
|
||||
for (VisualiserSettingJson setting : array) {
|
||||
try {
|
||||
res.add(properties.getFieldDescription(setting.name) + "=" + setting.value);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return String.join("\n", res);
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,7 @@ import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
public class BugReportRecipient extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String email = "";
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportRecipient src_= (BugReportRecipient) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
email = src_.email;
|
||||
}
|
||||
public BugReportRecipient() {
|
||||
|
||||
}
|
||||
public BugReportRecipient(BugReport bugReport, String email_in) {
|
||||
bugreport_id = bugReport.id;
|
||||
@@ -22,4 +14,11 @@ public class BugReportRecipient extends iDBObject {
|
||||
public BugReportRecipient(String email_in) {
|
||||
email = email_in;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportRecipient src_ = (BugReportRecipient) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
email = src_.email;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,6 @@ public class BugReportSetting extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String name = "";
|
||||
public String value = "";
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportSetting src_ = (BugReportSetting) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
name = src_.name;
|
||||
value = src_.value;
|
||||
}
|
||||
public BugReportSetting() {
|
||||
}
|
||||
public BugReportSetting(BugReport bugReport, String name_in, Object value_in) {
|
||||
@@ -24,4 +16,12 @@ public class BugReportSetting extends iDBObject {
|
||||
name = name_in;
|
||||
value = (value_in instanceof Boolean) ? ((boolean) value_in ? "1" : "0") : value_in.toString();
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportSetting src_ = (BugReportSetting) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
name = src_.name;
|
||||
value = src_.value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,4 @@ public class BugReportSettingsDBTable extends iDBTable<BugReportSetting> {
|
||||
public BugReportSettingsDBTable() {
|
||||
super(BugReportSetting.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,52 +58,5 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
}
|
||||
}
|
||||
public void Patch() throws Exception {
|
||||
/*
|
||||
Vector<BugReportSetting> settings = new Vector<>();
|
||||
//--
|
||||
for (BugReport bugReport : bugReports.Data.values()) {
|
||||
//--
|
||||
if (!bugReport.project_version.isEmpty()) {
|
||||
if (bugReport.visualiser_version < 1134) {
|
||||
VisualiserSettingsJson visualiserSettingsJson = bugReport.getSettingsJson();
|
||||
for (VisualiserSettingJson visualiserSettingJson : visualiserSettingsJson.array) {
|
||||
BugReportSetting bugReportSetting = new BugReportSetting();
|
||||
bugReportSetting.bugreport_id = bugReport.id;
|
||||
bugReportSetting.name = visualiserSettingJson.name;
|
||||
bugReportSetting.value = visualiserSettingJson.value;
|
||||
settings.add(bugReportSetting);
|
||||
}
|
||||
} else {
|
||||
SapforProperties sapforProperties = bugReport.getPropertiesJson();
|
||||
Vector<BugReportSetting> settings_= sapforProperties.toBugReportSettings();
|
||||
for (BugReportSetting bugReportSetting: settings_)
|
||||
bugReportSetting.bugreport_id = bugReport.id;
|
||||
settings.addAll(settings_);
|
||||
}
|
||||
}
|
||||
//--
|
||||
}
|
||||
BeginTransaction();
|
||||
for (BugReportSetting bugReportSetting : settings)
|
||||
Insert(bugReportSetting);
|
||||
Commit();
|
||||
*/
|
||||
//---
|
||||
/*
|
||||
Vector<BugReportRecipient> recipients = new Vector<>();
|
||||
for (BugReport bugReport: bugReports.Data.values()){
|
||||
RecipientsJson recipientsJson = Utils_.gson.fromJson(bugReport.packedRecipientsJson, RecipientsJson.class);
|
||||
for (RecipientJson recipientJson: recipientsJson.array){
|
||||
recipients.add(new BugReportRecipient(bugReport, recipientJson.address));
|
||||
}
|
||||
}
|
||||
|
||||
//-
|
||||
BeginTransaction();
|
||||
for (BugReportRecipient recipient: recipients){
|
||||
Insert(recipient);
|
||||
}
|
||||
Commit();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import Common.CommonConstants;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.Component.OSDComponent;
|
||||
import _VisualDVM.ComponentsServer.Component.Visualizer_2;
|
||||
import _VisualDVM.Constants;
|
||||
@@ -14,14 +12,12 @@ 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.SapforProperties;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -645,5 +641,4 @@ public abstract class Sapfor extends OSDComponent {
|
||||
Global.mainModule.getUI().getVersionsWindow().BlockVariants();
|
||||
}
|
||||
//--
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.RepositoryServer;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfigurationTest.DVMConfigurationTest;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -379,9 +378,4 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void StartAction() throws Exception {
|
||||
super.StartAction();
|
||||
db.Patch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int version = 1230;
|
||||
public static final int version = 1231;
|
||||
public static final int planner_version = 24;
|
||||
public static final int testingMaxKernels = 64;
|
||||
//--
|
||||
@@ -47,7 +47,7 @@ public class Constants {
|
||||
public static final int MailSocketPort = 465;
|
||||
//
|
||||
//7998 отладочный порт. теперь.
|
||||
public static final int ComponentsServerPort = 7998; //7795
|
||||
public static final int ComponentsServerPort = 7995; //7795
|
||||
public static final int TestingServerPort = 7996; //7996
|
||||
public static final int SocketTimeout = 0;
|
||||
//-
|
||||
|
||||
@@ -45,7 +45,6 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
target.project_version = "";
|
||||
target.visualiser_version = Global.visualiser.version;
|
||||
target.sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
|
||||
target.packedSettingsJson = "";
|
||||
target.percentage = 0;
|
||||
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
|
||||
target.date = new Date().getTime();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
@@ -10,7 +9,6 @@ import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.PublishServerObject;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
public class PublishBugReport extends PublishServerObject<ComponentsServer, BugReport> {
|
||||
public PublishBugReport() {
|
||||
@@ -53,10 +51,8 @@ public class PublishBugReport extends PublishServerObject<ComponentsServer, BugR
|
||||
"Обнаружена ошибка " + Utils_.Brackets(target.id),
|
||||
target.getNewMailText()
|
||||
);
|
||||
/*
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.recipients.getSelectedMails());
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
|
||||
Reference in New Issue
Block a user