Google core libraries for Java

Overview

Guava: Google Core Libraries for Java

Latest release Build Status

Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, caching, primitives, strings, and more! It is widely used on most Java projects within Google, and widely used by many other companies as well.

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.

Adding Guava to your build

Guava's Maven group ID is com.google.guava, and its artifact ID is guava. Guava provides two different "flavors": one for use on a (Java 8+) JRE and one for use on Android or Java 7 or by any library that wants to be compatible with either of those. These flavors are specified in the Maven version field as either 30.1.1-jre or 30.1.1-android. For more about depending on Guava, see using Guava in your build.

To add a dependency on Guava using Maven, use the following:

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>30.1.1-jre</version>
  <!-- or, for Android: -->
  <version>30.1.1-android</version>
</dependency>

To add a dependency using Gradle:

dependencies {
  // Pick one:

  // 1. Use Guava in your implementation only:
  implementation("com.google.guava:guava:30.1.1-jre")

  // 2. Use Guava types in your public API:
  api("com.google.guava:guava:30.1.1-jre")

  // 3. Android - Use Guava in your implementation only:
  implementation("com.google.guava:guava:30.1.1-android")

  // 4. Android - Use Guava types in your public API:
  api("com.google.guava:guava:30.1.1-android")
}

For more information on when to use api and when to use implementation, consult the Gradle documentation on API and implementation separation.

Snapshots and Documentation

Snapshots of Guava built from the master branch are available through Maven using version HEAD-jre-SNAPSHOT, or HEAD-android-SNAPSHOT for the Android flavor.

  • Snapshot API Docs: guava
  • Snapshot API Diffs: guava

Learn about Guava

Links

IMPORTANT WARNINGS

  1. APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, at any time. If your code is a library itself (i.e., it is used on the CLASSPATH of users outside your own control), you should not use beta APIs unless you repackage them. If your code is a library, we strongly recommend using the Guava Beta Checker to ensure that you do not use any @Beta APIs!

  2. APIs without @Beta will remain binary-compatible for the indefinite future. (Previously, we sometimes removed such APIs after a deprecation period. The last release to remove non-@Beta APIs was Guava 21.0.) Even @Deprecated APIs will remain (again, unless they are @Beta). We have no plans to start removing things again, but officially, we're leaving our options open in case of surprises (like, say, a serious security problem).

  3. Guava has one dependency that is needed for linkage at runtime: com.google.guava:failureaccess:1.0.1. It also has some annotation-only dependencies, which we discuss in more detail at that link.

  4. Serialized forms of ALL objects are subject to change unless noted otherwise. Do not persist these and assume they can be read by a future version of the library.

  5. Our classes are not designed to protect against a malicious caller. You should not use them for communication between trusted and untrusted code.

  6. For the mainline flavor, we test the libraries using only OpenJDK 8 and OpenJDK 11 on Linux. Some features, especially in com.google.common.io, may not work correctly in other environments. For the Android flavor, our unit tests also run on API level 15 (Ice Cream Sandwich).

Comments
  • FinalizableReferenceQueue keeps ClassLoaders around.

    FinalizableReferenceQueue keeps ClassLoaders around.

    Original issue created by nairb774 on 2008-07-28 at 05:39 PM


    If the class loader which loaded the google-collections jar is let go (consider redeploying a war to Apache Geronimo) the class loader will not be able to be garbage collected. This is caused by the thread started by FinalizableReferenceQueue never ending. In other words the garbage collection (for the class loader) can only happen when the thread stops. The solution is to stop the thread when there are no more objects on the queue. This will happen eventually if the rest of the app behaves correctly by not placing state outside of its class loader's environment. Attached is a version of the class which I have used to this effect.

    This is also a problem in the OSGi space where every jar gets its own class loader and they can be refreshed easily at runtime to do rolling upgrades/bug fixes.

    type=defect status=fixed package=base 
    opened by gissuebot 110
  • Maps.asMap(Set, Function) -> Map, or Maps.toMap(Iterable, Function) -> ImmutableMap (... or both)

    Maps.asMap(Set, Function) -> Map, or Maps.toMap(Iterable, Function) -> ImmutableMap (... or both)

    Original issue created by sebdotv on 2008-04-02 at 11:03 AM


    This method would create a new hash map, then iterate over keys: apply function to get value, add new entry to the map.

    Map<K, V> fromFunction(Set<K> keys, Function<K, V> function);

    status=fixed type=addition package=collect 
    opened by gissuebot 70
  • Provide custom exception handling in EventBus

    Provide custom exception handling in EventBus

    Original issue created by toellrich on 2011-10-20 at 12:05 PM


    I would love to replace our implementation of a synchronous event bus with the one from Guava. They do pretty much the same thing except for one notable difference: Ours propagates exceptions that happen during event handling since event handling must occur in the same database transaction as the code that raised the event. Is there any chance to make this configurable (flag/subclassing)?

    Cheers Thomas

    status=fixed type=enhancement package=eventbus 
    opened by gissuebot 61
  • guava 14.0.1 cannot be deployed in a JEE7 Container

    guava 14.0.1 cannot be deployed in a JEE7 Container

    Original issue created by AaronJWhiteside on 2013-05-28 at 09:34 PM


    In JEE7 CDI (CDI 2.0) is enabled by default (without a beans.xml needing to be present), with no standardized way of disable it.

    com.google.common.util.concurrent.ServiceManager is annotated with @Singleton and has a constructor...

      @Inject ServiceManager(Set<Service> services) {     this((Iterable<Service>) services);   }

    So any war or ear that contains a guava 14.0.1 jar suffers from CDI seeing this and trying to create the bean but failing and thus failing the entire war from loading.

    This error is from Glassfish 4.0

    [2013-05-23T15:08:35.664-0700] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=34 _ThreadName=admin-listener(2)] [timeMillis: 1369346915664] [levelValue: 1000] [[   Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [Set<Service>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)] org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Set<Service>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)]

    The same WAR also fails to deploy on Firefly 8.0 with a similar error.

    Can guava be modified to not use the @Singleton and @Inject annotations?

    status=fixed package=concurrent 
    opened by gissuebot 57
  • Guava for Android and Guava for the JRE need separate Maven namespaces

    Guava for Android and Guava for the JRE need separate Maven namespaces

    Guava for Android is lacking classes that are provided in Guava for the JRE (notably around support for Java 8 in the immutable collections). The two are not interchangeable.

    Maven's dependency resolution looks at group and project IDs, and then attempts to find the most recent version. Because the only difference between the android and JRE versions of guava is the version number, this can result in Java 8 projects getting the Android version of Guava (and, presumably, vice versa).

    For reference, at the time of writing search.maven.org believes the most recent guava release is the one for Android.

    guava-oops

    The correct thing to do is give the Android version a different project ID.

    P1 
    opened by shs96c 54
  • Support for trees and traversals

    Support for trees and traversals

    Original issue created by jvdneste on 2009-05-25 at 02:34 PM


    As a suggestion; I find it quite useful!

    /**  * returns a depth-first iterator for a tree of T  * @param f a function that returns the children of node of the tree  * @param root The root element of the tree  * @return  */ public static <T> Iterable<T> walk(final T root,     final Function<? super T, ? extends Iterable<? extends T>> getChildren) {   final Function<T, Iterable<? extends T>> walkFunc =       new Function<T, Iterable<? extends T>>() {     public Iterable<? extends T> apply(final T from) {       return walk(from, getChildren, this);     }   };   return walk(root, getChildren, walkFunc); }

    private static <T> Iterable<T> walk(final T root,   final Function<? super T, ? extends Iterable<? extends T>> getChildren,     final Function<T, Iterable<? extends T>> walkFunction) {   return Iterables.concat(     Collections.singleton(root),     Iterables.concat(       Iterables.transform(         getChildren.apply(root),         walkFunction))); }

    And a shortcut in case the nodes implement Iterable:

    @SuppressWarnings("unchecked") public static <T extends Iterable<T>> Iterable<T> walk(final T root) {   return walk(root, Functions.identity(), WalkIterableFunction.INSTANCE); }

    @SuppressWarnings("unchecked") private static enum WalkIterableFunction implements Function {   INSTANCE;

      public Object apply(final Object from) {     return walk(from, Functions.identity(), this);   } };

    status=fixed type=addition package=collect 
    opened by gissuebot 51
  • support OSGi manifest entries

    support OSGi manifest entries

    Original issue created by steven.marcus on 2008-05-08 at 11:50 PM


    Please support OSGi manifest entries. This will enable use of the library within OSGi runtimes without requiring post-processing by downloaders.

    status=duplicate 
    opened by gissuebot 47
  • Add functions to check blank Strings in com.google.common.base.Strings

    Add functions to check blank Strings in com.google.common.base.Strings

    Original issue created by jbaumgarten on 2010-04-24 at 07:25 PM


    Would be useful to have functions to check blank Strings "à la" commons-lang in com.google.common.base.Strings.

    Could be : static public boolean isBlank(final String s) static public boolean isNullOrBlank(@Nullable final String s)

    Could also add : static public @Nullable String blankToNull(@Nullable final String s).

    type=enhancement status=working-as-intended 
    opened by gissuebot 46
  • FluentIterable

    FluentIterable

    Original issue created by jonhnnyweslley on 2007-10-22 at 05:12 PM


    Hi,

    Last weekend I thought: "Why not to use functional programming with Java? More precisely using Google Collections!" ...

    Minutes later... Voila!!! I can to write pieces of code as:

    names.select(new Regexp(".*e$")).transform(new GetLength()).select(new OddNumber())

    I wanted to move this code to a fluent interface. Now, I dont need the verbose syntax of the static methods, and, mainly, this code is more easy to read.

    The attached jar file contains the full source code with:

    • FunctionalIterable interface, with all methods documented
    • StandartFunctionalIterable class, the default implementation
    • StandartFunctionalIterableTest class, the show case class

    About Fluente Interface: http://martinfowler.com/bliki/FluentInterface.html http://en.wikipedia.org/wiki/Fluent_interface

    status=fixed type=enhancement package=collect 
    opened by gissuebot 46
  • JDK and Guava TypeVariable implementations are no longer compatible under 1.7.0_51-b13

    JDK and Guava TypeVariable implementations are no longer compatible under 1.7.0_51-b13

    Original issue created by magiciankid on 2014-01-17 at 01:02 AM


    com.google.common.reflect.TypeResolverTest com.google.common.reflect.TypeTokenResolutionTest com.google.common.reflect.TypeTokenTest com.google.common.reflect.TypesTest

    java -version

    java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

    please fix it :)

    type=defect status=fixed package=reflect 
    opened by gissuebot 45
  • Add a fold method for Iterables

    Add a fold method for Iterables

    Original issue created by rwallace1979 on 2009-08-12 at 11:37 PM


    I find myself always wanting to iterate over a collection to aggregate the data and wishing Google Collections had a fold operation.

    An implementation can be found on StackOverflow, <http://stackoverflow.com/questions/950751/how-to-implement-a-list-fold-in-java/951337#951337>.

    type=addition package=collect status=will-not-fix 
    opened by gissuebot 45
  • Provide lazy variant of firstNonNull

    Provide lazy variant of firstNonNull

    Every now and then I'd like to check a variable for a non-null value or otherwise provide a reasonable non-null default value. Sometimes the second value is computed or should be created on-demand for different reasons. Therefore please provide T firstNonNull(T first, Supplier<? extends T> second) for that.

    firstNonNull is much more concise and expressive than requireNonNullElseGet or Optional.ofNullable(first).orElseGet(() -> second()).

    Additionally: java.util.Objects.requireNonNullElseGet(T obj, Supplier<? extends T> supplier) should be mentioned in Javadoc as an alternative for incoming parameter validation.

    Thank you for your great library.

    opened by bjmi 0
  • Use 2.x version for j2objc-annotations

    Use 2.x version for j2objc-annotations

    Guava currently uses 1.3 version for com.google.j2objc.j2objc-annotations

    https://github.com/google/guava/blob/0a17f4a429323589396c38d8ce75ca058faa6c64/pom.xml#L278-L282

    However, 2.x branch seems to be the one which is regularly maintained (https://github.com/google/j2objc). Though there are no new versions of 1.x branch after 2017 on Maven (https://search.maven.org/artifact/com.google.j2objc/j2objc-annotations).

    j2objc-annotations version 1.3 is getting flagged as EOL by our scanner. I would be like to suggest that Guava move to make use of latest 2.x version of j2objc-annotations.

    status=triaged type=other P3 
    opened by sandeepk-veritas 2
  • Fixes for issues #3965, #1710, #5882 and #5773

    Fixes for issues #3965, #1710, #5882 and #5773

    Fixed various open issues:

    • Issue #3965 : Added reverse method for ImmutableIntArray, ImmutableLongArray and ImmutableDoubleArray.
    • Issue #1710 : Added BooleanConverter in Booleans
    • Issue #5882 : Added constrain method to Range
    • Issue #5773 : Made mergeSort algorithm in Iterators

    Note: We are a student team and this is part of our undergraduate assignment

    type=addition package=collect P3 
    opened by u6873285 1
  • GitHub release descriptions use `http://` URLs for Javadoc and JDiff links

    GitHub release descriptions use `http://` URLs for Javadoc and JDiff links

    The descriptions of the GitHub releases on https://github.com/google/guava/releases seem to use http:// URLs for Javadoc and JDiff links instead of https://.

    At least for the description of future releases it would be good to use https:// given that guava.dev does support HTTPS.

    Browser developer tools screenshot showing one of the http:// URLs: Developer tools screenshot

    type=other type=documentation P3 
    opened by Marcono1234 0
  • TypeVariable bounds should be considered when resolve types

    TypeVariable bounds should be considered when resolve types

    Given :

    public interface MyType<T> {}
    
    public interface SubType<T> extends MyType<T> {}
    
    public interface SubTypeInteger extends MyType<Integer> {}
    
    public interface SubTypeBounded<T extends Number> extends MyType<T> {}
    
    TypeToken<MyType<String>> type = new TypeToken<>() {};
    

    When :

    TypeToken<? extends MyType<String>> subType = type.getSubtype(SubType.class);
    

    Then subType is SubType<String> (OK)

    When :

    TypeToken<? extends MyType<String>> subType = type.getSubtype(IntegerSubType.class);
    

    Then java.lang.IllegalArgumentException: No type mapping from class java.lang.Integer to class java.lang.String is thrown (OK)

    When :

    TypeToken<? extends MyType<String>> subType = type.getSubtype(SubTypeBounded.class);
    

    Then subType is SubTypeBounded<String> (KO?) Should a java.lang.IllegalArgumentException be thrown ? Maybe adding a check here would solve it?

    @Override
    void visitTypeVariable(TypeVariable<?> typeVariable) {
        Type[] bounds = typeVariable.getBounds();
        if (bounds.length > 0) {
            boolean contains = Arrays.stream(bounds)
                    .map(TypeToken::of)
                    .anyMatch(t -> t.getType() instanceof TypeVariable || t.isSupertypeOf(to)); //  t.getType() instanceof TypeVariable is too permisive ?
            checkArgument(!contains, "No type mapping from %s bounds (%s) to %s", typeVariable, Arrays.toString(bounds), to);
        }
        mappings.put(new TypeVariableKey(typeVariable), to);
    }
    
    type=defect package=reflect P3 
    opened by d-william 3
Releases(v31.1)
  • v31.1(Feb 28, 2022)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.1-jre</version>
      <!-- or, for Android: -->
      <version>31.1-android</version>
    </dependency>
    

    Jar files

    Guava requires one runtime dependency, which you can download here:

    Javadoc

    JDiff

    Changelog

    • base: Deprecated the Throwables methods lazyStackTrace and lazyStackTraceIsLazy. They are no longer useful on any current platform. (6ebd7d8648)
    • collect: Added a new method ImmutableMap.Builder.buildKeepingLast(), which keeps the last value for any given key rather than throwing an exception when a key appears more than once. (68500b2c09)
    • collect: As a side-effect of the buildKeepingLast() change, the idiom ImmutableList.copyOf(Maps.transformValues(map, function)) may produce different results if function has side-effects. (This is not recommended.) (68500b2c09)
    • hash: Added Hashing.fingerprint2011(). (13f703c25f)
    • io: Changed ByteStreams.nullOutputStream() to follow the contract of OutputStream.write by throwing an exception if the range of bytes is out of bounds. (1cd85d01c9)
    • net: Added @CheckReturnValue to the package (with a few exceptions). (a0e2577de6)
    • net: Added HttpHeaders constant for Access-Control-Allow-Private-Network. (6dabbdf9c9)
    • util.concurrent: Added accumulate/update methods for AtomicDouble and AtomicDoubleArray. (2d875d327a)

    APIs promoted from @Beta

    • base: Throwables methods getCausalChain and getCauseAs (dd462afa6b)
    • collect: Streams methods mapWithIndex and findLast (8079a29463)
    • collect: the remaining methods in Comparators: min, max, lexicographical, emptiesFirst, emptiesLast, isInOrder, isInStrictOrder (a3e411c3a4)
    • escape: various APIs (468c68a6ac)
    • io: various APIs in Files (828d9ee74e)
    • net: various APIs (261ac7afbf)
    • reflect: various APIs (9f6a384020)
    • testlib: various APIs (93a8f02f56)
    • util.concurrent: AsyncCallable, ListenableScheduledFuture, and ClosingFuture (8b4ad17dcf)
    • util.concurrent: ExecutionSequencer, MoreExecutors.newSequentialExecutor, and Monitor (189d668a95)
    • util.concurrent: Futures methods: submit, submitAsync, scheduleAsync, nonCancellationPropagating, inCompletionOrder (e015172847)
    • util.concurrent: Uninterruptibles: awaitTerminationUninterruptibly and the Duration overloads in the class (825de9a2d0)
    • util.concurrent: the FluentFuture type, its factory methods, and addCallback (9c7e13b5d4)
    Source code(tar.gz)
    Source code(zip)
  • v31.0.1(Sep 27, 2021)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.0.1-jre</version>
      <!-- or, for Android: -->
      <version>31.0.1-android</version>
    </dependency>
    

    Jar files

    Guava requires one runtime dependency, which you can download here:

    Javadoc

    JDiff

    Changelog

    Source code(tar.gz)
    Source code(zip)
  • v31.0(Sep 24, 2021)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.0-jre</version>
      <!-- or, for Android: -->
      <version>31.0-android</version>
    </dependency>
    

    Jar files

    Guava requires one runtime dependency, which you can download here:

    Javadoc

    JDiff

    Changelog

    Known issue (fixed in patch release 31.0.1): guava-gwt breaks GWT compilation

    Other Guava artifacts aren't affected, only users of GWT. (If you are using GWT, you would know it.)

    Sorry for missing this during release: It was a known issue, and we had a partial workaround in place, but I forgot to include the problem in the list of release blockers.

    To pick up the fix, upgrade to 31.0.1.

    Main changes

    • Changed guava-android to generate Java 8 bytecode. We still restrict ourselves to using APIs available on Ice Cream Sandwich. So, as long as you have enabled Java 8 language features for your Android build, this change should have no effect on Android projects. This change does drop support for Java 7 JREs, as announced last year.
    • Annotated Guava much more thoroughly for nullness. For details, see the bottom of the release notes.
    • base: Changed Functions.forSupplier and Predicates.instanceOf to accept an additional type argument to specify the input type for the returned Function/Predicate. The flexibility we're adding should typically not be necessary if users follow the PECS principle, but it can be useful in some cases, particularly around nullness analysis. Note that this change may require updates to callers' source code (to specify an additional type argument). Still, it maintains binary compatibility. (75110e936d)
    • collect: Added ImmutableMap.ofEntries, like Map.ofEntries but for ImmutableMap. (cd3b4197fb)
    • collect: Added overloads of ImmutableMap.of, ImmutableBiMap.of, and ImmutableSortedMap.of for up to 10 entries. (d5c30e3f19)
    • collect: Renamed ImmutableMap.Builder.build() to buildOrThrow(). The existing build() method will continue to exist but may be deprecated, and the new name should be used in new code. (4bbe12c4e0)
    • collect: Removed @Beta from Interner and Interners. (cf31f3a31d)
    • collect: Added @InlineMe to Streams.stream(Optional) and friends. (a176cd60f1)
    • graph: Made EndpointPair.adjacentNode require an N instead of accept any Object. (b0be21d46c)
    • hash: Removed @Beta from HashFunction. (e1cc195cfb)
    • hash: Deprecated buggy murmur3_32, and introduced murmur3_32_fixed. (a36f08fe31)
    • io: Changed CharStreams.asWriter(appendable).write(string[, ...]) to reject a null string. (50e7dddf5c)
    • io: Fixed a bug in FileBackedOutputStream cleanup: If writing to the temp file fails, we now delete it before propagating the exception. (6e054cea7b)
    • net: Changed HostAndPort.fromString to reject port numbers spelled with non-ASCII digits. (53fd1d7612)
    • net: Added HttpHeaders constants for X-Device-Ip, X-Device-Referer, X-Device-Accept-Language, X-Device-Requested-With, Sec-CH-Prefers-Color-Scheme, Sec-CH-UA-Bitness, and Keep-Alive. (da375be86a, b23b277422, 281edd4b6e, 9c88f9ad6d)
    • primitives: Fixed a rounding bug in UnsignedLong.doubleValue(). (e61cf2e8d7)
    • reflect: Changed the type hierarchy of Invokable: Invokable no longer inherits from AccessibleObject or GenericDeclaration, though it continues to define instance methods with the same signatures as the formerly inherited ones. This is technically a breaking API change to this @Beta API. We think it very unlikely that anyone is affected in practice. (12af215974)
    • testlib: Enhanced NullPointerTester to allow a parameter of type <T extends @Nullable Object> to be null. (e85672246f)
    • testlib: Fixed bug affecting derived tests of custom collection test suites: The setUp and tearDown methods are now copied to derived test suites. (c7d9fef73b)
    • util.concurrent: Added ServiceManager.startupDurations(). (c95ba5a298)
    • util.concurrent: Removed the GWT-only overloads of Futures.catching and catchingAsync that let callers omit the Executor. This matches a change made years ago to the non-GWT API. If this breaks your GWT client code compilation, you can fix it by passing an additional parameter, MoreExecutors.directExecutor() (0ff2f78959)

    Nullness annotations

    Previously, we annotated all parameters that could be null, and we did not annotate elsewhere reliably. Now:

    • We consistently annotate return types for nullness.
    • We annotate "components" of types, like the element type of an array or list and the bound of a type parameter. (To take advantage, Kotlin users can set -Xtype-enhancement-improvements-strict-mode.)
      • However, we don't yet annotate any such locations as non-nullable.
    • In our annotations (including on parameters), we distinguish between @Nullable T ("always nullable, regardless of the type argument used for T") and T ("nullable only if the type argument is").
    • We have temporarily increased our usage of jsr305, which we will ultimately phase out.
      • We use @CheckForNull instead of a type-annotation @Nullable wherever possible. This makes the nullness information available to more Kotlin users.
      • We've introduced a custom jsr305 annotation that informs Kotlin that unannotated return types are non-null (just like our usage of @ParametersAreNonnullByDefault already did for parameter types). (To take advantage, Kotlin users can set -Xjsr305=strict.)

    (Known issue: We are missing annotations on the TypeToInstanceMap classes. We'll fix this in a future release.)

    By providing additional nullness information, this release may result in more errors or warnings from any nullness analyzers you might use. If so, you may need to fix or suppress them as usual. For advice, see the documentation for the analyzer you're using, such as that for the Checker Framework or for Kotlin.

    If you use NullAway with the AnnotatedPackages flag set to cover com.google.common, you may see not only additional legitimate errors but also some incorrect errors because Guava no longer uses @Nullable as frequently on type-variable usages. The NullAway developers have suggested a workaround, and they are planning for NullAway 0.9.9 to treat our type-variable usages differently. However, even after 0.9.9, NullAway users are likely to see some incorrect errors if they keep com.google.common in their AnnotatedPackages. A fuller solution will require Guava and tools to adopt an annotation model that is more suited to generics. For updates on that, follow https://github.com/google/guava/issues/2960.

    We will be using more annotations to provide more nullness information in the future.

    Source code(tar.gz)
    Source code(zip)
  • v30.1.1(Mar 19, 2021)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>30.1.1-jre</version>
      <!-- or, for Android: -->
      <version>30.1.1-android</version>
    </dependency>
    

    Jar files

    Guava requires one runtime dependency, which you can download here:

    Javadoc

    JDiff

    Changelog

    • Increased the aggressiveness of Guava 30.1's warning log message for running guava-android under a Java 7 VM. (Android VMs are unaffected.) If the warning itself causes you trouble, you can eliminate it by silencing the logger for com.google.common.base.Preconditions (which is used only for this warning). This warning prepares for removing support for Java 7 in 2021. Please report any problems. We have tried to make the warning as safe as possible, but anytime a common library logs, especially as aggressively as we do in this new release, there is the potential for NullPointerException or even deadlock. (To be clear, Guava will not log under Java 8 or Android, but it will under Java 7.) (00c25e9b11)
    • cache: Fixed compatibility between asMap().compute(...) and a load. (42bf4f4eb7)
    • cache: Added @CheckReturnValue to some APIs. (a5ef129ffc)
    • collect: Added @DoNotCall to the mutator methods on immutable types (6ae9532d11)
    • hash: Removed @Beta from HashCode. (2c9f161e10)
    • io: Removed @Beta from CountingOutputStream. (d394bac847)
    Source code(tar.gz)
    Source code(zip)
  • v30.1(Dec 14, 2020)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>30.1-jre</version>
      <!-- or, for Android: -->
      <version>30.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • If you use guava-android in an Android project (as opposed to from a Java VM), you will need to enable desugaring of Java 8 language features if you have not already done so. (And if you are releasing an Android library, then anyone who uses that library will also have to enable desugaring.) We expect for nearly all Android projects to have already enabled desugaring. But if this causes problems for you, please let us know on issue #5358. The purpose of this change is to detect potential problems for users now so that we can plan to use Java 8 language features in our implementation later this year.
    • Introduced a warning log message when running guava-android under a Java 7 VM. (Android VMs are unaffected, aside from the need to use desugaring, described in the previous bullet.) This warning is not guaranteed to be logged when running under Java 7, so please don't rely on it as your only warning about future problems. If the warning itself causes you trouble, you can eliminate it by silencing the logger for com.google.common.base.MoreObjects$ToStringHelper (which is used only for this warning). This warning prepares for removing support for Java 7 in 2021. Please report any problems. We have tried to make the warning as safe as possible, but anytime a common library logs, there is the potential for NullPointerException or even deadlock. (To be clear, Guava will not log under Java 8 or Android, but it may log under Java 7.) (dc52e6e385)
      • Note that we subsequently made this warning more aggressive in Guava 30.1.1, including changing the logger it uses to com.google.common.base.Preconditions.
    • base: Deprecated StandardSystemProperty.JAVA_EXT_DIRS. We do not plan to remove the API, but note that, under recent versions of Java, that property always has a value of null. (38abf07772)
    • net: Added HttpHeaders constants for Origin-Isolation and X-Request-ID. (a48fb4f724, 8319d201cd)
    • reflect: Added ClassInfo.isTopLevel(). (410627262b)
    • util.concurrent: Added ClosingFuture.submitAsync(AsyncClosingCallable). (c5e2d8d5cb)
    Source code(tar.gz)
    Source code(zip)
  • v30.0(Oct 16, 2020)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>30.0-jre</version>
      <!-- or, for Android: -->
      <version>30.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • 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. (0cb89dd110)
    • cache: Fixed memory leak in LocalCache under j2objc. (5e519d91d0)
    • collect: Added two-element min and max methods to Comparators. (958186c071)
    • collect: Removed @Beta from Multimaps.toMultimap. (b6b4dc49b1)
    • 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()). (f5a69c33fc)
    • 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. (215b1f0dd7)
    • collect: Eliminated j2objc retain-cycle in SingletonImmutableBiMap. (0ad38b88bd)
    • eventbus: Prevented @Subscribe from being applied to a method that takes a primitive, as that will never be called. (554546c971)
    • graph: Made Traverser.breadthFirst() lazier, and optimized Traverser more generally. (32f2d770f7, b5210ca95c)
    • graph: Added @DoNotMock to Traverser. (6410f18c06)
    • io: Deprecated Files.createTempDir(). (fec0dbc463) (CVE-2020-8908; continuing discussion in https://github.com/google/guava/issues/4011)
    • ~~io: Upgraded ByteStreams.copy(InputStream, OutputStream) to use the faster FileChannel if possible. (a1e9a0bd12)~~ [update: My mistake: This was rolled back, so it did not make 30.0.]
    • math: Added roundToDouble to BigDecimalMath, BigIntegerMath, and LongMath. (bee4f3c7ed, 2b5c096ddf, 633abf2c62)
    • net: Added MediaType constants for several font/ types. (571cf66bac)
    • net: Added HttpHeaders constants for Cross-Origin-Embedder-Policy(-Report-Only)?. (c3bf73187a)
    • testing: Made EqualsTester test that non-String objects are not equal to their String representations. (c9570eae69)
    • util.concurrent: Added ClosingFuture. (52e048ed6c)
    • 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. (dfb0001714)
    • util.concurrent: Changed AbstractFuture.toString() to no longer include the toString() of the result. (2ebf27fd45)
    • util.concurrent: Added awaitTerminationUninterruptibly. (f07b9540dc)
    Source code(tar.gz)
    Source code(zip)
  • v29.0(Apr 13, 2020)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>29.0-jre</version>
      <!-- or, for Android: -->
      <version>29.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Guava types can no longer be sent over GWT-RPC. To temporarily reenable support, set the guava.gwt.emergency_reenable_rpc system property to true. (5214a10b1e)
      • This is the only breaking change in this release, and it affects only users of the guava-gwt artifact, not people who use only the guava artifact. This release contains no changes that break binary compatibility for any users.
    • API documentation for Guava classes is now easier to reach. For example, for ImmutableList, visit guava.dev/ImmutableList. Also, more easily access the index at guava.dev/api.
    • collect: Annotated FluentIterable.from(FluentIterable) with @DoNotCall. (b1c77b7df3)
    • collect: Made ceiling, floor, headSet(E, boolean), and tailSet(E, boolean) methods available in the GWT-emulated ImmutableSortedSet. (7e0fe90ca8, 5f2fbf27b2)
    • graph: Made it possible to set a stable incident edge order by calling the newly added method [Value]Graph.Builder.incidentEdgeOrder(ElementOrder.stable()). (70164025a8)
    • graph: Added incidentEdgeOrder() to the [Value]Graph interfaces. (cde576ec00)
    • util.concurrent: Added Duration-based default methods to ListeningScheduledExecutorService. (931e83f969)
    • util.concurrent: Added immediateVoidFuture. (9f3bae5853)
    • util.concurrent: Removed @Beta from Service and related classes. (dc46627fea)
    • util.concurrent: Deprecated the 1-arg overload of ServiceManager.addListener. (86e3620125)
    • util.concurrent: Changed the return type of ServiceManager.servicesByState() to ImmutableSetMultimap (but also retained a method with the old signature for binary compatibility). (31999ae6f5)
    • util.concurrent: Made it safe to load the AbstractFuture class from a ForkJoinPool thread under a security manager. (6e0c5b5d50)
    Source code(tar.gz)
    Source code(zip)
  • v28.2(Dec 27, 2019)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>28.2-jre</version>
      <!-- or, for Android: -->
      <version>28.2-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Warning to users of GWT-RPC: The first Guava release of 2020 will remove support for GWT-serializing Guava types. To test ahead of time with GWT-RPC support for Guava types disabled, set the guava.gwt.emergency_reenable_rpc system property to false. (Even without the system property enabled, apps will now log warnings when sending Guava types over GWT-RPC.) (08bbf53ab0)
    • base: Added Splitter.splitToStream().
    • concurrent: Added Futures.submit() (c7ef0cc93b)
    • concurrent: Made platformThreadFactory() and related utilities (mainly *Service) work under Java 11 App Engine, and tweaked other App Engine threading behavior. (e3ee00d6769d219c9646a17114fa00e2955b54aa)
    • concurrent: Added catch to StackOverflowError in AbstractFuture.toString to prevent long chains of futures from failing toString calls. (a2e6acc009)
    • concurrent: Made ListenableFuture implement Thenable via a default interface method in GWT/j2cl (e0bac74571).
    • graph: Fixed bug in AbstractNetwork.hasEdgeConnecting() causing it to throw if either endpoint was not in the graph. Originally reported as #3721. (2ee7f9da69)
    • graph: Fixed data race. (0e94fb5bb8)
    • math: Added Stream support to Stats and StatsAccumulator. (e2f4eba636)
    • math: Added Quantiles compute() methods which return a Map now return a map with entries in the same order in which the indexes were provided. (786c3d84f1)
    • net: Added support for scope IDs for IPv6 addresses. (8a7d36a8e5044096919a3512aa6734c95032f38c)
    • net: Added toBigInteger and fromIpv4BigInteger/fromIpv6BigInteger to InetAddresses for manipulating InetAddresses as BigIntegers (d7a0b3d367)
    • net: Added MediaType constants for application/opensearchdescription+xml (f79c4fe0a7) and MPEG-DASH (67dd062cb9), as well as a constant for the header Cross-Origin-Opener-Policy (4ef2111641).
    • net: Made MediaType reject empty type, subtype, and attribute (b080067) and non-ASCII parameter values (2278123479). Also, made it serialize empty parameter values to quoted strings (2278123479).
    • Added @DoNotMock to several types. (4eea0f79c2, add430908ec77c1859f84bd753b84a5eca57b327)
    • Removed dependency on animal-sniffer-annotations. (5f37e53fd7)
    Source code(tar.gz)
    Source code(zip)
  • v28.1(Aug 28, 2019)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>28.1-jre</version>
      <!-- or, for Android: -->
      <version>28.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • collect: Added RangeMap.merge, analogous to Map.merge. (687252d35)
    • collect: Fixed a bug in ImmutableSet.Builder that could lead to infinite loops when building multiple sets from the same builder. (0007cb257)
    • io: Fixed an issue where the InputStream returned by BaseEncoding.decodingStream(Reader) could fail to throw DecodingException while decoding an invalid string. (ddd4a49fb)
    • net: Added MediaType for "image/heif" and "image/jp2" (508696a4c)
    • net: Added Upgrade-Insecure-Requests header to HttpHeaders. (6a8b716af)
    • concurrent: Fixed potential memory leak in Futures.whenAllSucceed/whenAllComplete (494834bd4)
    Source code(tar.gz)
    Source code(zip)
  • v28.0(Jun 12, 2019)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>28.0-jre</version>
      <!-- or, for Android: -->
      <version>28.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • collect: Added Duration-based overloads to some Queues methods. (21d06cf1d48175ab5cdf3d88f1776d3cba227b37)
    • net: Added MediaType for "application/geo+json". (36cd5cfc5)
    • net: Added a number of constants to HttpHeaders.
    • concurrent: Removed deprecated CheckedFuture and related utilities. (3dd22fe75)
    • concurrent: Added Duration-based overloads to many methods.
    • concurrent: Removed @Beta from setFuture. (5ec136091)
    • concurrent: Added deprecated FluentFuture.from(FluentFuture) to point out redundant code. (f9f280776)
    • graph: Added GraphBuilder.immutable(),ValueGraphBuilder.immutable() and NetworkBuilder.immutable() for building immutable graphs in a fluent way.
    • J2ObjC: Fixed crashes from use of ImmutableMap.entrySet(). (74fc49faf)
    Source code(tar.gz)
    Source code(zip)
  • v27.1(Mar 8, 2019)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>27.1-jre</version>
      <!-- or, for Android: -->
      <version>27.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Removed GWT emulations that are no longer needed as of GWT 2.8.2. This means that GWT projects that use this version of Guava must use GWT 2.8.2 or higher. (5f3507252)
    • Created a BOM for Guava (new guava-bom artifact). (0e5964129)
    • Removed @Beta from a number of frequently used APIs. (6242bdd27)
    • net: Added Sec-Fetch headers to HttpHeaders. (673b24376)
    • net: Added SourceMap header to HttpHeaders (a99c15f4c)
    • net: Added MediaType for "application/jose" and "application/jose+json". (d416e04cf)
    • graph: Added overloads to methods accepting pairs of nodes to also accept EndpointPair; changed behavior of *Graph.edges().contains() to allow undirected graphs to accept ordered EndpointPairs. (af3ee1c59)
    Source code(tar.gz)
    Source code(zip)
  • v27.0.1(Nov 19, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>27.0.1-jre</version>
      <!-- or, for Android: -->
      <version>27.0.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Fixes an issue where classes that should only be included in failureaccess (Guava's one dependency) were also being included in the main Guava jar. (4d4a6765f)
    • Updates the version of failureaccess that Guava depends on to 1.0.1, which includes OSGi metadata. (7aae5f348)
    Source code(tar.gz)
    Source code(zip)
  • v27.0(Oct 18, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>27.0-jre</version>
      <!-- or, for Android: -->
      <version>27.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    Important: ListenableFuture is now available as a separate artifact (com.google.guava:listenablefuture:1.0) from the rest of Guava. As part of that change, Guava now has a real (needed at runtime) dependency on com.google.guava:failureaccess:1.0. For more details, see this announcement. (b62d52926)

    • collect: Added a gap(Range) method to Range that computes the Range that lies between them. (a9dd7098f)
    • net: Added HttpHeaders.EARLY_DATA. (e074cf1a7)
    • net: Added MediaType.WASM_APPLICATION. (0b3eb0f4e)
    • concurrent: AbstractFuture doesn't expose FluentFuture APIs anymore. (0f8d3608a)
    • concurrent: Added doCancelStart protected method to AbstractService (27bfe412b)
    Source code(tar.gz)
    Source code(zip)
  • v26.0(Aug 1, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>26.0-jre</version>
      <!-- or, for Android: -->
      <version>26.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • base: Removed deprecated public static fields from CharMatcher. Use the equivalent public static methods instead. (f1249c4f0)
    • base: Fixed the ServiceConfigurationError that some users encountered when using Guava as a JPMS module. (8287cdfa3)
    • cache: Fixed a bug where Cache.asMap.compute* methods could cause nonsensical weights to be stored, breaking cache eviction. (15764d7f3)
    • concurrent: Removed deprecated Futures methods that implicitly use directExecutor(). (87d87f5ca)
    • concurrent: Added ExecutionSequencer, a new utility to run a series of asynchronous operations serially. (8d1fbc96e)
    • concurrent: Removed special-casing UndeclaredThrowableException in Futures.transform(). (9466b62f5)
    • net: Changed HostAndPort.equals() and hashCode() to stop depending on whether brackets were included. Now they depend only on host and port. (34c161627)
    • net: Added HttpHeaders constant for Sec-Metadata header. (986a3a3ef)
    • net: Added MediaType for "application/hal+json". (fea88fe49)
    Source code(tar.gz)
    Source code(zip)
    guava-26.0-android.jar(2.47 MB)
    guava-26.0-jre.jar(2.61 MB)
    guava-testlib-26.0-android.jar(764.58 KB)
    guava-testlib-26.0-jre.jar(832.99 KB)
  • v23.6.1(May 31, 2018)

  • v25.1(May 31, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>25.1-jre</version>
      <!-- or, for Android: -->
      <version>25.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Switched to the type annotation version of @Nullable in the JRE/Java 8 flavor. (0a2258e66)
    • base: Added Strings.lenientFormat(), copied from Preconditions.format(). (7fe1702ae)
    • net: Added Token Binding HTTP headers to HttpHeaders. (d9113d51b)
    • reflect: Added overrides for methods on JDK types returning AnnotatedType in the JRE/Java 8 flavor. (d94eb93fb)
    • testing: Added support for type annotations in NullPointerTester in the JRE/Java 8 flavor. (d94eb93fb)
    • util.concurrent: Added @DoNotCall to Futures methods that do not accept an Executor in preparation for removal. (49a1df62b)
    Source code(tar.gz)
    Source code(zip)
  • v24.1.1(Apr 26, 2018)

    Note that we've also released Guava 25.0, which contains the change in 24.1.1 and some additional changes.

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>24.1.1-jre</version>
      <!-- or, for Android: -->
      <version>24.1.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    (There are no API diffs from 24.1. Our release tooling generated the following diffs against the newer 25.0, which doesn't really make sense. We'll try to get that fixed for future patch releases.)

    Changelog

    • Fixed Denial of Service vulnerability for servers that use Guava and deserialize attacker data: CVE-2018-10237. (7ec8718f1)
    Source code(tar.gz)
    Source code(zip)
  • v25.0(Apr 25, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>25.0-jre</version>
      <!-- or, for Android: -->
      <version>25.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Fixed Denial of Service vulnerability for servers that use Guava and deserialize attacker data: CVE-2018-10237. (f89ece572)
    • cache: Added java.time.Duration overloads to CacheBuilder. (9bf6d9590)
    • io: Removed deprecated Files.fileTreeTraverser() and MoreFiles.directoryTreeTraverser(). (ce6d93c20)
    Source code(tar.gz)
    Source code(zip)
  • v24.1(Mar 15, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>24.1-jre</version>
      <!-- or, for Android: -->
      <version>24.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • collect: Added hash flooding protection to ImmutableSet, ImmutableMultiset, ImmutableMap and ImmutableBiMap
    • graph: Added support for traversing from multiple start nodes in Traverser. (cbc530844)
    • net: Added X-Download-Options header to HttpHeaders (9b9a17535)
    • net: Added L16 audio constant to MediaType
    Source code(tar.gz)
    Source code(zip)
  • v24.0(Feb 1, 2018)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>24.0-jre</version>
      <!-- or, for Android: -->
      <version>24.0-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • base: Removed deprecated Predicates.assignableFrom(Class). (d57a40e54)
    • collect: Removed deprecated BinaryTreeTraverser. (f91ef6ca6)
    • concurrent: Removed deprecated Futures.dereference and MoreExecutors.sequentialExecutor. (f91ef6ca6)
    • graph: Removed deprecated Graphs.equivalent() (41fa39fa7)
    • graph: Added incidentEdges() method to Graph and ValueGraph. (d788bc15f)
    • net: Added HttpHeaders.HTTP2_SETTINGS header according to http://httpwg.org/specs/rfc7540.html#Http2SettingsHeader (393066e5b)
    • net: Added MediaType.withParameters method that can replace a specific attribute with zero or more values. (7da42d206)
    Source code(tar.gz)
    Source code(zip)
  • v23.6(Dec 21, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.6-jre</version>
      <!-- or, for Android: -->
      <version>23.6-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • concurrent: Added Uninterruptibles methods for Condition. (794a8ca43)
    • concurrent: Added a run method to FutureCombiner to allow passing a Runnable to Futures.whenAllComplete and Futures.whenAllSucceed (de28fd831)
    • concurrent: Made Futures.getUnchecked available under GWT. (b1d9d99b6)
    • net: Added "Server-Timing" HTTP header to HttpHeaders according to https://www.w3.org/TR/server-timing/ (f089e55e5)
    • testing: Started recognizing @NullableDecl in NullPointerTester and friends.
    • Migrated from jsr305 @Nullable to the Checker Framework @NullableDecl. Tools that read these annotations may need to be updated to recognize the new annotation. For Kotlin in particular, we sent a pull request, which has been merged for 1.2.20.
    • Migrated from jsr305 @CheckReturnValue, @GuardedBy and @OverridingMethodsMustInvokeSuper to the Error Prone equivalents.
    Source code(tar.gz)
    Source code(zip)
  • v23.5(Nov 22, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.5-jre</version>
      <!-- or, for Android: -->
      <version>23.5-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • base: Graduated Verify and VerifyException from @Beta. (0ad9c4410)
    • collect: ImmutableMap.getOrDefault is now also available in the Android flavor. (1e4938c)
    • graph: Tightened the contract for the edge-adding methods on Mutable{Graph, Network, ValueGraph}. This is a breaking change; implementors of these interfaces should verify that they still comply with this contract. (ec48806ee)
    • io: Added Files.fileTraverser() and MoreFiles.fileTraverser(). (af7514acd)
    • io: Deprecated Files.fileTreeTraverser() and MoreFiles.directoryTreeTraverser(). (1644f6ea9)
    • Migrated from jsr305's @Immutable to Error Prone's. (901e98559)
    • Added a dependency on, but did not begin using, the Checker Framework's annotations. We expect to begin using it in a future release.
      • If you're using maven-plugin-plugin, the Checker Framework dependency may trigger a bug. To fix it, upgrade maven-plugin-plugin to 3.5. We expect this problem to go away with Guava 23.6, which will change to a different Checker Framework dependency.
    Source code(tar.gz)
    Source code(zip)
  • v23.4(Nov 9, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.4-jre</version>
      <!-- or, for Android: -->
      <version>23.4-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • collect: Added support for empty ArrayTable.
    • net: Added Referrer-Policy to HttpHeaders, along with possible values for that header in ReferrerPolicyValues. (19b4d977a)
    • util.concurrent: Adjusted the interruption behavior of MoreExecutors.sequentialExecutor() to run tasks without a Thread interrupt marked (previously, interrupts leaked between tasks). If the Thread was interrupted when the Executor received it or during execution of its tasks, the thread will be re-interrupted before being yielded. Expanded the documentation of MoreExecutors.sequentialExecutor() to cover interruption and rejected execution behavior in detail. (40564c741)
    • Upgraded the version of GWT we test with to 2.8.2. We haven't yet intentionally depended on this new version, but now that we're testing with it, we may come to depend on it accidentally.
    Source code(tar.gz)
    Source code(zip)
  • v23.3(Oct 26, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.3-jre</version>
      <!-- or, for Android: -->
      <version>23.3-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • base: Updated hardcoded CharMatcher.digit() and invisible() from Unicode 6.3 to Unicode 9.
    • graph: Deprecated TreeTraverser and BinaryTreeTraverser. Please use com.google.common.graph.Traverser instead.
    • net: Added methods for dealing with registry suffixes to InternetDomainName.
    • util.concurrent: Introduced MoreExecutors.newSequentialExecutor, the new name for sequentialExecutor.
    Source code(tar.gz)
    Source code(zip)
  • v23.2(Oct 11, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.2-jre</version>
      <!-- or, for Android: -->
      <version>23.2-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • Added JPMS module name com.google.common for Guava.
    • base: Deprecated built-in CharMatchers which cannot work as expected because the API does not support supplementary code points.
    • collect: Fixed https://github.com/google/guava/issues/2962
    • collect: Fixed a bug in HashBiMap.inverse().forcePut()
    • graph: Added implementation for common.graph.Traverser, a new class that provides efficient breadth-first and depth-first traversal of graphs and trees. It should be used in place of common.collect.TreeTraverser, which will be deprecated.
    • graph: Fixed regression in ValueGraph.edgeValueOrDefault() (from Guava 23) that caused it sometimes to return null instead of the default value.
    Source code(tar.gz)
    Source code(zip)
  • v23.1(Sep 27, 2017)

    Maven

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.1-jre</version>
      <!-- or, for Android: -->
      <version>23.1-android</version>
    </dependency>
    

    Javadoc

    JDiff

    Changelog

    • New policy: For the indefinite future, we won't remove APIs (except those annotated @Beta).
    • FYI: This release is the first since our move to more frequent releases.
    • It is also the first to use the version format 23.1-jre (rather than just 23.1) for the non-Android artifact.
    • Guava should now be Java-9 compatible with the exception of the GWT-compatible libraries, which await a GWT release.
    • base: Added overloads of Verify.verify for different combinations of primitive and Object arguments
    • collect: Added builderWithExpectedSize factory methods for ImmutableCollection builders
    • graph: ~~Added Traverser<N> for graph and tree traversals~~
      • Note: Don't actually use this yet; most operations currently throw UnsupportedOperationException. Apologies!
    • primitives: Added reverse and sortDescending methods for primitive arrays
    • reflect: Updated ClassPath to continue to work with the system classloader under Java 9. (63898e263ddcdae00fc760fdaf97d90c8a656608)
    • util.concurrent: Added Executors.sequentialExecutor(Executor)
    Source code(tar.gz)
    Source code(zip)
  • v23.0(Aug 7, 2017)

  • v23.0-rc1(Aug 7, 2017)

  • v22.0(May 23, 2017)

  • v22.0-rc1(May 23, 2017)

Owner
Google
Google ❤️ Open Source
Google
A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

Evan Tatarka 5.3k Jan 5, 2023
I was fed up with writing Java classes to mirror json models. So I wrote this Java app to automate the process.

Json2Java I was fed up with writing Java classes to mirror json models. So I wrote this Java app to automate the process. What this tool can do right

Jon F Hancock 303 Oct 8, 2022
AboutLibraries is a library to offer some information of libraries.

AboutLibraries .. allows you to easily create an used open source libraries fragment/activity within your app. All the library information is automati

Mike Penz 3.1k Jan 3, 2023
Purpose for this base architectural project is to load it with all latest components and libraries So it become reference for all kind of Android projects

The purpose of this base architectural project is to load it with all the latest components and libraries, So it becomes a reference for all kinds of Android projects

null 7 Dec 7, 2021
Makes Google play in app purchase library (BillingClient) into a flowable that can easily be used in compose world

Billy the android Our goal is to make a modern api of BillingClient so that it is easier to use in compose world. This library is still early beta and

Stefan Wärting 16 Dec 14, 2022
ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

ZXing Project 30.5k Dec 27, 2022
AndroidPermissions 4.2 0.0 Java Android M was added to check Permission. but Permission check processing is so dirty.

Android Permissions Checker Android M was added to check Permission. but Permission check processing is so dirty. This Project is to be simple, Checki

Steve SeongUg Jung 340 Nov 11, 2022
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack

sixpack-java A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack Installing Sixpack-java is currently only

null 135 Oct 7, 2022
Simple Artificial Neural Network java library

SANN Simple Artificial Neural Network java library WIP Creating neural network Variant 1 //create new net (input, hidden, default len, output) Net net

Korpusov Maxim 14 Oct 11, 2022
PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

Pranav Patel 1 Apr 13, 2022
Android development recommendation for outdated libraries and current libraries preferred as of 2021

GADS21-Android-Recomendation-For currently used libraries and dependencies Android development recommendation for outdated libraries and current libra

Timz Owen 6 Nov 22, 2021
Java Logback Appender for Google Chat(Google Hangouts)

Logback Appender for Google Chat(Google Hangouts) This project is logback appender for Google Chat(Google Hangouts). Setup Add the JitPack repository

Kyungyoon Kim 3 Apr 7, 2022
Core Data for Android

NexusData Core Data for Android NexusData is an object graph and persistence framework for Android. It allows for organizing and managing relational d

Dia Kharrat 71 Nov 11, 2022
Core Data for Android

NexusData Core Data for Android NexusData is an object graph and persistence framework for Android. It allows for organizing and managing relational d

Dia Kharrat 71 Nov 11, 2022
ORMLite Android functionality used in conjunction with ormlite-core

ORMLite Android This package provides the Android specific functionality. You will also need to download the ormlite-core package as well. Users that

Gray 1.6k Dec 31, 2022
kotlin-core - A full framework for making Android apps. Based on Anko and Kotson.

kotlin-core This package is not Android-specific, and can be used across platforms. However, for a good example of use in Android, take a look at kotl

Lightning Kite 36 Oct 3, 2022
kotlin-core

kotlin-core This package is not Android-specific, and can be used across platforms. However, for a good example of use in Android, take a look at kotl

Lightning Kite 36 Oct 3, 2022
Repository for the Android app core module.

EU Digital COVID Certificate App Core - Android About • Development • Documentation • Support • Contribute • Contributors • Licensing About This repos

null 35 May 31, 2022
Warscape core library. Includes common models for sharing between platforms.

warscope-core This repository uses for sharing common models between backend and frontend sides. Implementation $version available at top of README.md

Warscape 5 Oct 8, 2021