Google common collect

Just ran a build (old style - still afraid to convert) on my sony plugin and noticed that it’s flagging all my google common collect (I use the BiMap alot) as “should not be used”. When was that decided and is their an alternative I should be using instead?

Also - where do we post issues with the syntax checker? I’ve noticed that it flags all my inner classes as needing a “NotNullByDefault” even though the outer class has one…

What do you need from common.collect?

The BiMap - use it quite a bit

I don’t know exactly when what was decided, but here is a old pr that may give some insight/ starting point: https://github.com/eclipse/smarthome/pull/5356 . The use of the guava library has been discouraged for some time as it’s a rather large library and with Java 8 most of it’s features are already in Java 8 I think.
With the new build it’s not even included by default so you either need to include your own (although I don’t think that would be accepted in a or) or rewrite to use another implementation. Most usages where only immutable lists. I don’t know of an alternative for BiMap, so you might need to do some research.

Issues related to syntax checking can be reported on the repository: https://github.com/openhab/static-code-analysis

1 Like

You could use something like that: https://stackoverflow.com/a/54871433

Thanks all - it’s not an issue to replace it with two maps, was just a time saver to use it instead since it was already built in.

1 Like

Darn - I actually use a bunch more from collect that I’ll need to convert (like the cache, cachebuilder and most importantly the listener).