mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Bring open source build closer to passing
This commit is contained in:
parent
1e0f064da6
commit
1a0c282cf8
3 changed files with 21 additions and 3 deletions
9
java/com/google/api/client/util/BUILD
Normal file
9
java/com/google/api/client/util/BUILD
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
java_library(
|
||||||
|
name = "util",
|
||||||
|
exports = [
|
||||||
|
"@google_api_client//jar",
|
||||||
|
"@google_http_client//jar",
|
||||||
|
],
|
||||||
|
)
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
package google.registry.model;
|
package google.registry.model;
|
||||||
|
|
||||||
|
import static com.google.common.base.Predicates.assignableFrom;
|
||||||
import static com.google.common.base.Predicates.or;
|
import static com.google.common.base.Predicates.or;
|
||||||
import static com.google.common.base.Predicates.subtypeOf;
|
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
@ -62,7 +62,7 @@ public final class SchemaVersion {
|
||||||
*/
|
*/
|
||||||
public static String getSchema() {
|
public static String getSchema() {
|
||||||
return FluentIterable.from(getAllPersistedTypes())
|
return FluentIterable.from(getAllPersistedTypes())
|
||||||
.filter(or(subtypeOf(Enum.class), subtypeOf(ImmutableObject.class)))
|
.filter(or(assignableFrom(Enum.class), assignableFrom(ImmutableObject.class)))
|
||||||
.transform(new Function<Class<?>, String>() {
|
.transform(new Function<Class<?>, String>() {
|
||||||
@Override
|
@Override
|
||||||
public String apply(Class<?> clazz) {
|
public String apply(Class<?> clazz) {
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
package google.registry.util;
|
package google.registry.util;
|
||||||
|
|
||||||
import static com.google.appengine.api.search.checkers.Preconditions.checkArgument;
|
import static com.google.appengine.api.search.checkers.Preconditions.checkArgument;
|
||||||
import static com.google.common.base.Throwables.throwIfUnchecked;
|
|
||||||
import static com.google.common.collect.Iterables.any;
|
import static com.google.common.collect.Iterables.any;
|
||||||
import static com.google.common.math.IntMath.pow;
|
import static com.google.common.math.IntMath.pow;
|
||||||
import static google.registry.util.PredicateUtils.supertypeOf;
|
import static google.registry.util.PredicateUtils.supertypeOf;
|
||||||
|
@ -108,4 +107,14 @@ public class Retrier implements Serializable {
|
||||||
return any(retryables, supertypeOf(e.getClass()));
|
return any(retryables, supertypeOf(e.getClass()));
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(user): Replace with Throwables.throwIfUnchecked
|
||||||
|
private static void throwIfUnchecked(Throwable throwable) {
|
||||||
|
if (throwable instanceof RuntimeException) {
|
||||||
|
throw (RuntimeException) throwable;
|
||||||
|
}
|
||||||
|
if (throwable instanceof Error) {
|
||||||
|
throw (Error) throwable;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue