/** * Set whether to cache some values. * * <p>By default, the engine will cache the results of <tt>Class.getMethods()</tt> and similar * calls. This can speed execution dramatically, but increases the memory footprint. Also, with * caching enabled, references may be held to objects past the lifetime of any real usage. * * <p>If caching is enabled and this method is called with a <code>false</code> argument, the * caches will be emptied. * * <p>Caching is enabled by default. * * @param enabled if true, caching is enabled * @see #clearCaches() */ public synchronized void setCachingEnabled(boolean enabled) { if (enabled == cachingIsEnabled) return; if (!enabled) clearCaches(); cachingIsEnabled = enabled; }