Fix "Illegal Reflection" warning for Clojure 1.10 & Java 11#152
Fix "Illegal Reflection" warning for Clojure 1.10 & Java 11#152cloojure wants to merge 5 commits intocgrand:masterfrom
Conversation
|
Uh oh, does the 1st argument have to be nailed down? The docstring (of a function that calls this one in the same file) says s may be "a File, InputStream or String naming a URI". That docstring matches clojure.xml/parse, and both of those functions actually also accept InputSource (which was suggested to be documented in Clojure here (https://dev.clojure.org/jira/browse/CLJ-1290)), which in turn accepts a Reader, which is the most direct way to parse XML content of a string... a StringReader in an InputSource. In short, the new constraint to just accept nothing but InputStream should be documented or, better yet, an alternative found without such a constraint. |
|
This error was resolved by updating from clojure version from 1.10 to 1.10.1 for me. |
Major changes: - Fix all reflection warnings for modern JVM compatibility (cgrand#158, PR cgrand#152) - Update jsoup from 1.7.2 to 1.18.3 - Add missing HTML5 void elements: col, embed, keygen, param, source, track, wbr (cgrand#140) - JSoup parser now supports Reader input (enables html-snippet) (cgrand#90) - Improve error message for missing resources with MissingResourceException (cgrand#154, PR cgrand#155) - Migrate from Leiningen to tools.deps (deps.edn) - Replace Travis CI with GitHub Actions (Java 11/17/21 matrix) - Remove obsolete build.xml (Ant) See CHANGELOG.md for full details.
Upgrading from Clojure 1.9 to 1.10, I am getting a new warning:
Using Java 11 on Ubuntu 16.04.
This can be fixed by type hints on the
net.cgrand.xml/startparse-saxmethod. I also upgraded theproject.cljto current versions ofleinandjsoup. Tests are clean: