sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-7380) Querying maps with Integer keys returns null
Date Tue, 16 Jan 2018 10:05:00 GMT

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

ASF GitHub Bot commented on SLING-7380:
---------------------------------------

raducotescu closed pull request #1: SLING-7380 - Querying maps with Integer keys returns null
URL: https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler/pull/1
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Querying maps with Integer keys returns null
> --------------------------------------------
>
>                 Key: SLING-7380
>                 URL: https://issues.apache.org/jira/browse/SLING-7380
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting HTL Compiler 1.0.12, Scripting HTL Java Compiler 1.0.12
>            Reporter: Radu Cotescu
>            Assignee: Radu Cotescu
>            Priority: Major
>             Fix For: Scripting HTL Java Compiler 1.0.20, Scripting HTL Compiler 1.0.18
>
>
> Querying maps with {{Integer}} keys returns {{null}} in HTL. The following code can be
used to reproduce the problem:
> {code:html}
> <pre data-sly-use.m="MapsPojo">
> Integer Map: \${m.INTEGER_MAP["one"]}: ${m.INTEGER_MAP["one"]}
> Strings Map: \${m.STRINGS_MAP[1]}: ${m.STRINGS_MAP[1]}
> </pre>{code}
> {code:java}
> public class MapsPojo {
>     public static final Map<String, Integer> INTEGER_MAP = new HashMap<String,
Integer>() {{
>         put("one", 1);
>     }};
>     public static final Map<Integer, String> STRINGS_MAP = new HashMap<Integer,
String>() {{
>         put(1, "one");
>     }};
> }
> {code}
> The expected output is:
> {code:html}
> Integer Map: ${m.INTEGER_MAP["one"]}: 1
> Strings Map: ${m.STRINGS_MAP[1]}: one
> {code}
> However, the current output is:
> {code:html}
> Integer Map: ${m.INTEGER_MAP["one"]}: 1
> Strings Map: ${m.STRINGS_MAP[1]}:
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message