mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Resolve some Guava 20 TODOs (mostly unnecessary asList() calls)
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146799536
This commit is contained in:
parent
f212a53232
commit
ec55aa5361
12 changed files with 18 additions and 41 deletions
|
@ -21,7 +21,6 @@ import static com.google.common.collect.Iterables.all;
|
|||
import static com.google.common.collect.Lists.newArrayList;
|
||||
import static com.google.common.collect.Maps.transformValues;
|
||||
import static com.google.common.collect.Sets.newLinkedHashSet;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Function;
|
||||
|
@ -93,7 +92,7 @@ public class ModelUtils {
|
|||
Iterable<?> body;
|
||||
if (clazz.isEnum()) {
|
||||
stringBuilder.append("enum ");
|
||||
body = FluentIterable.from(asList(clazz.getEnumConstants()));
|
||||
body = FluentIterable.from(clazz.getEnumConstants());
|
||||
} else {
|
||||
stringBuilder.append("class ");
|
||||
body = FluentIterable.from(getAllFields(clazz).values())
|
||||
|
|
|
@ -16,7 +16,6 @@ package google.registry.model.ofy;
|
|||
|
||||
import static com.googlecode.objectify.ObjectifyService.ofy;
|
||||
import static google.registry.util.ObjectifyUtils.OBJECTS_TO_KEYS;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import com.google.common.base.Functions;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
|
@ -45,7 +44,7 @@ abstract class AugmentedDeleter implements Deleter {
|
|||
|
||||
@Override
|
||||
public Result<Void> entities(Object... entities) {
|
||||
handleDeletion(FluentIterable.from(asList(entities)).transform(OBJECTS_TO_KEYS));
|
||||
handleDeletion(FluentIterable.from(entities).transform(OBJECTS_TO_KEYS));
|
||||
return delegate.entities(entities);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
package google.registry.model.ofy;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
|
@ -50,7 +48,7 @@ class TimestampInversionException extends RuntimeException {
|
|||
"Timestamp inversion between transaction time (%s) and %s",
|
||||
transactionTime,
|
||||
problem),
|
||||
getFileAndLine(FluentIterable.from(asList(new Exception().getStackTrace()))
|
||||
getFileAndLine(FluentIterable.from(new Exception().getStackTrace())
|
||||
.firstMatch(new Predicate<StackTraceElement>() {
|
||||
@Override
|
||||
public boolean apply(StackTraceElement element) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue