Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320407 - org.eclipse.wst.jsdt.debug.ui is being activated on the opening of a simple "hello world' java file
Summary: org.eclipse.wst.jsdt.debug.ui is being activated on the opening of a simple "...
Status: VERIFIED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 321958
  Show dependency tree
 
Reported: 2010-07-20 11:38 EDT by Chris Jaun CLA
Modified: 2010-08-06 04:45 EDT (History)
3 users (show)

See Also:
simon_kaegi: review+
Michael_Rennie: review+


Attachments
proposed patch (9.83 KB, patch)
2010-07-23 17:40 EDT, Nitin Dahyabhai CLA
no flags Details | Diff
updated patch (9.29 KB, patch)
2010-07-26 10:11 EDT, Nitin Dahyabhai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jaun CLA 2010-07-20 11:38:46 EDT
"It seems that the org.eclipse.wst.jsdt.debug.ui is adding the ExternalSourceProjectFilter to the package explorer view, I'm not sure why it needs to be loaded for Java files."



Activating bundle: org.eclipse.wst.jsdt.debug.ui
Bundle activation stack:
    org.eclipse.wst.jsdt.debug.ui
Class loading stack:
    org.eclipse.wst.jsdt.debug.internal.ui.ExternalSourceProjectFilter
Stack trace:
java.lang.Throwable
    at org.eclipse.core.runtime.internal.stats.StatsManager.traceActivate(Unknown Source)
    at org.eclipse.core.runtime.internal.stats.StatsManager.startActivation(Unknown Source)
    at org.eclipse.core.runtime.internal.stats.StatsManager.watchBundle(Unknown Source)
    at org.eclipse.osgi.baseadaptor.BaseAdaptor$3.watchBundle(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Unknown Source)
    at org.eclipse.osgi.framework.util.SecureAction.start(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(Unknown Source)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(Unknown Source)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Unknown Source)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(Unknown Source)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(Unknown Source)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(Unknown Source)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(Unknown Source)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(Unknown Source)
    at org.eclipse.jdt.internal.ui.filters.FilterDescriptor$1.run(Unknown Source)
    at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
    at org.eclipse.jdt.internal.ui.filters.FilterDescriptor.createViewerFilter(Unknown Source)
    at org.eclipse.jdt.ui.actions.CustomFiltersActionGroup$FilterItem.getFilterInstance(Unknown Source)
    at org.eclipse.jdt.ui.actions.CustomFiltersActionGroup.updateViewerFilters(Unknown Source)
    at org.eclipse.jdt.ui.actions.CustomFiltersActionGroup.<init>(Unknown Source)
    at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.createControl(Unknown Source)
    at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage(Unknown Source)
    at org.eclipse.ui.part.PageBookView.createPage(Unknown Source)
    at org.eclipse.ui.part.PageBookView.partActivated(Unknown Source)
    at org.eclipse.ui.views.contentoutline.ContentOutline.partBroughtToTop(Unknown Source)
    at org.eclipse.ui.part.PageBookView$4.partBroughtToTop(Unknown Source)
    at org.eclipse.ui.internal.PartListenerList2$2.run(Unknown Source)
    at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
    at org.eclipse.core.runtime.Platform.run(Unknown Source)
    at org.eclipse.ui.internal.PartListenerList2.fireEvent(Unknown Source)
    at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(Unknown Source)
    at org.eclipse.ui.internal.PartService.firePartBroughtToTop(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(Unknown Source)
    at org.eclipse.ui.internal.PartList.setActiveEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.partAdded(Unknown Source)
    at org.eclipse.ui.internal.EditorAreaHelper.addEditor(Unknown Source)
    at org.eclipse.ui.internal.EditorManager.createEditorTab(Unknown Source)
    at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(Unknown Source)
    at org.eclipse.ui.internal.EditorManager.openEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(Unknown Source)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(Unknown Source)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(Unknown Source)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(Unknown Source)
    at org.eclipse.jdt.ui.actions.OpenAction.run(Unknown Source)
    at org.eclipse.jdt.ui.actions.OpenAction.run(Unknown Source)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(Unknown Source)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Unknown Source)
    at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(Unknown Source)
    at org.eclipse.ui.actions.RetargetAction.run(Unknown Source)
    at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(Unknown Source)
    at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(Unknown Source)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(Unknown Source)
    at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
    at org.eclipse.ui.internal.JFaceUtil$1.run(Unknown Source)
    at org.eclipse.jface.util.SafeRunnable.run(Unknown Source)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(Unknown Source)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(Unknown Source)
    at org.eclipse.ui.navigator.CommonViewer.handleOpen(Unknown Source)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Unknown Source)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(Unknown Source)
    at org.eclipse.jface.util.OpenStrategy.access$2(Unknown Source)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    at org.eclipse.ui.internal.Workbench$7.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    at org.eclipse.equinox.launcher.Main.run(Unknown Source)
    at org.eclipse.equinox.launcher.Main.main(Unknown Source)
Comment 1 Michael Rennie CLA 2010-07-20 12:13:30 EDT
(In reply to comment #0)
> "It seems that the org.eclipse.wst.jsdt.debug.ui is adding the
> ExternalSourceProjectFilter to the package explorer view, I'm not sure why it
> needs to be loaded for Java files."
> 

It is not loaded because a Java file has been opened per-se, it is loaded because it contributes a filter to the package explorer using the org.eclipse.jdt.ui.javaElementFilters and org.eclipse.wst.jsdt.ui.javaElementFilters extension points.

There does not appear to be an option on either to say "don't start my bundle if it is not already started", so I am not sure we can do anything (unless we remove the filters).
Comment 2 Nitin Dahyabhai CLA 2010-07-23 17:28:27 EDT
Do we need the filter on the Package Explorer?  Alternately can we move our filter class into a separate package and exclude it from the lazy Bundle-ActivationPolicy?
Comment 3 Nitin Dahyabhai CLA 2010-07-23 17:40:09 EDT
Created attachment 175110 [details]
proposed patch
Comment 4 Simon Kaegi CLA 2010-07-26 00:13:18 EDT
This looks fine to me as the filter is not doing anything fancy that would require a BundleContext at this point.
Comment 5 Michael Rennie CLA 2010-07-26 09:49:15 EDT
(In reply to comment #4)
> This looks fine to me as the filter is not doing anything fancy that would
> require a BundleContext at this point.

+1 for the change the activation policy. 
-1 for adding the filter class as new API. The manifest should be updated to set the x-internal flag on the new package.
Comment 6 Michael Rennie CLA 2010-07-26 09:53:04 EDT
also noticed we don't correctly set the x-internal flag on

1. *.internal.ui.breakpoints.*
2. *.internal.ui.display
3. *.internal.ui.source.*

opened bug 320902 for that issue.
Comment 7 Nitin Dahyabhai CLA 2010-07-26 10:11:52 EDT
Created attachment 175220 [details]
updated patch

Updating the patch.  We actually were not exporting that package, nor several others, so the patch changes that and appends the internal attribute for them.  It also doesn't remove the key from the previous Messages class since I'm hoping Babel will pick up on the two values being identical as a result and reuse the existing translations.
Comment 8 Michael Rennie CLA 2010-07-26 10:52:34 EDT
+1 looks good to me. 

Applied patch to HEAD, thanks Nitin.