Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2640

tapestry-json improvements (implement Collection/Map, better exceptions)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.2, 5.7.0
    • Component/s: tapestry-json
    • Labels:
      None

      Description

      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

        Attachments

        1. 0001-tapestry-json-adding-JSONInvalidTypeException.patch
          12 kB
          Ben Weidig
        2. 0002-travis-disabled-mail-notification.patch
          0.5 kB
          Ben Weidig
        3. 0003-tapestry-json-added-JSONTypeMismatchException.patch
          25 kB
          Ben Weidig
        4. 0004-tapestry-json-JSONArray-get-now-throws-IndexOutOfBou.patch
          3 kB
          Ben Weidig
        5. 0005-tapestry-json-JSONTokener-constructors-exceptions-im.patch
          3 kB
          Ben Weidig
        6. 0006-tapestry-json-improve-JSONSpec-tests.patch
          2 kB
          Ben Weidig
        7. 0007-tapestry-json-better-exception-building.patch
          16 kB
          Ben Weidig
        8. 0008-tapestry-json-added-JSONSyntaxException.patch
          9 kB
          Ben Weidig
        9. 0009-tapesty-json-javadoc-updated.patch
          3 kB
          Ben Weidig
        10. 0010-tapestry-json-JSONArray-non-finite-nan-check-fixed.patch
          2 kB
          Ben Weidig
        11. 0011-tapestry-json-javadoc-typo.patch
          1 kB
          Ben Weidig
        12. 0012-tapestry-json-added-JSONArrayIndexOutOfBoundsExcepti.patch
          5 kB
          Ben Weidig
        13. 0013-tapestry-json-code-style.patch
          0.9 kB
          Ben Weidig
        14. 0014-tapestrsy-json-fix-lossy-conversion.patch
          2 kB
          Ben Weidig
        15. 0015-tapestry-json-source-formatting.patch
          11 kB
          Ben Weidig
        16. 0016-tapestry-json-throw-IllegalArgumentException-on-inva.patch
          4 kB
          Ben Weidig
        17. 0017-tapestry-json-JSONObject-implements-Map-String-Objec.patch
          12 kB
          Ben Weidig
        18. 0018-tapestry-json-added-get-type-OrDefault-methods-to-JS.patch
          8 kB
          Ben Weidig
        19. 0019-tapestry-json-make-JSONArray-a-real-Collection-wip.patch
          16 kB
          Ben Weidig
        20. 0020-tapestry-json-JSONArray-improve-javadoc.patch
          7 kB
          Ben Weidig
        21. 0021-tapestry-json-JSONObject-improve-javadoc.patch
          10 kB
          Ben Weidig

          Issue Links

            Activity

              People

              • Assignee:
                ben-ng Ben Weidig
                Reporter:
                ben-ng Ben Weidig
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: