mirror of
https://github.com/Wisser/Jailer.git
synced 2026-05-07 11:20:10 -05:00
Merge branch 'master' of https://github.com/Wisser/Jailer.git
This commit is contained in:
@@ -329,6 +329,8 @@ public class ExportPanel extends javax.swing.JPanel {
|
||||
selectAllButton.setText("Select All");
|
||||
}
|
||||
infoLabel.setText(info.isEmpty()? " " : info);
|
||||
|
||||
okButton.setEnabled(!selectedConnections.isEmpty() || !selectedModels.isEmpty());
|
||||
}
|
||||
|
||||
private List<JCheckBox> checkBoxes = new ArrayList<>();
|
||||
@@ -472,7 +474,13 @@ public class ExportPanel extends javax.swing.JPanel {
|
||||
String cmsf = DataModelManager.getCurrentModelSubfolder(executionContext);
|
||||
try {
|
||||
DataModelManager.setCurrentModelSubfolder(null, executionContext);
|
||||
String file = UIUtil.choseFile(null, ".", dialog.getTitle(), EXPORT_FILE_EXTENSION, ExportPanel.this, true, false, false);
|
||||
File proposal = null;
|
||||
if (selectedModels.size() == 1) {
|
||||
proposal = new File(selectedModels.iterator().next() + EXPORT_FILE_EXTENSION);
|
||||
} else if (selectedModels.isEmpty() && selectedConnections.size() == 1) {
|
||||
proposal = new File(selectedConnections.iterator().next().alias.replaceAll("[\\\\/:;*?\"\\<\\>\\|]+","_") + EXPORT_FILE_EXTENSION);
|
||||
}
|
||||
String file = UIUtil.choseFile(proposal, ".", dialog.getTitle(), EXPORT_FILE_EXTENSION, ExportPanel.this, true, false, false);
|
||||
UIUtil.setWaitCursor(this);
|
||||
if (file != null) {
|
||||
try {
|
||||
|
||||
@@ -1103,7 +1103,9 @@ public class UIUtil {
|
||||
private static int issueCount = 0;
|
||||
private static long lastIssueTS = 0;
|
||||
|
||||
public static void sendIssue(final String type, String theIssue) {
|
||||
public static boolean sendIssue(final String type, String theIssue) {
|
||||
// TODO
|
||||
// TODO return false iff theIssue is black listed
|
||||
String threadName = Thread.currentThread().getName();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
@@ -1197,6 +1199,7 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String toHTML(String plainText, int maxLineLength) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.sf.jailer.ui.UIUtil;
|
||||
|
||||
public class AWTWatchdog {
|
||||
|
||||
private static final long MAX_DELAY = 8000;
|
||||
private static final long MAX_DELAY = 8000 + 4000;
|
||||
|
||||
public static void start() {
|
||||
try {
|
||||
@@ -27,6 +27,7 @@ public class AWTWatchdog {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean issueSent = false;
|
||||
boolean issueBListed = false;
|
||||
int activeCD = 5;
|
||||
for (;;) {
|
||||
try {
|
||||
@@ -54,15 +55,18 @@ public class AWTWatchdog {
|
||||
}
|
||||
dump = JailerVersion.VERSION + " " + dump;
|
||||
String iMsg = dump;
|
||||
UIUtil.sendIssue("AWTHanging", iMsg);
|
||||
issueBListed = !UIUtil.sendIssue("AWTHanging", "(12s:)" + iMsg);
|
||||
issueSent = true;
|
||||
}
|
||||
} else {
|
||||
if (issueSent) {
|
||||
String iMsg = "AWT-Thread working";
|
||||
Session._log.info(iMsg);
|
||||
UIUtil.sendIssue("AWTHanging", iMsg);
|
||||
if (!issueBListed) {
|
||||
String iMsg = "AWT-Thread working";
|
||||
Session._log.info(iMsg);
|
||||
UIUtil.sendIssue("AWTHanging", iMsg);
|
||||
}
|
||||
issueSent = false;
|
||||
issueBListed = false;
|
||||
if (--activeCD <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -88,7 +92,7 @@ public class AWTWatchdog {
|
||||
}
|
||||
}
|
||||
|
||||
protected static String sendThreadDump() {
|
||||
private static String sendThreadDump() {
|
||||
ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean();
|
||||
for (ThreadInfo ti : threadMxBean.dumpAllThreads(true, true)) {
|
||||
if (ti.getThreadName() != null && ti.getThreadName().toLowerCase(Locale.ENGLISH).startsWith("awt-event")) {
|
||||
|
||||
Reference in New Issue
Block a user