From 9fc3ee97a485b2eb599eed0b08c06b5691712cbe Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 12 Jan 2016 14:15:29 -0500 Subject: [PATCH] MergeOp: Hold onto timestamp from submissionId Although we've been moving away from instance state in MergeOp, we still need the submissionId for logging purposes. This was already grabbing a timestamp; hold onto that so we can later use it in constructing BatchUpdates. Change-Id: Ic6d52fcfea271a4c80e15528c81a10b9e06c3207 --- .../main/java/com/google/gerrit/server/git/MergeOp.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java index 77c9a41c88..f9902b223f 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java @@ -274,7 +274,7 @@ public class MergeOp implements AutoCloseable { } MACHINE_ID = id; } - private String staticSubmissionId; + private Timestamp ts; private String submissionId; private ReviewDb db; @@ -467,9 +467,9 @@ public class MergeOp implements AutoCloseable { Hasher h = Hashing.sha1().newHasher(); h.putLong(Thread.currentThread().getId()) .putUnencodedChars(MACHINE_ID); - staticSubmissionId = h.hash().toString().substring(0, 8); - submissionId = change.getId().get() + "-" + TimeUtil.nowMs() + - "-" + staticSubmissionId; + ts = TimeUtil.nowTs(); + submissionId = change.getId().get() + "-" + ts.getTime() + + "-" + h.hash().toString().substring(0, 8); } public void merge(ReviewDb db, Change change, IdentifiedUser caller,