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 <[email protected]> Authored: Wed Jan 3 17:26:00 2018 +0800 Committer: sunlan <[email protected]> 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<Object,Object> EMPTY_CLOSURE_MAP = Collections.emptyMap(); private static final Set<String> 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
