RecordId keyId = segment.readRecordId(getOffset(8));
final String key = segment.readString(keyId);
final RecordId value = segment.readRecordId(getOffset(8, 1));
MapRecord base = new MapRecord(segment.readRecordId(getOffset(8, 2)));
boolean rv = base.compare(before, new DefaultNodeStateDiff() {
@Override
public boolean childNodeAdded(String name, NodeState after) {
return name.equals(key)
|| diff.childNodeAdded(name, after);
}
@Override
public boolean childNodeChanged(
String name, NodeState before, NodeState after) {
return name.equals(key)
|| diff.childNodeChanged(name, before, after);
}
@Override
public boolean childNodeDeleted(String name, NodeState before) {
return diff.childNodeDeleted(name, before);
}
});
if (rv) {
MapEntry beforeEntry = before.getEntry(key);
if (beforeEntry == null) {
rv = diff.childNodeAdded(
key,
new SegmentNodeState(value));
} else if (!value.equals(beforeEntry.getValue())) {
rv = diff.childNodeChanged(
key,
beforeEntry.getNodeState(),
new SegmentNodeState(value));
}
}
return rv;
}
Segment beforeSegment = before.getSegment();
int beforeHead = beforeSegment.readInt(before.getOffset(0));
if (isDiff(beforeHead)) {
int hash = beforeSegment.readInt(before.getOffset(4));
RecordId keyId = beforeSegment.readRecordId(before.getOffset(8));
final String key = beforeSegment.readString(keyId);
final RecordId value = beforeSegment.readRecordId(before.getOffset(8, 1));
MapRecord base = new MapRecord(beforeSegment.readRecordId(before.getOffset(8, 2)));
boolean rv = this.compare(base, new DefaultNodeStateDiff() {
@Override
public boolean childNodeAdded(String name, NodeState after) {
return diff.childNodeAdded(name, after);
}
@Override