Make ObjectToPack clearReuseAsIs signal available to subclasses
A subclass may want to use this method to release handles that are caching reuse information. Make it protected so they can override it and update themselves. Change-Id: I2277a56ad28560d2d2d97961cbc74bc7405a70d4 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
4569d77e13
commit
699e4aa7c5
|
@ -62,6 +62,12 @@ class LocalObjectToPack extends ObjectToPack {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void clearReuseAsIs() {
|
||||||
|
super.clearReuseAsIs();
|
||||||
|
pack = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void select(StoredObjectRepresentation ref) {
|
public void select(StoredObjectRepresentation ref) {
|
||||||
LocalObjectRepresentation ptr = (LocalObjectRepresentation) ref;
|
LocalObjectRepresentation ptr = (LocalObjectRepresentation) ref;
|
||||||
|
|
|
@ -199,7 +199,14 @@ void setReuseAsIs() {
|
||||||
flags |= REUSE_AS_IS;
|
flags |= REUSE_AS_IS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearReuseAsIs() {
|
/**
|
||||||
|
* Forget the reuse information previously stored.
|
||||||
|
* <p>
|
||||||
|
* Implementations may subclass this method, but they must also invoke the
|
||||||
|
* super version with {@code super.clearReuseAsIs()} to ensure the flag is
|
||||||
|
* properly cleared for the writer.
|
||||||
|
*/
|
||||||
|
protected void clearReuseAsIs() {
|
||||||
flags &= ~REUSE_AS_IS;
|
flags &= ~REUSE_AS_IS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue