Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 72507 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java (-5 / +7 lines)
Lines 2498-2520 Link Here
2498
		 */
2498
		 */
2499
		public IStatus run(IProgressMonitor monitor) {
2499
		public IStatus run(IProgressMonitor monitor) {
2500
			fJDIThread.fRunningAsyncJob= this;
2500
			fJDIThread.fRunningAsyncJob= this;
2501
			Vector runnables;
2501
			Object[] runnables;
2502
			synchronized (fRunnables) {
2502
			synchronized (fRunnables) {
2503
				runnables= fRunnables;
2503
				runnables= fRunnables.toArray();
2504
				fRunnables= new Vector(5);
2504
				fRunnables= new Vector(5);
2505
			}
2505
			}
2506
			
2506
			
2507
			MultiStatus failed = null;
2507
			MultiStatus failed = null;
2508
			monitor.beginTask(this.getName(), runnables.size()); //$NON-NLS-1$
2508
			monitor.beginTask(this.getName(), runnables.length); //$NON-NLS-1$
2509
			for (Iterator iter= runnables.iterator(); iter.hasNext() && !fJDIThread.isTerminated() && !monitor.isCanceled();) {
2509
			int i = 0;
2510
			while (i < runnables.length && !fJDIThread.isTerminated() && !monitor.isCanceled()) {
2510
				try {
2511
				try {
2511
					((Runnable) iter.next()).run();
2512
					((Runnable) runnables[i]).run();
2512
				} catch (Exception e) {
2513
				} catch (Exception e) {
2513
					if (failed == null) {
2514
					if (failed == null) {
2514
						failed = new MultiStatus(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.INTERNAL_ERROR, JDIDebugModelMessages.getString("JDIThread.0"), null); //$NON-NLS-1$
2515
						failed = new MultiStatus(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.INTERNAL_ERROR, JDIDebugModelMessages.getString("JDIThread.0"), null); //$NON-NLS-1$
2515
					}
2516
					}
2516
					failed.add(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.INTERNAL_ERROR, JDIDebugModelMessages.getString("JDIThread.0"), e)); //$NON-NLS-1$
2517
					failed.add(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.INTERNAL_ERROR, JDIDebugModelMessages.getString("JDIThread.0"), e)); //$NON-NLS-1$
2517
				}
2518
				}
2519
				i++;
2518
				monitor.worked(1);
2520
				monitor.worked(1);
2519
			}
2521
			}
2520
			fJDIThread.fRunningAsyncJob= null;
2522
			fJDIThread.fRunningAsyncJob= null;

Return to bug 72507