ChangeNotesState: Remove redundant revertOf field

This is a @Column in Change and thus belongs in ChangeColumns. In
ChangeNotes#create it reuses the same value in both places, so they
should always be equal, modulo missing ChangeColumns, in which case the
field in ChangeNotesState should never be accessed.

Change-Id: I63eb5acdcd6c47ea2ceea7d830d5b5b6e4b28d2f
This commit is contained in:
Dave Borowitz
2018-05-02 09:05:11 -04:00
parent bc4757f740
commit c92b828746
2 changed files with 2 additions and 7 deletions

View File

@@ -679,7 +679,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
}
public Change.Id getRevertOf() {
return state.revertOf();
return state.columns().revertOf();
}
public boolean hasReviewStarted() {

View File

@@ -75,7 +75,6 @@ public abstract class ChangeNotesState {
ImmutableList.of(),
ImmutableListMultimap.of(),
ImmutableListMultimap.of(),
null,
null);
}
@@ -147,8 +146,7 @@ public abstract class ChangeNotesState {
ImmutableList.copyOf(allChangeMessages),
ImmutableListMultimap.copyOf(changeMessagesByPatchSet),
ImmutableListMultimap.copyOf(publishedComments),
readOnlyUntil,
revertOf);
readOnlyUntil);
}
/**
@@ -244,9 +242,6 @@ public abstract class ChangeNotesState {
@Nullable
abstract Timestamp readOnlyUntil();
@Nullable
abstract Change.Id revertOf();
Change newChange(Project.NameKey project) {
ChangeColumns c = checkNotNull(columns(), "columns are required");
Change change =