Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Guava versions in Oxygen

Zoltán Ujhelyi wrote:
> the VIATRA project is not ready to move to Guava 21, as we still use
> Java 7 as a minimum requirement, while Guava 21 requires Java 8. We
> are now in the process of figuring out whether we can set up
> dependency ranges and uses constraints in a way that we can work both
> with Guava 15 and 21 (even if both are installed); if everything
> works as we expect, we will not block moving Oxygen to Guava-only.

As the Code Recommenders project is in a similar situation (still
wanting to support Java 7 on Neon and earlier releases), here's an
important observation *if* you have Guava classes (Optional, Predicate,
and Immutable* are likely candidates) in your *public* API: Your clients
also have to increase their version range to one that at least
encompasses yours, as there is an uses constraint (whether declared or
not is immaterial).

This is a problem for Code Recommenders, which previously imported Guava
[15, 16) and had classes like Optional in its public API. Any client
using both Code Recommenders' API (and thus by extension Guava classes)
would now need to update their version range, as the Optional returned
by Code Recommenders may now be a "Guava 21" Optional. As clients may
call functionality from Guava that is not present in the whole [15, 22)
range, this may break them -- even if Code Recommenders internally uses
only Guava functionality that's been present in all of [15, 22).

Strictly speaking, Code Recommenders would have to increase its *major*
version (as we completely break our public API) if we were to adopt a
broader version range for Guava, as it is part of our public API. IMHO,
that's not something we should do do; it causes huge pain for our
clients and is otherwise totally unwarranted (we planned on a minor
release for Oxygen only [1]). I'm not sure that the planning council was
aware of these far-reaching effects when they issues their
recommendation for Guava 21.

Best wishes,



Codetrails GmbH
The knowledge transfer company

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

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

Attachment: signature.asc
Description: OpenPGP digital signature

Back to the top