diff --git a/src/org/openstreetmap/josm/gui/util/GuiHelper.java b/src/org/openstreetmap/josm/gui/util/GuiHelper.java
index 61b12fb..af78db9 100644
|
a
|
b
|
import org.openstreetmap.josm.tools.ImageOverlay;
|
| 61 | 61 | import org.openstreetmap.josm.tools.ImageProvider; |
| 62 | 62 | import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; |
| 63 | 63 | import org.openstreetmap.josm.tools.LanguageInfo; |
| | 64 | import org.openstreetmap.josm.tools.bugreport.BugReport; |
| | 65 | import org.openstreetmap.josm.tools.bugreport.ReportedException; |
| 64 | 66 | |
| 65 | 67 | /** |
| 66 | 68 | * basic gui utils |
| … |
… |
public final class GuiHelper {
|
| 134 | 136 | * <a href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html">Event Dispatch Thread</a>. |
| 135 | 137 | * <p> |
| 136 | 138 | * Passes on the exception that was thrown to the thread calling this. |
| 137 | | * The exception is wrapped in a {@link RuntimeException} if it was a normal {@link Throwable}. |
| | 139 | * The exception is wrapped using a {@link ReportedException}. |
| 138 | 140 | * @param task The runnable to execute |
| 139 | 141 | * @see SwingUtilities#invokeAndWait |
| 140 | 142 | * @since 10271 |
| … |
… |
public final class GuiHelper {
|
| 145 | 147 | } else { |
| 146 | 148 | try { |
| 147 | 149 | SwingUtilities.invokeAndWait(task); |
| 148 | | } catch (InterruptedException e) { |
| 149 | | Main.error(e); |
| 150 | | } catch (InvocationTargetException e) { |
| 151 | | if (e.getCause() instanceof RuntimeException) { |
| 152 | | throw (RuntimeException) e.getCause(); |
| 153 | | } else { |
| 154 | | throw new RuntimeException("Exception while calling " + task, e.getCause()); |
| 155 | | } |
| | 150 | } catch (InterruptedException | InvocationTargetException e) { |
| | 151 | throw BugReport.intercept(e).put("task", task); |
| 156 | 152 | } |
| 157 | 153 | } |
| 158 | 154 | } |