Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] NPE in getAuthorIdent() on parsed RevCommit object

Hi all,

In EGit synchronization we have strange problem with
RevCommit.getAuthorIdent(). It occurs *only* on oldest commit that is
include in Synchronization view.

First thing that I've discover was, that
remoteCommit.getParent(0).getAuthorIdent() in some cases was throw NPE
even that remoteCommit.getParent(0).getId() returns proper value.
Therefore I've use RevWalk.parseCommit(remoteCommit.getParrent(0)) to
re-parse commit object. After re-parsing getAuthorIdent() returns
proper value (there were no more NPE). Reference to remote commit
parent is stored in private final field so that it can be obtained in
various place of synchronization.

But re-parsing commit object didn't solve this problem. NPE was still
thrown in same place! For some reasons reference to author ident is
lost before we achieve this trouble spot. Currently I come up with
workaround for this issue by re-parsing commit exactly in trouble spot
but this isn't efficient.

I've also raise a bug[1] for this strange behavior.

Thanks in advance for any help!

1. https://bugs.eclipse.org/bugs/show_bug.cgi?id=322935
-- 
Best regards

GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza


Back to the top