Skip to content

Commit

Permalink
Updates for typetools/checker-framework 3.39.0 release (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Oct 21, 2023
2 parents 8be42dd + d217f2e commit 290cfe5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions guava/cfMavenCentral.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<packaging>jar</packaging>

<name>Guava</name>
<url>https://github.com/typetools/guava</url>
<url>https://github.com/eisop/guava</url>
<description>Guava library, with additional type annotations</description>

<groupId>org.checkerframework.annotatedlib</groupId>
Expand All @@ -22,8 +22,8 @@
<version>30.1.1-jre</version>

<scm>
<url>https://github.com/typetools/guava.git</url>
<connection>https://github.com/typetools/guava.git</connection>
<url>https://github.com/eisop/guava.git</url>
<connection>https://github.com/eisop/guava.git</connection>
</scm>

<developers>
Expand Down
11 changes: 6 additions & 5 deletions guava/src/com/google/common/hash/BloomFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public int hashCode(@UnknownSignedness BloomFilter<T> this) {
* @since 23.0
*/
public static <T extends @Nullable Object> Collector<T, ?, BloomFilter<T>> toBloomFilter(
Funnel<? super T> funnel, @Positive long expectedInsertions, @NonNegative double fpp) {
Funnel<? super T> funnel, @Positive long expectedInsertions, double fpp) {
checkNotNull(funnel);
checkArgument(
expectedInsertions >= 0, "Expected insertions (%s) must be >= 0", expectedInsertions);
Expand Down Expand Up @@ -414,13 +414,13 @@ public int hashCode(@UnknownSignedness BloomFilter<T> this) {
* @since 19.0
*/
public static <T extends @Nullable Object> BloomFilter<T> create(
Funnel<? super T> funnel, @Positive long expectedInsertions, @NonNegative double fpp) {
Funnel<? super T> funnel, @Positive long expectedInsertions, double fpp) {
return create(funnel, expectedInsertions, fpp, BloomFilterStrategies.MURMUR128_MITZ_64);
}

@VisibleForTesting
static <T extends @Nullable Object> BloomFilter<T> create(
Funnel<? super T> funnel, @NonNegative long expectedInsertions, @NonNegative double fpp, Strategy strategy) {
Funnel<? super T> funnel, @NonNegative long expectedInsertions, double fpp, Strategy strategy) {
checkNotNull(funnel);
checkArgument(
expectedInsertions >= 0, "Expected insertions (%s) must be >= 0", expectedInsertions);
Expand All @@ -436,7 +436,8 @@ public int hashCode(@UnknownSignedness BloomFilter<T> this) {
* is proportional to -log(p), but there is not much of a point after all, e.g.
* optimalM(1000, 0.0000000000000001) = 76680 which is less than 10kb. Who cares!
*/
long numBits = optimalNumOfBits(expectedInsertions, fpp);
@SuppressWarnings("value:assignment") // This warning might be a true postive.
@IntRange(from=0, to=2147483647) long numBits = optimalNumOfBits(expectedInsertions, fpp);
int numHashFunctions = optimalNumOfHashFunctions(expectedInsertions, numBits);
try {
return new BloomFilter<T>(new LockFreeBitArray(numBits), numHashFunctions, funnel, strategy);
Expand Down Expand Up @@ -533,7 +534,7 @@ public int hashCode(@UnknownSignedness BloomFilter<T> this) {
* @param p false positive rate (must be 0 < p < 1)
*/
@VisibleForTesting
static @Positive long optimalNumOfBits(@Positive long n, @NonNegative double p) {
static @Positive long optimalNumOfBits(@Positive long n, double p) {
if (p == 0) {
p = Double.MIN_VALUE;//(2)
}
Expand Down
7 changes: 4 additions & 3 deletions typecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
set -e

## Build Checker Framework
# If variable is set or directory exists, assume the Checker Framework is built.
# Don't re-build because we might use wrong arguments (e.g., downloadjdk).
if [ -z "${CHECKERFRAMEWORK}" ] && [ ! -d "../checker-framework/" ] ; then
(cd .. && git clone --depth 1 https://github.com/eisop/checker-framework.git)
CHECKERFRAMEWORK=$(cd ../checker-framework/ >/dev/null 2>&1 && pwd -P)
export CHECKERFRAMEWORK
(cd "${CHECKERFRAMEWORK}" && checker/bin-devel/build.sh)
fi

# This also builds annotation-tools.
# Run assembleForJavac because it does not build the javadoc, so it is faster than assemble.
(cd "${CHECKERFRAMEWORK}" && ./gradlew assembleForJavac --console=plain -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 )

# As of 7/27/2019, there are only annotations for:
# * index
# * nullness
Expand Down

0 comments on commit 290cfe5

Please sign in to comment.