Title: warp of Sets of Enums is broken · Issue #255 · stleary/JSON-java · GitHub
Open Graph Title: warp of Sets of Enums is broken · Issue #255 · stleary/JSON-java
X Title: warp of Sets of Enums is broken · Issue #255 · stleary/JSON-java
Description: When I use an Enum with a "getter"-method and put this value into a set and this set as a value of a JSONObject the String representation of the Enum is not the same as when I put the Enum directly as a value of the JSONObject. This issu...
Open Graph Description: When I use an Enum with a "getter"-method and put this value into a set and this set as a value of a JSONObject the String representation of the Enum is not the same as when I put the Enum directly...
X Description: When I use an Enum with a "getter"-method and put this value into a set and this set as a value of a JSONObject the String representation of the Enum is not the same as when I put the Enu...
Opengraph URL: https://github.com/stleary/JSON-java/issues/255
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"warp of Sets of Enums is broken","articleBody":"When I use an Enum with a \"getter\"-method and put this value into a set and this set as a value of a JSONObject the String representation of the Enum is not the same as when I put the Enum directly as a value of the JSONObject. This issue depends on the `wrap` method of JSONObject that is called when a JSONArray (used for the Set) is created from a collection.\n\nHere is an example.\n\n```\n enum ToStringEnum{\n a,\n d(false);\n\n private final boolean flag;\n\n ToStringEnum() {\n this(true);\n }\n\n ToStringEnum(boolean disabledOnDefault) {\n this.flag = disabledOnDefault;\n }\n\n public boolean isFlag() {\n return this.flag;\n }\n }\n\n ToStringEnum a = ToStringEnum.a;\n JSONObject object = new JSONObject();\n Set\u003cToStringEnum> set = new HashSet\u003cToStringEnum>();\n set.add(a);\n object.put(\"testset\", set);\n object.put(\"test\", a);\n System.out.println(object.toString());\n //result: {\"testset\":[{\"flag\":true}],\"test\":\"a\"}\n //expected: {\"testset\":[\"a\"],\"test\":\"a\"}\n```\n","author":{"url":"https://github.com/Simulant87","@type":"Person","name":"Simulant87"},"datePublished":"2016-07-29T10:48:02Z","url":"https://github.com/stleary/JSON-java/issues/255"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f84dc174-3b18-32dc-9acd-d8132c52ff1d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E324:30AF58:24B347F:32FF76E:6AFD35E7 |
| html-safe-nonce | 88c4cb8c7a76eb7e90ee56944db8ea66a0440ba48ff40967662052a07f6bded5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzI0OjMwQUY1ODoyNEIzNDdGOjMyRkY3NkU6NkFGRDM1RTciLCJ2aXNpdG9yX2lkIjoiODQyNjIxOTI2NjYyOTI1MjU4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a94d3579aa7370489cc8bc12a2c6104d8ccb99352775d722fef03f86ac7d0240 |
| hovercard-subject-tag | issue:168299399 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stleary/JSON-java/255/issue_layout |
| twitter:image | https://opengraph.githubassets.com/549fdc3d8689f18a8b52bc46b5c344cffd147e8b6bc9f4be052df23598e1ecbe/stleary/JSON-java/issues/255 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/549fdc3d8689f18a8b52bc46b5c344cffd147e8b6bc9f4be052df23598e1ecbe/stleary/JSON-java/issues/255 |
| og:image:alt | When I use an Enum with a "getter"-method and put this value into a set and this set as a value of a JSONObject the String representation of the Enum is not the same as when I put the Enum directly... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Simulant87 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 |
| turbo-cache-control | no-preview |
| go-import | github.com/stleary/JSON-java git https://github.com/stleary/JSON-java.git |
| octolytics-dimension-user_id | 5107558 |
| octolytics-dimension-user_login | stleary |
| octolytics-dimension-repository_id | 1187853 |
| octolytics-dimension-repository_nwo | stleary/JSON-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1187853 |
| octolytics-dimension-repository_network_root_nwo | stleary/JSON-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 941021edf0c2ec58298f4a2c8f27ae507d129c92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width