Index: trunk/.checkstyle
===================================================================
--- trunk/.checkstyle	(revision 16049)
+++ trunk/.checkstyle	(revision 16050)
@@ -11,12 +11,8 @@
   <filter name="FilesFromPackage" enabled="true">
     <filter-data value="src/com"/>
-    <filter-data value="src/javax"/>
     <filter-data value="src/oauth"/>
     <filter-data value="src/org/apache"/>
-    <filter-data value="src/org/glassfish"/>
-    <filter-data value="src/org/jdesktop"/>
     <filter-data value="src/org/openstreetmap/gui"/>
     <filter-data value="src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen"/>
-    <filter-data value="src/org/tukaani"/>
     <filter-data value=".externalToolBuilders"/>
     <filter-data value=".settings"/>
Index: trunk/README
===================================================================
--- trunk/README	(revision 16049)
+++ trunk/README	(revision 16050)
@@ -190,5 +190,4 @@
     -> http://svn.openstreetmap.org/applications/viewer/jmapviewer/
 * Apache commons compress: Support for bzip2 compression when opening files
-    src/org/apache/commons/compress/compressors (svn external)
     -> https://github.com/apache/commons-compress
 * Apache commons validator: Improved validator routines
@@ -199,5 +198,4 @@
     -> https://github.com/blackears/svgSalamander
 * Metadata Extractor: Read EXIF Metadata of photos
-    src/com/drew
     -> https://github.com/drewnoakes/metadata-extractor
 * Signpost: OAuth library
@@ -208,9 +206,8 @@
     -> https://github.com/floscher/multi-split
     -> https://community.oracle.com/docs/DOC-983539
-* swinghelper: Class CheckThreadViolationRepaintManager to find classpath violations
-    src/org/jdesktop/swinghelper/debug/CheckThreadViolationRepaintManager.java
+* swinghelper: Class CheckThreadViolationRepaintManager to find EDT violations
+    src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java
     -> https://github.com/floscher/swinghelper
 * xz extractor
-    src/org/tukaani
     -> https://tukaani.org/xz/java.html
 * OpeningHoursParser (MIT license)
Index: trunk/build.xml
===================================================================
--- trunk/build.xml	(revision 16049)
+++ trunk/build.xml	(revision 16050)
@@ -298,5 +298,4 @@
             <!-- get rid of "internal proprietary API" warning -->
             <compilerarg value="-XDignore.symbol.file"/>
-            <exclude name="org/apache/commons/compress/**"/>
             <exclude name="org/apache/commons/jcs/JCS.java"/>
             <exclude name="org/apache/commons/jcs/access/GroupCacheAccess.java"/>
@@ -319,5 +318,7 @@
             <exclude name="org/apache/commons/jcs/utils/props/**"/>
             <exclude name="org/apache/commons/jcs/utils/servlet/**"/>
-            <exclude name="org/apache/commons/logging/**"/>
+            <classpath>
+                <path refid="runtime.path"/>
+            </classpath>
         </javac>
     </target>
@@ -1061,5 +1062,5 @@
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-tools.jar" includes="org/openstreetmap/josm/tools/**/*.class"/>
         <exec executable="jdeps" dir="${modules.dir}">
-            <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.jdesktop.*|org.openstreetmap.gui.*'"/>
+            <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.openstreetmap.gui.*'"/>
             <arg line="-dotoutput dots *.jar"/>
         </exec>
@@ -1069,12 +1070,10 @@
         <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-without-dependencies.png"/>
         <!-- Direct dependencies -->
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/metadata-extractor.jar" includes="com/drew/**/*.class"/>
+        <copy todir="${modules.dir}" flatten="true">
+            <fileset refid="runtime.fileset" />
+        </copy>
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/svgSalamander.jar" includes="com/kitfox/**/*.class"/>
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/javax-json.jar" includes="javax/**/*.class"/>
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/oauth-signpost.jar" includes="oauth/**/*.class"/>
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/commons-compress.jar" includes="org/apache/commons/compress/**/*.class"/>
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/commons-jcs.jar" includes="org/apache/commons/jcs/**/*.class"/>
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/glassfish-json.jar" includes="org/glassfish/**/*.class"/>
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/jdesktop.jar" includes="org/jdesktop/**/*.class"/>
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/jmapviewer.jar" includes="org/openstreetmap/gui/**/*.class"/>
         <exec executable="jdeps" dir="${modules.dir}">
@@ -1087,7 +1086,5 @@
         <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-direct-dependencies.png"/>
         <!-- All dependencies -->
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/commons-logging.jar" includes="org/apache/commons/logging/**/*.class"/>
         <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/google-gdata.jar" includes="com/google/**/*.class"/>
-        <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/tukaani-xz.jar" includes="org/tukaani/**/*.class"/>
         <exec executable="jdeps" dir="${modules.dir}">
             <arg line="-dotoutput dots *.jar"/>
@@ -1098,5 +1095,5 @@
         <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
     </target>
-    <target name="resolve" depends="init-ivy" unless="resolve.notRequired">
+    <target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
         <ivy:resolve keep="true"/>
         <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 16049)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 16050)
@@ -63,5 +63,4 @@
 import javax.swing.UnsupportedLookAndFeelException;
 
-import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager;
 import org.openstreetmap.josm.actions.DeleteAction;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -121,4 +120,5 @@
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
 import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor;
+import org.openstreetmap.josm.gui.util.CheckThreadViolationRepaintManager;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.util.RedirectInputMap;
Index: trunk/src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java	(revision 16050)
+++ trunk/src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java	(revision 16050)
@@ -0,0 +1,107 @@
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package org.openstreetmap.josm.gui.util;
+
+import java.lang.ref.WeakReference;
+
+import javax.swing.JComponent;
+import javax.swing.RepaintManager;
+import javax.swing.SwingUtilities;
+
+import org.openstreetmap.josm.tools.Logging;
+
+/**
+ * <p>This class is used to detect Event Dispatch Thread rule violations<br>
+ * See <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How to Use Threads</a>
+ * for more info</p>
+ * <p/>
+ * <p>This is a modification of original idea of Scott Delap<br>
+ * Initial version of ThreadCheckingRepaintManager can be found here<br>
+ * <a href="http://www.clientjava.com/blog/2004/08/20/1093059428000.html">Easily Find Swing Threading Mistakes</a>
+ * </p>
+ *
+ * @author Scott Delap
+ * @author Alexander Potochkin
+ *
+ * https://swinghelper.dev.java.net/
+ */
+public class CheckThreadViolationRepaintManager extends RepaintManager {
+    private WeakReference<JComponent> lastComponent;
+
+    @Override
+    public synchronized void addInvalidComponent(JComponent component) {
+        checkThreadViolations(component);
+        super.addInvalidComponent(component);
+    }
+
+    @Override
+    public void addDirtyRegion(JComponent component, int x, int y, int w, int h) {
+        checkThreadViolations(component);
+        super.addDirtyRegion(component, x, y, w, h);
+    }
+
+    private void checkThreadViolations(JComponent c) {
+        if (!SwingUtilities.isEventDispatchThread()) {
+            boolean repaint = false;
+            boolean fromSwing = false;
+            boolean imageUpdate = false;
+            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+            for (StackTraceElement st : stackTrace) {
+                if (repaint && st.getClassName().startsWith("javax.swing.") &&
+                    // for details see https://swinghelper.dev.java.net/issues/show_bug.cgi?id=1
+                    !st.getClassName().startsWith("javax.swing.SwingWorker")) {
+                    fromSwing = true;
+                }
+                if (repaint && "imageUpdate".equals(st.getMethodName())) {
+                    imageUpdate = true;
+                }
+                if ("repaint".equals(st.getMethodName())) {
+                    repaint = true;
+                    fromSwing = false;
+                }
+                if ("read".equals(st.getMethodName()) && "javax.swing.JEditorPane".equals(st.getClassName())) {
+                    // Swing reads html from a background thread
+                    return;
+                }
+            }
+            if (imageUpdate) {
+                //assuming it is java.awt.image.ImageObserver.imageUpdate(...)
+                //image was asynchronously updated, that's ok
+                return;
+            }
+            if (repaint && !fromSwing) {
+                //no problems here, since repaint() is thread safe
+                return;
+            }
+            //ignore the last processed component
+            if (lastComponent != null && c == lastComponent.get()) {
+                return;
+            }
+            lastComponent = new WeakReference<>(c);
+            violationFound(c, stackTrace);
+        }
+    }
+
+    protected static void violationFound(JComponent c, StackTraceElement[] stackTrace) {
+        Logging.error("");
+        Logging.error("EDT violation detected");
+        Logging.error(c.toString());
+        for (StackTraceElement st : stackTrace) {
+            Logging.error("\tat " + st);
+        }
+    }
+}
Index: trunk/tools/checkstyle/josm_filters.xml
===================================================================
--- trunk/tools/checkstyle/josm_filters.xml	(revision 16049)
+++ trunk/tools/checkstyle/josm_filters.xml	(revision 16050)
@@ -24,4 +24,5 @@
   <suppress checks="." files="[\\/]tools[\\/]pmd[\\/]" />
   <suppress checks="HeaderCheck" files="josm[\\/]tools[\\/]commons[\\/]" />
+  <suppress checks="HeaderCheck" files="CheckThreadViolationRepaintManager\.java" />
   <suppress checks="HeaderCheck" files="Ellipsoid\.java" />
   <suppress checks="HeaderCheck" files="NTV2GridShift\.java" />
Index: trunk/tools/spotbugs/josm-filter.xml
===================================================================
--- trunk/tools/spotbugs/josm-filter.xml	(revision 16049)
+++ trunk/tools/spotbugs/josm-filter.xml	(revision 16050)
@@ -64,7 +64,4 @@
     </Match>
     <Match>
-        <Class name="~org.jdesktop.swinghelper.debug.*" />
-    </Match>
-    <Match>
         <Class name="~org.openstreetmap.gui.jmapviewer.*" />
     </Match>
