|Make Google Guava bundles as singletons ? [message #1102202]
||Thu, 05 September 2013 14:01
| Maxence Vanbesien
Registered: October 2009
I have just one question, related to the use of the org.google.guava bundles that are proposed through Eclipse Orbit.
Lately, I got an issues that came to the fact that there were both versions 10.0.1 and 13.0.0 installed on my computer...
This lead to the following issue (I'm developing upon MDT Papyrus)
org.eclipse.e4.core.di.InjectionException: java.lang.LinkageError: com/google/common/base/Optional
This was due to the fact that the two versions were loaded and were leading to the two errors.
Also I saw that quite lots of tools fixed the version 10.0.x (e.g. Acceleo, EMF Compare, MDT Papyrus, Atlassian JIRA connector for Mylyn).
So my question, which may be a bit naive, but I would be glad to share a point of view around this... For such bundles that deal with classloading & so on, would it be preferable to build them as singletons ? This would prevent, at least, the installation of later versions when a specific version is already installed...
Thanks a lot in advance !
|Re: Make Google Guava bundles as singletons ? [message #1115476 is a reply to message #1102202]
||Tue, 24 September 2013 06:45
| David Williams
Registered: July 2009
On 09/05/2013 10:01 AM, Maxence Vanbesien wrote:|
> So my question, which may be a bit naive, but I would be glad to share
> a point of view around this... For such bundles that deal with
> classloading & so on, would it be preferable to build them as
> singletons ? This would prevent, at least, the installation of later
> versions when a specific version is already installed...
Having as "singletons" only changes runtime behavior, not what gets
installed. And, at runtime, which ever one get's "ran first" would be
"the singleton" used for the rest of the session. This may or may not be
what's desired, and may or may not result in a "runtime error". It all
depends on who depends on what, and what function a user runs first.
That's why a) best not to have singletons :) and b) when unavoidable,
everyone needs to make sure they are using the same version, ideally.
There are other things that can be done to improve the situation (import
what you export) but not sure they'd work for bundles with "major"
changes. You don't say, but sounds like you are a "user/contributor",
not a committer? And Eclipse uses older version, but you'd like to use
So, one thing you could do is open bugs on those projects and suggest
they upgrade to current version?
Powered by FUDForum
. Page generated in 0.01707 seconds