Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions guava/src/com/google/common/hash/ChecksumHashFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Throwables.throwIfUnchecked;

import com.google.errorprone.annotations.Immutable;
import com.google.j2objc.annotations.J2ObjCIncompatible;
import java.io.Serializable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.UndeclaredThrowableException;
import java.nio.ByteBuffer;
import java.util.zip.Checksum;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand Down Expand Up @@ -114,10 +116,10 @@ static boolean updateByteBuffer(Checksum cs, ByteBuffer bb) {
if (UPDATE_BB != null) {
try {
UPDATE_BB.invokeExact(cs, bb);
} catch (Error t) {
throw t;
} catch (Throwable t) {
throw new AssertionError(t);
} catch (Throwable e) {
throwIfUnchecked(e);
// This should be impossible, since `update` has no `throws` clause.
throw new UndeclaredThrowableException(e);
}
return true;
} else {
Expand Down
5 changes: 3 additions & 2 deletions guava/src/com/google/common/hash/Hashing.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.j2objc.annotations.J2ObjCIncompatible;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.UndeclaredThrowableException;
import java.security.Key;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -520,8 +521,8 @@ static Checksum newCrc32c() {
return (Checksum) CONSTRUCTOR.invokeExact();
} catch (Throwable e) {
throwIfUnchecked(e);
// That constructor has no `throws` clause.
throw newLinkageError(e);
// This should be impossible, since the constructor has no `throws` clause.
throw new UndeclaredThrowableException(e);
}
}

Expand Down
Loading