Community
Participate
Working Groups
1.1.0.201109151100-r. A compare editor opened from the Synchronize view does not show the right author on the right side if Team > [x] Show the file author in compare editors is enabled. Instead it throws and NPE: !ENTRY org.eclipse.core.jobs 4 2 2011-09-21 12:51:49.678 !MESSAGE An internal error occurred during: "Updating Compare Editor". !STACK 0 java.lang.NullPointerException at org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement.fetchAuthor(LocalResourceTypedElement.java:383) at org.eclipse.team.internal.ui.mapping.ResourceDiffCompareInput.updateAuthorInfo(ResourceDiffCompareInput.java:357) at org.eclipse.team.internal.ui.mapping.ResourceCompareInputChangeNotifier.fetchAuthors(ResourceCompareInputChangeNotifier.java:327) at org.eclipse.team.internal.ui.mapping.ResourceCompareInputChangeNotifier$3.run(ResourceCompareInputChangeNotifier.java:321) at org.eclipse.team.internal.core.BackgroundEventHandler$RunnableEvent.run(BackgroundEventHandler.java:176) at org.eclipse.team.internal.ui.mapping.CompareInputChangeNotifier$InputChangeEventHandler.executeRunnableNow(CompareInputChangeNotifier.java:146) at org.eclipse.team.internal.ui.mapping.CompareInputChangeNotifier$InputChangeEventHandler.doDispatchEvents(CompareInputChangeNotifier.java:101) at org.eclipse.team.internal.core.BackgroundEventHandler.dispatchEvents(BackgroundEventHandler.java:394) at org.eclipse.team.internal.core.BackgroundEventHandler.processEvents(BackgroundEventHandler.java:374) at org.eclipse.team.internal.core.BackgroundEventHandler$1.run(BackgroundEventHandler.java:203) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Might be a Platform Team bug.
(In reply to comment #1) > Might be a Platform Team bug. Confirmed. The API for withAllProperties(*) specs that 'null' is a valid return value. As an aside, it doesn't spec when a CoreException should be thrown. ------------------ revision= revision.withAllProperties(monitor); author= revision.getAuthor();
Tomek, could you or Gosia look at it?
It looks like this statement "NOTE: Must not check for revision#isPropertyMissing() as this will always return true for the workspace file revision"[1] is not quite for local revisions used in EGit. I would fix it on both sides: in Team, to be prepared for nulls and in EGit to return this when #withAllProperties is called for local revisions. What do you think Remy? [1] org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement.fetchAuthor(IProgressMonitor)
(In reply to comment #4) > I would fix it > on both sides: in Team, to be prepared for nulls and in EGit to return this > when #withAllProperties is called for local revisions. Yes, I also noticed this problem while looking at this code yesterday. It's likely we should return something valid instead of 'null'. There might be a reason for this but I'd have to check the history in more detail.
Created attachment 203903 [details] Fix v01 On second thought, EGit seems to be fine, it returns false when asked if any property is missing (#isPropertyMissing), meaning the revision is complete. So Team should not ask for other properties (#withAllProperties).
Created attachment 203904 [details] mylyn/context/zip
Fixed with http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=8afabc748e2b34711690564a9b390a43c3f5a295, a slightly modified Fix v01. Available in builds >= N20110926-2000.
> Available in builds >= N20110926-2000. Not really ;-).
Right, my bad, it's in I20110927-0800. I forgot to update the map file for said n-build (bug 359030). I've also filed bug 359071 against EGit for the missing author.
Verified that the NPE is gone.