Title: JSONObject.wrap does not handle enums · Issue #145 · stleary/JSON-java · GitHub
Open Graph Title: JSONObject.wrap does not handle enums · Issue #145 · stleary/JSON-java
X Title: JSONObject.wrap does not handle enums · Issue #145 · stleary/JSON-java
Description: Steps to reproduce: Create a new JSONObject(); try to add an enum as a value dump the jsonObject via the toString() method expected: we see the enum values actual: we do not see the enum values Please see below stack. It seems that the J...
Open Graph Description: Steps to reproduce: Create a new JSONObject(); try to add an enum as a value dump the jsonObject via the toString() method expected: we see the enum values actual: we do not see the enum values Ple...
X Description: Steps to reproduce: Create a new JSONObject(); try to add an enum as a value dump the jsonObject via the toString() method expected: we see the enum values actual: we do not see the enum values Ple...
Opengraph URL: https://github.com/stleary/JSON-java/issues/145
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSONObject.wrap does not handle enums","articleBody":"Steps to reproduce:\nCreate a new JSONObject();\ntry to add an enum as a value\ndump the jsonObject via the toString() method\n\nexpected:\nwe see the enum values\n\nactual:\nwe do not see the enum values\n\nPlease see below stack. It seems that the JSONObject.wrap function fails to recognize the enum and tries to use the bean constructor from the JSONObject class. My enum does not have getters/setters like (since it is not a bean) and so nothing gets dumped from the toString()\n\nJSONObject.wrap(Object) line: 1730 \nJSONArray.\u003cinit>(Collection\u003cObject>) line: 159 \nJSONObject.writeValue(Writer, Object, int, int) line: 1767 \nJSONObject.write(Writer, int, int) line: 1836 \nJSONObject.toString(int) line: 1614 \nJSONObject.toString() line: 1591 \nJSONOutputRenderer.buildVariantsArray(Set\u003cVariantInfo>) line: 100 \nJSONOutputRenderer.getJson(BuildInfo) line: 83 \nJSONOutputRenderer.generateBuildInfo(String, BuildInfo) line: 50 \nGenBuildOutputHandlerMain.outputBuildInfo(String, BuildInfo) line: 24 \nGenBuildOutputHandlerMain.processFile(String) line: 18 \nGenBuildOutputHandlerMain.main(String[]) line: 34\n\nI have pulled the latest source and built the following suggestion to fix the bug:\n\nAdded at line 1722 of JSONObject.java\n if(object instanceof Enum){\n return object.toString();\n }\n","author":{"url":"https://github.com/twoseascharlie","@type":"Person","name":"twoseascharlie"},"datePublished":"2015-08-09T18:43:23Z","url":"https://github.com/stleary/JSON-java/issues/145"}
| 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:b6bc861d-29c6-68b3-5d50-c656d45bffa5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9554:16C639:2CBCDF:3B45A7:6AFD35E6 |
| html-safe-nonce | 8a2aaa66d9b75ef77bf50aaf2a07ec6f54288109306d8266d6dddee449d888d9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTU0OjE2QzYzOToyQ0JDREY6M0I0NUE3OjZBRkQzNUU2IiwidmlzaXRvcl9pZCI6IjIzOTQwOTIwNTUyMDE4NDgwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 04a892c81bed8375be78081d0b83729bf35b1ca1356e6d475551dabb7251bc2c |
| hovercard-subject-tag | issue:99918867 |
| 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/145/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db82fc60289cfebc0cc7ee0e62b0b8a05d9c79fde6bfaf022ec012fb17e3105c/stleary/JSON-java/issues/145 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db82fc60289cfebc0cc7ee0e62b0b8a05d9c79fde6bfaf022ec012fb17e3105c/stleary/JSON-java/issues/145 |
| og:image:alt | Steps to reproduce: Create a new JSONObject(); try to add an enum as a value dump the jsonObject via the toString() method expected: we see the enum values actual: we do not see the enum values Ple... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | twoseascharlie |
| 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