DESCRIPTION

Update equals() and hashCode() in GitModelCommit

Bug: 323201
Change-Id: I3ca7cc79ea47f9a735d7be57d99a4776dc1d4489
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Jaylon Avila
date: 2010-08-20 18:14:56.000000000

Patch Set 1: (2 inline comments)

It feels to me like the code is susceptible to NPEs. From looking at the class, getBaseSha1() also looks like it's susceptible to NPEs so I'd expect NPEs to also be thrown in getKind().

Is it actually realistic for 'baseCommit' to be 'null' or should it "never" be 'null'?

Line:168, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> It seems like an NPE can occur here. In GitModelCommit's constructors, there is a code path where the 'baseCommit' field is set to 'null'.

Line:181, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> It seems like an NPE can occur here. In GitModelCommit's constructors, there is a code path where the 'baseCommit' field is set to 'null'.

-------------------------------------
author: Leslie Stephenson
date: 2010-08-20 18:39:03.000000000

Patch Set 1:

Indeed 'baseCommit' can be null, but this can only happen when remote commit has no parents. AFAIK in git there is only one commit object that has no parents, it is a initial commit. But yes, we should check here for null.

-------------------------------------
