mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
[190803] handling of interrupted exceptions
This commit is contained in:
parent
8125b0089c
commit
6922df7df3
5 changed files with 82 additions and 26 deletions
|
@ -15,6 +15,7 @@
|
|||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||
* Xuan Chen (IBM) - [189681] [dstore][linux] Refresh Folder in My Home messes up Refresh in Root
|
||||
* Kushal Munir (IBM) - [189352] Replace with appropriate line end character on upload
|
||||
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.dstore.files;
|
||||
|
@ -679,10 +680,15 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
|
||||
//getStatusMonitor(ds).waitForUpdate(status, monitor);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.dstore.processes;
|
||||
|
@ -304,7 +305,14 @@ public class DStoreProcessService extends AbstractProcessService implements IPro
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
getMinerElement();
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.dstore.shells;
|
||||
|
@ -151,7 +152,14 @@ public class DStoreShellService extends AbstractDStoreService implements IShellS
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
getMinerElement(getEnvSystemMinerId());
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes
|
||||
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes
|
||||
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.services.dstore;
|
||||
|
@ -87,11 +88,7 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
|
||||
smon.waitForUpdate(status, monitor);
|
||||
int resultSize = subject.getNestedSize();
|
||||
if (resultSize == 0)
|
||||
{
|
||||
//System.out.println("status="+status);
|
||||
//System.out.println("subject="+subject);
|
||||
}
|
||||
|
||||
checkHostJVM();
|
||||
// get results
|
||||
List nested = subject.getNestedData();
|
||||
|
@ -100,15 +97,19 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
return (DataElement[])nested.toArray(new DataElement[resultSize]);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("no query command for "+ subject); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return new DataElement[0];
|
||||
}
|
||||
|
||||
|
@ -125,8 +126,16 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
|
||||
smon.waitForUpdate(status, monitor);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -153,9 +162,16 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
return (DataElement[])nested.toArray(new DataElement[subject.getNestedSize()]);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
}
|
||||
return new DataElement[0];
|
||||
|
@ -174,8 +190,17 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
{
|
||||
getStatusMonitor(ds).waitForUpdate(status, monitor);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -252,7 +277,14 @@ public abstract class AbstractDStoreService implements IDStoreService
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// cancel monitor if it's still not canceled
|
||||
if (monitor != null && !monitor.isCanceled())
|
||||
{
|
||||
monitor.setCanceled(true);
|
||||
}
|
||||
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
}
|
||||
|
||||
getMinerElement();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2006, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,7 +12,7 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.services.dstore.util;
|
||||
|
@ -382,7 +382,9 @@ public class DStoreStatusMonitor implements IDomainListener
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
//InterruptedException is used to report user cancellation, so no need to log
|
||||
//This should be reviewed (use OperationCanceledException) with bug #190750
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue