October 24, 2020

Guava 30 released, Google Java core library

2 min read

Guava is a set of core libraries that includes new collection types (such as multimap and multiset), immutable collections, a graph library, functional types, an in-memory cache, and APIs/utilities for concurrency, I/O, hashing, primitives, reflection, string processing, and much more!

Guava comes in two flavors.

  • The JRE flavor requires JDK 1.8 or higher.
  • If you need support for JDK 1.7 or Android, use the Android flavor. You can find the Android Guava source in the android directory.

Guava 30 released.


  • Guava types can no longer be sent over GWT-RPC. Even the earlier, temporary way to reenable support (guava.gwt.emergency_reenable_rpc) no longer has an effect. (0cb89dd)
  • cache: Fixed memory leak in LocalCache under j2objc. (5e519d9)
  • collect: Added two-element min and max methods to Comparators. (958186c)
  • collect: Removed @Beta from Multimaps.toMultimap. (b6b4dc4)
  • collect: Made the set returned by ImmutableMap<K, V>.keySet() serializable as long as K is serializable, even if V is not (and similarly for values()). (f5a69c3)
  • collect: Fixed bug in powerSet.equals(otherPowerSet) would erroneously return false if the two power sets’ underlying sets were equal but had a different iteration order. (215b1f0)
  • collect: Eliminated j2objc retain-cycle in SingletonImmutableBiMap. (0ad38b8)
  • eventbus: Prevented @Subscribe from being applied to a method that takes a primitive, as that will never be called. (554546c)
  • graph: Made Traverser.breadthFirst() lazier, and optimized Traverser more generally. (32f2d77b5210ca)
  • graph: Added @DoNotMock to Traverser. (6410f18)
  • io: Deprecated Files.createTempDir(). (fec0dbc) (CVE forthcoming)
  • io: Upgraded ByteStreams.copy(InputStream, OutputStream) to use the faster FileChannel if possible. (a1e9a0b)
  • math: Added roundToDouble to BigDecimalMathBigIntegerMath, and LongMath. (bee4f3c2b5c096633abf2)
  • net: Added MediaType constants for several font/ types. (571cf66)
  • net: Added HttpHeaders constants for Cross-Origin-Embedder-Policy(-Report-Only)?. (c3bf731)
  • testing: Made EqualsTester test that non-String objects are not equal to their String representations. (c9570ea)
  • util.concurrent: Added ClosingFuture. (52e048e)
  • util.concurrent: Removed the deprecated 1-arg ServiceManager.addListener(Listener). Use the 2-arg addListener(Listener, Executor) overload, setting the executor to directExecutor() for equivalent behavior. (dfb0001)
  • util.concurrent: Changed AbstractFuture.toString() to no longer include the toString() of the result. (2ebf27f)
  • util.concurrent: Added awaitTerminationUninterruptibly. (f07b954)