FileTemplate (@NotNull @NonNls String templateName) { FileTemplateBase template = getSettings().getInternalTemplatesManager().findTemplateByName(templateName); if (template == null) { // todo: review the hack and try to get rid of this weird logic completely template = getSettings().getDefaultTemplatesManager().findTemplateByName(templateName); } return template; }