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