Bug 65454 - [implementation] JDT UI activated on editor opening
Summary: [implementation] JDT UI activated on editor opening
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.2   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2004-06-02 17:59 EDT by Pascal Rapicault CLA
Modified: 2007-02-19 11:07 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2004-06-02 17:59:24 EDT
In an empty workspace, create a java project with a java file in it.
Close the java perspective. Close the editor. Exit eclipse.
Restart eclipse, on the file that you created previously, right click on the
file and say "open with > text editor".

You will notice that JDT UI and all its friends get activated whereas they were
not in 2.1.3.

Marking as major since this is a regression.
Comment 1 Dirk Baeumer CLA 2004-06-03 06:01:41 EDT
The activation is caused by core.filebuffers. The stack trace is 

Thread [main] (Suspended (breakpoint at line 341 in JavaPlugin))
	JavaPlugin.<init>(IPluginDescriptor) line: 341
	NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) 
line: not available [native method]
	NativeConstructorAccessorImpl.newInstance(Object[]) line: 79
	DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 43
	Constructor.newInstance(Object[]) line: 313
	PluginDescriptor.internalDoPluginActivation() line: 411
	PluginDescriptor.doPluginActivation() line: 359
	PluginDescriptor.getPlugin() line: 328
	PluginActivator.start(BundleContext) line: 47
	BundleContextImpl$1.run() line: 958
	AccessController.doPrivileged(PrivilegedExceptionAction) line: 189
	BundleContextImpl.startActivator(BundleActivator) line: 954
	BundleContextImpl.start() line: 937
	BundleHost.startWorker(boolean) line: 421
	BundleHost(AbstractBundle).start() line: 293
	EclipseClassLoader.findLocalClass(String) line: 107
	BundleLoader.findLocalClass(String) line: 371
	BundleLoader.findClass(String) line: 402
	EclipseClassLoader(AbstractClassLoader).loadClass(String, boolean) 
line: 93
	EclipseClassLoader(ClassLoader).loadClass(String) line: 560
	BundleLoader.loadClass(String) line: 307
	BundleHost.loadClass(String, boolean) line: 336
	BundleHost(AbstractBundle).loadClass(String) line: 1313
	ConfigurationElement.createExecutableExtension(Bundle, String, Object, 
IConfigurationElement, String) line: 131
	ConfigurationElement.createExecutableExtension(Bundle, String, String, 
Object, IConfigurationElement, String) line: 124
	ConfigurationElement.createExecutableExtension(String) line: 113
	ExtensionsRegistry.getExtension(IConfigurationElement, Map, Class) 
line: 242
	ExtensionsRegistry.getDocumentFactory(String) line: 279
	ExtensionsRegistry.getDocumentFactory(IPath) line: 421
	TextFileBufferManager.createEmptyDocument(IPath) line: 145
	ResourceTextFileBuffer.initializeFileBufferContent(IProgressMonitor) 
line: 264
	ResourceTextFileBuffer(ResourceFileBuffer).create(IPath, 
IProgressMonitor) line: 228
	TextFileBufferManager.connect(IPath, IProgressMonitor) line: 70
	TextFileDocumentProvider.createFileInfo(Object) line: 481
	TextFileDocumentProvider.connect(Object) line: 425
	TextEditor(AbstractTextEditor).doSetInput(IEditorInput) line: 2723
	TextEditor(StatusTextEditor).doSetInput(IEditorInput) line: 173
	TextEditor(AbstractDecoratedTextEditor).doSetInput(IEditorInput) line: 
1083
	TextEditor.doSetInput(IEditorInput) line: 290
	AbstractTextEditor$14.run(IProgressMonitor) line: 2145
	ModalContext.runInCurrentThread(IRunnableWithProgress, 
IProgressMonitor) line: 302
	ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, 
Display) line: 252
	ApplicationWindow$1.run() line: 576
	BusyIndicator.showWhile(Display, Runnable) line: 69
	WorkbenchWindow(ApplicationWindow).run(boolean, boolean, 
IRunnableWithProgress) line: 573
	WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 1622
	TextEditor(AbstractTextEditor).internalInit(IWorkbenchWindow, 
IEditorSite, IEditorInput) line: 2159
	TextEditor(AbstractTextEditor).init(IEditorSite, IEditorInput) line: 
