Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 516149

Summary: Ensure compatibility to Guava 18 and 21.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: MiscAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M7   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2017-05-04 00:59:49 EDT
Up to now, GEF bundles support Guava 12 and 15. We should ensure we are compatible with Guava 18 and 21 as well. This involves changing the version constraints on the package imports as well as PB CQs for the respective Orbit libraries.
Comment 1 Alexander Nyßen CLA 2017-05-04 02:27:47 EDT
The only compatibility problem we have is that TypeToken.isAssignableFrom() has been deprecated in 19 and removed in 20. The replacement TypeToken.isSupertypeOf() has been introduced with 19. 

We can either stick to TypeToken.isAssignable and enable [15.0.0, 19.0.0) as range, or we can switch to TypeToken.isSuperTypeOf() and enable [19.0.0, 22.0.0). If we want to support the full range, i.e. [15.0.0, 22.0.0), we will have to provide an internal workaround that works with reflection.
Comment 2 Alexander Nyßen CLA 2017-05-04 02:54:54 EDT
As the Oxygen release is intended to be backwards compatible to Luna (where Guava 19 was not yet provided in Orbit), we should probably not drop support for it now.
Comment 3 Alexander Nyßen CLA 2017-05-04 11:39:17 EDT
I provided a utility method within our Types class, which uses reflection to delegate to TypeToken.isAssignableFrom(TypeToken) or TypeToken.isSuperTypeOf(TypeToken), whatever is available.

I widened out version constraints to comply with all Guava versions between 12 and 21.

I created PB CQs for 19 and 21, so usage is approved.

Resolving as fixed in 5.0.0 M7.