Repository: groovy Updated Branches: refs/heads/master 650c16c58 -> d4e792523
formatting Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a3ed9d48 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a3ed9d48 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a3ed9d48 Branch: refs/heads/master Commit: a3ed9d482381f8ea0e6a9efd16c35028c66791e0 Parents: 650c16c Author: Paul King <[email protected]> Authored: Sun Apr 1 23:09:29 2018 +1000 Committer: Paul King <[email protected]> Committed: Sun Apr 1 23:40:33 2018 +1000 ---------------------------------------------------------------------- .../runtime/metaclass/MetaClassRegistryImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/a3ed9d48/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java index ff30a2b..2914d02 100644 --- a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java +++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java @@ -513,22 +513,22 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{ public void onModule(final ExtensionModule module) { if (moduleRegistry.hasModule(module.getName())) { - ExtensionModule loadedModule = moduleRegistry.getModule(module.getName()); - if (loadedModule.getVersion().equals(module.getVersion())) { - // already registered - return; - } else { - throw new GroovyRuntimeException("Conflicting module versions. Module ["+module.getName()+" is loaded in version "+ - loadedModule.getVersion()+" and you are trying to load version "+module.getVersion()); + ExtensionModule loadedModule = moduleRegistry.getModule(module.getName()); + if (loadedModule.getVersion().equals(module.getVersion())) { + // already registered + return; + } else { + throw new GroovyRuntimeException("Conflicting module versions. Module [" + module.getName() + " is loaded in version " + + loadedModule.getVersion() + " and you are trying to load version " + module.getVersion()); + } } - } moduleRegistry.addModule(module); // register MetaMethods List<MetaMethod> metaMethods = module.getMetaMethods(); for (MetaMethod metaMethod : metaMethods) { CachedClass cachedClass = metaMethod.getDeclaringClass(); List<MetaMethod> methods = map.get(cachedClass); - if (methods==null) { + if (methods == null) { methods = new ArrayList<MetaMethod>(4); map.put(cachedClass, methods); }
