mirror of
https://github.com/google/nomulus
synced 2026-01-10 16:00:52 +00:00
Refactor Guava functional methods to use lambdas
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177027488
This commit is contained in:
@@ -71,15 +71,12 @@ public final class SoyTemplateUtils {
|
||||
return memoize(
|
||||
() -> {
|
||||
final ImmutableMap<String, String> renames = getCssRenames(cssMap, cssMapDebug);
|
||||
return new SoyCssRenamingMap() {
|
||||
@Override
|
||||
public String get(String cssClassName) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String part : CSS_CLASS_SPLITTER.split(cssClassName)) {
|
||||
result.add(renames.getOrDefault(part, part));
|
||||
}
|
||||
return CSS_CLASS_JOINER.join(result);
|
||||
return (cssClassName) -> {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String part : CSS_CLASS_SPLITTER.split(cssClassName)) {
|
||||
result.add(renames.getOrDefault(part, part));
|
||||
}
|
||||
return CSS_CLASS_JOINER.join(result);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static com.google.common.collect.Iterables.toArray;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Streams;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.util.FormattingLogger;
|
||||
import google.registry.util.NonFinalForTesting;
|
||||
import google.registry.util.SendEmailService;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.inject.Inject;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.internet.AddressException;
|
||||
@@ -77,7 +77,7 @@ public class SendEmailUtils {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Predicates.notNull())
|
||||
.filter(Objects::nonNull)
|
||||
.collect(toImmutableList());
|
||||
if (emails.isEmpty()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user