2177
	EditorManager.createSite(IEditorReference, IEditorPart, 
EditorDescriptor, IEditorInput) line: 717
	EditorManager.openInternalEditor(IEditorReference, EditorDescriptor, 
IEditorInput, boolean) line: 776
	EditorManager.openEditorFromDescriptor(IEditorReference, 
EditorDescriptor, IEditorInput) line: 581
	EditorManager.openEditor(String, IEditorInput, boolean) line: 569
	WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean) 
line: 2187
	WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean) line: 2120
	WorkbenchPage.access$6(WorkbenchPage, IEditorInput, String, boolean) 
line: 2112
	WorkbenchPage$9.run() line: 2099
	BusyIndicator.showWhile(Display, Runnable) line: 69
	WorkbenchPage.openEditor(IEditorInput, String, boolean) line: 2094
	WorkbenchPage.openEditor(IEditorInput, String) line: 2077
	OpenWithMenu.openEditor(IEditorDescriptor) line: 258
	OpenWithMenu.access$0(OpenWithMenu, IEditorDescriptor) line: 251
	OpenWithMenu$2.handleEvent(Event) line: 166
	EventTable.sendEvent(Event) line: 82
	MenuItem(Widget).sendEvent(Event) line: 796
	Display.runDeferredEvents() line: 2716
	Display.readAndDispatch() line: 2382
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1363
	Workbench.runUI() line: 1334
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 253
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 141
	IDEApplication.run(Object) line: 96
	PlatformActivator$1.run(Object) line: 334
	EclipseStarter.run(Object) line: 273
	EclipseStarter.run(String[], Runnable) line: 128
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
available [native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 79
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 41
	Method.invoke(Object, Object[]) line: 386
	Main.basicRun(String[]) line: 185
	Main.run(String[]) line: 638
	Main.main(String[]) line: 622
Comment 2 Kai-Uwe Maetzel CLA 2004-06-03 06:57:31 EDT
3.0 candidate. Non-trival problem as it would require either listing to plug-
in activation or cooperation of extension providing plug-ins.
Comment 3 Kai-Uwe Maetzel CLA 2004-06-25 11:03:07 EDT
Removing target milestone, no further action for 3.0.
Comment 4 Tod Creasey CLA 2005-03-07 11:57:31 EST
Adding my name to the cc list as we are now tracking performance issues more
closely. Please remove the performance keyword if this is not a performance bug.
Comment 5 Mike Wilson CLA 2005-04-21 15:06:25 EDT
Is this still happening? Will something be done about it for R3.1?
Comment 6 Tobias Widmer CLA 2005-04-22 11:19:40 EDT
Unfortunately this is still happening. IMHO it makes no sense to use the 
JavaDocumentFactories and setup participants in this case, since the 
contributed extra functionality is never used when opening a Java file in the 
text editor.
Ideally, the filebuffer manager should not use contributed extensions declared 
by plugins which have not yet been activated. However, we must be careful with 
shared file buffers which are again accessed after the Java UI plugin is 
loaded.
Comment 7 Dani Megert CLA 2005-04-22 11:40:21 EDT
Thanks Tobias for checking.

Once JDT UI is loaded we would have to replace the documents if requested via a
pre-JDT UI created file buffer. This is not possible with the current framework
since pre-JDT UI created file buffer clients are still holding on to the old
documents.

This can't be addressed for 3.1.
Comment 8 Dani Megert CLA 2005-05-25 17:50:57 EDT
Deferred.
Comment 9 Dani Megert CLA 2007-02-19 06:29:17 EST
I've fixed this for 3.2 by replacing the extension and using a synchronized document.

Note however, that as of 3.3 the bug is back because since the Common Navigator (aka Project Explorer) replaces the Navigator in the resource perspective and this one loads the Java plug-in as soon as it shows a Java element.
Comment 10 Mike Wilson CLA 2007-02-19 09:26:24 EST
Well... Since the Project Explorer is intended to show the Java content, it seems reasonable for it to load the Java plug-ins. 
Comment 11 Dani Megert CLA 2007-02-19 11:07:06 EST
Sure, but the change in the resource perspective means for clients that previously used to use it, that it can take much longer to start the workbench because even if nothing is expanded the corresponding plug-in for each project type (e.g. JDT, CDT etc.) that has its own content provider gets loaded.

Anyway - this bug here is fixed.