mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 03:09:33 +02:00
Replace FluentIterable with streams
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=180005797
This commit is contained in:
parent
552ab12314
commit
3f7cd00882
13 changed files with 121 additions and 104 deletions
|
@ -14,11 +14,10 @@
|
|||
|
||||
package google.registry.model.ofy;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Objectify;
|
||||
import google.registry.model.BackupGroupRoot;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -43,19 +42,19 @@ class TimestampInversionException extends RuntimeException {
|
|||
|
||||
private TimestampInversionException(DateTime transactionTime, String problem) {
|
||||
super(
|
||||
Joiner.on('\n')
|
||||
.join(
|
||||
String.format(
|
||||
"Timestamp inversion between transaction time (%s) and %s",
|
||||
transactionTime, problem),
|
||||
getFileAndLine(
|
||||
FluentIterable.from(new Exception().getStackTrace())
|
||||
.firstMatch(
|
||||
(StackTraceElement element) ->
|
||||
!element
|
||||
.getClassName()
|
||||
.startsWith(Objectify.class.getPackage().getName())
|
||||
&& !element.getClassName().startsWith(Ofy.class.getName()))
|
||||
.get())));
|
||||
String.format(
|
||||
"Timestamp inversion between transaction time (%s) and %s\n%s",
|
||||
transactionTime,
|
||||
problem,
|
||||
getFileAndLine(
|
||||
Arrays.stream(new Exception().getStackTrace())
|
||||
.filter(
|
||||
element ->
|
||||
!element
|
||||
.getClassName()
|
||||
.startsWith(Objectify.class.getPackage().getName())
|
||||
&& !element.getClassName().startsWith(Ofy.class.getName()))
|
||||
.findFirst()
|
||||
.get())));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue