Changeset 16050 in josm for trunk/src/org
- Timestamp:
- 2020-03-06T23:54:39+01:00 (5 years ago)
- Location:
- trunk/src/org
- Files:
-
- 3 deleted
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apache/commons
- Property svn:externals
-
old new 1 1 https://github.com/apache/commons-jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs jcs 2 https://github.com/apache/commons-logging/trunk/src/main/java/org/apache/commons/logging logging3 https://github.com/apache/commons-compress/trunk/src/main/java/org/apache/commons/compress compress
-
- Property svn:externals
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r15469 r16050 63 63 import javax.swing.UnsupportedLookAndFeelException; 64 64 65 import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager;66 65 import org.openstreetmap.josm.actions.DeleteAction; 67 66 import org.openstreetmap.josm.actions.JosmAction; … … 121 120 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference; 122 121 import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor; 122 import org.openstreetmap.josm.gui.util.CheckThreadViolationRepaintManager; 123 123 import org.openstreetmap.josm.gui.util.GuiHelper; 124 124 import org.openstreetmap.josm.gui.util.RedirectInputMap; -
trunk/src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java
r16049 r16050 15 15 */ 16 16 17 package org. jdesktop.swinghelper.debug;17 package org.openstreetmap.josm.gui.util; 18 18 19 19 import java.lang.ref.WeakReference; … … 22 22 import javax.swing.RepaintManager; 23 23 import javax.swing.SwingUtilities; 24 25 import org.openstreetmap.josm.tools.Logging; 24 26 25 27 /** … … 39 41 */ 40 42 public class CheckThreadViolationRepaintManager extends RepaintManager { 41 // it is recommended to pass the complete check42 private boolean completeCheck = true;43 43 private WeakReference<JComponent> lastComponent; 44 45 public CheckThreadViolationRepaintManager(boolean completeCheck) {46 this.completeCheck = completeCheck;47 }48 49 public CheckThreadViolationRepaintManager() {50 this(true);51 }52 44 53 45 @Override … … 64 56 65 57 private void checkThreadViolations(JComponent c) { 66 if (!SwingUtilities.isEventDispatchThread() && (completeCheck || c.isShowing())) {58 if (!SwingUtilities.isEventDispatchThread()) { 67 59 boolean repaint = false; 68 60 boolean fromSwing = false; … … 71 63 for (StackTraceElement st : stackTrace) { 72 64 if (repaint && st.getClassName().startsWith("javax.swing.") && 73 // for details see 74 // https://swinghelper.dev.java.net/issues/show_bug.cgi?id=1 75 !st.getClassName().startsWith("javax.swing.SwingWorker")) { 65 // for details see https://swinghelper.dev.java.net/issues/show_bug.cgi?id=1 66 !st.getClassName().startsWith("javax.swing.SwingWorker")) { 76 67 fromSwing = true; 77 68 } … … 106 97 } 107 98 108 protected void violationFound(JComponent c, StackTraceElement[] stackTrace) {109 System.out.println();110 System.out.println("EDT violation detected");111 System.out.println(c);99 protected static void violationFound(JComponent c, StackTraceElement[] stackTrace) { 100 Logging.error(""); 101 Logging.error("EDT violation detected"); 102 Logging.error(c.toString()); 112 103 for (StackTraceElement st : stackTrace) { 113 System.out.println("\tat " + st);104 Logging.error("\tat " + st); 114 105 } 115 106 }
Note:
See TracChangeset
for help on using the changeset viewer.