ngrunwald / ring-middleware-format

Ring middleware for parsing parameters and emitting responses in JSON or other formats
163 stars 49 forks source link

Fix for reflection warning: "call to method setText on CharsetDetector can't be resolved" #64

Closed timgilbert closed 7 years ago

timgilbert commented 7 years ago

I was originally going to file a ticket on this, but the fix seemed pretty easy so here is a PR instead.

This is a fix for the following message, which I am seeing printed to stdout when my application starts up:

Reflection warning, ring/middleware/format_params.clj:25:7 - call to method setText on com.ibm.icu.text.CharsetDetector can't be resolved (argument types: java.lang.Object).

I'm running [ring-middleware-format "0.7.0"] and [org.clojure/clojure "1.9.0-alpha10"] with Leiningen 2.7.0 on Java 1.8.0_45 Java HotSpot(TM) 64-Bit Server VM.

When I run with this patch applied I no longer see the warning.

I'm not really sure why this change fixes the issue; googling around a little bit did turn up an ancient bug about primitive type-hinting and destructuring args, but it doesn't look directly related to this. I also don't know of a good way to test this.

Deraen commented 7 years ago

I can reproduce this with 1.9.0-alpha10 but not with 1.9.0-alpha14 so I'm going to presume the problem was in the Clojure and not here.