Bug 33610 - Deltas sent while in operation executed with JavaCore.run
Summary: Deltas sent while in operation executed with JavaCore.run
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.1 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-01 14:28 EST by Martin Aeschlimann CLA
Modified: 2003-03-03 05:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2003-03-01 14:28:11 EST
RC1

1. Select a project and do 'Organize Import'
2. Note that while the operation is busy the package viewer constantly refreshes.

- The UI thread starts the action. The action creates a runnable that is forked
to the ModelContext thread. This runnable runs the operation using JavaCore.run
- The operation does work on all CUs. To allow cancel on the progress monitor it
executes the changes for each CU in a sync exec.

ModelContext Thread:
Thread [ModalContext] (Suspended)
	Object.wait(long) line: not available [native method]
	Semaphore(Object).wait() line: 426 [local variables unavailable]
	Semaphore.acquire() line: 20
	UISynchronizer.syncExec(Runnable) line: 34
	Display.syncExec(Runnable) line: 2083
	OrganizeImportsAction.runInSync(OrganizeImportsOperation, String, MultiStatus,
IProgressMonitor) line: 377
	OrganizeImportsAction.doRunOnMultiple(ICompilationUnit[], MultiStatus,
IProgressMonitor) line: 323
	OrganizeImportsAction.access$0(OrganizeImportsAction, ICompilationUnit[],
MultiStatus, IProgressMonitor) line: 296
	OrganizeImportsAction$1.run(IProgressMonitor) line: 278
	BatchOperation.executeOperation() line: 34
	BatchOperation(JavaModelOperation).execute() line: 365
	BatchOperation(JavaModelOperation).run(IProgressMonitor) line: 681
	Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1588
	JavaCore.run(IWorkspaceRunnable, IProgressMonitor) line: 2699
	WorkbenchRunnableAdapter.run(IProgressMonitor) line: 32
	ModalContext$ModalContextThread.run() line: 95


UI Thread

PackageExplorerContentProvider.postRunnable(Runnable) line: 547
PackageExplorerContentProvider.postRefresh(Object, boolean) line: 515
PackageExplorerContentProvider.refreshWorkingCopy(IWorkingCopy) line: 423
PackageExplorerContentProvider.processDelta(IJavaElementDelta) line: 281
PackageExplorerContentProvider.processAffectedChildren(IJavaElementDelta[])
line: 372
PackageExplorerContentProvider.handleAffectedChildren(IJavaElementDelta,
IJavaElement) line: 367
PackageExplorerContentProvider.processDelta(IJavaElementDelta) line: 341
PackageExplorerContentProvider.processAffectedChildren(IJavaElementDelta[])
line: 372
PackageExplorerContentProvider.handleAffectedChildren(IJavaElementDelta,
IJavaElement) line: 367
PackageExplorerContentProvider.processDelta(IJavaElementDelta) line: 341
PackageExplorerContentProvider.processAffectedChildren(IJavaElementDelta[])
line: 372
PackageExplorerContentProvider.handleAffectedChildren(IJavaElementDelta,
IJavaElement) line: 367
PackageExplorerContentProvider.processDelta(IJavaElementDelta) line: 341
PackageExplorerContentProvider.processAffectedChildren(IJavaElementDelta[])
line: 372
PackageExplorerContentProvider.handleAffectedChildren(IJavaElementDelta,
IJavaElement) line: 367
PackageExplorerContentProvider.processDelta(IJavaElementDelta) line: 341
PackageExplorerContentProvider.elementChanged(ElementChangedEvent) line: 86
JavaModelManager$2.run() line: 786
InternalPlatform.run(ISafeRunnable) line: 867
Platform.run(ISafeRunnable) line: 413
JavaModelManager.notifyListeners(IJavaElementDelta, int,
IElementChangedListener[], int[], int) line: 781
JavaModelManager.firePostChangeDelta(IJavaElementDelta,
IElementChangedListener[], int[], int) line: 750
JavaModelManager.fire(IJavaElementDelta, int) line: 706
CreateSharedWorkingCopyOperation(JavaModelOperation).run(IProgressMonitor) line: 701
CompilationUnit(JavaElement).runOperation(JavaModelOperation, IProgressMonitor)
line: 553
CompilationUnit.getSharedWorkingCopy(IProgressMonitor, IBufferFactory,
IProblemRequestor) line: 582
CompilationUnitDocumentProvider.createElementInfo(Object) line: 852
CompilationUnitDocumentProvider(AbstractDocumentProvider).connect(Object) line: 302
TextBufferFactory.acquire(IFile) line: 85
TextBuffer.acquire(IFile) line: 371
ImportsStructure.aquireTextBuffer() line: 551
ImportsStructure.create(boolean, IProgressMonitor) line: 529
OrganizeImportsOperation.run(IProgressMonitor) line: 507
OrganizeImportsAction$3.run() line: 364
UIWorkspaceLock.doPendingWork() line: 53
UISynchronizer$1.run() line: 23
RunnableLock.run() line: 31
UISynchronizer(Synchronizer).runAsyncMessages() line: 94
Display.runAsyncMessages() line: 1752
Display.readAndDispatch() line: 1487
ModalContext$ModalContextThread.block() line: 130
ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display)
line: 255
ProgressMonitorDialog.run(boolean, boolean, IRunnableWithProgress) line: 351
OrganizeImportsAction.runOnMultiple(ICompilationUnit[]) line: 276
OrganizeImportsAction.run(IStructuredSelection) line: 265
OrganizeImportsAction(SelectionDispatchAction).dispatchRun(ISelection) line: 191
OrganizeImportsAction(SelectionDispatchAction).run() line: 169
OrganizeImportsAction(Action).runWithEvent(Event) line: 841
ActionContributionItem.handleWidgetSelection(Event) line: 456
ActionContributionItem.handleWidgetEvent(Event) line: 403
ActionContributionItem.access$0(ActionContributionItem, Event) line: 397
ActionContributionItem$ActionListener.handleEvent(Event) line: 72
EventTable.sendEvent(Event) line: 77
MenuItem(Widget).sendEvent(Event) line: 836
Display.runDeferredEvents() line: 1775
Display.readAndDispatch() line: 1483
Workbench.runEventLoop(Window$IExceptionHandler) line: 1271
Workbench.run(Object) line: 1254
InternalBootLoader.run(String, URL, String, String[], Runnable) line: 845
BootLoader.run(String, URL, String, String[], Runnable) line: 461
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available
[native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 [local variables
unavailable]
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 [local variables
unavailable]
Method.invoke(Object, Object[]) line: 324 [local variables unavailable]
Main.basicRun(String[]) line: 247
Main.run(String[]) line: 703
Main.main(String[]) line: 539
Comment 1 Jerome Lanneluc CLA 2003-03-02 17:19:01 EST
JavaCore.run() will batch deltas in the same thread only.
Comment 2 Jerome Lanneluc CLA 2003-03-02 17:22:38 EST
Note this is consistent with the behavior of IWorkspace.run()
Comment 3 Philipe Mulet CLA 2003-03-03 05:37:14 EST
As Jerome said, this is working as designed. The batching only occurs within 
the same thread. Any suboperation initiated in a different thread will behave 
as if it was alone, and notify accordingly (note that if it was triggered child 
operations in the same thread, they would batch deltas in this thread).

Closing.