Guava:Google的Java核心库
Guava项目包含了很多Java项目开发中依赖的Google核心库:集合、缓存、基础类型支持、并发库、通用注解、字符串处理、I/O等等。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
UPDATE: 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 had expected for nearly all Android projects to already be set up this way, but we have gotten a report of at least one that is not. If this causes problems for you, please let us know on #5358. We are figuring out our next steps.
- Introduced a warning log message when running
guava-android
under a Java 7 VM. (Android VMs are unaffected.) 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 forcom.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 forNullPointerException
or even deadlock. (To be clear, Guava will not log under Java 8 or Android, but it may log under Java 7.) (dc52e6e) base
: DeprecatedStandardSystemProperty.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 ofnull
. (38abf07)net
: AddedHttpHeaders
constants forOrigin-Isolation
andX-Request-ID
. (a48fb4f, 8319d20)reflect
: AddedClassInfo.isTopLevel()
. (4106272)util.concurrent
: AddedClosingFuture.submitAsync(AsyncClosingCallable)
. (c5e2d8d)
Assets
2
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. (0cb89dd) cache
: Fixed memory leak inLocalCache
under j2objc. (5e519d9)collect
: Added two-elementmin
andmax
methods toComparators
. (958186c)collect
: Removed@Beta
fromMultimaps.toMultimap
. (b6b4dc4)collect
: Made the set returned byImmutableMap<K, V>.keySet()
serializable as long asK
is serializable, even ifV
is not (and similarly forvalues()
). (f5a69c3)collect
: Fixed bug inpowerSet.equals(otherPowerSet)
would erroneously returnfalse
if the two power sets' underlying sets were equal but had a different iteration order. (215b1f0)collect
: Eliminated j2objc retain-cycle inSingletonImmutableBiMap
. (0ad38b8)eventbus
: Prevented@Subscribe
from being applied to a method that takes a primitive, as that will never be called. (554546c)graph
: MadeTraverser.breadthFirst()
lazier, and optimizedTraverser
more generally. (32f2d77, b5210ca)graph
: Added@DoNotMock
toTraverser
. (6410f18)io
: DeprecatedFiles.createTempDir()
. (fec0dbc) (CVE forthcoming)io
: UpgradedByteStreams.copy(InputStream, OutputStream)
to use the fasterFileChannel
if possible. (a1e9a0b)math
: AddedroundToDouble
toBigDecimalMath
,BigIntegerMath
, andLongMath
. (bee4f3c, 2b5c096, 633abf2)net
: AddedMediaType
constants for several font/ types. (571cf66)net
: AddedHttpHeaders
constants forCross-Origin-Embedder-Policy(-Report-Only)?
. (c3bf731)testing
: MadeEqualsTester
test that non-String
objects are not equal to theirString
representations. (c9570ea)util.concurrent
: AddedClosingFuture
. (52e048e)util.concurrent
: Removed the deprecated 1-argServiceManager.addListener(Listener)
. Use the 2-argaddListener(Listener, Executor)
overload, setting the executor todirectExecutor()
for equivalent behavior. (dfb0001)util.concurrent
: ChangedAbstractFuture.toString()
to no longer include thetoString()
of the result. (2ebf27f)util.concurrent
: AddedawaitTerminationUninterruptibly
. (f07b954)
Assets
2
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 totrue
. (5214a10)- This is the only breaking change in this release, and it affects only users of the
guava-gwt
artifact, not people who use only theguava
artifact. This release contains no changes that break binary compatibility for any users.
- This is the only breaking change in this release, and it affects only users of the
- 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
: AnnotatedFluentIterable.from(FluentIterable)
with@DoNotCall
. (b1c77b7)collect
: Madeceiling
,floor
,headSet(E, boolean)
, andtailSet(E, boolean)
methods available in the GWT-emulatedImmutableSortedSet
. (7e0fe90, 5f2fbf2)graph
: Made it possible to set a stable incident edge order by calling the newly added method[Value]Graph.Builder.incidentEdgeOrder(ElementOrder.stable())
. (7016402)graph
: AddedincidentEdgeOrder()
to the[Value]Graph
interfaces. (cde576e)util.concurrent
: AddedDuration
-baseddefault
methods toListeningScheduledExecutorService
. (931e83f)util.concurrent
: AddedimmediateVoidFuture
. (9f3bae5)util.concurrent
: Removed@Beta
fromService
and related classes. (dc46627)util.concurrent
: Deprecated the 1-arg overload ofServiceManager.addListener
. (86e3620)util.concurrent
: Changed the return type ofServiceManager.servicesByState()
toImmutableSetMultimap
(but also retained a method with the old signature for binary compatibility). (31999ae)util.concurrent
: Made it safe to load theAbstractFuture
class from aForkJoinPool
thread under a security manager. (6e0c5b5)
Assets
2
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 tofalse
. (Even without the system property enabled, apps will now log warnings when sending Guava types over GWT-RPC.) (08bbf53) base
: AddedSplitter.splitToStream()
.concurrent
: AddedFutures.submit()
(c7ef0cc)concurrent
: MadeplatformThreadFactory()
and related utilities (mainly*Service
) work under Java 11 App Engine, and tweaked other App Engine threading behavior. (e3ee00d)concurrent
: Addedcatch
toStackOverflowError
inAbstractFuture.toString
to prevent long chains of futures from failingtoString
calls. (a2e6acc)concurrent
: MadeListenableFuture
implementThenable
via a default interface method in GWT/j2cl (e0bac74).graph
: Fixed bug inAbstractNetwork.hasEdgeConnecting()
causing it to throw if either endpoint was not in the graph. Originally reported as #3721. (2ee7f9d)graph
: Fixed data race. (0e94fb5)math
: AddedStream
support toStats
andStatsAccumulator
. (e2f4eba)math
: AddedQuantiles
compute()
methods which return aMap
now return a map with entries in the same order in which the indexes were provided. (786c3d8)net
: Added support for scope IDs for IPv6 addresses. (8a7d36a)net
: AddedtoBigInteger
andfromIpv4BigInteger
/fromIpv6BigInteger
toInetAddresses
for manipulatingInetAddresses
asBigIntegers
(d7a0b3d)net
: AddedMediaType
constants for application/opensearchdescription+xml (f79c4fe) and MPEG-DASH (67dd062), as well as a constant for the header Cross-Origin-Opener-Policy (4ef2111).net
: MadeMediaType
reject empty type, subtype, and attribute (b080067) and non-ASCII parameter values (2278123). Also, made it serialize empty parameter values to quoted strings (2278123).- Added
@DoNotMock
to several types. (4eea0f7, add4309) - Removed dependency on
animal-sniffer-annotations
. (5f37e53)
Assets
2
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
: AddedRangeMap.merge
, analogous toMap.merge
. (687252d)collect
: Fixed a bug inImmutableSet.Builder
that could lead to infinite loops when building multiple sets from the same builder. (0007cb2)io
: Fixed an issue where theInputStream
returned byBaseEncoding.decodingStream(Reader)
could fail to throwDecodingException
while decoding an invalid string. (ddd4a49)net
: AddedMediaType
for "image/heif" and "image/jp2" (508696a)net
: AddedUpgrade-Insecure-Requests
header toHttpHeaders
. (6a8b716)concurrent
: Fixed potential memory leak inFutures.whenAllSucceed/whenAllComplete
(494834b)
Assets
2
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
net
: AddedMediaType
for "application/geo+json". (36cd5cf)concurrent
: Removed deprecatedCheckedFuture
and related utilities. (3dd22fe)concurrent
: AddedDuration
-based overloads to many methods.concurrent
: Removed@Beta
fromsetFuture
. (5ec1360)concurrent
: Added deprecatedFluentFuture.from(FluentFuture)
to point out redundant code. (f9f2807)graph
: AddedGraphBuilder.immutable()
,ValueGraphBuilder.immutable()
andNetworkBuilder.immutable()
for building immutable graphs in a fluent way.- J2ObjC: Fixed crashes from use of
ImmutableMap.entrySet()
. (74fc49f)
Assets
2
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. (5f35072)
- Created a BOM for Guava (new
guava-bom
artifact). (0e59641) - Removed
@Beta
from a number of frequently used APIs. (6242bdd) net
: AddedSec-Fetch
headers toHttpHeaders
. (673b243)net
: AddedSourceMap
header toHttpHeaders
(a99c15f)net
: AddedMediaType
for "application/jose" and "application/jose+json". (d416e04)graph
: Added overloads to methods accepting pairs of nodes to also acceptEndpointPair
; changed behavior of*Graph.edges().contains()
to allow undirected graphs to accept orderedEndpointPair
s. (af3ee1c)
Assets
2
cgdecker released this
Assets
2
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
Assets
2
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. (b62d529)
collect
: Added agap(Range)
method toRange
that computes theRange
that lies between them. (a9dd709)net
: AddedHttpHeaders.EARLY_DATA
. (e074cf1)net
: AddedMediaType.WASM_APPLICATION
. (0b3eb0f)concurrent
:AbstractFuture
doesn't exposeFluentFuture
APIs anymore. (0f8d360)concurrent
: AddeddoCancelStart
protected method toAbstractService
(27bfe41)
Assets
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 deprecatedpublic static
fields fromCharMatcher
. Use the equivalentpublic static
methods instead. (f1249c4)base
: Fixed theServiceConfigurationError
that some users encountered when using Guava as a JPMS module. (8287cdf)cache
: Fixed a bug whereCache.asMap.compute*
methods could cause nonsensical weights to be stored, breaking cache eviction. (15764d7)concurrent
: Removed deprecatedFutures
methods that implicitly usedirectExecutor()
. (87d87f5)concurrent
: AddedExecutionSequencer
, a new utility to run a series of asynchronous operations serially. (8d1fbc9)concurrent
: Removed special-casingUndeclaredThrowableException
inFutures.transform()
. (9466b62)net
: ChangedHostAndPort.equals()
andhashCode()
to stop depending on whether brackets were included. Now they depend only on host and port. (34c1616)net
: AddedHttpHeaders
constant for Sec-Metadata header. (986a3a3)net
: AddedMediaType
for "application/hal+json". (fea88fe)
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
- 25.1-jre vs. 25.0-jre (shows a lot of junk, probably due to switch to
@Nullable
type annotations) - 25.1-android vs. 25.0-android
- 25.1-android vs. 25.1-jre
Changelog
- Switched to the type annotation version of
@Nullable
in the JRE/Java 8 flavor. (0a2258e) base
: AddedStrings.lenientFormat()
, copied fromPreconditions.format()
. (7fe1702)net
: Added Token Binding HTTP headers toHttpHeaders
. (d9113d5)reflect
: Added overrides for methods on JDK types returningAnnotatedType
in the JRE/Java 8 flavor. (d94eb93)testing
: Added support for type annotations inNullPointerTester
in the JRE/Java 8 flavor. (d94eb93)util.concurrent
: Added@DoNotCall
toFutures
methods that do not accept anExecutor
in preparation for removal. (49a1df6)
24.1.1
cpovirk released this
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. (7ec8718)
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 toImmutableSet
,ImmutableMultiset
,ImmutableMap
andImmutableBiMap
graph
: Added support for traversing from multiple start nodes inTraverser
. (cbc5308)net
: Added X-Download-Options header toHttpHeaders
(9b9a175)net
: Added L16 audio constant toMediaType
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 deprecatedPredicates.assignableFrom(Class)
. (d57a40e)collect
: Removed deprecatedBinaryTreeTraverser
. (f91ef6c)concurrent
: Removed deprecatedFutures.dereference
andMoreExecutors.sequentialExecutor
. (f91ef6c)graph
: Removed deprecatedGraphs.equivalent()
(41fa39f)graph
: AddedincidentEdges()
method toGraph
andValueGraph
. (d788bc1)net
: AddedHttpHeaders.HTTP2_SETTINGS
header according to http://httpwg.org/specs/rfc7540.html#Http2SettingsHeader (393066e)net
: AddedMediaType.withParameters
method that can replace a specific attribute with zero or more values. (7da42d2)
Watchers:2478 |
Star:40874 |
Fork:9131 |
创建时间: 2014-05-30 00:23:17 |
最后Commits: 今天 |
43a53bc
Compare
Maven
Javadoc
JDiff
Changelog
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 forcom.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 forNullPointerException
or even deadlock. (To be clear, Guava will not log under Java 8 or Android, but it will under Java 7.) (00c25e9)cache
: Fixed compatibility betweenasMap().compute(...)
and a load. (42bf4f4)cache
: Added@CheckReturnValue
to some APIs. (a5ef129)collect
: Added@DoNotCall
to the mutator methods on immutable types (6ae9532)hash
: Removed@Beta
fromHashCode
. (2c9f161)io
: Removed@Beta
fromCountingOutputStream
. (d394bac)