[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Guava 15/21 warning

Hi Ed,

> Please read the
> Bugzillas. https://bugs.eclipse.org/bugs/show_bug.cgi?id=427862
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=437107

Reading through Bug 427862 comment 8 ff. [1], it seems like OSGi's uses
constraints would solve your problem.

> The problem never occurs for individual projects. It only occurs when an
> integrating project 'inherits' conflicting Guava loads from two distinct
> component projects with Guava in the APIs.
> 
> So Mylyn only is no problem, but something that integrates Mylyn and
> Xtext can encounter obscure failures when the wrong class is re-used on
> a code path in which both are used.
I had a *brief* look at the Papyrus (RT) code and I think I know why you
continue to have problems with Guava:

1.) A bundle like org.eclipse.papyrusrt.umlrt.core requires
com.google.guava, but only provides a lower version bound [2]:

> Require-Bundle: com.google.guava;bundle-version="11.0.0"

This is dangerous, as Guava may change API in incompatible ways between
major versions (and has done so in the past).

2.) Your bundles export packages [3] whose classes have Guava classes in
their public API [4]:

> Export-Package: org.eclipse.papyrus.infra.core.resource

> Optional<Boolean> isReadOnly(...)

The above package should clearly have a uses constraints:

> Export-Package:
org.eclipse.papyrus.infra.core.resource;uses:="com.google.common.base"

Have a look at this article [5] that nicely explains "What is a Uses
Constraint Anyway".

Hope this helps,

Andreas

[1] <https://bugs.eclipse.org/bugs/show_bug.cgi?id=427862#c8>
[2]
<http://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/tree/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/META-INF/MANIFEST.MF#n18>
[3]
<http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF#n2>
[4]
<http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractReadOnlyHandler.java#n68>
[5] <http://njbartlett.name/2011/09/02/uses-constraints.html>

-- 
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940

Attachment: signature.asc
Description: OpenPGP digital signature