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

Replace json.org-licensed classes with Apache-compatible versions

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3.8, 5.4.1
    • 5.5.0, 5.4.2
    • tapestry-json
    • None

    Description

      Because of license issues, we need to replace all json.org-licensed classes with alternative classes having an Apache-approved license. Apache legal has imposed a deadline of April 30, 2017.

      Tapestry apparently includes 3 classes that are, starting in version 5.2, "repackaged, improved (and tested) version of code originally from json.org." These 3 all include D. Crockford's "The Software shall be used for Good, not Evil" statement in the JSON license at the top.

      The 3 classes are:

      • JSONArray.java
      • JSONTokener.java
      • JSONObject.java

      Other Apache projects (including Wicket) have successfully switched to https://github.com/tdunning/open-json, which contains versions of the above 3 classes that are purported to be mostly compatible with the current versions from json.org. However, there have been changes to Tapestry's own version since the original copy was made (May 2008 or possibly earlier), and those changes would need to be re-applied. Some examples:

      • TAP5-1153: When in development mode, Tapestry should pretty-print JSON content
      • TAP5-2209 Make JSONObject and JSONArray implement Serializable
      • Make JSONArray.from() not care about what values are stored in Iterable
      • Add a new constructor to JSONObject to make it easier to initalize a JSONObjects key/value pairs (if all strings)
      • Change generics signature for JSONArray.putAll() and JSONObject.putAll()
      • TAP5-2098: Maintain JSONObject keys & values in the order they were added
      • Add a copy() method to JSONObject
      • Add JSONArray.toList()
      • Add JSONArray.putAll()
      • Added remove(int index) to JSONArray
      • TAP5-1970: Make it easier to create JSONObject and JSONArray instances
      • Add JSONObject.toMap()
      • Add JSONObject.in(String) to create (if needed) and return a nested JSONObject

      There are 116 unit tests for the JSON module. A starting point would be to overlay the open-json classes and see what tests fail.

      Attachments

        Issue Links

          Activity

            People

              jkemnade Jochen Kemnade
              bobharner Bob Harner
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: