You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2015/09/02 08:55:45 UTC

[jira] [Commented] (WW-4542) FreemarkerManager class throws null pointer exception

    [ https://issues.apache.org/jira/browse/WW-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14726856#comment-14726856 ] 

Lukasz Lenart commented on WW-4542:
-----------------------------------

{{getInstanceNames}} will return an empty set

{code:java}
  /**
   * Gets a set of all registered names for the given type
   * @param type The instance type
   * @return A set of registered names or empty set if no instances are registered for that type
   */
  Set<String> getInstanceNames(Class<?> type);
{code}

and this code works very well, it was there before for long time

> FreemarkerManager class throws null pointer exception 
> ------------------------------------------------------
>
>                 Key: WW-4542
>                 URL: https://issues.apache.org/jira/browse/WW-4542
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.3.24
>         Environment: Win7
> WebLogic 2.1.3
> JDK 1.7
>            Reporter: Rin Saunders
>            Priority: Minor
>             Fix For: 2.3.x
>
>
> Am getting a null pointer error in the FreemarkerManager class. It occurs in the setContainer method. The code below seems to assume that getInstanceNames returns an empty set if there are no matches. In fact, it returns a null, which is legit according to the XWork doc. This occurs in Freemarker 2.3.23 under WebLogic 12.1.3.
> {code:java}
>     Map<String, TagLibrary> oldMap = new HashMap<String, TagLibrary>();
>     Set<String> oldPrefixes = container.getInstanceNames(TagLibrary.class);
>     for (String prefix : oldPrefixes) {
>         oldMap.put(prefix, container.getInstance(TagLibrary.class, prefix));
> {code}
> Not sure if this affects the presentation of Struts2 views. Is there a workaround or fix?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)