Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] canonical way to handle optional dependencies

Yes, those are two good options. AFAIK there is no additional magic that you miss.

I would wrap the dependency checking in a static class. e.g use if(DepBundleChecker.isAvailable()){ .. do something ..} instead of catching class loading exceptions. It's a bit more elegant but it stays a pita.

Cheers,

Wim

On Thu, Apr 15, 2021 at 1:39 PM Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:
Hello,

(Not sure this is on topic for the list - but not sure where to ask.)

What is the canonical way to check if an optional dependency is available?

I know of a couple of methods:

1. wrapping code in try/catch and catching something wide like Throwable or NoClassDefFoundError
2. checking for bundle status (e.g. calling Platform.getBundle(symbolicName) and Bundle.getState)

Thank you.
Jonah




~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com
_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/platform-dev

Back to the top