douglascrockford/JSON-java — Issue #31: Stack Overflow from Recursive Constructors
Author: jojenki
Created: 2011-11-03 01:28:02+00:00
State: open

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.