Move XML-related code in Web to new util class #3298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change-Id: I79468d41978d1d2c3c41b41f9c9992092fd22da4
General items:
ant tests
passes on my machineFor all other changes:
master
master
as the baseWhat does this PR accomplish?
tldr: This fixes a regression in
master
where compiling an app without a Web component causes a syntax error in Kawa.In the PR that made it so dictionaries could be parsed directly in the Scheme code, I referenced
com.google.appinventor.components.runtime.Web
in the code since we want to call a static function on Web that handles the parsing of JSON. It seems though that by referencing the class, Kawa loads it and attempts to validate all of its types, including the classcom.google.appinventor.components.runtime.repackaged.org.json.XML
. This is provided by a library, json.jar, which is annotated on the Web component. When compiling the companion, or any other app that has a Web component, this JAR file is included and the app will build. For apps without a Web component (e.g., HelloPurr), the library is not included in the classpath and Kawa fails to compile the runtime.scm, despite the fact that none of the code in Screen1 will call the particular XML-related function. This PR moves the call to the XML library to a separate XmlUtil class, which allows the Web class to validate. Why Kawa manifests this as a SyntaxError is a mystery to me.