Benjamin Weidig created TAP5-2640:
-------------------------------------
Summary: tapestry-json improvements (implement Collection/Map,
better exceptions)
Key: TAP5-2640
URL: https://issues.apache.org/jira/browse/TAP5-2640
Project: Tapestry 5
Issue Type: Improvement
Components: tapestry-json
Reporter: Benjamin Weidig
Attachments: 0001-tapestry-json-adding-JSONInvalidTypeException.patch,
0002-travis-disabled-mail-notification.patch,
0003-tapestry-json-added-JSONTypeMismatchException.patch,
0004-tapestry-json-JSONArray-get-now-throws-IndexOutOfBou.patch,
0005-tapestry-json-JSONTokener-constructors-exceptions-im.patch,
0006-tapestry-json-improve-JSONSpec-tests.patch,
0007-tapestry-json-better-exception-building.patch,
0008-tapestry-json-added-JSONSyntaxException.patch,
0009-tapesty-json-javadoc-updated.patch,
0010-tapestry-json-JSONArray-non-finite-nan-check-fixed.patch,
0011-tapestry-json-javadoc-typo.patch,
0012-tapestry-json-added-JSONArrayIndexOutOfBoundsExcepti.patch,
0013-tapestry-json-code-style.patch,
0014-tapestrsy-json-fix-lossy-conversion.patch,
0015-tapestry-json-source-formatting.patch,
0016-tapestry-json-throw-IllegalArgumentException-on-inva.patch,
0017-tapestry-json-JSONObject-implements-Map-String-Objec.patch,
0018-tapestry-json-added-get-type-OrDefault-methods-to-JS.patch,
0019-tapestry-json-make-JSONArray-a-real-Collection-wip.patch,
0020-tapestry-json-JSONArray-improve-javadoc.patch,
0021-tapestry-json-JSONObject-improve-javadoc.patch
As laid out in
[http://mail-archives.apache.org/mod_mbox/tapestry-dev/202007.mbox/browser]
these patches aim to improve tapestry-json.
Core features:
* JSONArray/JSONObject implements Collection/Map
* Better exceptions
Unit-tests were added if appropiate. "Passthrough"-methods to the underlying
storage weren't tested if there are no additional edge-cases.
Javadoc was added, trying to mimic Collection/Map, but reduced to the actual
exception cases.
Minar/breaking changes occur as discussed on the mailing list:
* Signature change: JSONObject get(Object name) instead of JSONObject
get(String name)
* Return type / Signature change: void putAll(Map<? extends String, ? extends
Object> newProperties) instead of JSONObject putAll(Map<String, ?>
newProperties)
I've attached 21 patch files. Maybe I should've squashed it, but if anyone is
interested in the evolution/idea behind the code, this way it would be easier
to grasp it.
The code is also available on Github
https://github.com/apache/tapestry-5/compare/master...benweidig:feature/tapestry-json-exceptions
--
This message was sent by Atlassian Jira
(v8.3.4#803005)