external/guava-libraries.git
5 days agoUpgrade truth's gwt library to a more recent snapshot and upgrade OptionalTest to... master
Colin Decker [Wed, 16 Jul 2014 19:55:54 +0000 (15:55 -0400)]
Upgrade truth's gwt library to a more recent snapshot and upgrade OptionalTest to verify.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71278153

5 days agoUpdate the public suffix list.
Colin Decker [Wed, 16 Jul 2014 19:48:20 +0000 (15:48 -0400)]
Update the public suffix list.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71219810

5 days agoRemove specification of behavior when the number of arguments does not match the...
Colin Decker [Wed, 16 Jul 2014 19:46:40 +0000 (15:46 -0400)]
Remove specification of behavior when the number of arguments does not match the number of "%s" in the format string from Preconditions javadoc.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71201390

5 days agoRename SameThreadExecutorService to DirectExecutorService.
Colin Decker [Wed, 16 Jul 2014 19:39:55 +0000 (15:39 -0400)]
Rename SameThreadExecutorService to DirectExecutorService.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71178008

5 days agoFix errors in @GuardedBy annotations.
Colin Decker [Wed, 16 Jul 2014 19:27:05 +0000 (15:27 -0400)]
Fix errors in @GuardedBy annotations.

@GuardedBy("Segment.this") refers to an enclosing class named 'Segment';
@GuardedBy("this") refers to the current class.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70991665

5 days agoFixed a java 8 compatibility issue in ForwardingWrapperTest. Can't use isDefault...
Colin Decker [Wed, 16 Jul 2014 19:18:49 +0000 (15:18 -0400)]
Fixed a java 8 compatibility issue in ForwardingWrapperTest. Can't use isDefault() because this code needs to compile under Java 7
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70779175

5 days agoAdd @Beta to methods we just open sourced in FluentIterable.
Colin Decker [Wed, 16 Jul 2014 19:17:00 +0000 (15:17 -0400)]
Add @Beta to methods we just open sourced in FluentIterable.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70732653

5 days agoFix: NullPointerException in getAllPresent().
Colin Decker [Wed, 16 Jul 2014 19:13:28 +0000 (15:13 -0400)]
Fix: NullPointerException in getAllPresent().

Currently when some of the keys aren't cached, getIfPresent() returns null and ImmutableMap throws an exception as it doesn't allow neither null keys nor null values.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70704051

5 days agoUpgrade Truth to 0.22
Colin Decker [Wed, 16 Jul 2014 19:11:49 +0000 (15:11 -0400)]
Upgrade Truth to 0.22
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70679145

2 weeks agoOpen-source tests for Monitor (which is already open-sourced as part
Colin Decker [Mon, 7 Jul 2014 21:25:55 +0000 (17:25 -0400)]
Open-source tests for Monitor (which is already open-sourced as part
of guava) by removing @GoogleInternal, removing the dependence on
TearDownTestCase, and also open-sourcing the helper class TestThread.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70653606

2 weeks agoRemove javax.inject from OSGi package imports and from dependencyManagement in guava...
Colin Decker [Mon, 7 Jul 2014 21:24:36 +0000 (17:24 -0400)]
Remove javax.inject from OSGi package imports and from dependencyManagement in guava-parent.

Guava issue: https://code.google.com/p/guava-libraries/issues/detail?id=1798
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70642363

2 weeks agoExpand contract for Futures.makeChecked().
Colin Decker [Mon, 7 Jul 2014 21:03:26 +0000 (17:03 -0400)]
Expand contract for Futures.makeChecked().
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70433012

2 weeks agoReenable EnumMap tests, which work as of JDK7: http://bugs.java.com/view_bug.do?bug_i...
Colin Decker [Mon, 7 Jul 2014 21:01:18 +0000 (17:01 -0400)]
Reenable EnumMap tests, which work as of JDK7: bugs.java.com/view_bug.do?bug_id=6312706
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70423146

2 weeks agoRelease FluentIterable methods for Guava 18 and remove @Beta from toSortedList.
Colin Decker [Mon, 7 Jul 2014 20:59:30 +0000 (16:59 -0400)]
Release FluentIterable methods for Guava 18 and remove @Beta from toSortedList.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70420650

2 weeks agoSuppress ConcurrentHashMap.entrySet().add() tests, which fail now that JDK8 permits...
Colin Decker [Mon, 7 Jul 2014 20:57:22 +0000 (16:57 -0400)]
Suppress ConcurrentHashMap.entrySet().add() tests, which fail now that JDK8 permits those calls.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70418657

2 weeks agoAdd x-apple-aspen-config mediatype for Apple .mobileconfig file serving.
Colin Decker [Mon, 7 Jul 2014 20:48:11 +0000 (16:48 -0400)]
Add x-apple-aspen-config mediatype for Apple .mobileconfig file serving.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70333950

2 weeks agoBenchmark should build in JDK 6.
Colin Decker [Mon, 7 Jul 2014 20:39:17 +0000 (16:39 -0400)]
Benchmark should build in JDK 6.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70264278

2 weeks agoAdd "unless noted otherwise" to the README section about the serialized forms of...
Colin Decker [Mon, 7 Jul 2014 20:37:27 +0000 (16:37 -0400)]
Add "unless noted otherwise" to the README section about the serialized forms of objects.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70263802

2 weeks agoUpdate the Guava README.
Colin Decker [Mon, 7 Jul 2014 20:35:42 +0000 (16:35 -0400)]
Update the Guava README.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70258669

2 weeks agoCrude hack to make ForwardingMapTest pass in JDK8.
Colin Decker [Mon, 7 Jul 2014 20:31:50 +0000 (16:31 -0400)]
Crude hack to make ForwardingMapTest pass in JDK8.

The proxy idea is probably fine, but I'm using very suspect logic to
make it work.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70251894

2 weeks agoPrevent bursty RateLimiters from getting stuck at an infinite rate if they spent...
Colin Decker [Mon, 7 Jul 2014 20:27:59 +0000 (16:27 -0400)]
Prevent bursty RateLimiters from getting stuck at an infinite rate if they spent any time with one.
https://code.google.com/p/guava-libraries/issues/detail?id=1791
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70235429

3 weeks agoUse @Nullable on public *methods* consistently for Guava classes of common.base
Christian Edward Gruber [Mon, 30 Jun 2014 01:48:51 +0000 (18:48 -0700)]
Use @Nullable on public *methods* consistently for Guava classes of common.base
(plus StringUtil, given how erratic its null-friendliness is). Of course,
nothing is *proving* that these are correct or complete (and probably nothing
short of moving to full JSR308ness can?).
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70026461

3 weeks agoUpdate the suffix patterns.
Christian Edward Gruber [Mon, 30 Jun 2014 01:45:13 +0000 (18:45 -0700)]
Update the suffix patterns.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70001122

3 weeks agoCall size() once.
Christian Edward Gruber [Wed, 25 Jun 2014 18:58:48 +0000 (11:58 -0700)]
Call size() once.

See https://code.google.com/p/guava-libraries/issues/detail?id=1790
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69946558

3 weeks agoMake doHash() protected in Equals Equivalence.
Christian Edward Gruber [Wed, 25 Jun 2014 18:49:28 +0000 (11:49 -0700)]
Make doHash() protected in Equals Equivalence.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69899412

3 weeks agoMore strictly restrict when fields are added to the set of relevant fields, only...
Christian Edward Gruber [Wed, 25 Jun 2014 18:47:38 +0000 (11:47 -0700)]
More strictly restrict when fields are added to the set of relevant fields, only supporting non-synthetic String fields.

Rollback of a rollback, reverting changelist 69845543

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69877432

3 weeks agoRemove methods scheduled for removal in Guava 18.0.
Christian Edward Gruber [Wed, 25 Jun 2014 18:38:17 +0000 (11:38 -0700)]
Remove methods scheduled for removal in Guava 18.0.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69856875

3 weeks agoAutomated g4 rollback of changelist 69842250.
Christian Edward Gruber [Wed, 25 Jun 2014 18:36:11 +0000 (11:36 -0700)]
Automated g4 rollback of changelist 69842250.

*** Reason for rollback ***

Breaks tests

*** Original change description ***

More strictly restrict when fields are added to the set of relevant fields, only supporting non-synthetic String fields.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69845543

3 weeks agoMore strictly restrict when fields are added to the set of relevant fields, only...
Christian Edward Gruber [Wed, 25 Jun 2014 18:34:28 +0000 (11:34 -0700)]
More strictly restrict when fields are added to the set of relevant fields, only supporting non-synthetic String fields.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69842250

3 weeks agoMove implementations from Objects methods into MoreObjects.
Christian Edward Gruber [Wed, 25 Jun 2014 18:26:49 +0000 (11:26 -0700)]
Move implementations from Objects methods into MoreObjects.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69783878

3 weeks agoAdd scheduled deletion date of June 2016 to deprecated methods in Objects.
Christian Edward Gruber [Wed, 25 Jun 2014 18:24:42 +0000 (11:24 -0700)]
Add scheduled deletion date of June 2016 to deprecated methods in Objects.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69770246

4 weeks agoReplace usages of deprecated Objects.toStringHelper() with
Colin Decker [Fri, 20 Jun 2014 21:46:53 +0000 (17:46 -0400)]
Replace usages of deprecated Objects.toStringHelper() with
MoreObjects.toStringHelper().
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69572761

4 weeks agoUse MoreObjects.firstNonNull instead of Objects.firstNonNull.
Colin Decker [Fri, 20 Jun 2014 21:43:10 +0000 (17:43 -0400)]
Use MoreObjects.firstNonNull instead of Objects.firstNonNull.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69552363

4 weeks agoMake Converter.andThen() final. jdk5-backport-sync
Colin Decker [Wed, 18 Jun 2014 23:08:20 +0000 (19:08 -0400)]
Make Converter.andThen() final.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69490364

4 weeks agoGuava issue 1768: FilteredEntryNavigableMap should short-circuit isEmpty() queries.
Colin Decker [Wed, 18 Jun 2014 23:07:03 +0000 (19:07 -0400)]
Guava issue 1768: FilteredEntryNavigableMap should short-circuit isEmpty() queries.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69479092

4 weeks agoIn HashCode#equals implementation, avoid creating new byte arrays when it can be...
Colin Decker [Wed, 18 Jun 2014 22:51:55 +0000 (18:51 -0400)]
In HashCode#equals implementation, avoid creating new byte arrays when it can be avoided:
- first, check that the 2 hash codes have the same number of bits
- if the number of bits is 4 or 8, compare the results of #asInt() or #asLong()
- otherwise, use HashCode#getBytesInternal() instead of HashCode#asBytes()
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69395204

4 weeks agoDisable incorrect @GuardedBy annotations.
Colin Decker [Wed, 18 Jun 2014 22:30:03 +0000 (18:30 -0400)]
Disable incorrect @GuardedBy annotations.

The @GuardedBy annotations in this CL did not follow the JCIP semantics: either
they referred to locks that did not exist, or they were being used for general
documentation.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69311266

4 weeks agoOpen source base.MoreObjects and add appropriate @since tags.
Colin Decker [Wed, 18 Jun 2014 22:27:48 +0000 (18:27 -0400)]
Open source base.MoreObjects and add appropriate @since tags.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69310042

4 weeks agoUpdate to Truth 0.20 to match the internal version and to eliminate non-fatal compile...
Colin Decker [Wed, 18 Jun 2014 22:25:27 +0000 (18:25 -0400)]
Update to Truth 0.20 to match the internal version and to eliminate non-fatal compile errors. (AbstractArraySubject used Pattern and Matcher from java.util.regex.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69308900

5 weeks agoDocument that the allAsList Future fails immediately when an input fails.
Chris Povirk [Mon, 16 Jun 2014 17:13:42 +0000 (13:13 -0400)]
Document that the allAsList Future fails immediately when an input fails.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69300816

5 weeks agoFix BloomFilter.optimalNumOfHashFunctions calculation.
Chris Povirk [Mon, 16 Jun 2014 16:26:56 +0000 (12:26 -0400)]
Fix BloomFilter.optimalNumOfHashFunctions calculation.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69297820

5 weeks agoAvoid using a constructor that is available only in JDK6+.
Chris Povirk [Mon, 16 Jun 2014 16:24:28 +0000 (12:24 -0400)]
Avoid using a constructor that is available only in JDK6+.
This lets the mainline code work for the Guava backport.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69296675

5 weeks agoUpdate tests broken by CL 69197766's update to the public-suffix list.
Chris Povirk [Mon, 16 Jun 2014 15:37:24 +0000 (11:37 -0400)]
Update tests broken by CL 69197766's update to the public-suffix list.
Those tests used nic.uk as an example of an exclusion, and it no longer is one.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69295926

5 weeks agoUpdate PSL to pick up *.uk changes: .uk TLD is now available for public
Chris Povirk [Mon, 16 Jun 2014 14:01:39 +0000 (10:01 -0400)]
Update PSL to pick up *.uk changes: .uk TLD is now available for public
registration http://www.nominet.org.uk/uk-domain-names/introducing-uk
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69197766

5 weeks agoRelease BloomFilter#writeTo and #readFrom, which provide custom serialization that...
Chris Povirk [Mon, 16 Jun 2014 13:57:58 +0000 (09:57 -0400)]
Release BloomFilter#writeTo and #readFrom, which provide custom serialization that is more compact than standard Java serialization.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69172238

5 weeks agoGraduate Queues.synchronized{Que,Deq}ue from @Beta.
Chris Povirk [Mon, 16 Jun 2014 13:54:01 +0000 (09:54 -0400)]
Graduate Queues.synchronized{Que,Deq}ue from @Beta.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69169032

5 weeks agoUpdate the Public Suffix files.
Chris Povirk [Fri, 13 Jun 2014 15:20:54 +0000 (11:20 -0400)]
Update the Public Suffix files.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69140019

5 weeks agoDisable incorrect @GuardedBy annotations.
Chris Povirk [Fri, 13 Jun 2014 15:10:08 +0000 (11:10 -0400)]
Disable incorrect @GuardedBy annotations.

The @GuardedBy annotations in this CL did not follow the JCIP semantics: either
they referred to locks that did not exist, or they were being used for general
documentation.

The annotations are being replaced with comments in preparation for enabling
static analysis of @GuardedBy annotations.

Tested:
TAP presubmits for global presubmit queue
[]Some tests failed; test failures are believed to be unrelated to this CL
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69093384

5 weeks agoWithdraw application/x-protobuf from Guava, and document it.
Chris Povirk [Wed, 11 Jun 2014 21:09:31 +0000 (17:09 -0400)]
Withdraw application/x-protobuf from Guava, and document it.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69015118

5 weeks agoUpdate @since to reflect the change in parameter types.
Chris Povirk [Wed, 11 Jun 2014 21:07:05 +0000 (17:07 -0400)]
Update @since to reflect the change in parameter types.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69014933

5 weeks agoReplace meaningful Javadoc with GWT-emulation boilerplate.
Chris Povirk [Wed, 11 Jun 2014 21:03:28 +0000 (17:03 -0400)]
Replace meaningful Javadoc with GWT-emulation boilerplate.

I have two main reasons for this:
1. Meaningful Javadoc is sure to get out of sync between the two versions.
2. Boilerplate helps to distinguish the two in searches, e.g., http://jsearch.[]/search?jq=immutablecollection

There's also the implicit third reason "We do it this way in the other classes." If we instead want to include real Javadoc, it would be nice to do so consistently.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69014555

5 weeks agoStrip isPrime benchmarks from Guava, since isPrime itself is @GoogleInternal.
Chris Povirk [Wed, 11 Jun 2014 20:59:46 +0000 (16:59 -0400)]
Strip isPrime benchmarks from Guava, since isPrime itself is @GoogleInternal.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69012929

5 weeks agoShuffling from internal-only change.
Chris Povirk [Wed, 11 Jun 2014 20:26:29 +0000 (16:26 -0400)]
Shuffling from internal-only change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69004612

5 weeks agoAdd application/x-protobuf.
Chris Povirk [Wed, 11 Jun 2014 18:05:40 +0000 (14:05 -0400)]
Add application/x-protobuf.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68866844

5 weeks agoAdd a benchmark for [Google-internal -- this CL will be rolled back in Guava] isPrime...
Chris Povirk [Wed, 11 Jun 2014 17:34:30 +0000 (13:34 -0400)]
Add a benchmark for [Google-internal -- this CL will be rolled back in Guava] isPrime on positive inputs.  The input distribution is logarithmic.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68733770

5 weeks agoMake ImmutableCollection.Builder public in the GWT emulation.
Chris Povirk [Wed, 11 Jun 2014 17:20:28 +0000 (13:20 -0400)]
Make ImmutableCollection.Builder public in the GWT emulation.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68729337

5 weeks agoFix EventBus to not include bridge methods when registering subscribers under Java...
Chris Povirk [Wed, 11 Jun 2014 16:59:02 +0000 (12:59 -0400)]
Fix EventBus to not include bridge methods when registering subscribers under Java 8. Annotations are included on bridge methods in Java 8 where they weren't before.

(Guava issue 1549.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68654467

5 weeks agoShuffling from internal-only change.
Chris Povirk [Wed, 11 Jun 2014 16:55:40 +0000 (12:55 -0400)]
Shuffling from internal-only change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68641973

5 weeks agoUpdating comments to fix statements that MoreExecutors.sameThreadExecutor is used...
Chris Povirk [Wed, 11 Jun 2014 16:06:01 +0000 (12:06 -0400)]
Updating comments to fix statements that MoreExecutors.sameThreadExecutor is used if an Executor is not supplied, which is no longer actually the case since we switched the defaults to the internal INLINE_EXECUTOR.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68506380

5 weeks agoAdd default instances of ByteSource, ByteSink, CharSource and CharSink to ArbitraryIn...
Chris Povirk [Wed, 11 Jun 2014 15:55:17 +0000 (11:55 -0400)]
Add default instances of ByteSource, ByteSink, CharSource and CharSink to ArbitraryInstances. (Guava issue 1770.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68417594

5 weeks agoShuffling from internal-only change.
Chris Povirk [Wed, 11 Jun 2014 15:51:20 +0000 (11:51 -0400)]
Shuffling from internal-only change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68416232

5 weeks agoAdd "et" as an effective TLD.
Chris Povirk [Wed, 11 Jun 2014 15:47:27 +0000 (11:47 -0400)]
Add "et" as an effective TLD.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68415393

5 weeks agoWiden Multisets.removeOccurrences to accept Iterables.
Chris Povirk [Wed, 11 Jun 2014 15:44:07 +0000 (11:44 -0400)]
Widen Multisets.removeOccurrences to accept Iterables.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68409485

5 weeks agoIncrease the symmetry of the Javadoc changes to Multimap.hashCode().
Chris Povirk [Wed, 11 Jun 2014 15:40:10 +0000 (11:40 -0400)]
Increase the symmetry of the Javadoc changes to Multimap.hashCode().
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68397956

7 weeks agojava/com/google/common: CL generated with data from dead-code analysis
Christian Edward Gruber [Mon, 2 Jun 2014 07:57:34 +0000 (00:57 -0700)]
java/com/google/common: CL generated with data from dead-code analysis
using //devtools/scythe:remove_dead_code
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68103937

7 weeks agoExpand Javadoc of Multimap to clarify unusual hashCode implementations, as per Guava...
Christian Edward Gruber [Mon, 2 Jun 2014 07:53:33 +0000 (00:53 -0700)]
Expand Javadoc of Multimap to clarify unusual hashCode implementations, as per Guava issue 1722.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68093584

7 weeks agoFix overflow issues in LocalCache, as per Guava issue 1761
Christian Edward Gruber [Mon, 2 Jun 2014 07:46:29 +0000 (00:46 -0700)]
Fix overflow issues in LocalCache, as per Guava issue 1761
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=68007129

8 weeks agoShuffling from internal change.
Colin Decker [Fri, 23 May 2014 20:18:30 +0000 (16:18 -0400)]
Shuffling from internal change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67842017

8 weeks agoTest that it's possible to attach a callback to a ListenableFuture<?>.
Colin Decker [Fri, 23 May 2014 20:05:30 +0000 (16:05 -0400)]
Test that it's possible to attach a callback to a ListenableFuture<?>.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67713851

8 weeks agoRelease FutureCallbackTest to Guava.
Colin Decker [Fri, 23 May 2014 20:04:02 +0000 (16:04 -0400)]
Release FutureCallbackTest to Guava.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67707789

8 weeks agoUpdate Truth version to 0.18.
Colin Decker [Fri, 23 May 2014 19:54:51 +0000 (15:54 -0400)]
Update Truth version to 0.18.

This version includes primitive type arrays, improved String support, renaming of the object under test, as well as custom error messages.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67639126

2 months agoAdd OSGi Bundle-DocURL to Guava MANIFEST file.
Chris Povirk [Thu, 15 May 2014 18:12:54 +0000 (14:12 -0400)]
Add OSGi Bundle-DocURL to Guava MANIFEST file.

Despite the name, it doesn't seem like it should point to the Javadoc (based on what http://wiki.osgi.org/wiki/Bundle-DocURL says), so I just pointed it to the Guava project page.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67036360

2 months agoSplit RateLimiter implementations off into separate files.
Chris Povirk [Thu, 15 May 2014 18:10:01 +0000 (14:10 -0400)]
Split RateLimiter implementations off into separate files.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=67034085

2 months agoExtend mocking tests to cover EasyMock.
Chris Povirk [Wed, 14 May 2014 17:53:05 +0000 (13:53 -0400)]
Extend mocking tests to cover EasyMock.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66920336

2 months agoFix Guava issue 1751
Chris Povirk [Tue, 13 May 2014 19:44:12 +0000 (15:44 -0400)]
Fix Guava issue 1751

http://code.google.com/p/guava-libraries/issues/detail?id=1751

The bug is that this test depends on listener ordering. I believe that this race was technically introduced by [], since our strategy for invoking listener callbacks was sufficiently serialized prior to that cl, such that this was safe even though it violated the spec.

As it is, it takes some seriously bad luck to observe the race (thanks cpovirk!)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66902563

2 months agoAdd Google-internal ManualRateLimiter and (as part of that work) public Uninterruptib...
Chris Povirk [Tue, 13 May 2014 19:05:56 +0000 (15:05 -0400)]
Add Google-internal ManualRateLimiter and (as part of that work) public Uninterruptibles.tryAcquireUninterruptibly.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66895167

2 months agoReduce differences between "when is the next permit available?" and "request a permit":
Chris Povirk [Tue, 13 May 2014 19:02:43 +0000 (15:02 -0400)]
Reduce differences between "when is the next permit available?" and "request a permit":
- Standardize the method name format.
- Standardize on returning the next available time (rather than the wait time that one of the two currently returns).
- Standardize on allowing the return value to indicate a time in the past (rather than requiring it to be a present/future time as one of the two currently does).

Also, improve tests and documentation around all this, particularly the "in the past" part.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66891133

2 months agoRevert base.Objects -> j.u.Objects deprecations until we do the bulk of the migration...
Chris Povirk [Tue, 13 May 2014 01:26:39 +0000 (21:26 -0400)]
Revert base.Objects -> j.u.Objects deprecations until we do the bulk of the migrations ourselves (blocked: see bug).
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66815987

2 months agoThe example is below, not above.
Chris Povirk [Mon, 12 May 2014 17:37:51 +0000 (13:37 -0400)]
The example is below, not above.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66659338

2 months agoAdd documentation to all versions of Lists.newArrayList methods to discourage their...
Chris Povirk [Mon, 12 May 2014 17:34:50 +0000 (13:34 -0400)]
Add documentation to all versions of Lists.newArrayList methods to discourage their usage; all the other collection factory methods to follow (Sets.newHashSet, etc.). Tweak verbiage of other obsoleted-by-Java7 methods to match.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66644002

2 months agoRemove buggy future workarounds from ChainingListenableFuture (a.k.a. the future...
Chris Povirk [Mon, 12 May 2014 17:12:35 +0000 (13:12 -0400)]
Remove buggy future workarounds from ChainingListenableFuture (a.k.a. the future returned by Futures.transform)

This should only affect users who are passing buggy future implementations to Futures.transform, the most likely culprit is com.google.net.rpc.util.{RpcListenableFuture,RpcCheckedFuture}.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66523545

2 months agoShuffling from internal-only change.
Chris Povirk [Wed, 7 May 2014 22:00:09 +0000 (18:00 -0400)]
Shuffling from internal-only change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66426194

2 months agoAdd David E. Wheeler to Guava AUTHORS
Chris Povirk [Wed, 7 May 2014 21:51:32 +0000 (17:51 -0400)]
Add David E. Wheeler to Guava AUTHORS
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66319030

2 months agoGive date-based deletions a stay of execution (24 months, not 18).
Chris Povirk [Wed, 7 May 2014 21:39:15 +0000 (17:39 -0400)]
Give date-based deletions a stay of execution (24 months, not 18).
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66299916

2 months agoDeprecate Iterators.emptyIterator() in Guava, because it always has a decent replacem...
Chris Povirk [Wed, 7 May 2014 21:36:07 +0000 (17:36 -0400)]
Deprecate Iterators.emptyIterator() in Guava, because it always has a decent replacement even when not on Java 7.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66299891

2 months agoAdd more tests for known BF false positives when using UTF8.
Chris Povirk [Wed, 7 May 2014 21:32:56 +0000 (17:32 -0400)]
Add more tests for known BF false positives when using UTF8.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66295364

2 months agoDisable PackageSanityTests null-pointer testing for LongAdder, as we don't want to...
Chris Povirk [Wed, 7 May 2014 21:29:58 +0000 (17:29 -0400)]
Disable PackageSanityTests null-pointer testing for LongAdder, as we don't want to patch Striped64 to include @Nullable annotations.
Also, remove that annotation.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66293925

2 months agoSync with latest upstream jsr166e changes.
Chris Povirk [Wed, 7 May 2014 21:23:48 +0000 (17:23 -0400)]
Sync with latest upstream jsr166e changes.
Fixes "classloader leak".
https://code.google.com/p/guava-libraries/issues/detail?id=1553
http://comments.gmane.org/gmane.comp.java.jsr.166-concurrency/12659
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66247344

2 months agoUse a MatchResult created by a successful match, as required by Harmony (used on...
Chris Povirk [Wed, 7 May 2014 21:17:45 +0000 (17:17 -0400)]
Use a MatchResult created by a successful match, as required by Harmony (used on Android):
http://goo.gl/5VQFmC
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=66096434

2 months agoBeef up documentation and validation of parameters.
Chris Povirk [Wed, 7 May 2014 21:00:25 +0000 (17:00 -0400)]
Beef up documentation and validation of parameters.
Also, fully hide/remove some unusable methods, and fix up a return type.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65883612

2 months agoTest mocking of RateLimiter to avoid regressions like that of CL 65383672.
Chris Povirk [Wed, 7 May 2014 20:57:35 +0000 (16:57 -0400)]
Test mocking of RateLimiter to avoid regressions like that of CL 65383672.
Ideally we will make all non-final methods mockable, but for now, I'll settle for not breaking any new ones.
(The real fix may be a bigger project, e.g., converting RateLimiter to an interface. I don't know yet.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65821400

2 months agoMigrate calls to Annotation.getClass() to Annotation.annotationType().
Chris Povirk [Wed, 7 May 2014 20:51:59 +0000 (16:51 -0400)]
Migrate calls to Annotation.getClass() to Annotation.annotationType().

Annotation.getClass() returns a proxy class generated at runtime that is not particularly useful -- it returns false for isAnnotation(), for example -- where annotationType() actually returns the type associated with the annotation (e.g. MyAnnotation.class for @MyAnnotation).

Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65806476

2 months agoMake Ints.tryParse available under GWT.
Chris Povirk [Wed, 7 May 2014 20:49:15 +0000 (16:49 -0400)]
Make Ints.tryParse available under GWT.

It already works, thanks to careful avoidance of overflow in checks against |cap| and MIN_VALUE.
(Contrast the previous (Android) version, which may or may not have worked under GWT because GWT integers don't wrap when they overflow. (I think that our workaround for this was successful, but it's hard to be confident.))

Also, enable the tests for *Longs*.tryParse under GWT.
(I also added a few more tests to both versions just to be paranoid.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65806393

2 months agoShuffling from internal-only change.
Chris Povirk [Wed, 7 May 2014 20:43:00 +0000 (16:43 -0400)]
Shuffling from internal-only change.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65733547

2 months agoRemove the callAllGets 'feature' of CombinedFuture.
Chris Povirk [Wed, 7 May 2014 20:37:00 +0000 (16:37 -0400)]
Remove the callAllGets 'feature' of CombinedFuture.

This should only be necessary for buggy future implementation

This is a rollfoward.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65725521

2 months agoAutomated g4 rollback of changelist 65602026.
Christian Edward Gruber [Mon, 28 Apr 2014 00:37:10 +0000 (17:37 -0700)]
Automated g4 rollback of changelist 65602026.

*** Reason for rollback ***

This commit caused several test failures, so rollback until a forward-fix can be integrated.

*** Original change description ***

Remove the callAllGets 'feature' of CombinedFuture.

This should only be necessary for buggy future implementation.
***
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65624847

2 months agoReimplement Throttle as a passthrough to its reimplementation under the new RateLimit...
Christian Edward Gruber [Mon, 28 Apr 2014 00:33:48 +0000 (17:33 -0700)]
Reimplement Throttle as a passthrough to its reimplementation under the new RateLimiter API.
I've attempted to leave the behavior untouched (aside from fixing an unsynchronized access to maxTime).
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65604449

2 months agoRemove the callAllGets 'feature' of CombinedFuture.
Christian Edward Gruber [Mon, 28 Apr 2014 00:31:58 +0000 (17:31 -0700)]
Remove the callAllGets 'feature' of CombinedFuture.

This should only be necessary for buggy future implementation.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65602026

2 months agoChange the implementation of Futures.combine to be faster!
Chris Povirk [Fri, 25 Apr 2014 15:48:56 +0000 (11:48 -0400)]
Change the implementation of Futures.combine to be faster!

Also, replace all uses of sameThreadExecutor with a cheaper implementation. (IMHO, this should be _the_ implementation of sameThreadExecutor with a new sameThreadExecutorService for those who want it, but since that wouldn't be backwards compatible.... sadness)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65564280

2 months agoHandle overflow and negative timeouts:
Chris Povirk [Fri, 25 Apr 2014 15:35:44 +0000 (11:35 -0400)]
Handle overflow and negative timeouts:
http://code.google.com/p/guava-libraries/issues/detail?id=1622

Some discussion of each:
- Overflow is of course impossible to prevent entirely with fixed-size number types, but we're less likely to see overflow with the new "available - timeout" than with the old "now + timeout': The latter can overflow almost immediately if given MAX_VALUE timeout. (Compare the advice at <http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime%28%29>.)
- Negative timeouts are supported by java.util.concurrent APIs. For similar behavior in RateLimiter, we need to be sure that a request to "wait up to -1 seconds" is treated identically to "wait up to 0 seconds" -- specifically, that it works right if the permit has become available within the last second. (Another potential problem, albeit one much less likely, is overflow when subtracting an input of MIN_VALUE.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=65540333