[ 
https://issues.apache.org/jira/browse/LANG-1543?focusedWorklogId=451900&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-451900
 ]

ASF GitHub Bot logged work on LANG-1543:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jun/20 19:27
            Start Date: 27/Jun/20 19:27
    Worklog Time Spent: 10m 
      Work Description: coveralls commented on pull request #561:
URL: https://github.com/apache/commons-lang/pull/561#issuecomment-650608940


   
   [![Coverage 
Status](https://coveralls.io/builds/31725436/badge)](https://coveralls.io/builds/31725436)
   
   Coverage increased (+0.0007%) to 94.679% when pulling 
**a60bd7a9686c2bbc37d249d9faaa5b9c41f03efa on rwanderc:LANG-1543** into 
**062bc6fe7d48d4eb4cdf3abec09e7547a0a9aed7 on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 451900)
    Time Spent: 20m  (was: 10m)

> [JSON string for maps] ToStringBuilder.reflectionToString doesnt render 
> nested maps correctly.
> ----------------------------------------------------------------------------------------------
>
>                 Key: LANG-1543
>                 URL: https://issues.apache.org/jira/browse/LANG-1543
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.10
>            Reporter: Swaraj Pal
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Nested Maps are not converted correctly as JSON using 
> ToStringBuilder.reflectToString commons-lang3:3.10 . Please find below the 
> example to reproduce:-
> Class:
> {code:java}
> public class Student {    
>     private String name;
>     private Map<String, String> education;
>     //getters and setters...
>     public String toString() {
>         return ToStringBuilder.reflectionToString(this, 
> ToStringStyle.JSON_STYLE);
>     }}
> {code}
>  
> Driver test:
> {code:java}
>         Student p = new Student();
>         p.setName("como");
>         
>         Map<String, String> educationMap = new HashMap<String, String>();
>         educationMap.put("primary", "school");
>         educationMap.put("graduation", "B.S.");
>         
>         p.setEducation(educationMap);
>         
>         System.out.println(p.toString());
> {code}
> The toString() prints
> {code:java}
> {"education":{graduation=B.S., primary=school},"name":"como"}
> {code}
> but I expect as JSON it should print as below (with proper key,value pairs as 
> field names and values)
> {code:java}
> {"education":{"graduation": "B.S.", "primary":"school"},"name":"como"}
> {code}
> Suggested fix:
> I can create a Pull request for this issue handling Maps appending logic.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to