From notifications-return-1500-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Aug 21 12:34:56 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7E3C1180607 for ; Wed, 21 Aug 2019 14:34:56 +0200 (CEST) Received: (qmail 66598 invoked by uid 500); 21 Aug 2019 12:34:56 -0000 Mailing-List: contact notifications-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list notifications@zookeeper.apache.org Received: (qmail 66589 invoked by uid 99); 21 Aug 2019 12:34:55 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2019 12:34:55 +0000 From: GitBox To: notifications@zookeeper.apache.org Subject: [GitHub] [zookeeper] symat commented on issue #1056: ZOOKEEPER-3495: fix SnapshotDigestTest to work with JDK12+ Message-ID: <156639089588.8812.182226134414653273.gitbox@gitbox.apache.org> Date: Wed, 21 Aug 2019 12:34:55 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit symat commented on issue #1056: ZOOKEEPER-3495: fix SnapshotDigestTest to work with JDK12+ URL: https://github.com/apache/zookeeper/pull/1056#issuecomment-523436622 > Also DigestCalculator is not only used in DataTree, it will also being used in PrepRequestProcessor ... Thanks for pointing this out! Let's wait for your PR to be submitted / merged, before finalizing this one. Can you link the jira ticket / PR here? > The DIGEST_VERSION is made to be static final to make sure it won't be changed in code with things like setVersion. I think with the solution proposed by @anmolnar it is still possible to keep the DIGEST_VERSION to be static final and make it impossible to change it from the code accidentally. We only create a default constructor for `DataTree`, injecting the static final DigestCalculator singleton. While for some tests, we can create a `DataTree` with a mocked DigestCalculator. (I think this approach is cleaner in terms of object-oriented design patterns, as the DigestCalculator is actually a dependency of the DataTree, but it is hidden in the current implementation.) I will submit a new commit here, trying out @anmolnar's proposal, then we can see if everyone likes it or not :) - but let's wait with the merge until I merged with @lvfangmin's change... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services