mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 14:54:51 +02: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:
parent
2ae496bfce
commit
bbe2584da4
47 changed files with 478 additions and 647 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue