You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
atdj: generate wrapper classes for top-level list aliases (#500)
* atdj: generate wrapper classes for top-level list aliases
Java has no type aliases, so 'type items = item list' previously caused
an error. We now generate a class Items implementing Atdj with:
- a no-arg constructor (empty list)
- a constructor from ArrayList<Item>
- a constructor from a JSON string
- a package-private constructor from JSONArray (analogous to the JSONObject
constructor generated for records)
- toJsonBuffer / toJson
- a public 'value' field of type ArrayList<Item>
The assign function is also updated so that list aliases used as record
fields or sum-variant payloads are deserialized via 'new Items(jsonArray)'
rather than triggering the inline ArrayList-building loop.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update CHANGES.md for atdj list alias support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* atdj: cast keys().next() to String for newer org.json
JSONObject.keys() returns Iterator<Object> in newer versions of
org.json, causing a compile error. The returned key is always a String
in practice, so a cast is safe.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments