Community
Participate
Working Groups
The init() method wrongfully assumes that there is an active workbench window. java.lang.NullPointerException at org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.init(MonitorUiPlugin.java:404) at org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.start(MonitorUiPlugin.java:148) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:408) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:381) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:454) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) [...]
What is the purpose of the ShellLifeCycleListener anyways? The implementation seems bogus, particularly if multiple windows are opened. Also this line doesn't seem quite right: launchingWorkbenchWindow = getWorkbench().getActiveWorkbenchWindow();. Why not use the first window where is no active window?
Created attachment 152555 [details] patch that removes ShellLifeCycleListener
Created attachment 152556 [details] mylyn/context/zip
(In reply to comment #1) > What is the purpose of the ShellLifeCycleListener anyways? The implementation > seems bogus, particularly if multiple windows are opened. This doesn't seem to do anything useful at all anymore. The ACTIVITY_STRUCTUREKIND_LIFECYCLE and the two deltas aren't used anywhere else in the code, so it seems that this is just dead code. > Also this line doesn't seem quite right: launchingWorkbenchWindow = > getWorkbench().getActiveWorkbenchWindow();. Why not use the first window where > is no active window? Yeah, using the first window should work here. Would have to confirm that this would have the same behavior though.
(In reply to comment #4) > (In reply to comment #1) > > What is the purpose of the ShellLifeCycleListener anyways? The implementation > > seems bogus, particularly if multiple windows are opened. > > This doesn't seem to do anything useful at all anymore. The > ACTIVITY_STRUCTUREKIND_LIFECYCLE and the two deltas aren't used anywhere else > in the code, so it seems that this is just dead code. Mik, can you confirm that this is safe to delete? > > Also this line doesn't seem quite right: launchingWorkbenchWindow = > > getWorkbench().getActiveWorkbenchWindow();. Why not use the first window where > > is no active window? > > Yeah, using the first window should work here. Would have to confirm that this > would have the same behavior though. The only place where this is used in Mylyn is the perspective manager. I don't even know if it's right that we only save/restore the perspective of the launching window. Shouldn't we manage all windows? It also doesn't seem right that we hold on to the launching window throughout the whole life cycle of MonitorUiPlugin. What if the user closes the window, shouldn't the reference be discarded (or can that never happen to the launching window)? We can try using the active window first if you think that is more accurate. I would thi
(In reply to comment #5) > > > Also this line doesn't seem quite right: launchingWorkbenchWindow = > > > getWorkbench().getActiveWorkbenchWindow();. Why not use the first window > where > > > is no active window? > > > > Yeah, using the first window should work here. Would have to confirm that > this > > would have the same behavior though. > > The only place where this is used in Mylyn is the perspective manager. I don't > even know if it's right that we only save/restore the perspective of the > launching window. Shouldn't we manage all windows? > > It also doesn't seem right that we hold on to the launching window throughout > the whole life cycle of MonitorUiPlugin. What if the user closes the window, > shouldn't the reference be discarded (or can that never happen to the launching > window)? > We can try using the active window first if you think that is more accurate. I > would thi I also see it used in the editor manager, but I assume that you have changed this with you changes to the editor mementos. I don't think that i have a problem with removing this, but it is API, so we will have to depreciate it for now.
Committed patch.
*** Bug 297583 has been marked as a duplicate of this bug. ***