Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Orbit » Make Google Guava bundles as singletons ?(Make Google Guava bundles as singletons ?)
Make Google Guava bundles as singletons ? [message #1102202] Thu, 05 September 2013 14:01 Go to next message
Maxence Vanbesien is currently offline Maxence VanbesienFriend
Messages: 10
Registered: October 2009
Junior Member
Hello,

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
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:224)
at

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 !

Maxence Vanbésien
Worldline
mvaawl@gmail.com
Re: Make Google Guava bundles as singletons ? [message #1115476 is a reply to message #1102202] Tue, 24 September 2013 06:45 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
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
newer version?
So, one thing you could do is open bugs on those projects and suggest
they upgrade to current version?

HTH
Re: Make Google Guava bundles as singletons ? [message #1431264 is a reply to message #1115476] Thu, 25 September 2014 12:33 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 24/09/2013 08:45, David Williams wrote:
> 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...
>>

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=427862
Previous Topic:Issue with org.apache.jasper.glassfish 2.2.2 and JDK 8
Next Topic:PDF transcoding color issue
Goto Forum:
  


Current Time: Sat Apr 20 04:03:30 GMT 2024

Powered by FUDForum. Page generated in 0.03144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top