Open reprogrammer opened 13 years ago
I changed org.eclipse.mylyn.internal.monitor.ui.ActivityContextManager.updateWorkingSetSelection()
to the following.
protected void updateWorkingSetSelection() {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
if (page != null)
workingSets = page.getWorkingSets();
}
}
});
}
Simply, I add the check if (page != null)
. Surprisingly, this change fixed the NPE exception. Note that this change is outside the org.eclipse.jdt.ui.tests.refactoring
and is inside the org.eclipse.mylyn.monitor.ui
. And, I have no idea why we didn't encounter this problem before. However, this change makes all the refactoring tests pass without throwing any exceptions.
I came across the same failing tests today. But, I couldn't find the source code of org.eclipse.mylyn.monitor.ui
plug-in to apply our patch to. I couldn't even find the bytecode of any class called ActivityContextManager
in my workspace. I have no idea why I couldn't find the class even though it's mentioned in the exception trace. We need to document the steps to checkout out the source code of this plug-in and applying the patch to it on the wiki page.
The following tests from
org.eclipse.jdt.ui.tests.refactoring.all.AllAllRefactoringTests
fail.org.eclipse.jdt.ui.tests.refactoring.ccp.CopyTest.testDestination_root_yes_1()
org.eclipse.jdt.ui.tests.refactoring.ccp.CopyTest.testCopy_Package_to_JavaProject_That_Is_Root()
org.eclipse.jdt.ui.tests.refactoring.ccp.CopyTest.testCopy_root_to_other_Java_project()
org.eclipse.jdt.ui.tests.refactoring.ccp.MoveTest.testDestination_no_packageToCu()
org.eclipse.jdt.ui.tests.refactoring.ccp.MoveTest.testDestination_no_sourceFolderToJavaProjecteWithNoSourceFolder()
The above tests fail with the following exception trace.