Merge branch 'stable-3.8' into stable-3.9 * stable-3.8: ChangesByProjectCacheImpl: Fix PATCH_SET_ID typo ChangesByProjectCacheImpl: Remove unused import ChangesByProjectCacheImpl: Fix typo with originalSubject Change: Consistently apply @Nullable Change-Id: Ie02629188776259e2d93699861a363e7d401a8ba Release-Notes: skip
diff --git a/java/com/google/gerrit/entities/Change.java b/java/com/google/gerrit/entities/Change.java index fad3aa8..3ad7e03 100644 --- a/java/com/google/gerrit/entities/Change.java +++ b/java/com/google/gerrit/entities/Change.java
@@ -434,7 +434,7 @@ private Id changeId; /** ServerId of the Gerrit instance that has created the change */ - private String serverId; + @Nullable private String serverId; /** Globally assigned unique identifier of the change */ private Key changeKey; @@ -545,7 +545,8 @@ * ServerId of the Gerrit instance that created the change. It could be null when the change is * not fetched from NoteDb but obtained through protobuf deserialisation. */ - public @Nullable String getServerId() { + @Nullable + public String getServerId() { return serverId; } @@ -607,6 +608,7 @@ return originalSubject != null ? originalSubject : subject; } + @Nullable public String getOriginalSubjectOrNull() { return originalSubject; } @@ -652,6 +654,7 @@ originalSubject = null; } + @Nullable public String getSubmissionId() { return submissionId; } @@ -684,6 +687,7 @@ return isAbandoned() || isMerged(); } + @Nullable public String getTopic() { return topic; } @@ -720,10 +724,12 @@ this.revertOf = revertOf; } + @Nullable public Id getRevertOf() { return this.revertOf; } + @Nullable public PatchSet.Id getCherryPickOf() { return cherryPickOf; }
diff --git a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java index 66c63c6..cb4fcff 100644 --- a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java +++ b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
@@ -24,7 +24,6 @@ import com.google.gerrit.entities.Project; import com.google.gerrit.server.ReviewerSet; import com.google.gerrit.server.cache.CacheModule; -import com.google.gerrit.server.git.ChangesByProjectCache.UseIndex; import com.google.gerrit.server.index.change.ChangeField; import com.google.gerrit.server.logging.Metadata; import com.google.gerrit.server.logging.TraceContext; @@ -301,7 +300,9 @@ size += JavaWeights.REFERENCE + (c.getTopic() == null ? 0 : c.getTopic().length()); size += JavaWeights.REFERENCE - + (c.getOriginalSubject().equals(c.getSubject()) ? 0 : c.getSubject().length()); + + (c.getOriginalSubject().equals(c.getSubject()) + ? 0 + : c.getOriginalSubject().length()); size += JavaWeights.REFERENCE + (c.getSubmissionId() == null ? 0 : c.getSubmissionId().length()); size += JavaWeights.REFERENCE + JavaWeights.BOOLEAN; // isPrivate; @@ -309,7 +310,7 @@ size += JavaWeights.REFERENCE + JavaWeights.BOOLEAN; // reviewStarted; size += JavaWeights.REFERENCE + (c.getRevertOf() == null ? 0 : GerritWeights.CHANGE_NUM); size += - JavaWeights.REFERENCE + (c.getCherryPickOf() == null ? 0 : GerritWeights.PACTCH_SET_ID); + JavaWeights.REFERENCE + (c.getCherryPickOf() == null ? 0 : GerritWeights.PATCH_SET_ID); return size; } @@ -343,7 +344,7 @@ public static final int KEY_INT = JavaWeights.OBJECT + JavaWeights.INT; // IntKey public static final int CHANGE_NUM = KEY_INT; public static final int ACCOUNT_ID = KEY_INT; - public static final int PACTCH_SET_ID = + public static final int PATCH_SET_ID = JavaWeights.OBJECT + (JavaWeights.REFERENCE + GerritWeights.CHANGE_NUM) // PatchSet.Id.changeId + JavaWeights.INT; // PatchSet.Id patch_num;