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:
@@ -679,7 +679,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Change.Id getRevertOf() {
|
public Change.Id getRevertOf() {
|
||||||
return state.revertOf();
|
return state.columns().revertOf();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasReviewStarted() {
|
public boolean hasReviewStarted() {
|
||||||
|
@@ -75,7 +75,6 @@ public abstract class ChangeNotesState {
|
|||||||
ImmutableList.of(),
|
ImmutableList.of(),
|
||||||
ImmutableListMultimap.of(),
|
ImmutableListMultimap.of(),
|
||||||
ImmutableListMultimap.of(),
|
ImmutableListMultimap.of(),
|
||||||
null,
|
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,8 +146,7 @@ public abstract class ChangeNotesState {
|
|||||||
ImmutableList.copyOf(allChangeMessages),
|
ImmutableList.copyOf(allChangeMessages),
|
||||||
ImmutableListMultimap.copyOf(changeMessagesByPatchSet),
|
ImmutableListMultimap.copyOf(changeMessagesByPatchSet),
|
||||||
ImmutableListMultimap.copyOf(publishedComments),
|
ImmutableListMultimap.copyOf(publishedComments),
|
||||||
readOnlyUntil,
|
readOnlyUntil);
|
||||||
revertOf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,9 +242,6 @@ public abstract class ChangeNotesState {
|
|||||||
@Nullable
|
@Nullable
|
||||||
abstract Timestamp readOnlyUntil();
|
abstract Timestamp readOnlyUntil();
|
||||||
|
|
||||||
@Nullable
|
|
||||||
abstract Change.Id revertOf();
|
|
||||||
|
|
||||||
Change newChange(Project.NameKey project) {
|
Change newChange(Project.NameKey project) {
|
||||||
ChangeColumns c = checkNotNull(columns(), "columns are required");
|
ChangeColumns c = checkNotNull(columns(), "columns are required");
|
||||||
Change change =
|
Change change =
|
||||||
|
Reference in New Issue
Block a user