Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Overflow from Recursive Constructors #31

Closed
jojenki opened this issue Nov 3, 2011 · 1 comment
Closed

Stack Overflow from Recursive Constructors #31

jojenki opened this issue Nov 3, 2011 · 1 comment

Comments

@jojenki
Copy link

jojenki commented Nov 3, 2011

I had created an enum, PrivacyState, that had a function named getPrivacyStates() that returned all of the PrivacyState enums. I then passed that array to JSONArray(Object obj) constructor. This causes a stack overflow.

I have since removed the function entirely in favor of values() that is built into enum, which solves my problem, but technically a similar situation could still cause the bug to appear.

Thanks.

@douglascrockford
Copy link
Contributor

You cannot serialize cyclical structures.

BGehrels pushed a commit to BGehrels/JSON-java that referenced this issue Apr 29, 2020
Replace util compare method with JsonPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants