рефакторинг

This commit is contained in:
2023-09-29 21:46:08 +03:00
parent 12898b07bb
commit 760707e6fb
41 changed files with 510 additions and 486 deletions

View File

@@ -0,0 +1,357 @@
package Common.Constants;
import java.util.regex.Pattern;
public class Constants {
public static final int Nan = -1;
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
public static char[] forbidden_file_name_characters = new char[]{
'#', '%', '&', '{', '}',
'<', '>', '*', '?', '!',
'$', '\'', '\"', '@', '+',
'`', '|', '=', '#', ':', '/', '\\',
'~', '^'
};
public static char[] regular_metasymbols = new char[]{
'<', '>', '(', ')', '[', ']', '{', '}', '^', '-', '=', '$', '!', '|', '?', '*', '+', '.'
};
//все запретные символы через пробел.
public static String all_forbidden_characters_string = "";
//https://losst.ru/komandy-terminala-linux
public static String[] linux_system_commands = new String[]{
//<editor-fold desc="все линуксовые команды. их МНОГО">
"a2p",
"ac",
"addgroup",
"adduser",
"agrep",
"alias",
"apropos",
"apt",
"aptitude",
"ar",
"arch",
"arp",
"as",
"aspell",
"at",
"awk",
"basename",
"bash",
"bс",
"bdiff",
"bfs",
"bg",
"biff",
"break",
"bs",
"bye",
"cal",
"calendar",
"cancel",
"cat",
"cc",
"cd",
"cfdisk",
"chdir",
"checkeq",
"checknr",
"chfn",
"chgrp",
"chmod",
"chown",
"chroot",
"chsh",
"cksum",
"clear",
"cmp",
"col",
"comm",
"compress",
"continue",
"cp",
"cpio",
"crontab",
"csh",
"csplit",
"ctags",
"cu",
"curl",
"cut",
"date",
"dc",
"dd",
"delgroup",
"deluser",
"depmod",
"deroff",
"df",
"dhclient",
"dig",
"dircmp",
"dirname",
"dmesg",
"dos2unix",
"dpkg",
"dpost",
"du",
"echo",
"ed",
"edit",
"egrep",
"eject",
"elm",
"emacs",
"emerge",
"enable",
"env",
"eqn",
"ex",
"exit",
"expand",
"expr",
"fc",
"fdisk",
"fg",
"fgrep",
"file",
"find",
"findsmb",
"finger",
"fmt",
"fold",
"for",
"foreach",
"free",
"fsck",
"ftp",
"fuser",
"gawk",
"getfacl",
"gpasswd",
"gprof",
"grep",
"groupadd",
"groupdel",
"groupmod",
"gnuzip",
"gview",
"gvim",
"gzip",
"halt",
"head",
"help",
"history",
"host",
"hostid",
"hostname",
"htop",
"id",
"ifconfig",
"ifdown",
"ifquery",
"ifup",
"info",
"insmod",
"iostat",
"ip",
"iwconfig",
"jobs",
"join",
"kill",
"killall",
"ksh",
"last",
"ld",
"ldd",
"less",
"link",
"ln",
"lo",
"locate",
"login",
"logname",
"logout",
"losetup",
"ls",
"lsmod",
"lsof",
"lzcat",
"lzma",
"mach",
"mailx",
"make",
"man",
"merge",
"mesg",
"mkdir",
"mkfs",
"mkswap",
"modinfo",
"modprobe",
"more",
"mount",
"mt",
"mv",
"mysql",
"mysqldump",
"nc",
"netstat",
"newgrp",
"nice",
"niscat",
"nischmod",
"nischown",
"nischttl",
"nisdefaults",
"nistbladm",
"nl",
"nmap",
"nohup",
"nroff",
"nslookup",
"od",
"on",
"onintr",
"pack",
"pacman",
"pagesize",
"parted",
"partprobe",
"passwd",
"paste",
"pax",
"pact",
"perl",
"pg",
"pico",
"pine",
"pkill",
"poweroff",
"pr",
"printenv",
"printf",
"ps",
"pstree",
"pvs",
"pwd",
"quit",
"rcp",
"readlink",
"reboot",
"red",
"rename",
"repeat",
"replace",
"rlogin",
"rm",
"rmdir",
"rmmod",
"route",
"rpcinfo",
"rsh",
"rsync",
"s2p",
"scp",
"screen",
"script",
"sdiff",
"sed",
"sendmail",
"service",
"set",
"setfacl",
"sfdisk",
"sftp",
"sh",
"shred",
"shutdown",
"sleep",
"slogin",
"smbclient",
"sort",
"spell",
"split",
"startx",
"ss",
"ssh",
"stat",
"stop",
"strftime",
"strip",
"stty",
"su",
"sudo",
"swapoff",
"swapon",
"systemctl",
"tabs",
"tac",
"tail",
"talk",
"tar",
"tcopy",
"tcpdump",
"tcsh",
"tee",
"telnet",
"test",
"time",
"timex",
"todos",
"top",
"touch",
"traceroute",
"tree",
"tty",
"umask",
"umount",
"unalias",
"uname",
"uncompress",
"uniq",
"unlink",
"unlzma",
"unpack",
"until",
"unxz",
"unzip",
"uptime",
"useradd",
"userdel",
"usermod",
"vacation",
"vi",
"vim",
"w",
"wait",
"wall",
"wc",
"wget",
"whereis",
"which",
"while",
"who",
"whoami",
"whois",
"Xorg",
"xargs",
"xfd",
"xhost",
"xlsfonts",
"xrdb",
"xset",
"xz",
"xzcat",
"yacc",
"yes",
"yppasswd",
"yum",
"zcat",
"zipcloack",
"zipinfo",
"zipnote",
"zipsplit",
"zypper"
//</editor-fold>
};
}

View File

@@ -1,4 +1,5 @@
package Common.Database;
import Common.Constants.Constants;
import Common.Global;
import Common.Utils.Utils;
import Repository.RepositoryRefuseException;
@@ -226,7 +227,7 @@ public abstract class Database {
(O) (tables.get(class_in).Data.get(pk)) : null;
}
public <O extends iDBObject> O getById(Class<O> class_in, int pk) {
return getByPK(class_in, pk, Utils.Nan);
return getByPK(class_in, pk, Constants.Nan);
}
public <G, O extends DBObject, F extends DBObject> LinkedHashMap<G, F> getByFKAndGroupBy(O owner, Class<F> fk_class, String group_field, Class<G> group_class) {
LinkedHashMap<G, F> res = new LinkedHashMap<>();

View File

@@ -1,5 +1,5 @@
package Common.Database;
import Common.Utils.Utils;
import Common.Constants.Constants;
import com.sun.org.glassfish.gmbal.Description;
//автоинкрементальный ключ
public class iDBObject extends DBObject {
@@ -15,7 +15,7 @@ public class iDBObject extends DBObject {
}
@Override
public Object getEmptyFK() {
return Utils.Nan;
return Constants.Nan;
}
//---
@Override

View File

@@ -1,4 +1,5 @@
package Common.UI;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Database.DBTable;
@@ -9,7 +10,6 @@ import Common.UI.Menus.TableMenu;
import Common.UI.Tables.ColumnInfo;
import Common.UI.Tables.DataTable;
import Common.UI.Tables.Grid.GridAnchestor;
import Common.Utils.Utils;
import GlobalData.Grid.Grid;
import javax.swing.*;
@@ -209,7 +209,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
}
};
if (CurrentName() != Current.Undefined) {
current_row_i = Utils.Nan;
current_row_i = Constants.Nan;
ListSelectionModel selModel = control.getSelectionModel();
selModel.addListSelectionListener(e -> {
int row = control.getSelectedRow();
@@ -227,7 +227,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
}
}
} else {
current_row_i = Utils.Nan;
current_row_i = Constants.Nan;
// System.out.println("no current row_i="+current_row_i);
getDataSource().dropCurrent();
if (events_on) {

View File

@@ -1,10 +1,11 @@
package Common.UI.Menus;
import Common.Constants.Constants;
import Common.Utils.Utils;
import javax.swing.*;
public class TableMenu extends StyledPopupMenu {
int row = Utils.Nan;
int column = Utils.Nan;
int row = Constants.Nan;
int column = Constants.Nan;
Object target = null;
//-
JTable owner = null;

View File

@@ -1,13 +1,13 @@
package Common.UI.Tables;
import Common.Utils.Utils;
import Common.Constants.Constants;
public class ColumnInfo {
private String Name = "?";
private boolean visible = true;
private boolean editable = false;
private TableRenderers renderer = TableRenderers.RendererDefault;
private TableEditors editor = TableEditors.EditorDefault;
private int maxWidth = Utils.Nan;
private int minWidth = Utils.Nan;
private int maxWidth = Constants.Nan;
private int minWidth = Constants.Nan;
//private int lastWidth = Utils.Nan;
// public void setLastWidth(int width_in) {
// lastWidth = width_in;
@@ -72,7 +72,7 @@ public class ColumnInfo {
this.maxWidth = maxWidth_in;
}
public boolean hasMaxWidth() {
return maxWidth != Utils.Nan;
return maxWidth != Constants.Nan;
}
//-
public int getMinWidth() {
@@ -82,7 +82,7 @@ public class ColumnInfo {
this.minWidth = minWidth_in;
}
public boolean hasMinWidth() {
return minWidth != Utils.Nan;
return minWidth != Constants.Nan;
}
/*

View File

@@ -1,4 +1,5 @@
package Common.Utils;
import Common.Constants.Constants;
import Common.Global;
import Common.UI.UI;
import ProjectData.Files.DBProjectFile;
@@ -34,367 +35,14 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Utils {
public static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
public static final int Nan = -1;
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
//https://losst.ru/komandy-terminala-linux
public static String[] linux_system_commands = new String[]{
//<editor-fold desc="все линуксовые команды. их МНОГО">
"a2p",
"ac",
"addgroup",
"adduser",
"agrep",
"alias",
"apropos",
"apt",
"aptitude",
"ar",
"arch",
"arp",
"as",
"aspell",
"at",
"awk",
"basename",
"bash",
"bс",
"bdiff",
"bfs",
"bg",
"biff",
"break",
"bs",
"bye",
"cal",
"calendar",
"cancel",
"cat",
"cc",
"cd",
"cfdisk",
"chdir",
"checkeq",
"checknr",
"chfn",
"chgrp",
"chmod",
"chown",
"chroot",
"chsh",
"cksum",
"clear",
"cmp",
"col",
"comm",
"compress",
"continue",
"cp",
"cpio",
"crontab",
"csh",
"csplit",
"ctags",
"cu",
"curl",
"cut",
"date",
"dc",
"dd",
"delgroup",
"deluser",
"depmod",
"deroff",
"df",
"dhclient",
"dig",
"dircmp",
"dirname",
"dmesg",
"dos2unix",
"dpkg",
"dpost",
"du",
"echo",
"ed",
"edit",
"egrep",
"eject",
"elm",
"emacs",
"emerge",
"enable",
"env",
"eqn",
"ex",
"exit",
"expand",
"expr",
"fc",
"fdisk",
"fg",
"fgrep",
"file",
"find",
"findsmb",
"finger",
"fmt",
"fold",
"for",
"foreach",
"free",
"fsck",
"ftp",
"fuser",
"gawk",
"getfacl",
"gpasswd",
"gprof",
"grep",
"groupadd",
"groupdel",
"groupmod",
"gnuzip",
"gview",
"gvim",
"gzip",
"halt",
"head",
"help",
"history",
"host",
"hostid",
"hostname",
"htop",
"id",
"ifconfig",
"ifdown",
"ifquery",
"ifup",
"info",
"insmod",
"iostat",
"ip",
"iwconfig",
"jobs",
"join",
"kill",
"killall",
"ksh",
"last",
"ld",
"ldd",
"less",
"link",
"ln",
"lo",
"locate",
"login",
"logname",
"logout",
"losetup",
"ls",
"lsmod",
"lsof",
"lzcat",
"lzma",
"mach",
"mailx",
"make",
"man",
"merge",
"mesg",
"mkdir",
"mkfs",
"mkswap",
"modinfo",
"modprobe",
"more",
"mount",
"mt",
"mv",
"mysql",
"mysqldump",
"nc",
"netstat",
"newgrp",
"nice",
"niscat",
"nischmod",
"nischown",
"nischttl",
"nisdefaults",
"nistbladm",
"nl",
"nmap",
"nohup",
"nroff",
"nslookup",
"od",
"on",
"onintr",
"pack",
"pacman",
"pagesize",
"parted",
"partprobe",
"passwd",
"paste",
"pax",
"pact",
"perl",
"pg",
"pico",
"pine",
"pkill",
"poweroff",
"pr",
"printenv",
"printf",
"ps",
"pstree",
"pvs",
"pwd",
"quit",
"rcp",
"readlink",
"reboot",
"red",
"rename",
"repeat",
"replace",
"rlogin",
"rm",
"rmdir",
"rmmod",
"route",
"rpcinfo",
"rsh",
"rsync",
"s2p",
"scp",
"screen",
"script",
"sdiff",
"sed",
"sendmail",
"service",
"set",
"setfacl",
"sfdisk",
"sftp",
"sh",
"shred",
"shutdown",
"sleep",
"slogin",
"smbclient",
"sort",
"spell",
"split",
"startx",
"ss",
"ssh",
"stat",
"stop",
"strftime",
"strip",
"stty",
"su",
"sudo",
"swapoff",
"swapon",
"systemctl",
"tabs",
"tac",
"tail",
"talk",
"tar",
"tcopy",
"tcpdump",
"tcsh",
"tee",
"telnet",
"test",
"time",
"timex",
"todos",
"top",
"touch",
"traceroute",
"tree",
"tty",
"umask",
"umount",
"unalias",
"uname",
"uncompress",
"uniq",
"unlink",
"unlzma",
"unpack",
"until",
"unxz",
"unzip",
"uptime",
"useradd",
"userdel",
"usermod",
"vacation",
"vi",
"vim",
"w",
"wait",
"wall",
"wc",
"wget",
"whereis",
"which",
"while",
"who",
"whoami",
"whois",
"Xorg",
"xargs",
"xfd",
"xhost",
"xlsfonts",
"xrdb",
"xset",
"xz",
"xzcat",
"yacc",
"yes",
"yppasswd",
"yum",
"zcat",
"zipcloack",
"zipinfo",
"zipnote",
"zipsplit",
"zypper"
//</editor-fold>
};
public static char[] forbidden_file_name_characters = new char[]{
'#', '%', '&', '{', '}',
'<', '>', '*', '?', '!',
'$', '\'', '\"', '@', '+',
'`', '|', '=', '#', ':', '/', '\\',
'~', '^'
};
public static char[] regular_metasymbols = new char[]{
'<', '>', '(', ')', '[', ']', '{', '}', '^', '-', '=', '$', '!', '|', '?', '*', '+', '.'
};
//все запретные символы через пробел.
public static String all_forbidden_characters_string = "";
public static String hideRegularMetasymbols(String word) {
String res = word.replace("\\", "\\\\");
for (char c : regular_metasymbols)
for (char c : Constants.regular_metasymbols)
res = res.replace(String.valueOf(c), "\\" + c);
return res;
}
public static boolean isLinuxSystemCommand(String text) {
for (String command : linux_system_commands) {
for (String command : Constants.linux_system_commands) {
if (text.equalsIgnoreCase(command)) return true;
}
return false;
@@ -406,13 +54,13 @@ public class Utils {
return false;
}
public static boolean isForbidden(char c) {
for (char f : forbidden_file_name_characters)
for (char f : Constants.forbidden_file_name_characters)
if (c == f) return true;
return false;
}
public static void init() {
for (char f : forbidden_file_name_characters)
all_forbidden_characters_string += f + " ";
for (char f : Constants.forbidden_file_name_characters)
Constants.all_forbidden_characters_string += f + " ";
}
public static String DQuotes(Object o) {
return "\"" + o.toString() + "\"";
@@ -516,7 +164,7 @@ public class Utils {
}
}
}
public static long last_ticks = Utils.Nan;
public static long last_ticks = Constants.Nan;
public static void sleep(long millis) {
try {
Thread.sleep(millis);
@@ -819,7 +467,7 @@ public class Utils {
res = false;
}
if (ContainsForbiddenName(name)) {
Log.Writeln_("Имя файла не может содержать запрещённых символов\n" + all_forbidden_characters_string);
Log.Writeln_("Имя файла не может содержать запрещённых символов\n" + Constants.all_forbidden_characters_string);
res = false;
}
return res;
@@ -851,7 +499,7 @@ public class Utils {
validateProjectFolder_r(dir, files_list);
if (!files_list.isEmpty())
Log.Writeln_("Имена " + filesLines.length + " файлов/подпапок содержат запрещённые символы " +
all_forbidden_characters_string +
Constants.all_forbidden_characters_string +
"или кириллицу");
//нужно проверить корень на наличие хоть одной программы.
return Log.isEmpty();
@@ -996,7 +644,7 @@ public class Utils {
Files.copy(i, dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
public static boolean validateEmail(String address, TextLog log) {
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(address);
Matcher matcher = Constants.VALID_EMAIL_ADDRESS_REGEX.matcher(address);
if (!matcher.find()) {
log.Writeln_("введённый адрес электронной почты некорректен.");
return false;
@@ -1052,7 +700,6 @@ public class Utils {
public static Process startScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
return startScript(scriptDirectory, targetDirectory, name, scriptText, null);
}
public static Process startScript_(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
//->
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (Global.isWindows ? ".bat" : "")).toFile();
@@ -1427,7 +1074,7 @@ public class Utils {
return false;
}
public static void copyDirectory(File src, File dst) throws Exception {
int code = Utils.Nan;
int code = Constants.Nan;
String command = "xcopy " +
Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath()) + " /e";

View File

@@ -1,4 +1,5 @@
package Common.Utils.Validators;
import Common.Constants.Constants;
import Common.Utils.TextLog;
import Common.Utils.Utils;
import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities;
@@ -53,7 +54,7 @@ public class PathValidator extends Validator {
Log.Writeln(string_name + ": имя файла или каталога в пути имеет неверный формат");
break;
case Forbidden:
Log.Writeln(string_name + ": Составляющие путь имена содержат запрещённые символы \n" + Utils.all_forbidden_characters_string);
Log.Writeln(string_name + ": Составляющие путь имена содержат запрещённые символы \n" + Constants.all_forbidden_characters_string);
break;
case Name:
if (spaces_count > 0)

View File

@@ -1,18 +1,18 @@
package GlobalData.Credentials;
import Common.Constants.Constants;
import Common.Database.iDBObject;
import Common.Utils.Utils;
import com.sun.org.glassfish.gmbal.Description;
public class Credentials extends iDBObject {
@Description("DEFAULT -1")
public int machine_id = Utils.Nan;
public int machine_id = Constants.Nan;
@Description("DEFAULT -1")
public int user_id = Utils.Nan;
public int user_id = Constants.Nan;
@Description("DEFAULT -1")
public int compiler_id = Utils.Nan;
public int compiler_id = Constants.Nan;
@Description("DEFAULT -1")
public int makefile_id = Utils.Nan;
public int makefile_id = Constants.Nan;
@Description("DEFAULT -1")
public int runconfiguration_id = Utils.Nan;
public int runconfiguration_id = Constants.Nan;
@Description("DEFAULT -1")
public int remotesapfor_id = Utils.Nan;
public int remotesapfor_id = Constants.Nan;
}

View File

@@ -1,12 +1,13 @@
package GlobalData.EnvironmentValue;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.iDBObject;
import Common.Utils.Utils;
public class EnvironmentValue extends iDBObject {
public String name = "";
public String value = "";
public int machine_id = Utils.Nan; //для удаления машин
public int run_configuration_id = Utils.Nan;
public int machine_id = Constants.Nan; //для удаления машин
public int run_configuration_id = Constants.Nan;
@Override
public boolean isVisible() {
return Current.HasRunConfiguration() && (run_configuration_id == Current.getRunConfiguration().id);

View File

@@ -1,11 +1,11 @@
package GlobalData.Module;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.Makefile.Makefile;
import ProjectData.LanguageName;
public class Module extends ModuleAnchestor {
public int makefile_id = Utils.Nan;
public int makefile_id = Constants.Nan;
public LanguageName language = LanguageName.n;
public int on = 1; //учитывать ли модуль при сборке. указание пользователя. если файлы отсутствуют - игнорится
public Module() {

View File

@@ -1,12 +1,13 @@
package GlobalData.Module;
import Common.Constants.Constants;
import Common.Database.iDBObject;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.Compiler.Compiler;
public class ModuleAnchestor extends iDBObject {
//--------------------------------------------------------------------------------------
public int machine_id = Utils.Nan;
public int compiler_id = Utils.Nan;
public int machine_id = Constants.Nan;
public int compiler_id = Constants.Nan;
public String command = ""; //дополнительная команда компилятору. между вызовом и флагами.
public String flags = ""; //последовательность флагов
//---------------------------------------------------------------------------------------

View File

@@ -1,8 +1,8 @@
package GlobalData.Module.UI;
import Common.Constants.Constants;
import Common.Current;
import Common.UI.UI;
import Common.UI.Windows.Dialog.DBObjectDialog;
import Common.Utils.Utils;
import GlobalData.Compiler.Compiler;
import GlobalData.Compiler.CompilerType;
import GlobalData.Makefile.Makefile;
@@ -100,7 +100,7 @@ public class ModuleAnchestorForm<T extends ModuleAnchestor> extends DBObjectDial
public void ProcessResult() {
Result.machine_id = Current.getMachine().id;
Compiler compiler = (Compiler) fields.cbCompilers.getSelectedItem();
Result.compiler_id = (compiler != null) ? compiler.id : Utils.Nan;
Result.compiler_id = (compiler != null) ? compiler.id : Constants.Nan;
Result.command = command;
Result.flags = flags;
}

View File

@@ -1,4 +1,5 @@
package GlobalData.RunConfiguration;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.iDBObject;
import Common.Global;
@@ -22,7 +23,7 @@ public class RunConfiguration extends iDBObject {
public int machine_id;
//---------------------------------------->
@Description("DEFAULT -1")
public int compiler_id = Utils.Nan;
public int compiler_id = Constants.Nan;
public String LauncherCall = ""; //например DVM или mpirun
public String LauncherOptions = ""; //например run
//--------------------------------------
@@ -175,7 +176,7 @@ public class RunConfiguration extends iDBObject {
}
public String getLaunchShortDescription() {
String res = "";
if (compiler_id != Utils.Nan) {
if (compiler_id != Constants.Nan) {
res += getCompiler().description;
if (!LauncherOptions.isEmpty())
res += " " + LauncherOptions;

View File

@@ -1,11 +1,11 @@
package GlobalData.RunConfiguration;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.*;
import Common.Global;
import Common.UI.DataSetControlForm;
import Common.UI.UI;
import Common.UI.Windows.Dialog.DBObjectDialog;
import Common.Utils.Utils;
import GlobalData.Compiler.Compiler;
import GlobalData.Compiler.CompilerType;
import GlobalData.DVMParameter.DVMParameter;
@@ -68,7 +68,7 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
Result.LauncherOptions = (String) fields.cbLaunchOptions.getSelectedItem();
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
Result.compiler_id = ((Compiler) (fields.cbLauncherCall.getSelectedItem())).id;
} else Result.compiler_id = Utils.Nan;
} else Result.compiler_id = Constants.Nan;
//-
Result.dim = (int) fields.sMaxDim.getValue();
Result.minMatrix = fields.minMatrixBar.pack(Result.dim);

View File

@@ -1,7 +1,7 @@
package GlobalData.SapforProfileSetting;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.iDBObject;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import com.sun.org.glassfish.gmbal.Description;
public class SapforProfileSetting extends iDBObject {
@@ -10,7 +10,7 @@ public class SapforProfileSetting extends iDBObject {
@Description("DEFAULT ''")
public String value = "";
@Description("DEFAULT -1")
public int sapforprofile_id = Utils.Nan;
public int sapforprofile_id = Constants.Nan;
@Override
public boolean isVisible() {
return Current.HasSapforProfile() && Current.getSapforProfile().id == sapforprofile_id;

View File

@@ -1,6 +1,6 @@
package GlobalData.Splitter;
import Common.Constants.Constants;
import Common.Database.DBObject;
import Common.Utils.Utils;
import com.sun.org.glassfish.gmbal.Description;
import javax.swing.*;
@@ -8,7 +8,7 @@ public class Splitter extends DBObject {
@Description("PRIMARY KEY, UNIQUE")
public String name = "";
@Description("DEFAULT -1")
public int position = Utils.Nan;
public int position = Constants.Nan;
public Splitter() {
}
public Splitter(JSplitPane splitPane) {

View File

@@ -1,4 +1,5 @@
package GlobalData.Tasks.CompilationTask;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
@@ -15,7 +16,7 @@ import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.LinkedHashMap;
public class CompilationTask extends Task {
public int makefile_id = Utils.Nan;
public int makefile_id = Constants.Nan;
public String binary_name = ""; //исполняемый файл.
//---------------------------------------------------
@Description("DEFAULT ''")

View File

@@ -1,4 +1,5 @@
package GlobalData.Tasks.RunTask;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.Utils.StringTemplate;
@@ -17,8 +18,8 @@ import java.io.File;
import java.nio.file.Paths;
import java.util.List;
public class RunTask extends Task {
public int compilation_task_id = Utils.Nan; //нужна для бинарника
public int run_configuration_id = Utils.Nan;
public int compilation_task_id = Constants.Nan; //нужна для бинарника
public int run_configuration_id = Constants.Nan;
@Description("DEFAULT ''")
public String last_sts_name = "";
@Description("DEFAULT 0")
@@ -152,7 +153,7 @@ public class RunTask extends Task {
public boolean hasDVMPar() {
RunConfiguration config = getRunConfiguration();
return
config.compiler_id != Utils.Nan &&
config.compiler_id != Constants.Nan &&
config.getCompiler().type.equals(CompilerType.dvm) &&
!config.getParList().isEmpty()
;

View File

@@ -1,4 +1,5 @@
package GlobalData.Tasks.Supervisor.Local;
import Common.Constants.Constants;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.Tasks.RunTask.RunTask;
@@ -22,7 +23,7 @@ public abstract class LocalTaskSupervisor<T extends Task> extends TaskSupervisor
protected int exitCode;
@Override
protected void StartTask() throws Exception {
exitCode = Utils.Nan;
exitCode = Constants.Nan;
taskProcess = Utils.startScript(task.getLocalWorkspace(), getProjectCopy(), "start_task_script", getScriptText(), getEnvs());
task.state = TaskState.Running;
}

View File

@@ -1,4 +1,5 @@
package GlobalData.Tasks;
import Common.Constants.Constants;
import Common.Database.iDBObject;
import Common.Global;
import Common.Utils.Utils;
@@ -15,8 +16,8 @@ public abstract class Task extends iDBObject {
//</editor-fold>
public TaskState state = TaskState.Inactive;
//----------------------------------
public int machine_id = Utils.Nan;
public int user_id = Utils.Nan;
public int machine_id = Constants.Nan;
public int user_id = Constants.Nan;
//-----------------------------------
public String PID = "";
public String project_path;// путь к проекту.
@@ -28,9 +29,9 @@ public abstract class Task extends iDBObject {
public long EndDate = 0;//дата окончания выполнения
//---------------------------------
@Description("IGNORE")
public int progressStep = Utils.Nan;
public int progressStep = Constants.Nan;
@Description("IGNORE")
public int progressAll = Utils.Nan;
public int progressAll = Constants.Nan;
public boolean belongsToProject(db_project_info project) {
return this.project_path.equalsIgnoreCase(project.Home.getAbsolutePath());
}
@@ -107,11 +108,11 @@ public abstract class Task extends iDBObject {
progressAll = progressAll_in;
}
public void dropProgress() {
progressStep = Utils.Nan;
progressAll = Utils.Nan;
progressStep = Constants.Nan;
progressAll = Constants.Nan;
}
public boolean hasProgress() {
return (progressStep != Utils.Nan) && (progressAll != Utils.Nan);
return (progressStep != Constants.Nan) && (progressAll != Constants.Nan);
}
//---------------------------------
public void AnalyzeResultsTexts(db_project_info project) throws Exception {

View File

@@ -1,7 +1,7 @@
package GlobalData.User;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.iDBObject;
import Common.Utils.Utils;
import GlobalData.Machine.Machine;
import TestingSystem.UserConnection;
import Visual_DVM_2021.Passes.SSH.ConnectionPass;
@@ -12,7 +12,7 @@ import java.nio.file.Paths;
public class User extends iDBObject {
public String login;
public String password = "";
public int machine_id = Utils.Nan;
public int machine_id = Constants.Nan;
public UserAuthentication authentication = UserAuthentication.password;
public String workspace = ""; //рабочая папка визуализатора пользователя на машине. полный путь.
public UserState state = UserState.initial;

View File

@@ -1,4 +1,5 @@
package ProjectData.Project;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Global;
@@ -82,7 +83,7 @@ public class db_project_info extends DBObject {
public String Log = "";//текст выдаваемый сапфором
//-----------------------------------------------
@Description("DEFAULT -1")
public long creationDate = Utils.Nan; //--------------------------------------------------NEW.
public long creationDate = Constants.Nan; //--------------------------------------------------NEW.
@Description("DEFAULT ''")
public String compilation_output = "";
@Description("DEFAULT ''")
@@ -105,19 +106,19 @@ public class db_project_info extends DBObject {
public int maxdim = 0;
//<editor-fold desc="Метрика">
@Description("DEFAULT -1")
public int numLines = Utils.Nan;
public int numLines = Constants.Nan;
@Description("DEFAULT -1")
public int numSPF = Utils.Nan;
public int numSPF = Constants.Nan;
@Description("DEFAULT -1")
public int numDVM = Utils.Nan;
public int numDVM = Constants.Nan;
@Description("DEFAULT -1")
public int numArrays = Utils.Nan;
public int numArrays = Constants.Nan;
@Description("DEFAULT -1")
public int numLoops = Utils.Nan;
public int numLoops = Constants.Nan;
@Description("DEFAULT -1")
public int numFunctions = Utils.Nan;
public int numFunctions = Constants.Nan;
@Description("DEFAULT -1")
public int numAddicted = Utils.Nan;
public int numAddicted = Constants.Nan;
//-------------------------------------
//параметры графа функций. храним для каждого проекта.
@Description("DEFAULT 500")
@@ -435,13 +436,13 @@ public class db_project_info extends DBObject {
allIncludes.clear();
files_order.clear();
functionsGraph.Clear();
numLines = Utils.Nan;
numSPF = Utils.Nan;
numDVM = Utils.Nan;
numArrays = Utils.Nan;
numFunctions = Utils.Nan;
numAddicted = Utils.Nan;
numLoops = Utils.Nan;
numLines = Constants.Nan;
numSPF = Constants.Nan;
numDVM = Constants.Nan;
numArrays = Constants.Nan;
numFunctions = Constants.Nan;
numAddicted = Constants.Nan;
numLoops = Constants.Nan;
Log = "";
Scenario = "";
declaratedArrays.clear();
@@ -565,10 +566,10 @@ public class db_project_info extends DBObject {
return numLoops == ParallelVariant.statNaN ? recommendAnalysis(PassCode_2021.SPF_GetGraphLoops) : String.valueOf(numLoops);
}
public String FunctionsCount() {
return numFunctions == Utils.Nan ? recommendAnalysis(PassCode_2021.SPF_GetGraphFunctions) : String.valueOf(numFunctions);
return numFunctions == Constants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetGraphFunctions) : String.valueOf(numFunctions);
}
public String AddictedCount() {
return numAddicted == Utils.Nan ? recommendAnalysis(PassCode_2021.SPF_GetIncludeDependencies) : String.valueOf(numAddicted);
return numAddicted == Constants.Nan ? recommendAnalysis(PassCode_2021.SPF_GetIncludeDependencies) : String.valueOf(numAddicted);
}
public boolean UpdateLinesCount() {
try {

View File

@@ -1,4 +1,5 @@
package Repository.Component;
import Common.Constants.Constants;
import Common.Database.DBObject;
import Common.Global;
import Common.Utils.Files.VFileChooser;
@@ -13,9 +14,9 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public abstract class Component extends DBObject implements Loggable {
public String date_text = Global.dateNaN;
public long version = Utils.Nan;
public long actual_version = Utils.Nan;
public long minimal_version = Utils.Nan;
public long version = Constants.Nan;
public long actual_version = Constants.Nan;
public long minimal_version = Constants.Nan;
//--
public String code = "";
public String actual_code = "";
@@ -33,7 +34,7 @@ public abstract class Component extends DBObject implements Loggable {
return String.valueOf(version);
}
public void CheckIfNeedsUpdateOrPublish() {
if (actual_version != Utils.Nan) {
if (actual_version != Constants.Nan) {
if (version < minimal_version) setState(ComponentState.Old_version);
else {
ComponentState new_state =
@@ -47,7 +48,7 @@ public abstract class Component extends DBObject implements Loggable {
setState(ComponentState.Undefined);
if (getFile().exists()) {
GetVersionInfo();
if (version == Utils.Nan)
if (version == Constants.Nan)
setState(ComponentState.Unknown_version);
} else setState(ComponentState.Not_found);
}
@@ -85,7 +86,7 @@ public abstract class Component extends DBObject implements Loggable {
return getComponentType();
}
public boolean isValidVersion(TextLog Log, String desc) {
if (version == Utils.Nan) {
if (version == Constants.Nan) {
Log.Writeln_("Не определена версия " + desc + " компонента " + Utils.Brackets(getComponentType().getDescription()));
return false;
}

View File

@@ -1,4 +1,5 @@
package Repository.Component.Sapfor;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.UI.UI;
@@ -365,7 +366,7 @@ public abstract class Sapfor extends OSDComponent {
//временный (?) проход, по тихому получить размерность теста, предварительно выполнив тихий парс.
//тут все одноразовое. считаем что таблицы бд уже заполнены как надо.
public int getTextMaxDim(File testFile, db_project_info target) {
int res = Utils.Nan;
int res = Constants.Nan;
LinkedHashMap<String, DBProjectFile> files = null;
if (testFile != null) {
DBProjectFile dbProjectFile = new DBProjectFile(testFile, target);

View File

@@ -1,6 +1,6 @@
package SapforTestingSystem.SapforTask;
import Common.Constants.Constants;
import Common.Database.DBObject;
import Common.Utils.Utils;
import GlobalData.Tasks.TaskState;
import SapforTestingSystem.Json.SapforVersion_json;
import com.google.gson.annotations.Expose;
@@ -11,10 +11,10 @@ public class SapforTask extends DBObject {
//------------------------------------>>
@Description("PRIMARY KEY, UNIQUE")
@Expose
public long id = Utils.Nan;
public long id = Constants.Nan;
@Description("DEFAULT '-1'")
@Expose
public int sapfortaskspackage_2023_id = Utils.Nan;
public int sapfortaskspackage_2023_id = Constants.Nan;
//------------------------------------->>
@Description("DEFAULT ''")
@Expose

View File

@@ -1,8 +1,8 @@
package SapforTestingSystem.SapforTasksPackage;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Database.iDBObject;
import Common.Utils.Utils;
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
import TestingSystem.Test.Test;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -10,7 +10,7 @@ import com.sun.org.glassfish.gmbal.Description;
import java.util.Vector;
public class SapforTasksPackage extends iDBObject {
public int sapforscenario_id = Utils.Nan;
public int sapforscenario_id = Constants.Nan;
@Description("DEFAULT ''")
public String sapforconfiguration_id = "";
//--

View File

@@ -1,7 +1,7 @@
package SapforTestingSystem.ThreadTask;
import Common.Utils.Utils;
import Common.Constants.Constants;
public class ThreadTask {
public int id = Utils.Nan;
public int id = Constants.Nan;
public Thread thread;
public ThreadTask(int id_in, Runnable runnable){
id = id_in;

View File

@@ -1,6 +1,6 @@
package TestingSystem.Tasks;
import Common.Constants.Constants;
import Common.Database.DBObject;
import Common.Utils.Utils;
import GlobalData.Tasks.TaskState;
import ProjectData.LanguageName;
import TestingSystem.Configuration.Configuration;
@@ -16,7 +16,7 @@ public class TestRunTask extends TestTask {
return TestRunTaskInterface.isVisible(this);
}
//--
public long testcompilationtask_id = Utils.Nan;
public long testcompilationtask_id = Constants.Nan;
public String matrix = "";
@Description("DEFAULT ''")
public String args = "";

View File

@@ -1,6 +1,6 @@
package TestingSystem.Tasks;
import Common.Constants.Constants;
import Common.Database.DBObject;
import Common.Utils.Utils;
import GlobalData.Tasks.TaskState;
import TestingSystem.Configuration.Configuration;
import TestingSystem.Group.Group;
@@ -13,7 +13,7 @@ import java.util.Vector;
//тут все поля должны быть текстовыми. никаких ссылок по ид. мало ли, группу удалят
public class TestTask extends DBObject {
@Description("PRIMARY KEY, UNIQUE")
public long id = Utils.Nan;
public long id = Constants.Nan;
@Description("DEFAULT ''")
public String taskspackage_id = "";
@Description("DEFAULT ''")

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Current;
import Common.UI.UI;
import Common.UI.Windows.Dialog.Text.FileNameForm;
@@ -30,7 +31,7 @@ public class AddFile extends ChangeFilePass<DBProjectFile> {
if (Utils.ContainsForbiddenName(fileName)) {
Log.Writeln_("Имя файла " + Utils.Brackets(fileName)
+ " содержит запрещенные символы." +
"\n" + Utils.all_forbidden_characters_string);
"\n" + Constants.all_forbidden_characters_string);
return false;
}
} else {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Current;
import Common.Utils.Utils;
import ProjectData.Files.DBProjectFile;
@@ -43,7 +44,7 @@ public class OpenSapforTest extends Pass_2021<SapforTaskResult> {
public MessageError unpackMessage(String line_in) throws Exception {
MessageError res = new MessageError();
res.file = "";
res.line = Utils.Nan;
res.line = Constants.Nan;
res.value = "";
String line = line_in.substring(9);
System.out.println(line);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Utils.Utils;
import ProjectData.Project.db_project_info;
import SapforTestingSystem.Json.SapforVersion_json;
@@ -22,7 +23,7 @@ public class PerformSapforTasksPackage extends Pass_2021<SapforScenario_json> {
File task;
//---
Process process = null;
int exit_code = Utils.Nan;
int exit_code = Constants.Nan;
//----
File outputFile = null;
File errorsFile = null;
@@ -75,7 +76,7 @@ public class PerformSapforTasksPackage extends Pass_2021<SapforScenario_json> {
}
protected boolean performSapforScript(String name, File workspace, String flags, String command, String outName, String errName) throws Exception {
process = null;
exit_code = Utils.Nan;
exit_code = Constants.Nan;
//---
File data_workspace = new File(workspace, db_project_info.data);
Utils.CheckDirectory(data_workspace);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Global;
import Common.Utils.Utils;
import ProjectData.Project.db_project_info;
@@ -25,7 +26,7 @@ public class PerformScenario extends Pass_2021<SapforScenario_json> {
File task;
//---
Process process = null;
int exit_code = Utils.Nan;
int exit_code = Constants.Nan;
//----
File outputFile = null;
File errorsFile = null;
@@ -95,7 +96,7 @@ public class PerformScenario extends Pass_2021<SapforScenario_json> {
}
protected boolean performSapforScript(String name, File workspace, String flags, String command, String outName, String errName) throws Exception {
process = null;
exit_code = Utils.Nan;
exit_code = Constants.Nan;
//---
File data_workspace = new File(workspace, db_project_info.data);
Utils.CheckDirectory(data_workspace);

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.UI.Windows.Dialog.Dialog;
import Common.Utils.Utils;
import GlobalData.Compiler.Compiler;
import GlobalData.Compiler.CompilerType;
import GlobalData.CompilerEnvironment.CompilerEnvironment;
@@ -29,7 +29,7 @@ public class PickCompilerEnvironments extends Pass_2021<String> {
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.RunConfiguration)) {
RunConfiguration configuration = Current.getRunConfiguration();
if (configuration.compiler_id == Utils.Nan) {
if (configuration.compiler_id == Constants.Nan) {
Log.Writeln_("Отсутвует DVM компилятор, связанный с текущей конфигурацией запуска.\n" +
"Если конфигурация содержит вызов DVM компилятора, но была создана на версии 801 и ниже,\n" +
"войдите в окно её редактирования,нажмите ОК, а затем повторите попытку.");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.UI.UI;
@@ -89,7 +90,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
prepareForParse(); //---->
//-
performanceTime = 0;
exitCode = Utils.Nan;
exitCode = Constants.Nan;
//------------------
workspace = Paths.get(Global.TempDirectory.getAbsolutePath(), Utils.getDateName("precompilation")).toFile();
FileUtils.forceMkdir(workspace);
@@ -138,8 +139,8 @@ public class Precompilation extends Pass_2021<db_project_info> {
protected static void unpackPrecompilationMessages(db_project_info target, String text) throws Exception {
boolean messageStarted = false;
String messageFile = "";
int messageLine = Utils.Nan;
int messageType = Utils.Nan;
int messageLine = Constants.Nan;
int messageType = Constants.Nan;
Vector<String> messageText = new Vector<>();
String[] nw = text.split("\n");
for (String S : nw) {
@@ -155,7 +156,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
messageText.add(S.substring(6));
messageType = 2;
}
if (messageType != Utils.Nan) {
if (messageType != Constants.Nan) {
target.db.files.Data.get(messageFile).CreateAndAddNewMessage(messageType, String.join("\n", messageText), messageLine, Message.parser_group);
messageStarted = false;
} else {
@@ -170,7 +171,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
if (data.length > 1) {
messageFile = name;
messageLine = Integer.parseInt(data[1]);
messageType = Utils.Nan;
messageType = Constants.Nan;
messageText = new Vector<>();
messageStarted = true;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.Constants.Constants;
import Common.Global;
import Common.Utils.Utils;
@@ -10,13 +11,13 @@ import java.util.LinkedHashMap;
import java.util.Vector;
public abstract class ProcessPass<T> extends Pass_2021<T> {
public Process process = null;
public int exit_code = Utils.Nan;
public int exit_code = Constants.Nan;
public LinkedHashMap<String, String> envs = new LinkedHashMap<>();
public Vector<String> output = new Vector<>();
protected String process_path = "";
public void CreateProcess(String exec_path_in, File workspace, String ... command) throws Exception {
output.clear();
exit_code = Utils.Nan;
exit_code = Constants.Nan;
process_path = exec_path_in;
ProcessBuilder procBuilder = new ProcessBuilder(process_path);
//-

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common.Constants.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Global;
@@ -188,7 +189,7 @@ public abstract class ComparisonForm<T extends DBObject> {
//предполагаем что оба объекта есть и мы можем получить с них текст.
protected void Compare() throws Exception {
events_on = false;
current_diff_line = Utils.Nan;
current_diff_line = Constants.Nan;
colors.clear();
//-----------------------------------------------------------------------------------------------
Body.setText("");
@@ -252,7 +253,7 @@ public abstract class ComparisonForm<T extends DBObject> {
}
public void Show() throws Exception {
events_on = false;
current_diff_line = Utils.Nan;
current_diff_line = Constants.Nan;
colors.clear();
//----------------------------------------------------------------------------------------------
Body.setText("");
@@ -339,7 +340,7 @@ public abstract class ComparisonForm<T extends DBObject> {
//</editor-fold>
slave.master = this;
bPrevious.addActionListener(e -> {
if (current_diff_line != Utils.Nan) {
if (current_diff_line != Constants.Nan) {
if (current_diff_line > 0)
current_diff_line--;
else
@@ -348,7 +349,7 @@ public abstract class ComparisonForm<T extends DBObject> {
}
});
bNext.addActionListener(e -> {
if (current_diff_line != Utils.Nan) {
if (current_diff_line != Constants.Nan) {
if (current_diff_line < colors.size() - 1)
current_diff_line++;
else

View File

@@ -1,10 +1,10 @@
package Visual_DVM_2021.UI.Main;
import Common.Constants.Constants;
import Common.Global;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.FileMenuBar.FileMenuBar;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.UI.Editor.SPFEditor;
@@ -29,7 +29,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
//контролы в столбцах
//https://stackoverflow.com/questions/7137786/how-can-i-put-a-control-in-the-jtableheader-of-a-jtable
//todo _ временно
public static int current_file_line = Utils.Nan;
public static int current_file_line = Constants.Nan;
private final Viewer compilationOutput;
private final Viewer runOutput;
private final Viewer gcovLog;

View File

@@ -1,10 +1,10 @@
package Visual_DVM_2021.UI.Main;
import Common.Constants.Constants;
import Common.Current;
import Common.Global;
import Common.UI.Menus_2023.TasksPackagesMenuBar.TasksPackagesMenuBar;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Compiler.CompilerType;
import GlobalData.Credentials.Credentials;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
@@ -355,48 +355,48 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
@Override
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Utils.Nan) {
if (credentials.machine_id != Constants.Nan) {
if (Global.db.machines.containsKey(credentials.machine_id)) {
Global.db.machines.ShowUI(credentials.machine_id);
if (Global.db.users.containsKey(credentials.user_id)) {
Global.db.users.ShowUI(credentials.user_id);
} else {
credentials.user_id = Utils.Nan;
credentials.user_id = Constants.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
Global.db.compilers.ShowUI(credentials.compiler_id);
} else {
credentials.compiler_id = Utils.Nan;
credentials.compiler_id = Constants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
Global.db.makefiles.ShowUI(credentials.makefile_id);
} else {
credentials.makefile_id = Utils.Nan;
credentials.makefile_id = Constants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
} else {
credentials.runconfiguration_id = Utils.Nan;
credentials.runconfiguration_id = Constants.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.remoteSapfors.containsKey(credentials.remotesapfor_id)) {
Global.db.remoteSapfors.ShowUI(credentials.remotesapfor_id);
} else {
credentials.remotesapfor_id = Utils.Nan;
credentials.remotesapfor_id = Constants.Nan;
Global.db.UpdateCredentials();
}
} else {
credentials.machine_id = Utils.Nan;
credentials.user_id = Utils.Nan;
credentials.compiler_id = Utils.Nan;
credentials.remotesapfor_id = Utils.Nan;
credentials.makefile_id = Utils.Nan;
credentials.runconfiguration_id = Utils.Nan;
credentials.machine_id = Constants.Nan;
credentials.user_id = Constants.Nan;
credentials.compiler_id = Constants.Nan;
credentials.remotesapfor_id = Constants.Nan;
credentials.makefile_id = Constants.Nan;
credentials.runconfiguration_id = Constants.Nan;
Global.db.UpdateCredentials();
}
}