Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reflection warnings #163

Closed
loganlinn opened this issue May 29, 2015 · 1 comment
Closed

Fix reflection warnings #163

loganlinn opened this issue May 29, 2015 · 1 comment

Comments

@loganlinn
Copy link

This project has a handful of reflection warnings. I didn't see any other previous issues opened about this, so I wanted to bring them to light. Here are the warnings emitted from running the tests, filtered to only those from clojurewerkz package. I've looked into a few of these and some look more critical than others, but ideally there shouldn't be any.

Reflection warning, clojurewerkz/elastisch/native/conversion.clj:199:9 - call to method put on org.elasticsearch.common.settings.ImmutableSettings$Builder can't be resolved (argument types: java.lang.String, java.lang.Object).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:199:9 - call to method put on org.elasticsearch.common.settings.ImmutableSettings$Builder can't be resolved (argument types: java.lang.String, java.lang.Object).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:314:54 - reference to field getValue on java.lang.Object can't be resolved.
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:409:10 - call to method routing on org.elasticsearch.action.delete.DeleteRequest can't be resolved (argument types: java.lang.Object).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:475:10 - call to method routing on org.elasticsearch.action.update.UpdateRequest can't be resolved (argument types: java.lang.Object).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:493:10 - call to method routing on org.elasticsearch.action.update.UpdateRequest can't be resolved (argument types: java.lang.Object).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:775:7 - call to method minWordLen on org.elasticsearch.action.mlt.MoreLikeThisRequest can't be resolved (no such method).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:777:7 - call to method maxWordLen on org.elasticsearch.action.mlt.MoreLikeThisRequest can't be resolved (no such method).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:1182:11 - call to org.elasticsearch.action.admin.indices.create.CreateIndexRequest ctor can't be resolved.
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:1276:7 - call to method waitForMerge on org.elasticsearch.action.admin.indices.optimize.OptimizeRequest can't be resolved (no such method).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:1292:7 - call to method full on org.elasticsearch.action.admin.indices.flush.FlushRequest can't be resolved (no such method).
Reflection warning, clojurewerkz/elastisch/native/conversion.clj:1338:7 - call to method indices on org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest can't be resolved (argument types: java.lang.Object).

I enabled this output by adding the following to :dev profile:

:global-vars {*warn-on-reflection* true}
@michaelklishin
Copy link
Member

@loganlinn note that in a fair share of cases, the Java method invoked is overridden on argument type. While not impossible to work around from Clojure, it would lead to ugly and fairly fragile code.

Feel free to take a look into the warnings. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants