File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
grails-scaffolding/src/main/groovy/grails/plugin/scaffolding Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ class ScaffoldingViewResolver extends GroovyPageViewResolver implements Resource
8585 this . templateOverridePluginDescriptor = templateOverridePluginDescriptor
8686 }
8787
88+ private static final Object NULL_SCAFFOLD_VALUE = new Object ()
89+
8890 ResourceLoader resourceLoader
8991 protected Map<String , View > generatedViewCache = new ConcurrentHashMap<> ()
9092 protected Map<Class , Object > scaffoldValueCache = new ConcurrentHashMap<> ()
@@ -209,7 +211,8 @@ class ScaffoldingViewResolver extends GroovyPageViewResolver implements Resource
209211 // Cache the scaffold value to avoid repeated reflection
210212 Class controllerClazz = controllerClass. clazz
211213 if (scaffoldValueCache. containsKey(controllerClazz)) {
212- return scaffoldValueCache. get(controllerClazz)
214+ Object cached = scaffoldValueCache. get(controllerClazz)
215+ return cached == NULL_SCAFFOLD_VALUE ? null : cached
213216 }
214217
215218 def scaffoldValue = controllerClass. getPropertyValue(' scaffold' )
@@ -222,7 +225,7 @@ class ScaffoldingViewResolver extends GroovyPageViewResolver implements Resource
222225 }
223226
224227 // Cache the result (even if null, to avoid repeated lookups)
225- scaffoldValueCache. put(controllerClazz, scaffoldValue)
228+ scaffoldValueCache. put(controllerClazz, scaffoldValue == null ? NULL_SCAFFOLD_VALUE : scaffoldValue )
226229 return scaffoldValue
227230 }
228231
You can’t perform that action at this time.
0 commit comments