├── CONTRIBUTORS ├── guava-tests ├── test │ └── com │ │ └── google │ │ └── common │ │ ├── io │ │ ├── testdata │ │ │ ├── i18n.txt │ │ │ └── ascii.txt │ │ ├── TestOption.java │ │ ├── TestStreamSupplier.java │ │ └── RandomAmountInputStream.java │ │ ├── reflect │ │ ├── test.txt │ │ ├── subpackage │ │ │ └── ClassInSubPackage.java │ │ └── PackageSanityTests.java │ │ ├── math │ │ ├── TestPlatform.java │ │ └── PackageSanityTests.java │ │ ├── escape │ │ ├── PackageSanityTests.java │ │ └── CharEscaperBuilderTest.java │ │ ├── util │ │ └── concurrent │ │ │ ├── InterruptibleMonitorTest.java │ │ │ ├── ForwardingFutureTest.java │ │ │ ├── UninterruptibleMonitorTest.java │ │ │ ├── ForwardingBlockingQueueTest.java │ │ │ ├── ForwardingExecutorServiceTest.java │ │ │ ├── ForwardingCheckedFutureTest.java │ │ │ ├── ForwardingListenableFutureTest.java │ │ │ ├── ForwardingListeningExecutorServiceTest.java │ │ │ ├── RunnablesTest.java │ │ │ ├── TrustedInputFutureTest.java │ │ │ └── UntrustedInputFutureTest.java │ │ ├── cache │ │ ├── LongAdderTest.java │ │ └── PackageSanityTests.java │ │ ├── primitives │ │ └── PackageSanityTests.java │ │ ├── net │ │ └── PackageSanityTests.java │ │ ├── base │ │ └── PackageSanityTests.java │ │ ├── collect │ │ ├── PackageSanityTests.java │ │ ├── DiscreteDomainTest.java │ │ ├── RangeNonGwtTest.java │ │ └── RegularImmutableAsListTest.java │ │ ├── hash │ │ └── PackageSanityTests.java │ │ └── graph │ │ └── ImmutableGraphTest.java └── benchmark │ └── com │ └── google │ └── common │ └── eventbus │ └── EventBusBenchmark.java ├── guava-gwt ├── src-super │ ├── java │ │ ├── lang │ │ │ ├── Lang.gwt.xml │ │ │ └── super │ │ │ │ └── java │ │ │ │ └── lang │ │ │ │ ├── InterruptedException.java │ │ │ │ └── reflect │ │ │ │ └── UndeclaredThrowableException.java │ │ └── util │ │ │ ├── Util.gwt.xml │ │ │ └── super │ │ │ └── java │ │ │ └── util │ │ │ └── concurrent │ │ │ ├── Delayed.java │ │ │ ├── ScheduledFuture.java │ │ │ ├── Executor.java │ │ │ ├── RunnableFuture.java │ │ │ ├── Callable.java │ │ │ ├── TimeoutException.java │ │ │ ├── CancellationException.java │ │ │ ├── ConcurrentMap.java │ │ │ ├── ExecutionException.java │ │ │ ├── RejectedExecutionException.java │ │ │ ├── Executors.java │ │ │ └── Future.java │ └── com │ │ └── google │ │ └── common │ │ ├── cache │ │ └── super │ │ │ └── com │ │ │ └── google │ │ │ └── common │ │ │ └── cache │ │ │ ├── LongAddables.java │ │ │ └── LongAdder.java │ │ ├── util │ │ └── concurrent │ │ │ └── super │ │ │ └── com │ │ │ └── google │ │ │ └── common │ │ │ └── util │ │ │ └── concurrent │ │ │ ├── InterruptibleTask.java │ │ │ ├── Platform.java │ │ │ └── Uninterruptibles.java │ │ ├── collect │ │ └── super │ │ │ └── com │ │ │ └── google │ │ │ └── common │ │ │ └── collect │ │ │ ├── RegularImmutableMap.java │ │ │ ├── RegularImmutableSet.java │ │ │ ├── RegularImmutableList.java │ │ │ └── RegularImmutableSortedSet.java │ │ └── escape │ │ └── super │ │ └── com │ │ └── google │ │ └── common │ │ └── escape │ │ └── Platform.java ├── test │ └── com │ │ └── google │ │ └── common │ │ ├── html │ │ ├── testModule.gwt.xml │ │ ├── TestModuleEntryPoint.java │ │ └── HtmlEscapersTest_gwt.java │ │ ├── testing │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── xml │ │ ├── testModule.gwt.xml │ │ ├── TestModuleEntryPoint.java │ │ └── XmlEscapersTest_gwt.java │ │ ├── primitives │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── collect │ │ ├── testing │ │ │ ├── testModule.gwt.xml │ │ │ └── TestModuleEntryPoint.java │ │ ├── testModule.gwt.xml │ │ ├── TestModuleEntryPoint.java │ │ ├── UnmodifiableIteratorTest_gwt.java │ │ ├── RegularImmutableAsListTest_gwt.java │ │ ├── SortedListsTest_gwt.java │ │ ├── SortedIterablesTest_gwt.java │ │ ├── MultimapBuilderTest_gwt.java │ │ ├── ImmutableEnumMapTest_gwt.java │ │ └── SimpleAbstractMultisetTest_gwt.java │ │ ├── base │ │ ├── testModule.gwt.xml │ │ ├── TestModuleEntryPoint.java │ │ └── CharsetsTest_gwt.java │ │ ├── escape │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── math │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── util │ │ └── concurrent │ │ │ ├── testModule.gwt.xml │ │ │ ├── TestModuleEntryPoint.java │ │ │ ├── CallablesTest_gwt.java │ │ │ └── RunnablesTest_gwt.java │ │ ├── io │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── cache │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── net │ │ ├── testModule.gwt.xml │ │ └── TestModuleEntryPoint.java │ │ ├── GuavaTestsEntryPoint.java │ │ └── GuavaTests.gwt.xml ├── src │ └── com │ │ └── google │ │ └── common │ │ ├── collect │ │ ├── ImmutableAsList_CustomFieldSerializer.java │ │ ├── ForwardingImmutableList_CustomFieldSerializer.java │ │ ├── ForwardingImmutableSet_CustomFieldSerializer.java │ │ ├── ImmutableSet_CustomFieldSerializer.java │ │ ├── ImmutableList_CustomFieldSerializer.java │ │ ├── ImmutableBiMap_CustomFieldSerializer.java │ │ ├── ImmutableMultiset_CustomFieldSerializer.java │ │ ├── ImmutableSortedSet_CustomFieldSerializer.java │ │ ├── AllEqualOrdering_CustomFieldSerializer.java │ │ ├── NaturalOrdering_CustomFieldSerializer.java │ │ └── UsingToStringOrdering_CustomFieldSerializer.java │ │ ├── ForceGuavaCompilationEntryPoint.java │ │ ├── ForceGuavaCompilation.gwt.xml │ │ └── annotations │ │ └── Annotations.gwt.xml └── test-super │ └── com │ └── google │ └── common │ ├── math │ └── super │ │ └── com │ │ └── google │ │ └── common │ │ └── math │ │ └── TestPlatform.java │ └── testing │ └── super │ └── com │ └── google │ └── common │ └── testing │ └── Platform.java ├── .gitignore ├── .gitattributes ├── util ├── deploy_snapshot.sh ├── settings.xml └── update_snapshot_docs.sh ├── guava └── src │ └── com │ └── google │ └── common │ ├── annotations │ ├── package-info.java │ └── VisibleForTesting.java │ ├── cache │ ├── LongAddable.java │ └── Weigher.java │ ├── eventbus │ ├── SubscriberExceptionHandler.java │ └── AllowConcurrentEvents.java │ ├── xml │ └── package-info.java │ ├── html │ └── package-info.java │ ├── reflect │ ├── package-info.java │ └── TypeCapture.java │ ├── collect │ ├── ForwardingImmutableList.java │ ├── ForwardingImmutableMap.java │ ├── ForwardingImmutableSet.java │ ├── FilteredSetMultimap.java │ ├── ForwardingImmutableCollection.java │ ├── FilteredMultimap.java │ ├── SortedMultisetBridge.java │ ├── ComputationException.java │ ├── SortedMapDifference.java │ ├── GwtTransient.java │ ├── EmptyImmutableListMultimap.java │ └── EmptyImmutableSetMultimap.java │ ├── net │ └── package-info.java │ ├── io │ └── FileWriteMode.java │ ├── hash │ └── package-info.java │ ├── graph │ ├── GraphConstants.java │ └── package-info.java │ ├── util │ └── concurrent │ │ ├── Platform.java │ │ ├── ListenableScheduledFuture.java │ │ ├── Runnables.java │ │ ├── GwtFuturesCatchingSpecialization.java │ │ └── package-info.java │ ├── math │ └── package-info.java │ └── base │ └── FinalizableReference.java ├── guava-testlib ├── test │ └── com │ │ └── google │ │ └── common │ │ └── testing │ │ ├── PackageSanityTests.java │ │ ├── RelationshipTesterTest.java │ │ └── anotherpackage │ │ └── SomeClassThatDoesNotUseNullable.java └── src │ └── com │ └── google │ └── common │ ├── testing │ ├── package-info.java │ └── TearDownAccepter.java │ ├── collect │ └── testing │ │ ├── AnEnum.java │ │ ├── WrongType.java │ │ ├── TestCollectionGenerator.java │ │ ├── TestIteratorGenerator.java │ │ ├── TestQueueGenerator.java │ │ ├── TestSetGenerator.java │ │ ├── TestListGenerator.java │ │ ├── ExampleIteratorTester.java │ │ ├── google │ │ ├── TestSetMultimapGenerator.java │ │ ├── TestListMultimapGenerator.java │ │ ├── TestMultisetGenerator.java │ │ ├── SortedSetMultimapGetTester.java │ │ ├── TestBiMapGenerator.java │ │ ├── GoogleHelpers.java │ │ └── AbstractMultisetTester.java │ │ ├── DerivedComparable.java │ │ ├── TestSubjectGenerator.java │ │ ├── TestMapGenerator.java │ │ ├── testers │ │ ├── AbstractQueueTester.java │ │ ├── MapSizeTester.java │ │ ├── CollectionSizeTester.java │ │ ├── AbstractSetTester.java │ │ └── MapSerializationTester.java │ │ └── features │ │ └── Feature.java │ └── escape │ └── testing │ └── package-info.java └── .travis.yml /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Doug Lea 2 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/io/testdata/i18n.txt: -------------------------------------------------------------------------------- 1 | Îñţérñåţîöñåļîžåţîöñ -------------------------------------------------------------------------------- /guava-gwt/src-super/java/lang/Lang.gwt.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/Util.gwt.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/reflect/test.txt: -------------------------------------------------------------------------------- 1 | This is a resource file for testing purpose. 2 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/io/testdata/ascii.txt: -------------------------------------------------------------------------------- 1 | !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target/ 3 | *.ser 4 | *.ec 5 | 6 | # IntelliJ Idea 7 | .idea/ 8 | out/ 9 | *.ipr 10 | *.iws 11 | *.iml 12 | 13 | # Eclipse 14 | .classpath 15 | .project 16 | .settings/ 17 | .metadata/ 18 | 19 | # OS X 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Known text files 5 | *.java text 6 | *.xml text 7 | *.yml text 8 | *.md text 9 | *.sh text 10 | *.css text 11 | *.txt text 12 | 13 | # Known binary files 14 | *.jar binary -------------------------------------------------------------------------------- /util/deploy_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # see https://coderwall.com/p/9b_lfq 4 | 5 | set -e -u 6 | 7 | if [ "$TRAVIS_REPO_SLUG" == "google/guava" ] && \ 8 | [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \ 9 | [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ 10 | [ "$TRAVIS_BRANCH" == "master" ]; then 11 | echo "Publishing Maven snapshot..." 12 | 13 | mvn clean source:jar javadoc:jar deploy --settings="util/settings.xml" -DskipTests=true 14 | 15 | echo "Maven snapshot published." 16 | fi 17 | -------------------------------------------------------------------------------- /util/settings.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | sonatype-nexus-snapshots 7 | ${env.CI_DEPLOY_USERNAME} 8 | ${env.CI_DEPLOY_PASSWORD} 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/html/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/testing/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/xml/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/primitives/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/testing/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/base/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/Delayed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a modified version of 3 | * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/CountDownLatch.java?revision=1.43 4 | * which contained the following notice: 5 | * 6 | * Written by Doug Lea with assistance from members of JCP JSR-166 7 | * Expert Group and released to the public domain, as explained at 8 | * http://creativecommons.org/publicdomain/zero/1.0/ 9 | */ 10 | 11 | package java.util.concurrent; 12 | 13 | /** 14 | * Emulation of Delayed. 15 | */ 16 | public interface Delayed extends Comparable { 17 | long getDelay(TimeUnit unit); 18 | } 19 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/escape/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/math/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/ScheduledFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a modified version of 3 | * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/CountDownLatch.java?revision=1.43 4 | * which contained the following notice: 5 | * 6 | * Written by Doug Lea with assistance from members of JCP JSR-166 7 | * Expert Group and released to the public domain, as explained at 8 | * http://creativecommons.org/publicdomain/zero/1.0/ 9 | */ 10 | 11 | package java.util.concurrent; 12 | 13 | /** 14 | * Emulation of ScheduleFuture. 15 | * 16 | * @param value type returned by the future. 17 | */ 18 | public interface ScheduledFuture extends Delayed, Future { 19 | } 20 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/util/concurrent/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/io/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/cache/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/reflect/subpackage/ClassInSubPackage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.reflect.subpackage; 18 | 19 | public class ClassInSubPackage {} 20 | -------------------------------------------------------------------------------- /util/update_snapshot_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details 4 | 5 | set -e -u 6 | 7 | if [ "$TRAVIS_REPO_SLUG" == "google/guava" ] && \ 8 | [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \ 9 | [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ 10 | [ "$TRAVIS_BRANCH" == "master" ]; then 11 | echo "Publishing Javadoc and JDiff..." 12 | 13 | cd $HOME 14 | git clone -q -b gh-pages https://${GH_TOKEN}@github.com/google/guava gh-pages > /dev/null 15 | cd gh-pages 16 | 17 | git config --global user.email "travis@travis-ci.org" 18 | git config --global user.name "travis-ci" 19 | 20 | ./updaterelease.sh snapshot 21 | 22 | git push -fq origin gh-pages > /dev/null 23 | 24 | echo "Javadoc and JDiff published to gh-pages." 25 | fi 26 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/net/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/testModule.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/Executor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of Executor. 21 | */ 22 | public interface Executor { 23 | void execute(Runnable command); 24 | } -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/RunnableFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of RunnableFuture. 21 | */ 22 | public interface RunnableFuture extends Runnable, Future { 23 | } 24 | -------------------------------------------------------------------------------- /guava/src/com/google/common/annotations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * Common annotation types. This package is a part of the open-source 17 | * Guava library. 18 | */ 19 | package com.google.common.annotations; 20 | -------------------------------------------------------------------------------- /guava-testlib/test/com/google/common/testing/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing; 18 | 19 | /** 20 | * Test nulls for the entire package. 21 | */ 22 | 23 | public class PackageSanityTests extends AbstractPackageSanityTests {} 24 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/Callable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of Callable. 21 | * 22 | * @author Charles Fry 23 | */ 24 | public interface Callable { 25 | V call() throws Exception; 26 | } 27 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/testing/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains testing utilities. 19 | * It is a part of the open-source 20 | * Guava library. 21 | */ 22 | @javax.annotation.ParametersAreNonnullByDefault 23 | package com.google.common.testing; 24 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/reflect/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.reflect; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Tests nulls for the entire package. 23 | */ 24 | 25 | public class PackageSanityTests extends AbstractPackageSanityTests {} 26 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/math/TestPlatform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.math; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * @author Chris Povirk 23 | */ 24 | @GwtCompatible(emulated = true) 25 | class TestPlatform { 26 | static boolean intsCanGoOutOfRange() { 27 | return false; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guava/src/com/google/common/annotations/VisibleForTesting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.annotations; 16 | 17 | /** 18 | * Annotates a program element that exists, or is more widely visible than otherwise necessary, only 19 | * for use in test code. 20 | * 21 | * @author Johannes Henkel 22 | */ 23 | @GwtCompatible 24 | public @interface VisibleForTesting { 25 | } 26 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LongAddables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.cache; 18 | 19 | /** 20 | * GWT emulation for LongAddables. 21 | * 22 | * @author Louis Wasserman 23 | */ 24 | final class LongAddables { 25 | public static LongAddable create() { 26 | return new LongAdder(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/TimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of TimeoutException. 21 | */ 22 | public class TimeoutException extends Exception { 23 | public TimeoutException() {} 24 | 25 | public TimeoutException(String message) { 26 | super(message); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/escape/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.escape; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Basic sanity tests for the entire package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests {} 28 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/GuavaTestsEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point for our tests. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | public class GuavaTestsEntryPoint implements EntryPoint { 27 | @Override public void onModuleLoad() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableAsList_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableAsList} cannot be instantiated, we still need 21 | * a custom field serializer. TODO(cpovirk): why? 22 | * 23 | * @author Hayward Chan 24 | */ 25 | public final class ImmutableAsList_CustomFieldSerializer {} 26 | -------------------------------------------------------------------------------- /guava-gwt/test-super/com/google/common/math/super/com/google/common/math/TestPlatform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.math; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * @author Chris Povirk 23 | */ 24 | @GwtCompatible(emulated = true) 25 | class TestPlatform { 26 | static boolean intsCanGoOutOfRange() { 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/io/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.io; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/net/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.net; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/xml/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.xml; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/base/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.base; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/cache/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.cache; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/html/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.html; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/math/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.math; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/io/TestOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.io; 18 | 19 | /** 20 | * Options controlling the behavior of sources/sinks/streams for testing. 21 | * 22 | * @author Colin Decker 23 | */ 24 | public enum TestOption { 25 | OPEN_THROWS, 26 | SKIP_THROWS, 27 | READ_THROWS, 28 | WRITE_THROWS, 29 | CLOSE_THROWS, 30 | AVAILABLE_ALWAYS_ZERO 31 | } 32 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/escape/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.escape; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/testing/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/AnEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * A sample enumerated type we use for testing. 23 | * 24 | * @author Kevin Bourrillion 25 | */ 26 | @GwtCompatible 27 | public enum AnEnum { 28 | A, 29 | B, 30 | C, 31 | D, 32 | E, 33 | F 34 | } 35 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: java 4 | 5 | jdk: 6 | - oraclejdk8 7 | - oraclejdk7 8 | - openjdk7 9 | 10 | install: mvn -B install -U -DskipTests=true 11 | 12 | script: mvn -B verify -U -Dmaven.javadoc.skip=true 13 | 14 | after_success: 15 | - util/deploy_snapshot.sh 16 | - util/update_snapshot_docs.sh 17 | 18 | cache: 19 | directories: 20 | - $HOME/.m2 21 | 22 | env: 23 | global: 24 | - secure: "IPvqFwnLx/GXyImJuwM2MIvzDlBLqEXaQXFGJgAP1nbuenaLAloOOlqQ+iy2FDLBD/j+zjSbR3WWF9DIT4YxAS03Z6iMwxh7GCfk+tyhVtLQnwt7w1rquyhbrrGFsY5U0hr5q80Ww6J+zfp2yZ8aP9FHSy5ahNjqys4FtubOWLk=" 25 | - secure: "G77Wt2h2fceQ867i1uwOjUygrNeBpLRS8sxgfUZsO66dvlrx1wYFpZLLRIiPcy01peUTE2SvXIXLHKe9v3AlMonPibsQtvvfQSVfx+jgKwLZx9cuf/M5VQlD3etRUh4K/rBezlxWRroeeKcM2DQqiEVLsTDSyNZV9kVAjwfLTvM=" 26 | - secure: "wieIClPLTXS3QjDzqyp0TqIrVP/Q6iWNPOtcUQYfdDZJGwufE61laTFtzVKXZRb7uJ4GXDObcVU3AcpAwkTX/5sEksBxgv3TZ5Qi0mVx2GRmbE06ULLxi7sPnTCZ/VFtselDWcWArWGAcdCjW9gcCrgj5K/+sYpVKz9a8V+SDM4=" 27 | 28 | branches: 29 | only: 30 | - master 31 | - /^release.*$/ 32 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/CancellationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of CancellationException. 21 | */ 22 | public class CancellationException extends IllegalStateException { 23 | 24 | public CancellationException() {} 25 | 26 | public CancellationException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ForwardingImmutableList_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ForwardingImmutableList} cannot be instantiated, we still 21 | * need a custom field serializer. TODO(cpovirk): why? 22 | * 23 | * @author Hayward Chan 24 | */ 25 | public final class ForwardingImmutableList_CustomFieldSerializer {} 26 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ForwardingImmutableSet_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ForwardingImmutableSet} cannot be instantiated, we still 21 | * need a custom field serializer. TODO(cpovirk): why? 22 | * 23 | * @author Hayward Chan 24 | */ 25 | public final class ForwardingImmutableSet_CustomFieldSerializer {} 26 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/primitives/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.primitives; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/cache/LongAddable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.cache; 16 | 17 | import com.google.common.annotations.GwtCompatible; 18 | 19 | /** 20 | * Abstract interface for objects that can concurrently add longs. 21 | * 22 | * @author Louis Wasserman 23 | */ 24 | @GwtCompatible 25 | interface LongAddable { 26 | void increment(); 27 | 28 | void add(long x); 29 | 30 | long sum(); 31 | } 32 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/testing/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/util/concurrent/TestModuleEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point of the test module. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public class TestModuleEntryPoint implements EntryPoint { 27 | 28 | @Override public void onModuleLoad() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/escape/testing/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Testing utilities for use in tests of {@code com.google.common.escape}. 19 | * 20 | *

This package is a part of the open-source 21 | * Guava library. 22 | */ 23 | @CheckReturnValue 24 | package com.google.common.escape.testing; 25 | 26 | import javax.annotation.CheckReturnValue; 27 | -------------------------------------------------------------------------------- /guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.google.common.eventbus; 15 | 16 | /** 17 | * Handler for exceptions thrown by event subscribers. 18 | * 19 | * @since 16.0 20 | */ 21 | public interface SubscriberExceptionHandler { 22 | /** 23 | * Handles exceptions thrown by subscribers. 24 | */ 25 | void handleException(Throwable exception, SubscriberExceptionContext context); 26 | } 27 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/ForceGuavaCompilationEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common; 18 | 19 | import com.google.gwt.core.client.EntryPoint; 20 | 21 | /** 22 | * A dummy entry point to convince Maven to compile our classes. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | public class ForceGuavaCompilationEntryPoint implements EntryPoint { 27 | @Override public void onModuleLoad() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | /** 20 | * Tests for {@link Monitor}'s interruptible methods. 21 | * 22 | * @author Justin T. Sampson 23 | */ 24 | 25 | public class InterruptibleMonitorTest extends MonitorTestCase { 26 | 27 | public InterruptibleMonitorTest() { 28 | super(true); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Unit tests for {@link ForwardingFuture} 23 | */ 24 | public class ForwardingFutureTest extends TestCase { 25 | public void testForwarding() { 26 | ForwardingObjectTester.testForwardingObject(ForwardingFuture.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | /** 20 | * Tests for {@link Monitor}'s uninterruptible methods. 21 | * 22 | * @author Justin T. Sampson 23 | */ 24 | 25 | public class UninterruptibleMonitorTest extends MonitorTestCase { 26 | 27 | public UninterruptibleMonitorTest() { 28 | super(false); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /guava/src/com/google/common/xml/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * Escapers 17 | * for 18 | * XML. 19 | * 20 | *

This package is a part of the open-source Guava 21 | * library. 22 | */ 23 | @CheckReturnValue 24 | @ParametersAreNonnullByDefault 25 | package com.google.common.xml; 26 | 27 | import javax.annotation.CheckReturnValue; 28 | import javax.annotation.ParametersAreNonnullByDefault; 29 | -------------------------------------------------------------------------------- /guava/src/com/google/common/html/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * Escapers 17 | * for 18 | * HTML. 19 | * 20 | *

This package is a part of the open-source Guava 21 | * library. 22 | */ 23 | @CheckReturnValue 24 | @ParametersAreNonnullByDefault 25 | package com.google.common.html; 26 | 27 | import javax.annotation.CheckReturnValue; 28 | import javax.annotation.ParametersAreNonnullByDefault; 29 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/cache/LongAdderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.cache; 16 | 17 | /** 18 | * No-op null-pointer test for {@link LongAdder} to override the {@link PackageSanityTests} version, 19 | * which checks package-private methods that we don't want to have to annotate as {@code Nullable} 20 | * because we don't want diffs from jsr166e. 21 | */ 22 | public class LongAdderTest { 23 | public void testNulls() {} 24 | } 25 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/math/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.math; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Basic sanity tests for the entire package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests { 28 | public PackageSanityTests() { 29 | publicApiOnly(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /guava/src/com/google/common/reflect/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * This package contains utilities to work with Java reflection. It is a part of the open-source 17 | * Guava library. 18 | */ 19 | @CheckReturnValue 20 | @ParametersAreNonnullByDefault 21 | package com.google.common.reflect; 22 | 23 | import javax.annotation.CheckReturnValue; 24 | import javax.annotation.ParametersAreNonnullByDefault; 25 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableSet_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableSet} cannot be instantiated, we still need 21 | * a custom field serializer to unify the type signature of 22 | * {@code ImmutableSet[]} on server and client side. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public final class ImmutableSet_CustomFieldSerializer {} 27 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableList_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableList} cannot be instantiated, we still need 21 | * a custom field serializer to unify the type signature of 22 | * {@code ImmutableList[]} on server and client side. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public final class ImmutableList_CustomFieldSerializer {} 27 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/ForwardingImmutableList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Unused stub class, unreferenced under Java and manually emulated under GWT. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | @GwtCompatible(emulated = true) 27 | abstract class ForwardingImmutableList { 28 | private ForwardingImmutableList() {} 29 | } 30 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/ForwardingImmutableMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Unused stub class, unreferenced under Java and manually emulated under GWT. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | @GwtCompatible(emulated = true) 27 | abstract class ForwardingImmutableMap { 28 | private ForwardingImmutableMap() {} 29 | } 30 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/ForwardingImmutableSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Unused stub class, unreferenced under Java and manually emulated under GWT. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | @GwtCompatible(emulated = true) 27 | abstract class ForwardingImmutableSet { 28 | private ForwardingImmutableSet() {} 29 | } 30 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableBiMap_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableBiMap} cannot be instantiated, we still need 21 | * a custom field serializer to unify the type signature of 22 | * {@code ImmutableBiMap[]} on server and client side. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public final class ImmutableBiMap_CustomFieldSerializer {} 27 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableMultiset_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableMultiset} cannot be instantiated, we still need 21 | * a custom field serializer to unify the type signature of 22 | * {@code ImmutableMultiset[]} on server and client side. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | public class ImmutableMultiset_CustomFieldSerializer {} 27 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Unit tests for {@link ForwardingBlockingQueue} 23 | */ 24 | public class ForwardingBlockingQueueTest extends TestCase { 25 | public void testForwarding() { 26 | ForwardingObjectTester.testForwardingObject(ForwardingBlockingQueue.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/ImmutableSortedSet_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | /** 20 | * Even though {@link ImmutableSortedSet} cannot be instantiated, we still need 21 | * a custom field serializer to unify the type signature of 22 | * {@code ImmutableSortedSet[]} on server and client side. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | public final class ImmutableSortedSet_CustomFieldSerializer {} 27 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/base/CharsetsTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.base; 17 | public class CharsetsTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.base.testModule"; 20 | } 21 | public void testUtf8() throws Exception { 22 | com.google.common.base.CharsetsTest testCase = new com.google.common.base.CharsetsTest(); 23 | testCase.testUtf8(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/WrongType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * A type which will never be used as the element type of any collection in our 23 | * tests, and so can be used to test how a Collection behaves when given input 24 | * of the wrong type. 25 | */ 26 | @GwtCompatible 27 | public enum WrongType { 28 | VALUE 29 | } 30 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Unit tests for {@link ForwardingExecutorService} 23 | */ 24 | public class ForwardingExecutorServiceTest extends TestCase { 25 | public void testForwarding() { 26 | ForwardingObjectTester.testForwardingObject(ForwardingExecutorService.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/primitives/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.primitives; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Tests basic sanity for each class in the package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests { 28 | public PackageSanityTests() { 29 | setDefault(String.class, "string"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/FilteredSetMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * A supertype for filtered {@link SetMultimap} implementations. 23 | * 24 | * @author Louis Wasserman 25 | */ 26 | @GwtCompatible 27 | interface FilteredSetMultimap extends FilteredMultimap, SetMultimap { 28 | @Override 29 | SetMultimap unfiltered(); 30 | } 31 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingCheckedFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Test for {@link ForwardingCheckedFuture} 23 | * 24 | * @author Ben Yu 25 | */ 26 | public class ForwardingCheckedFutureTest extends TestCase { 27 | public void testForwarding() { 28 | ForwardingObjectTester.testForwardingObject(ForwardingCheckedFuture.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/ForwardingImmutableCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Dummy class that makes the GWT serialization policy happy. It isn't used 23 | * on the server-side. 24 | * 25 | * @author Hayward Chan 26 | */ 27 | @GwtCompatible(emulated = true) 28 | class ForwardingImmutableCollection { 29 | private ForwardingImmutableCollection() {} 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/net/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * This package contains utility methods and classes for working with net addresses (numeric IP and 17 | * domain names). 18 | * 19 | *

This package is a part of the open-source Guava 20 | * library. 21 | * 22 | * @author Craig Berry 23 | */ 24 | @ParametersAreNonnullByDefault 25 | package com.google.common.net; 26 | 27 | import javax.annotation.ParametersAreNonnullByDefault; 28 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestCollectionGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Collection; 22 | 23 | /** 24 | * Creates collections, containing sample elements, to be tested. 25 | * 26 | * @author Kevin Bourrillion 27 | */ 28 | @GwtCompatible 29 | public interface TestCollectionGenerator extends TestContainerGenerator, E> {} 30 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/net/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.net; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Basic sanity tests for the entire package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests { 28 | public PackageSanityTests() { 29 | setDefault(InternetDomainName.class, InternetDomainName.from("google.com")); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Tests for {@link ForwardingListenableFuture}. 23 | * 24 | * @author Ben Yu 25 | */ 26 | public class ForwardingListenableFutureTest extends TestCase { 27 | public void testForwarding() { 28 | ForwardingObjectTester.testForwardingObject(ForwardingListenableFuture.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/html/HtmlEscapersTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.html; 17 | public class HtmlEscapersTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.html.testModule"; 20 | } 21 | 22 | public void testHtmlEscaper() throws Exception { 23 | com.google.common.html.HtmlEscapersTest testCase = new com.google.common.html.HtmlEscapersTest(); 24 | testCase.testHtmlEscaper(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestIteratorGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Iterator; 22 | 23 | /** 24 | * Creates iterators to be tested. 25 | * 26 | * @param the element type of the iterator. 27 | * 28 | * @author George van den Driessche 29 | */ 30 | @GwtCompatible 31 | public interface TestIteratorGenerator { 32 | Iterator get(); 33 | } 34 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Unit tests for {@link ForwardingListeningExecutorService} 23 | */ 24 | public class ForwardingListeningExecutorServiceTest extends TestCase { 25 | public void testForwarding() { 26 | ForwardingObjectTester.testForwardingObject(ForwardingListeningExecutorService.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guava/src/com/google/common/io/FileWriteMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.io; 16 | 17 | import com.google.common.annotations.GwtIncompatible; 18 | 19 | /** 20 | * Modes for opening a file for writing. The default when mode when none is specified is to truncate 21 | * the file before writing. 22 | * 23 | * @author Colin Decker 24 | */ 25 | @GwtIncompatible 26 | public enum FileWriteMode { 27 | /** Specifies that writes to the opened file should append to the end of the file. */ 28 | APPEND 29 | } 30 | -------------------------------------------------------------------------------- /guava/src/com/google/common/hash/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | // TODO(user): when things stabilize, flesh this out 16 | /** 17 | * Hash functions and related structures. 18 | * 19 | *

See the Guava User Guide article on 20 | * hashing. 21 | */ 22 | @CheckReturnValue 23 | @ParametersAreNonnullByDefault 24 | package com.google.common.hash; 25 | 26 | import javax.annotation.CheckReturnValue; 27 | import javax.annotation.ParametersAreNonnullByDefault; 28 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestQueueGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Queue; 22 | 23 | /** 24 | * Creates queues, containing sample elements, to be tested. 25 | * 26 | * @author Jared Levy 27 | */ 28 | @GwtCompatible 29 | public interface TestQueueGenerator extends TestCollectionGenerator { 30 | @Override 31 | Queue create(Object... elements); 32 | } 33 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestSetGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Set; 22 | 23 | /** 24 | * Creates sets, containing sample elements, to be tested. 25 | * 26 | * @author Kevin Bourrillion 27 | */ 28 | @GwtCompatible 29 | public interface TestSetGenerator extends TestCollectionGenerator { 30 | @Override 31 | Set create(Object... elements); 32 | } 33 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.escape; 18 | 19 | import junit.framework.TestCase; 20 | 21 | public class CharEscaperBuilderTest extends TestCase { 22 | 23 | public void testAddEscapes() { 24 | char[] cs = {'a', 'b', 'c'}; 25 | CharEscaperBuilder builder = new CharEscaperBuilder().addEscapes(cs, "Z"); 26 | Escaper escaper = builder.toEscaper(); 27 | assertEquals("ZZZdef", escaper.escape("abcdef")); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/InterruptibleTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | /** 20 | * Emulation for InterruptibleTask in GWT. 21 | */ 22 | abstract class InterruptibleTask implements Runnable { 23 | @Override public void run() { 24 | runInterruptibly(); 25 | } 26 | 27 | abstract void runInterruptibly(); 28 | 29 | abstract boolean wasInterrupted(); 30 | 31 | final void interruptTask() {} 32 | } 33 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestListGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * Creates sets, containing sample elements, to be tested. 25 | * 26 | * @author Kevin Bourrillion 27 | */ 28 | @GwtCompatible 29 | public interface TestListGenerator extends TestCollectionGenerator { 30 | @Override 31 | List create(Object... elements); 32 | } 33 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/base/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.base; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Basic sanity tests for classes in {@code common.base}. 23 | */ 24 | 25 | public class PackageSanityTests extends AbstractPackageSanityTests { 26 | public PackageSanityTests() { 27 | // package private classes like FunctionalEquivalence are tested through the public API. 28 | publicApiOnly(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/graph/GraphConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.graph; 18 | 19 | /** 20 | * A utility class to hold various constants used by the Guava Graph library. 21 | */ 22 | // TODO(user): Decide what else to put here (error message strings, node/edge map sizes, etc.) 23 | final class GraphConstants { 24 | 25 | private GraphConstants() {} 26 | 27 | // TODO(user): Enable users to specify the expected (in/out?) degree of nodes. 28 | static final int EXPECTED_DEGREE = 11; 29 | } 30 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LongAdder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.cache; 18 | 19 | /** 20 | * GWT emulated version of LongAdder. 21 | * 22 | * @author Charles Fry 23 | */ 24 | class LongAdder implements LongAddable { 25 | 26 | private long value; 27 | 28 | public void increment() { 29 | value++; 30 | } 31 | 32 | public void add(long x) { 33 | value += x; 34 | } 35 | 36 | public long sum() { 37 | return value; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/UnmodifiableIteratorTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class UnmodifiableIteratorTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testRemove() throws Exception { 22 | com.google.common.collect.UnmodifiableIteratorTest testCase = new com.google.common.collect.UnmodifiableIteratorTest(); 23 | testCase.testRemove(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/util/concurrent/CallablesTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.util.concurrent; 17 | public class CallablesTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.util.concurrent.testModule"; 20 | } 21 | public void testReturning() throws Exception { 22 | com.google.common.util.concurrent.CallablesTest testCase = new com.google.common.util.concurrent.CallablesTest(); 23 | testCase.testReturning(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/ExampleIteratorTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * A non-empty tester for {@link java.util.Iterator}. 23 | * 24 | * @author George van den Driessche 25 | */ 26 | @GwtCompatible 27 | public final class ExampleIteratorTester extends AbstractTester> { 28 | public void testSomethingAboutIterators() { 29 | assertTrue(true); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import junit.framework.TestCase; 22 | 23 | /** 24 | * Unit tests for {@link Runnables}. 25 | * 26 | * @author Olivier Pernet 27 | */ 28 | @GwtCompatible 29 | public class RunnablesTest extends TestCase { 30 | public void testDoNothingRunnableIsSingleton() { 31 | assertSame(Runnables.doNothing(), Runnables.doNothing()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * Minimal GWT emulation of a map providing atomic operations. 23 | * 24 | * @author Jesse Wilson 25 | */ 26 | public interface ConcurrentMap extends Map { 27 | 28 | V putIfAbsent(K key, V value); 29 | 30 | boolean remove(Object key, Object value); 31 | 32 | V replace(K key, V value); 33 | 34 | boolean replace(K key, V oldValue, V newValue); 35 | } 36 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/TestSetMultimapGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.SetMultimap; 21 | 22 | /** 23 | * A generator for {@code SetMultimap} implementations based on test data. 24 | * 25 | * @author Louis Wasserman 26 | */ 27 | @GwtCompatible 28 | public interface TestSetMultimapGenerator 29 | extends TestMultimapGenerator> {} 30 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/DerivedComparable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Simple derived class to verify that we handle generics correctly. 23 | * 24 | * @author Kevin Bourrillion 25 | */ 26 | @GwtCompatible 27 | public class DerivedComparable extends BaseComparable { 28 | public DerivedComparable(String s) { 29 | super(s); 30 | } 31 | 32 | private static final long serialVersionUID = 0; 33 | } 34 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestSubjectGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * To be implemented by test generators that can produce test subjects without 23 | * requiring any parameters. 24 | * 25 | * @param the type created by this generator. 26 | * 27 | * @author George van den Driessche 28 | */ 29 | @GwtCompatible 30 | public interface TestSubjectGenerator { 31 | T createTestSubject(); 32 | } 33 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/TestListMultimapGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.ListMultimap; 21 | 22 | /** 23 | * A generator for {@code ListMultimap} implementations based on test data. 24 | * 25 | * @author Louis Wasserman 26 | */ 27 | @GwtCompatible 28 | public interface TestListMultimapGenerator 29 | extends TestMultimapGenerator> {} 30 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/FilteredMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.base.Predicate; 21 | 22 | import java.util.Map.Entry; 23 | 24 | /** 25 | * An interface for all filtered multimap types. 26 | * 27 | * @author Louis Wasserman 28 | */ 29 | @GwtCompatible 30 | interface FilteredMultimap extends Multimap { 31 | Multimap unfiltered(); 32 | 33 | Predicate> entryPredicate(); 34 | } 35 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/RegularImmutableAsListTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class RegularImmutableAsListTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testDoesntCheckForNull() throws Exception { 22 | com.google.common.collect.RegularImmutableAsListTest testCase = new com.google.common.collect.RegularImmutableAsListTest(); 23 | testCase.testDoesntCheckForNull(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guava/src/com/google/common/graph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * An API for representing graph (node and edge) data. It is analogous to the Java Collections 19 | * Framework APIs for lists, maps, sets, etc. 20 | * 21 | *

This package is a part of the open-source Guava 22 | * library. 23 | */ 24 | @CheckReturnValue 25 | @ParametersAreNonnullByDefault 26 | package com.google.common.graph; 27 | 28 | import javax.annotation.CheckReturnValue; 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | 31 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/util/concurrent/RunnablesTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.util.concurrent; 17 | public class RunnablesTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.util.concurrent.testModule"; 20 | } 21 | public void testDoNothingRunnableIsSingleton() throws Exception { 22 | com.google.common.util.concurrent.RunnablesTest testCase = new com.google.common.util.concurrent.RunnablesTest(); 23 | testCase.testDoNothingRunnableIsSingleton(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/TestMapGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * Creates maps, containing sample elements, to be tested. 25 | * 26 | * @author George van den Driessche 27 | */ 28 | @GwtCompatible 29 | public interface TestMapGenerator extends TestContainerGenerator, Map.Entry> { 30 | K[] createKeyArray(int length); 31 | 32 | V[] createValueArray(int length); 33 | } 34 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/ForceGuavaCompilation.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/collect/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Covers basic sanity checks for the entire package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests { 28 | public PackageSanityTests() { 29 | publicApiOnly(); // Many package-private classes are tested through the public API. 30 | setDefault(DiscreteDomain.class, DiscreteDomain.integers()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /guava/src/com/google/common/util/concurrent/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.util.concurrent; 16 | 17 | import com.google.common.annotations.GwtCompatible; 18 | 19 | import javax.annotation.Nullable; 20 | 21 | /** 22 | * Methods factored out so that they can be emulated differently in GWT. 23 | */ 24 | @GwtCompatible(emulated = true) 25 | final class Platform { 26 | static boolean isInstanceOfThrowableClass( 27 | @Nullable Throwable t, Class expectedClass) { 28 | return expectedClass.isInstance(t); 29 | } 30 | 31 | private Platform() {} 32 | } 33 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/lang/super/java/lang/InterruptedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.lang; 18 | 19 | /** 20 | * Minimal emulation of {@link java.lang.InterruptedException}, that should 21 | * only be used in method signatures. New GWT code should not reference this 22 | * class at all. It is here only to ease the GWTification of common code. 23 | * 24 | * @author Tom O'Neill 25 | */ 26 | public class InterruptedException extends Exception { 27 | public InterruptedException() {} 28 | 29 | public InterruptedException(String message) { 30 | super(message); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing; 18 | 19 | import com.google.common.testing.RelationshipTester.ItemReporter; 20 | 21 | import junit.framework.TestCase; 22 | 23 | /** 24 | * Tests for {@link RelationshipTester}. 25 | * 26 | * @author Ben Yu 27 | */ 28 | public class RelationshipTesterTest extends TestCase { 29 | 30 | public void testNulls() { 31 | new ClassSanityTester() 32 | .setDefault(ItemReporter.class, new ItemReporter()) 33 | .testNulls(RelationshipTester.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guava/src/com/google/common/util/concurrent/ListenableScheduledFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.util.concurrent; 16 | 17 | import com.google.common.annotations.Beta; 18 | import com.google.common.annotations.GwtIncompatible; 19 | 20 | import java.util.concurrent.ScheduledFuture; 21 | 22 | /** 23 | * Helper interface to implement both {@link ListenableFuture} and {@link ScheduledFuture}. 24 | * 25 | * @author Anthony Zana 26 | * 27 | * @since 15.0 28 | */ 29 | @Beta 30 | @GwtIncompatible 31 | public interface ListenableScheduledFuture extends ScheduledFuture, ListenableFuture {} 32 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * GWt emulation of {@link RegularImmutableMap}. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | final class RegularImmutableMap extends ForwardingImmutableMap { 27 | 28 | RegularImmutableMap(Map delegate) { 29 | super(delegate); 30 | } 31 | 32 | RegularImmutableMap(Entry... entries) { 33 | super(entries); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guava/src/com/google/common/cache/Weigher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.cache; 16 | 17 | import com.google.common.annotations.GwtCompatible; 18 | 19 | /** 20 | * Calculates the weights of cache entries. 21 | * 22 | * @author Charles Fry 23 | * @since 11.0 24 | */ 25 | @GwtCompatible 26 | public interface Weigher { 27 | 28 | /** 29 | * Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply 30 | * relative to each other. 31 | * 32 | * @return the weight of the entry; must be non-negative 33 | */ 34 | int weigh(K key, V value); 35 | } 36 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/testers/AbstractQueueTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.testers; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.testing.AbstractCollectionTester; 21 | 22 | import java.util.Queue; 23 | 24 | /** 25 | * Base class for queue collection tests. 26 | * 27 | * @author Jared Levy 28 | */ 29 | @GwtCompatible 30 | public class AbstractQueueTester extends AbstractCollectionTester { 31 | protected final Queue getQueue() { 32 | return (Queue) collection; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import java.util.Collections; 20 | import java.util.Set; 21 | 22 | /** 23 | * GWT emulation of {@link RegularImmutableSet}. 24 | * 25 | * @author Hayward Chan 26 | */ 27 | final class RegularImmutableSet extends ForwardingImmutableSet { 28 | static final RegularImmutableSet EMPTY = new RegularImmutableSet( 29 | Collections.emptySet()); 30 | 31 | RegularImmutableSet(Set delegate) { 32 | super(delegate); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | /** 20 | * Methods factored out so that they can be emulated differently in GWT. 21 | */ 22 | final class Platform { 23 | static boolean isInstanceOfThrowableClass(Throwable t, Class expectedClass) { 24 | /* 25 | * This method is used only by CatchingFuture, and CatchingFuture accepts only Throwable.class 26 | * under GWT. 27 | */ 28 | return true; 29 | } 30 | 31 | private Platform() {} 32 | } 33 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/ExecutionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of ExecutionException. 21 | * 22 | * @author Charles Fry 23 | */ 24 | public class ExecutionException extends Exception { 25 | protected ExecutionException() { } 26 | 27 | protected ExecutionException(String message) { 28 | super(message); 29 | } 30 | 31 | public ExecutionException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public ExecutionException(Throwable cause) { 36 | super(cause); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/TestMultisetGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.Multiset; 21 | import com.google.common.collect.testing.TestCollectionGenerator; 22 | 23 | /** 24 | * Creates multisets, containing sample elements, to be tested. 25 | * 26 | * @author Jared Levy 27 | */ 28 | @GwtCompatible 29 | public interface TestMultisetGenerator extends TestCollectionGenerator { 30 | @Override 31 | Multiset create(Object... elements); 32 | } 33 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/features/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.features; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.Set; 22 | 23 | /** 24 | * Base class for enumerating the features of an interface to be tested. 25 | * 26 | * @param The interface whose features are to be enumerated. 27 | * @author George van den Driessche 28 | */ 29 | @GwtCompatible 30 | public interface Feature { 31 | /** Returns the set of features that are implied by this feature. */ 32 | Set> getImpliedFeatures(); 33 | } 34 | -------------------------------------------------------------------------------- /guava/src/com/google/common/math/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * Arithmetic functions operating on primitive values and {@link java.math.BigInteger} instances. 17 | * 18 | *

This package is a part of the open-source Guava 19 | * library. 20 | * 21 | *

See the Guava User Guide article on 22 | * math utilities. 23 | */ 24 | @ParametersAreNonnullByDefault 25 | @CheckReturnValue 26 | package com.google.common.math; 27 | 28 | import javax.annotation.CheckReturnValue; 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /guava-testlib/test/com/google/common/testing/anotherpackage/SomeClassThatDoesNotUseNullable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing.anotherpackage; 18 | 19 | /** Does not check null, but should not matter since it's in a different package. */ 20 | @SuppressWarnings("unused") // For use by NullPointerTester 21 | public class SomeClassThatDoesNotUseNullable { 22 | 23 | void packagePrivateButDoesNotCheckNull(String s) {} 24 | 25 | protected void protectedButDoesNotCheckNull(String s) {} 26 | 27 | public void publicButDoesNotCheckNull(String s) {} 28 | 29 | public static void staticButDoesNotCheckNull(String s) {} 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/lang/super/java/lang/reflect/UndeclaredThrowableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.lang.reflect; 18 | 19 | /** 20 | * GWT emulation of UndeclaredThrowableException. 21 | */ 22 | public class UndeclaredThrowableException extends RuntimeException { 23 | public UndeclaredThrowableException(Throwable undeclaredThrowable) { 24 | super(undeclaredThrowable); 25 | } 26 | 27 | public UndeclaredThrowableException(Throwable undeclaredThrowable, String message) { 28 | super(message, undeclaredThrowable); 29 | } 30 | 31 | public Throwable getUndeclaredThrowable() { 32 | return getCause(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-gwt/test-super/com/google/common/testing/super/com/google/common/testing/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing; 18 | 19 | import static com.google.common.base.Preconditions.checkNotNull; 20 | 21 | /** 22 | * Methods factored out so that they can be emulated differently in GWT. 23 | * 24 | * @author Chris Povirk 25 | */ 26 | final class Platform { 27 | /** 28 | * Serializes and deserializes the specified object (a no-op under GWT). 29 | */ 30 | @SuppressWarnings("unchecked") 31 | static T reserialize(T object) { 32 | return checkNotNull(object); 33 | } 34 | 35 | private Platform() {} 36 | } 37 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/RejectedExecutionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * GWT emulation of RejectedExecutionException. 21 | */ 22 | public class RejectedExecutionException extends RuntimeException { 23 | public RejectedExecutionException() { 24 | } 25 | 26 | public RejectedExecutionException(String message) { 27 | super(message); 28 | } 29 | 30 | public RejectedExecutionException(String message, Throwable cause) { 31 | super(message, cause); 32 | } 33 | 34 | public RejectedExecutionException(Throwable cause) { 35 | super(cause); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/SortedMultisetBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtIncompatible; 20 | 21 | import java.util.SortedSet; 22 | 23 | /** 24 | * Superinterface of {@link SortedMultiset} to introduce a bridge method for 25 | * {@code elementSet()}, to ensure binary compatibility with older Guava versions 26 | * that specified {@code elementSet()} to return {@code SortedSet}. 27 | * 28 | * @author Louis Wasserman 29 | */ 30 | @GwtIncompatible 31 | interface SortedMultisetBridge extends Multiset { 32 | @Override 33 | SortedSet elementSet(); 34 | } 35 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/hash/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.hash; 18 | 19 | import com.google.common.hash.BloomFilterStrategies.BitArray; 20 | import com.google.common.testing.AbstractPackageSanityTests; 21 | 22 | /** 23 | * Basic sanity tests for the entire package. 24 | * 25 | * @author Ben Yu 26 | */ 27 | 28 | public class PackageSanityTests extends AbstractPackageSanityTests { 29 | public PackageSanityTests() { 30 | setDefault(BitArray.class, new BitArray(1)); 31 | setDefault(HashCode.class, HashCode.fromInt(1)); 32 | setDefault(String.class, "MD5"); 33 | setDefault(int.class, 32); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/GuavaTests.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/ComputationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import javax.annotation.Nullable; 22 | 23 | /** 24 | * Wraps an exception that occurred during a computation. 25 | * 26 | * @author Bob Lee 27 | * @since 2.0 28 | */ 29 | @GwtCompatible 30 | public class ComputationException extends RuntimeException { 31 | /** 32 | * Creates a new instance with the given cause. 33 | */ 34 | public ComputationException(@Nullable Throwable cause) { 35 | super(cause); 36 | } 37 | 38 | private static final long serialVersionUID = 0; 39 | } 40 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapGetTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.SortedSetMultimap; 21 | 22 | /** 23 | * Tester for {@link SortedSetMultimap#get(Object)}. 24 | * 25 | * @author Louis Wasserman 26 | */ 27 | @GwtCompatible 28 | public class SortedSetMultimapGetTester 29 | extends AbstractMultimapTester> { 30 | public void testValueComparator() { 31 | assertEquals(multimap().valueComparator(), multimap().get(k0()).comparator()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/io/TestStreamSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.io; 18 | 19 | /** 20 | * Interface for a supplier of streams that can report whether a stream was opened and whether that 21 | * stream was closed. Intended for use in a test where only a single stream should be opened and 22 | * possibly closed. 23 | * 24 | * @author Colin Decker 25 | */ 26 | public interface TestStreamSupplier { 27 | 28 | /** 29 | * Returns whether or not a new stream was opened. 30 | */ 31 | boolean wasStreamOpened(); 32 | 33 | /** 34 | * Returns whether or not an open stream was closed. 35 | */ 36 | boolean wasStreamClosed(); 37 | } 38 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.escape; 18 | 19 | /** 20 | * @author Jesse Wilson 21 | */ 22 | final class Platform { 23 | 24 | private static final char[] CHAR_BUFFER = new char[1024]; 25 | 26 | static char[] charBufferFromThreadLocal() { 27 | // ThreadLocal is not available to GWT, so we always reuse the same 28 | // instance. It is always safe to return the same instance because 29 | // javascript is single-threaded, and only used by blocks that doesn't 30 | // involve async callbacks. 31 | return CHAR_BUFFER; 32 | } 33 | 34 | private Platform() {} 35 | } 36 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/TestBiMapGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.BiMap; 21 | import com.google.common.collect.testing.TestContainerGenerator; 22 | 23 | import java.util.Map; 24 | 25 | /** 26 | * Creates bimaps, containing sample entries, to be tested. 27 | * 28 | * @author Louis Wasserman 29 | */ 30 | @GwtCompatible 31 | public interface TestBiMapGenerator 32 | extends TestContainerGenerator, Map.Entry> { 33 | K[] createKeyArray(int length); 34 | 35 | V[] createValueArray(int length); 36 | } 37 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/SortedListsTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class SortedListsTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testWithDups() throws Exception { 22 | com.google.common.collect.SortedListsTest testCase = new com.google.common.collect.SortedListsTest(); 23 | testCase.testWithDups(); 24 | } 25 | 26 | public void testWithoutDups() throws Exception { 27 | com.google.common.collect.SortedListsTest testCase = new com.google.common.collect.SortedListsTest(); 28 | testCase.testWithoutDups(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/graph/ImmutableGraphTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.graph; 18 | 19 | import static com.google.common.truth.Truth.assertThat; 20 | 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | import org.junit.runners.JUnit4; 24 | 25 | /** 26 | * Tests for {@link ImmutableGraph}. 27 | */ 28 | @RunWith(JUnit4.class) 29 | public class ImmutableGraphTest { 30 | 31 | @Test 32 | public void copyOfImmutableGraph_optimized() { 33 | Graph graph1 = ImmutableGraph.copyOf(GraphBuilder.directed().build()); 34 | Graph graph2 = ImmutableGraph.copyOf(graph1); 35 | 36 | assertThat(graph2).isSameAs(graph1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/xml/XmlEscapersTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.xml; 17 | public class XmlEscapersTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.xml.testModule"; 20 | } 21 | public void testXmlAttributeEscaper() throws Exception { 22 | com.google.common.xml.XmlEscapersTest testCase = new com.google.common.xml.XmlEscapersTest(); 23 | testCase.testXmlAttributeEscaper(); 24 | } 25 | 26 | public void testXmlContentEscaper() throws Exception { 27 | com.google.common.xml.XmlEscapersTest testCase = new com.google.common.xml.XmlEscapersTest(); 28 | testCase.testXmlContentEscaper(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/reflect/TypeCapture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.reflect; 16 | 17 | import static com.google.common.base.Preconditions.checkArgument; 18 | 19 | import java.lang.reflect.ParameterizedType; 20 | import java.lang.reflect.Type; 21 | 22 | /** 23 | * Captures the actual type of {@code T}. 24 | * 25 | * @author Ben Yu 26 | */ 27 | abstract class TypeCapture { 28 | 29 | /** Returns the captured type. */ 30 | final Type capture() { 31 | Type superclass = getClass().getGenericSuperclass(); 32 | checkArgument(superclass instanceof ParameterizedType, "%s isn't parameterized", superclass); 33 | return ((ParameterizedType) superclass).getActualTypeArguments()[0]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/GoogleHelpers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import static junit.framework.Assert.fail; 20 | 21 | import com.google.common.annotations.GwtCompatible; 22 | import com.google.common.collect.Multimap; 23 | 24 | /** 25 | * Helper methods/assertions for use with {@code com.google.common.collect} types. 26 | * 27 | * @author Colin Decker 28 | */ 29 | @GwtCompatible 30 | final class GoogleHelpers { 31 | 32 | private GoogleHelpers() {} 33 | 34 | static void assertEmpty(Multimap multimap) { 35 | if (!multimap.isEmpty()) { 36 | fail("Not true that " + multimap + " is empty"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /guava/src/com/google/common/base/FinalizableReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.base; 16 | 17 | import com.google.common.annotations.GwtIncompatible; 18 | 19 | /** 20 | * Implemented by references that have code to run after garbage collection of their referents. 21 | * 22 | * @see FinalizableReferenceQueue 23 | * @author Bob Lee 24 | * @since 2.0 25 | */ 26 | @GwtIncompatible 27 | public interface FinalizableReference { 28 | /** 29 | * Invoked on a background thread after the referent has been garbage collected unless security 30 | * restrictions prevented starting a background thread, in which case this method is invoked when 31 | * new references are created. 32 | */ 33 | void finalizeReferent(); 34 | } 35 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/testers/MapSizeTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.testers; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.testing.AbstractMapTester; 21 | 22 | /** 23 | * A generic JUnit test which tests {@code size()} operations on a map. 24 | * Can't be invoked directly; please see 25 | * {@link com.google.common.collect.testing.MapTestSuiteBuilder}. 26 | * 27 | * @author George van den Driessche 28 | */ 29 | @GwtCompatible 30 | public class MapSizeTester extends AbstractMapTester { 31 | public void testSize() { 32 | assertEquals("size():", getNumElements(), getMap().size()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/collect/DiscreteDomainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import static com.google.common.testing.SerializableTester.reserializeAndAssert; 20 | 21 | import com.google.common.annotations.GwtIncompatible; 22 | 23 | import junit.framework.TestCase; 24 | 25 | /** 26 | * Tests for {@link DiscreteDomain}. 27 | * 28 | * @author Chris Povirk 29 | */ 30 | @GwtIncompatible // SerializableTester 31 | public class DiscreteDomainTest extends TestCase { 32 | public void testSerialization() { 33 | reserializeAndAssert(DiscreteDomain.integers()); 34 | reserializeAndAssert(DiscreteDomain.longs()); 35 | reserializeAndAssert(DiscreteDomain.bigIntegers()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/SortedMapDifference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | import java.util.SortedMap; 22 | 23 | /** 24 | * An object representing the differences between two sorted maps. 25 | * 26 | * @author Louis Wasserman 27 | * @since 8.0 28 | */ 29 | @GwtCompatible 30 | public interface SortedMapDifference extends MapDifference { 31 | 32 | @Override 33 | SortedMap entriesOnlyOnLeft(); 34 | 35 | @Override 36 | SortedMap entriesOnlyOnRight(); 37 | 38 | @Override 39 | SortedMap entriesInCommon(); 40 | 41 | @Override 42 | SortedMap> entriesDiffering(); 43 | } 44 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/SortedIterablesTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class SortedIterablesTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testComparator() throws Exception { 22 | com.google.common.collect.SortedIterablesTest testCase = new com.google.common.collect.SortedIterablesTest(); 23 | testCase.testComparator(); 24 | } 25 | 26 | public void testSameComparator() throws Exception { 27 | com.google.common.collect.SortedIterablesTest testCase = new com.google.common.collect.SortedIterablesTest(); 28 | testCase.testSameComparator(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import static java.util.Collections.unmodifiableList; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * GWT emulated version of {@link RegularImmutableList}. 25 | * 26 | * @author Hayward Chan 27 | */ 28 | class RegularImmutableList extends ForwardingImmutableList { 29 | private final List delegate; 30 | 31 | RegularImmutableList(List delegate) { 32 | // TODO(cpovirk): avoid redundant unmodifiableList wrapping 33 | this.delegate = unmodifiableList(delegate); 34 | } 35 | 36 | @Override List delegateList() { 37 | return delegate; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Uninterruptibles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import java.util.concurrent.ExecutionException; 20 | import java.util.concurrent.Future; 21 | 22 | /** 23 | * Emulation of Uninterruptibles in GWT. 24 | */ 25 | public final class Uninterruptibles { 26 | 27 | private Uninterruptibles() { 28 | } 29 | 30 | public static V getUninterruptibly(Future future) throws ExecutionException { 31 | try { 32 | return future.get(); 33 | } catch (InterruptedException e) { 34 | // Should never be thrown in GWT but play it safe 35 | throw new IllegalStateException(e); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/cache/PackageSanityTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.cache; 18 | 19 | import com.google.common.testing.AbstractPackageSanityTests; 20 | 21 | /** 22 | * Basic sanity tests for the entire package. 23 | * 24 | * @author Ben Yu 25 | */ 26 | 27 | public class PackageSanityTests extends AbstractPackageSanityTests { 28 | public PackageSanityTests() { 29 | setDefault(CacheLoader.class, new CacheLoader() { 30 | @Override public Object load(Object key) { 31 | return key; 32 | }}); 33 | setDefault(LocalCache.class, new LocalCache(CacheBuilder.newBuilder(), null)); 34 | setDefault(CacheBuilder.class, CacheBuilder.newBuilder()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; 21 | 22 | /** 23 | * Tests for {@link AbstractFuture} that use a {@link TrustedFuture} for 24 | * {@link AbstractFuture#setFuture} calls. 25 | */ 26 | @GwtCompatible 27 | public class TrustedInputFutureTest extends AbstractAbstractFutureTest { 28 | @Override 29 | AbstractFuture newDelegate() { 30 | AbstractFuture future = new TrustedFuture() {}; 31 | assertTrue(future instanceof TrustedFuture); // sanity check 32 | return future; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/testers/CollectionSizeTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.testers; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.testing.AbstractCollectionTester; 21 | 22 | /** 23 | * A generic JUnit test which tests {@code size()} operations on a collection. 24 | * Can't be invoked directly; please see 25 | * {@link com.google.common.collect.testing.CollectionTestSuiteBuilder}. 26 | * 27 | * @author Kevin Bourrillion 28 | */ 29 | @GwtCompatible 30 | public class CollectionSizeTester extends AbstractCollectionTester { 31 | public void testSize() { 32 | assertEquals("size():", getNumElements(), collection.size()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.google; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.Multiset; 21 | import com.google.common.collect.testing.AbstractCollectionTester; 22 | 23 | /** 24 | * Base class for multiset collection tests. 25 | * 26 | * @author Jared Levy 27 | */ 28 | @GwtCompatible 29 | public class AbstractMultisetTester extends AbstractCollectionTester { 30 | protected final Multiset getMultiset() { 31 | return (Multiset) collection; 32 | } 33 | 34 | protected void initThreeCopies() { 35 | collection = getSubjectGenerator().create(e0(), e0(), e0()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.util.concurrent; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; 21 | 22 | /** 23 | * Tests for {@link AbstractFuture} that use a non-{@link TrustedFuture} for 24 | * {@link AbstractFuture#setFuture} calls. 25 | */ 26 | @GwtCompatible 27 | public class UntrustedInputFutureTest extends AbstractAbstractFutureTest { 28 | @Override 29 | AbstractFuture newDelegate() { 30 | AbstractFuture future = new AbstractFuture() {}; 31 | assertFalse(future instanceof TrustedFuture); // sanity check 32 | return future; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/GwtTransient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import static java.lang.annotation.ElementType.FIELD; 20 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 21 | 22 | import com.google.common.annotations.GwtCompatible; 23 | 24 | import java.lang.annotation.Documented; 25 | import java.lang.annotation.Retention; 26 | import java.lang.annotation.Target; 27 | 28 | /** 29 | * Private replacement for {@link com.google.gwt.user.client.rpc.GwtTransient} 30 | * to work around build-system quirks. This annotation should be used 31 | * only in {@code com.google.common.collect}. 32 | */ 33 | @Documented 34 | @GwtCompatible 35 | @Retention(RUNTIME) 36 | @Target(FIELD) 37 | @interface GwtTransient {} 38 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/MultimapBuilderTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class MultimapBuilderTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testGenerics_gwtCompatible() throws Exception { 22 | com.google.common.collect.MultimapBuilderTest testCase = new com.google.common.collect.MultimapBuilderTest(); 23 | testCase.testGenerics_gwtCompatible(); 24 | } 25 | 26 | public void testTreeKeys_gwtCompatible() throws Exception { 27 | com.google.common.collect.MultimapBuilderTest testCase = new com.google.common.collect.MultimapBuilderTest(); 28 | testCase.testTreeKeys_gwtCompatible(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava/src/com/google/common/util/concurrent/Runnables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.util.concurrent; 16 | 17 | import com.google.common.annotations.Beta; 18 | import com.google.common.annotations.GwtCompatible; 19 | 20 | /** 21 | * Static utility methods pertaining to the {@link Runnable} interface. 22 | * 23 | * @since 16.0 24 | */ 25 | @Beta 26 | @GwtCompatible 27 | public final class Runnables { 28 | 29 | private static final Runnable EMPTY_RUNNABLE = 30 | new Runnable() { 31 | @Override 32 | public void run() {} 33 | }; 34 | 35 | /** 36 | * Returns a {@link Runnable} instance that does nothing when run. 37 | */ 38 | public static Runnable doNothing() { 39 | return EMPTY_RUNNABLE; 40 | } 41 | 42 | private Runnables() {} 43 | } 44 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/ImmutableEnumMapTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class ImmutableEnumMapTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testEmptyImmutableEnumMap() throws Exception { 22 | com.google.common.collect.ImmutableEnumMapTest testCase = new com.google.common.collect.ImmutableEnumMapTest(); 23 | testCase.testEmptyImmutableEnumMap(); 24 | } 25 | 26 | public void testImmutableEnumMapOrdering() throws Exception { 27 | com.google.common.collect.ImmutableEnumMapTest testCase = new com.google.common.collect.ImmutableEnumMapTest(); 28 | testCase.testImmutableEnumMapOrdering(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/collect/RangeNonGwtTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.testing.NullPointerTester; 20 | 21 | import junit.framework.TestCase; 22 | 23 | /** 24 | * Test cases for {@link Range} which cannot run as GWT tests. 25 | * 26 | * @author Gregory Kick 27 | * @see RangeTest 28 | */ 29 | public class RangeNonGwtTest extends TestCase { 30 | 31 | public void testNullPointers() { 32 | NullPointerTester tester = new NullPointerTester(); 33 | 34 | tester.testAllPublicStaticMethods(Range.class); 35 | tester.testAllPublicStaticMethods(Range.class); 36 | 37 | tester.testAllPublicInstanceMethods(Range.all()); 38 | tester.testAllPublicInstanceMethods(Range.open(1, 3)); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/testers/AbstractSetTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.testers; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | import com.google.common.collect.testing.AbstractCollectionTester; 21 | 22 | import java.util.Set; 23 | 24 | /** 25 | * @author George van den Driessche 26 | */ 27 | @GwtCompatible 28 | public class AbstractSetTester extends AbstractCollectionTester { 29 | /* 30 | * Previously we had a field named set that was initialized to the value of 31 | * collection in setUp(), but that caused problems when a tester changed the 32 | * value of set or collection but not both. 33 | */ 34 | protected final Set getSet() { 35 | return (Set) collection; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava-gwt/test/com/google/common/collect/SimpleAbstractMultisetTest_gwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.common.collect; 17 | public class SimpleAbstractMultisetTest_gwt extends com.google.gwt.junit.client.GWTTestCase { 18 | @Override public String getModuleName() { 19 | return "com.google.common.collect.testModule"; 20 | } 21 | public void testFastAddAllMultiset() throws Exception { 22 | com.google.common.collect.SimpleAbstractMultisetTest testCase = new com.google.common.collect.SimpleAbstractMultisetTest(); 23 | testCase.testFastAddAllMultiset(); 24 | } 25 | 26 | public void testRemoveUnsupported() throws Exception { 27 | com.google.common.collect.SimpleAbstractMultisetTest testCase = new com.google.common.collect.SimpleAbstractMultisetTest(); 28 | testCase.testRemoveUnsupported(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/testing/TearDownAccepter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.testing; 18 | 19 | import com.google.common.annotations.Beta; 20 | import com.google.common.annotations.GwtCompatible; 21 | 22 | /** 23 | * Any object which can accept registrations of {@link TearDown} instances. 24 | * 25 | * @author Kevin Bourrillion 26 | * @since 10.0 27 | */ 28 | @Beta 29 | @GwtCompatible 30 | public interface TearDownAccepter { 31 | /** 32 | * Registers a TearDown implementor which will be run after the test proper. 33 | * 34 | *

In JUnit4 language, that means as an {@code @After}. 35 | * 36 | *

In JUnit3 language, that means during the 37 | * {@link junit.framework.TestCase#tearDown()} step. 38 | */ 39 | void addTearDown(TearDown tearDown); 40 | } 41 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/Executors.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a modified version of 3 | * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/Executors.java?revision=1.90 4 | * which contained the following notice: 5 | * 6 | * Written by Doug Lea with assistance from members of JCP JSR-166 7 | * Expert Group and released to the public domain, as explained at 8 | * http://creativecommons.org/publicdomain/zero/1.0/ 9 | */ 10 | 11 | package java.util.concurrent; 12 | 13 | /** 14 | * Emulation of executors. 15 | */ 16 | public class Executors { 17 | 18 | public static Callable callable(Runnable task, T result) { 19 | if (task == null) { 20 | throw new NullPointerException(); 21 | } 22 | return new RunnableAdapter(task, result); 23 | } 24 | 25 | public static Callable callable(Runnable task) { 26 | if (task == null) { 27 | throw new NullPointerException(); 28 | } 29 | return new RunnableAdapter(task, null); 30 | } 31 | 32 | static final class RunnableAdapter implements Callable { 33 | 34 | final Runnable task; 35 | final T result; 36 | 37 | RunnableAdapter(Runnable task, T result) { 38 | this.task = task; 39 | this.result = result; 40 | } 41 | 42 | public T call() { 43 | task.run(); 44 | return result; 45 | } 46 | } 47 | 48 | private Executors() { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/annotations/Annotations.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableSortedSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import java.util.SortedSet; 20 | 21 | /** 22 | * GWT emulation of {@link RegularImmutableSortedSet}. 23 | * 24 | * @author Hayward Chan 25 | */ 26 | final class RegularImmutableSortedSet extends ImmutableSortedSet { 27 | 28 | /** true if this set is a subset of another immutable sorted set. */ 29 | final boolean isSubset; 30 | 31 | RegularImmutableSortedSet(SortedSet delegate, boolean isSubset) { 32 | super(delegate); 33 | this.isSubset = isSubset; 34 | } 35 | 36 | @Override ImmutableList createAsList() { 37 | return new ImmutableSortedAsList(this, ImmutableList.asImmutableList(toArray())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/collect/RegularImmutableAsListTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.collect; 16 | 17 | import com.google.common.annotations.GwtCompatible; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** 22 | * Tests for {@link RegularImmutableAsList}. 23 | * 24 | * @author Louis Wasserman 25 | */ 26 | @GwtCompatible 27 | public class RegularImmutableAsListTest extends TestCase { 28 | /** 29 | * RegularImmutableAsList should assume its input is null-free without checking, because it only 30 | * gets invoked from other immutable collections. 31 | */ 32 | public void testDoesntCheckForNull() { 33 | ImmutableSet set = ImmutableSet.of(1, 2, 3); 34 | new RegularImmutableAsList(set, new Object[] {null, null, null}); 35 | // shouldn't throw! 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/AllEqualOrdering_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.gwt.user.client.rpc.SerializationStreamReader; 20 | import com.google.gwt.user.client.rpc.SerializationStreamWriter; 21 | 22 | /** 23 | * This class implements the GWT serialization of {@link AllEqualOrdering}. 24 | * 25 | * @author Chris Povirk 26 | */ 27 | public class AllEqualOrdering_CustomFieldSerializer { 28 | public static void deserialize(SerializationStreamReader reader, AllEqualOrdering instance) {} 29 | 30 | public static AllEqualOrdering instantiate(SerializationStreamReader reader) { 31 | return AllEqualOrdering.INSTANCE; 32 | } 33 | 34 | public static void serialize(SerializationStreamWriter writer, AllEqualOrdering instance) {} 35 | } 36 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/NaturalOrdering_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.gwt.user.client.rpc.SerializationStreamReader; 20 | import com.google.gwt.user.client.rpc.SerializationStreamWriter; 21 | 22 | /** 23 | * This class implements the GWT serialization of {@link NaturalOrdering}. 24 | * 25 | * @author Chris Povirk 26 | */ 27 | public class NaturalOrdering_CustomFieldSerializer { 28 | 29 | public static void deserialize(SerializationStreamReader reader, NaturalOrdering instance) {} 30 | 31 | public static NaturalOrdering instantiate(SerializationStreamReader reader) { 32 | return NaturalOrdering.INSTANCE; 33 | } 34 | 35 | public static void serialize(SerializationStreamWriter writer, NaturalOrdering instance) {} 36 | } 37 | -------------------------------------------------------------------------------- /guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.eventbus; 18 | 19 | import com.google.caliper.BeforeExperiment; 20 | import com.google.caliper.Benchmark; 21 | 22 | /** 23 | * Benchmark for {@link EventBus}. 24 | * 25 | * @author Eric Fellheimer 26 | */ 27 | public class EventBusBenchmark { 28 | 29 | private EventBus eventBus; 30 | 31 | @BeforeExperiment 32 | void setUp() { 33 | eventBus = new EventBus("for benchmarking purposes"); 34 | eventBus.register(this); 35 | } 36 | 37 | @Benchmark void postStrings(int reps) { 38 | for (int i = 0; i < reps; i++) { 39 | eventBus.post("hello there"); 40 | } 41 | } 42 | 43 | @Subscribe 44 | public void handleStrings(String string) { 45 | // Nothing to do here. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /guava-tests/test/com/google/common/io/RandomAmountInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.io; 18 | 19 | import static com.google.common.base.Preconditions.checkNotNull; 20 | 21 | import java.io.FilterInputStream; 22 | import java.io.IOException; 23 | import java.io.InputStream; 24 | import java.util.Random; 25 | 26 | /** Returns a random portion of the requested bytes on each call. */ 27 | class RandomAmountInputStream extends FilterInputStream { 28 | private final Random random; 29 | 30 | public RandomAmountInputStream(InputStream in, Random random) { 31 | super(checkNotNull(in)); 32 | this.random = checkNotNull(random); 33 | } 34 | 35 | @Override public int read(byte[] b, int off, int len) throws IOException { 36 | return super.read(b, off, random.nextInt(len) + 1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/EmptyImmutableListMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Implementation of {@link ImmutableListMultimap} with no entries. 23 | * 24 | * @author Jared Levy 25 | */ 26 | @GwtCompatible(serializable = true) 27 | class EmptyImmutableListMultimap extends ImmutableListMultimap { 28 | static final EmptyImmutableListMultimap INSTANCE = new EmptyImmutableListMultimap(); 29 | 30 | private EmptyImmutableListMultimap() { 31 | super(ImmutableMap.>of(), 0); 32 | } 33 | 34 | private Object readResolve() { 35 | return INSTANCE; // preserve singleton property 36 | } 37 | 38 | private static final long serialVersionUID = 0; 39 | } 40 | -------------------------------------------------------------------------------- /guava/src/com/google/common/collect/EmptyImmutableSetMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.common.annotations.GwtCompatible; 20 | 21 | /** 22 | * Implementation of {@link ImmutableListMultimap} with no entries. 23 | * 24 | * @author Mike Ward 25 | */ 26 | @GwtCompatible(serializable = true) 27 | class EmptyImmutableSetMultimap extends ImmutableSetMultimap { 28 | static final EmptyImmutableSetMultimap INSTANCE = new EmptyImmutableSetMultimap(); 29 | 30 | private EmptyImmutableSetMultimap() { 31 | super(ImmutableMap.>of(), 0, null); 32 | } 33 | 34 | private Object readResolve() { 35 | return INSTANCE; // preserve singleton property 36 | } 37 | 38 | private static final long serialVersionUID = 0; 39 | } 40 | -------------------------------------------------------------------------------- /guava/src/com/google/common/eventbus/AllowConcurrentEvents.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.eventbus; 16 | 17 | import com.google.common.annotations.Beta; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Marks an event subscriber method as being thread-safe. This annotation indicates that EventBus 26 | * may invoke the event subscriber simultaneously from multiple threads. 27 | * 28 | *

This does not mark the method, and so should be used in combination with {@link Subscribe}. 29 | * 30 | * @author Cliff Biffle 31 | * @since 10.0 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.METHOD) 35 | @Beta 36 | public @interface AllowConcurrentEvents {} 37 | -------------------------------------------------------------------------------- /guava/src/com/google/common/util/concurrent/GwtFuturesCatchingSpecialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.google.common.util.concurrent; 16 | 17 | import com.google.common.annotations.GwtCompatible; 18 | 19 | /** 20 | * Hidden superclass of {@link Futures} that provides us a place to declare special GWT versions of 21 | * the {@link Futures#catching(ListenableFuture, Class, com.google.common.base.Function) 22 | * Futures.catching} family of methods. Those versions have slightly different signatures. 23 | */ 24 | @GwtCompatible(emulated = true) 25 | abstract class GwtFuturesCatchingSpecialization { 26 | /* 27 | * This server copy of the class is empty. The corresponding GWT copy contains alternative 28 | * versions of catching() and catchingAsync() with slightly different signatures from the ones 29 | * found in Futures.java. 30 | */ 31 | } 32 | -------------------------------------------------------------------------------- /guava-gwt/src-super/java/util/super/java/util/concurrent/Future.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package java.util.concurrent; 18 | 19 | /** 20 | * Emulation of Future. Since GWT environment is single threaded, attempting to block on the future 21 | * by calling {@link #get()} or {@link #get(long, TimeUnit)} when the it is not yet done is 22 | * considered illegal because it would lead to a deadlock. Future implementations must throw 23 | * {@link IllegalStateException} to avoid a deadlock. 24 | */ 25 | public interface Future { 26 | boolean cancel(boolean mayInterruptIfRunning); 27 | 28 | boolean isCancelled(); 29 | 30 | boolean isDone(); 31 | 32 | V get() throws InterruptedException, ExecutionException; 33 | 34 | V get(long timeout, TimeUnit unit) 35 | throws InterruptedException, ExecutionException, TimeoutException; 36 | } 37 | -------------------------------------------------------------------------------- /guava/src/com/google/common/util/concurrent/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /** 16 | * Concurrency utilities. 17 | * 18 | *

Commonly used types include {@link com.google.common.util.concurrent.ListenableFuture} and 19 | * {@link com.google.common.util.concurrent.Service}. 20 | * 21 | *

Commonly used utilities include {@link com.google.common.util.concurrent.Futures}, 22 | * {@link com.google.common.util.concurrent.MoreExecutors}, and 23 | * {@link com.google.common.util.concurrent.ThreadFactoryBuilder}. 24 | * 25 | *

This package is a part of the open-source Guava 26 | * library. 27 | */ 28 | @CheckReturnValue 29 | @ParametersAreNonnullByDefault 30 | package com.google.common.util.concurrent; 31 | 32 | import javax.annotation.CheckReturnValue; 33 | import javax.annotation.ParametersAreNonnullByDefault; 34 | -------------------------------------------------------------------------------- /guava-testlib/src/com/google/common/collect/testing/testers/MapSerializationTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect.testing.testers; 18 | 19 | import static com.google.common.collect.testing.features.CollectionFeature.SERIALIZABLE; 20 | 21 | import com.google.common.annotations.GwtCompatible; 22 | import com.google.common.collect.testing.AbstractMapTester; 23 | import com.google.common.collect.testing.features.CollectionFeature; 24 | import com.google.common.testing.SerializableTester; 25 | 26 | /** 27 | * Basic serialization test for maps. 28 | * 29 | * @author Louis Wasserman 30 | */ 31 | @GwtCompatible 32 | public class MapSerializationTester extends AbstractMapTester { 33 | @CollectionFeature.Require(SERIALIZABLE) 34 | public void testReserializeMap() { 35 | SerializableTester.reserializeAndAssert(getMap()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guava-gwt/src/com/google/common/collect/UsingToStringOrdering_CustomFieldSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Guava Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.common.collect; 18 | 19 | import com.google.gwt.user.client.rpc.SerializationStreamReader; 20 | import com.google.gwt.user.client.rpc.SerializationStreamWriter; 21 | 22 | /** 23 | * This class implements the GWT serialization of {@link UsingToStringOrdering}. 24 | * 25 | * @author Chris Povirk 26 | */ 27 | public class UsingToStringOrdering_CustomFieldSerializer { 28 | 29 | public static void deserialize( 30 | SerializationStreamReader reader, UsingToStringOrdering instance) {} 31 | 32 | public static UsingToStringOrdering instantiate(SerializationStreamReader reader) { 33 | return UsingToStringOrdering.INSTANCE; 34 | } 35 | 36 | public static void serialize(SerializationStreamWriter writer, UsingToStringOrdering instance) {} 37 | } 38 | --------------------------------------------------------------------------------