* Avoid creating a ClassNameHelper when turning caching off.

* When turning debug generation on, don't change opt level from -1 to 0.
This commit is contained in:
nboyd%atg.com 2002-02-07 17:54:57 +00:00
Родитель dca471f970
Коммит ef54ffb244
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -1244,7 +1244,7 @@ public class Context {
*/ */
public void setGeneratingDebug(boolean generatingDebug) { public void setGeneratingDebug(boolean generatingDebug) {
generatingDebugChanged = true; generatingDebugChanged = true;
if (generatingDebug) if (generatingDebug && getOptimizationLevel() > 0)
setOptimizationLevel(0); setOptimizationLevel(0);
this.generatingDebug = generatingDebug; this.generatingDebug = generatingDebug;
} }
@ -1618,9 +1618,8 @@ public class Context {
if (isCachingEnabled && !cachingEnabled) { if (isCachingEnabled && !cachingEnabled) {
// Caching is being turned off. Empty caches. // Caching is being turned off. Empty caches.
JavaMembers.classTable = new Hashtable(); JavaMembers.classTable = new Hashtable();
ClassNameHelper nameHelper = getNameHelper(); if (savedNameHelper != null)
if (nameHelper != null) savedNameHelper.reset();
nameHelper.reset();
} }
isCachingEnabled = cachingEnabled; isCachingEnabled = cachingEnabled;
FunctionObject.setCachingEnabled(cachingEnabled); FunctionObject.setCachingEnabled(cachingEnabled);