Community
Participate
Working Groups
egit version: 562b88498 jgit version: 8d761febc eclipse.buildId=I20100608-0911 java.version=1.6.0_20 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.platform.ide Command-line arguments: -product org.eclipse.platform.ide -data /Users/d029788/Documents/workspace/egit/../runtime-New_configuration -dev file:/Users/d029788/Documents/workspace/egit/.metadata/.plugins/org.eclipse.pde.core/EGit/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog - clone jgit - change one jgit source file and commit the change - Team > Synchronize - the changeset containing this change is shown properly - drill down to file which has been changed in Synchronize view - double click on the changed file in Synchronize view - NPE is thrown - do another change and repeat the sequence on this change -> no NPE is thrown Error Mon Aug 16 00:43:00 CEST 2010 An internal error occurred during: "Initializing Compare Editor". java.lang.NullPointerException at org.eclipse.jgit.util.RawParseUtils.author(RawParseUtils.java:549) at org.eclipse.jgit.revwalk.RevCommit.getAuthorIdent(RevCommit.java:303) at org.eclipse.egit.core.internal.storage.CommitFileRevision.<init>(CommitFileRevision.java:59) at org.eclipse.egit.core.internal.storage.GitFileRevision.inCommit(GitFileRevision.java:50) at org.eclipse.egit.ui.internal.CompareUtils.getFileRevision(CompareUtils.java:110) at org.eclipse.egit.ui.internal.CompareUtils.getFileRevisionTypedElement(CompareUtils.java:73) at org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob.getRight(GitModelBlob.java:114) at org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob.prepareInput(GitModelBlob.java:141) at org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput.prepareCompareInput(ModelCompareEditorInput.java:121) at org.eclipse.team.ui.synchronize.SaveableCompareEditorInput.prepareInput(SaveableCompareEditorInput.java:235) at org.eclipse.compare.CompareEditorInput.run(CompareEditorInput.java:483) at org.eclipse.compare.internal.CompareUIPlugin.prepareInput(CompareUIPlugin.java:548) at org.eclipse.compare.internal.CompareEditor$2.run(CompareEditor.java:349) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
I've investigate it and it appears that this NPE occurs for all files that are associated with oldest commit that is included in change set.
*** Bug 322920 has been marked as a duplicate of this bug. ***
From my point of view this look like a bug in JGit. For some strange reasons JGit lost some data in RevCommit object. From my investigations appears that sometime: revCommit.getParrent(0).getAuthorIdent() throws NPE but calling: revCommit.getParrent(0).getId() on same object return commit SHA-1 Quick fix for this seems to be re-parsing revCommit object, so I've add this to GitCommiModel constructor. Check does all baseCommit's has author indent and it appears to be working ... but while calling Compare View NPE still occur. Even that all baseCommit's was re-parsed in GitModelObject constructor. Finally, the true quick fix for this would be replacing simple getBaseCommit() in GitModelBlob.getRight() with RevWalk.parseCommit(getBaseCommit()). With this approach NPE doesn't occur any more but this is rather workaround then true fix.
(In reply to comment #3) > From my point of view this look like a bug in JGit. For some strange reasons > JGit lost some data in RevCommit object. From my investigations appears that > sometime: > revCommit.getParrent(0).getAuthorIdent() > throws NPE but calling: > revCommit.getParrent(0).getId() > on same object return commit SHA-1 > > Quick fix for this seems to be re-parsing revCommit object, so I've add this to > GitCommiModel constructor. Check does all baseCommit's has author indent and it > appears to be working ... but while calling Compare View NPE still occur. Even > that all baseCommit's was re-parsed in GitModelObject constructor. > > Finally, the true quick fix for this would be replacing simple getBaseCommit() > in GitModelBlob.getRight() with RevWalk.parseCommit(getBaseCommit()). With this > approach NPE doesn't occur any more but this is rather workaround then true > fix. Send an email to jgit-dev and file a bug against JGit.
This patch should fix this: http://egit.eclipse.org/r/1339
Fixed with ff88637c69af6e114c3d8c722681f655943dfe23 Thanks Dariusz!
*** Bug 322498 has been marked as a duplicate of this bug. ***