commit | 6ed6670d6619e68d7d4acaf8b252b5202b470e38 | [log] [tgz] |
---|---|---|
author | sbegaudeau <stephane.begaudeau@obeo.fr> | Wed May 14 17:51:43 2014 +0200 |
committer | sbegaudeau <stephane.begaudeau@obeo.fr> | Wed May 14 17:51:43 2014 +0200 |
tree | 877f516fc76b260099b83b314460170fa373a844 | |
parent | caf4397b6db4fd4ee984ef42d6e4075fccea90e4 [diff] |
Improve performances for dynamic modules. Change-Id: I65825e62c837d313dfb1d40be02dbcef8153301e
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java index 2f0b076..db82d86 100644 --- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java +++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java
@@ -46,6 +46,7 @@ import org.eclipse.acceleo.engine.AcceleoEngineMessages; import org.eclipse.acceleo.engine.AcceleoEnginePlugin; import org.eclipse.acceleo.engine.AcceleoEvaluationException; +import org.eclipse.acceleo.engine.internal.utils.AcceleoDynamicTemplatesEclipseUtil; import org.eclipse.acceleo.engine.service.AcceleoDynamicTemplatesRegistry; import org.eclipse.acceleo.engine.service.AcceleoModulePropertiesAdapter; import org.eclipse.acceleo.model.mtl.Module; @@ -930,7 +931,7 @@ * Maps dynamic overriding templates for smoother polymorphic resolution. */ private void mapDynamicOverrides() { - if (AcceleoDynamicTemplatesRegistry.INSTANCE.getRegisteredModules().isEmpty()) { + if (!AcceleoDynamicTemplatesEclipseUtil.hasDynamicModulesDescriptors()) { return; }
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/utils/AcceleoDynamicTemplatesEclipseUtil.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/utils/AcceleoDynamicTemplatesEclipseUtil.java index 14af8a0..71dd377 100644 --- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/utils/AcceleoDynamicTemplatesEclipseUtil.java +++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/utils/AcceleoDynamicTemplatesEclipseUtil.java
@@ -96,6 +96,15 @@ } /** + * Returns <code>true</code> if there are some bundles providing dynamic templates. + * + * @return <code>true</code> if there are some bundles providing dynamic templates. + */ + public static boolean hasDynamicModulesDescriptors() { + return EXTENDING_BUNDLES.size() > 0; + } + + /** * Returns all registered modules. The returned set is a copy of this instance's. * * @param generatorID