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 [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C89F2160C15 for ; Wed, 3 Jan 2018 10:28:53 +0100 (CET) Received: (qmail 49822 invoked by uid 500); 3 Jan 2018 09:28:53 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 49813 invoked by uid 99); 3 Jan 2018 09:28:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2018 09:28:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1378DFD7B; Wed, 3 Jan 2018 09:28:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Message-Id: <1ce0664c2ceb4a0daf7e59a5de3c47b7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Fix `ExceptionInInitializerError` of ProxyGenerator Date: Wed, 3 Jan 2018 09:28:49 +0000 (UTC) archived-at: Wed, 03 Jan 2018 09:28:54 -0000 Repository: groovy Updated Branches: refs/heads/master 3ca2577b9 -> cd03070c8 Fix `ExceptionInInitializerError` of ProxyGenerator Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/cd03070c Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/cd03070c Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/cd03070c Branch: refs/heads/master Commit: cd03070c8945361bd804af30267aa688ac283c28 Parents: 3ca2577 Author: sunlan Authored: Wed Jan 3 17:26:00 2018 +0800 Committer: sunlan Committed: Wed Jan 3 17:26:52 2018 +0800 ---------------------------------------------------------------------- src/main/groovy/groovy/util/ProxyGenerator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/cd03070c/src/main/groovy/groovy/util/ProxyGenerator.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/ProxyGenerator.java b/src/main/groovy/groovy/util/ProxyGenerator.java index 63c0311..ff4c1d5 100644 --- a/src/main/groovy/groovy/util/ProxyGenerator.java +++ b/src/main/groovy/groovy/util/ProxyGenerator.java @@ -55,8 +55,6 @@ public class ProxyGenerator { private static final Map EMPTY_CLOSURE_MAP = Collections.emptyMap(); private static final Set EMPTY_KEYSET = Collections.emptySet(); - public static final ProxyGenerator INSTANCE = new ProxyGenerator(); // TODO should we make ProxyGenerator singleton? - static { // wrap the standard MetaClass with the delegate setMetaClass(GroovySystem.getMetaClassRegistry().getMetaClass(ProxyGenerator.class)); @@ -66,8 +64,10 @@ public class ProxyGenerator { private boolean debug = false; private boolean emptyMethods = false; - private static final String GROOVY_ADAPTER_CACHE_DEFAULT_SIZE_OPT = "groovy.adapter.cache.default.size"; - private static final Integer GROOVY_ADAPTER_CACHE_DEFAULT_SIZE = Integer.getInteger(GROOVY_ADAPTER_CACHE_DEFAULT_SIZE_OPT, 16); + private static final Integer GROOVY_ADAPTER_CACHE_DEFAULT_SIZE = Integer.getInteger("groovy.adapter.cache.default.size", 16); + + public static final ProxyGenerator INSTANCE = new ProxyGenerator(); // TODO should we make ProxyGenerator singleton? + /** * The adapter cache is used to cache proxy classes. When, for example, a call like: * map as MyClass is found, then a lookup is made into the cache to find if a suitable