is there an example of a working :deprecations disable for a java class? the example in the readme isn't valid edn and I can't seem to make my regex do what I expect (I'm only targeting one method)
minimal surprising failure: #".*"
successfully suppresses the warning, #"org\.apache\.*"
does not
src/ledger/topology.clj:561:8: deprecations: Static method 'public static org.apache.kafka.streams.state.Stores$StoreFactory org.apache.kafka.streams.state.Stores.create(java.lang.String)' is deprecated.
do I need the literal contents in the '' there?
Hmm. I am trying to reproduce the issue and figure out how to make that work, but I apparently no longer know how to install a version of Eastwood from source code with the latest code.
It used to be I could edit the project.clj
file of Eastwood's source to some version number like "0.2.10-SNAPSHOT", type the command lein install
, edit my $HOME/.lein/profile.clj file to include {:user {:plugins [[jonase/eastwood "0.2.10-SNAPSHOT"]]}}
, and go into any other Leiningen project directory and type lein eastwood
, and it would run that version of Eastwood's source code.
Right now, when I try that sequence of steps, starting from an empty $HOME/.m2
directory, the lein install
step does create version 0.2.10-SNAPSHOT
of an Eastwood jar file in my $HOME/.m2 directory tree, with no version 0.2.8 or any other version of Eastwood. However, when I edit the $HOME/.lein/profiles.clj file and type lein eastwood
in a different Lein project root directory, it downloads Eastwood 0.2.8 jar file from Clojars, and uses that instead.
That really confuses me. No idea why that would happen.
Maybe something weird involving the sha in Eastwood's resources/EASTWOOD_VERSION file?
@slipset ? ^^^
I’m at a conference today, so I’ll probably not be able to handle it today, but I’ll look into it tomorrow
Thanks, no rush. I can create an issue on Eastwood Github if that would be preferable.
That’d be great!
Created one, with a sequence of steps that I used to be able to use around Eastwood 0.2.7 in order to create a local -SNAPSHOT version and run it locally, but now downloads and uses 0.2.8 instead.
I'm still stuck on how to whitelist a static method as an exclusion in the deprecations linter
I'm still baffled why I can't locally install and run the latest Eastwood source in my ~/.m2 🙂
Asking in the #leiningen channel and created an issue.
Not saying that it is impossible to answer your question without doing that, but I'm not sure that in the current state, deploying a new Eastwood release to Clojars will actually let you run it, since I'm not sure it is even possible to run Eastwood 0.2.9 that is in Clojars, let alone a new version I might deploy.
If I can't run a locally installed Eastwood from source, I can't add debug print messages around the code of the deprecations linter to experiment and see what regexes might be useful there.
sorry, I'm just venting a bit there.
Maybe a cooler head will have an idea for this I'm not thinking of.
OK - thanks - I wasn't sure you'd noticed my question about that earlier, now I see how not being able to install locally would be a reply to that
It was prompted by trying to answer your question, although far from obvious what the cause and effect were there 🙂
Hmm. Maybe I can debug a slightly older version of Eastwood that has the deprecations code in it, if it was added early enough to avoid the recent weirdness.
I might find a few minutes to make a repro issue with some static method in the default jvm that's deprecated
just in case the issue is deprecated-static-method specific
That'd be cool, although I may have recreated one with the same class you had, after some Google'ing about. I probably don't have a matching version and all that, so one you create that has the deprecation warning would be useful.
up to date apache kafka would replicate
If I figure it out, I may even be able to improve the docs a bit for that feature in Eastwood's README
cool - unit tests can act as docs too, I'll see if I can find some time for something like that (which would mean deprecated static method in regular vm would be nice)
repro:
(ns deprecation.core)
(defn foo
"I don't do a whole lot."
[x]
(java.net.URLDecoder/decode "foo"))
(disable-warning
{:linter :deprecations
:symbol-matches #{#"^java\.net\.URLDecoder"}})
changing the regex to #".*" disables the warning@noisesmith away from computer, so can’t think, but I have answered this before somewhere.
That was more a clue to myself, than anything else
@noisesmith ^^ so basically, you need to either prefix your regex with whatever modifiers your java-method has, or your regex needs to be something like #".*?java\.net\.URLDecoder"
thanks - I had something like that earlier but must have had a subtle error