[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Work logged] (LANG-1542) ToStringBuilder.reflectionToString - Wrong JSON format when object 
From:       "ASF GitHub Bot (Jira)" <jira () apache ! org>
Date:       2020-05-31 15:53:00
Message-ID: JIRA.13305137.1589529575000.140684.1590940380125 () Atlassian ! JIRA
[Download RAW message or body]


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

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

                Author: ASF GitHub Bot
            Created on: 31/May/20 15:52
            Start Date: 31/May/20 15:52
    Worklog Time Spent: 10m 
      Work Description: coveralls edited a comment on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-629603951


   
   [![Coverage Status](https://coveralls.io/builds/31144338/badge)](https://coveralls.io/builds/31144338)
  
   Coverage increased (+0.0009%) to 95.092% when pulling \
**852f924c95b39b7f4b745f3b0f4d2872abf5aed5 on TranNgocKhoa:master** into \
**f6923510352fc3fbfad68bc6c5ac5258a34671b7 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:
users@infra.apache.org


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

    Worklog Id:     (was: 439260)
    Time Spent: 1h 50m  (was: 1h 40m)

> ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of \
>                 Enum
> -------------------------------------------------------------------------------------
>  
> Key: LANG-1542
> URL: https://issues.apache.org/jira/browse/LANG-1542
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.10
> Environment: Open JDK 1.8
> Reporter: Trần Ngọc Khoa
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
> 
> I'm trying to log an object to console with JSON style using  \
> {{ToStringBuilder.reflectionToString}}  from  {{commons-lang3:3.10}}  but it seems \
> generated a wrong JSON format. Problem happening when I have a list of enums in my \
> field list. 
> {code:java}
> This is the class:
> public class Person {
> private long id;
> private String name;
> private List<MyEnum> listEnums;
> //getter and setter
> public String toString(){
> return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); 
> }
> }
> {code}
> 
> And  {{MyEnum}}:
> {code:java}
> public enum MyEnum {
> FOOD,
> SPORT,
> BOOK,
> MUSIC
> }{code}
> When I call  {{toString()}}  of Person object. It shows like this
> {code:java}
> {
> "id": 1,
> "name": "Karl",
> "listEnums": [FRIDAY, MONDAY, TUESDAY]
> }{code}
> 
> What I expected is:
> {code:java}
> {
> "id": 1,
> "name": "Karl",
> "listEnums": ["FRIDAY", "MONDAY", "TUESDAY"]
> }{code}
> 



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic