- 
        Couldn't load subscription status. 
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
SPT Developer opened SPR-9389 and commented
"FreeMarkerConfigurationFactory.createConfiguration()" uses instance variable "templateLoaders" (List).
This method adds loaders to "templateLoaders" directly.
if (this.preTemplateLoaders != null) {
    this.templateLoaders.addAll(this.preTemplateLoaders); // Line 298
}
...
If I call this method many times, "templateLoaders" contains great number of same loader.
I think, local variable is need for loaders.
  List<TemplateLoader> templateLoaders = new ArrayList<TemplateLoader>();
    templateLoaders.addAll(this.templateLoaders);
  
    if (this.preTemplateLoaders != null) {
!           templateLoaders.addAll(this.preTemplateLoaders);
}
...
Thank you for your consideration.
Affects: 3.0.3
Backported to: 3.1.4
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug