This is interesting. I was just wondering about that in these days. Thanks
Michael
PeppeIl 30 giu 2018 7:46 PM jump-pilot-svn--- via Jump-pilot-devel
<jump-pilot-devel@lists.sourceforge.net> ha scritto:
>
> Revision: 5906
> http://sourceforge.net/p/jump-pilot/code/5906
> Author: michaudm
> Date: 2018-06-30 17:46:04 +0000 (Sat, 30 Jun 2018)
> Log Message:
> -----------
> Avoid showing dialog with exception after every dialog closing
>
> Modified Paths:
> --------------
>
> core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorManager.java
>
>
> Modified:
> core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorManager.java
>
> ===================================================================
> ---
> core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorManager.java
> 2018-06-30 07:57:05 UTC (rev 5905)
> +++
> core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorManager.java
> 2018-06-30 17:46:04 UTC (rev 5906)
> @@ -68,7 +68,7 @@
> // Aquino]
> final TaskWrapper taskWrapper = new TaskWrapper(plugIn, context,
> progressDialog);
> - final Thread thread = new Thread(taskWrapper);
> +
> progressDialog.addWindowListener(new WindowAdapter() {
> private int attempts = 0;
>
> @@ -94,7 +94,7 @@
> progressDialog.setVisible(false);
> progressDialog.dispose();
> }
> - thread.stop();
> + taskWrapper.stop();
> }
> });
> progressDialog.addComponentListener(new ComponentAdapter() {
> @@ -102,7 +102,7 @@
> //Wait for the dialog to appear before starting the task.
> // Otherwise the task might possibly finish before the
> dialog
> // appeared and the dialog would never close. [Jon Aquino]
> - thread.start();
> + taskWrapper.start();
> }
> });
> GUIUtil.centreOnWindow(progressDialog);
> @@ -131,7 +131,7 @@
> });
> }
>
> - private class TaskWrapper implements Runnable {
> + private class TaskWrapper extends Thread {
> private ThreadedPlugIn plugIn;
>
> private PlugInContext context;
> @@ -160,7 +160,9 @@
> // [Jon Aquino 2004-09-07]
>
> dialog.setVisible( false );
> - if (throwable != null) {
> + // Avoid showing another dialogbox with a ThreadDeath
> exception
> + // after dialog closing
> + if (throwable != null && !(throwable instanceof
> ThreadDeath)) {
> context.getErrorHandler().handleThrowable(throwable);
> }
> dialog.dispose();
>
>
> ------------------------------------------------------------------------------
>
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel