Browse Source

Don't serialize internal hash collision chain link

ObjectId is serializable, and so are its subtypes. Ensure that
serialization does not follow the hash collision chain internal to the
ObjectIdOwnerMap, otherwise completely unrelated objects may get
serialized when a RevObject is serialized.

Note that serializing a RevCommit or RevTag may serialize quite a few
objects due to the parent/object links they contain. A user has no real
control over how many objects will be written when a RevCommit is
serialized. C.f [1]. This change does not resolve that, but in any case
this internal hash collision chain link should not participate in
serialization.

[1] https://github.com/gitblit/gitblit/pull/1141

Change-Id: Ice331a9dc80a59ca360fcc04adaff8b5e750d847
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
stable-4.6
Thomas Wolf 8 years ago
parent
commit
d0023c3c8f
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java

2
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java

@ -341,7 +341,7 @@ public class ObjectIdOwnerMap<V extends ObjectIdOwnerMap.Entry>
/** Type of entry stored in the {@link ObjectIdOwnerMap}. */
public static abstract class Entry extends ObjectId {
Entry next;
transient Entry next;
/**
* Initialize this entry with a specific ObjectId.

Loading…
Cancel
Save