Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
james-yong committed Jan 12, 2021
1 parent 3795727 commit 3c83ab5
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -37,7 +37,7 @@ public final class MultiBlockHtmlTemplateUtil {

private static final String MODULE = MultiBlockHtmlTemplateUtil.class.getName();
public static final String FTL_WRITER = "WriterForFTL";
private static final String SCRIPT_LINKS_FOR_FOOT = "ScriptLinksForFoot";
private static final String SCRIPT_LINKS_FOR_BODY_END = "ScriptLinksForBodyEnd";
private static int maxScriptCacheSizePerUserSession = 15;
private static int estimatedConcurrentUserSessions = 250;
/**
Expand All @@ -61,11 +61,11 @@ private MultiBlockHtmlTemplateUtil() { }
* @param filePath
*/
public static void addScriptLinkForFoot(final HttpServletRequest request, final String filePath) {
Set<String> scriptLinks = UtilGenerics.cast(request.getAttribute(SCRIPT_LINKS_FOR_FOOT));
Set<String> scriptLinks = UtilGenerics.cast(request.getAttribute(SCRIPT_LINKS_FOR_BODY_END));
if (scriptLinks == null) {
// use of LinkedHashSet to maintain insertion order
scriptLinks = new LinkedHashSet<>();
request.setAttribute(SCRIPT_LINKS_FOR_FOOT, scriptLinks);
request.setAttribute(SCRIPT_LINKS_FOR_BODY_END, scriptLinks);
}
scriptLinks.add(filePath);
}
Expand All @@ -76,7 +76,7 @@ public static void addScriptLinkForFoot(final HttpServletRequest request, final
* @return
*/
public static Set<String> getScriptLinksForFoot(HttpServletRequest request) {
Set<String> scriptLinks = UtilGenerics.cast(request.getAttribute(SCRIPT_LINKS_FOR_FOOT));
Set<String> scriptLinks = UtilGenerics.cast(request.getAttribute(SCRIPT_LINKS_FOR_BODY_END));
return scriptLinks;
}

Expand Down

0 comments on commit 3c83ab5

Please sign in to comment.