mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02:00
Fix a few Java 9+isms and ignore IML files (#973)
This allows us to run tests in IDEA which is significantly quicker. We shouldn't be using anything past Java 8 anyway since that's what GAE runs with.
This commit is contained in:
parent
61599b0d45
commit
d79a8b1513
4 changed files with 10 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -75,7 +75,7 @@ local.properties
|
||||||
autogenerated/
|
autogenerated/
|
||||||
|
|
||||||
# IDEA
|
# IDEA
|
||||||
nomulus.iml
|
**/*.iml
|
||||||
nomulus.ipr
|
nomulus.ipr
|
||||||
nomulus.iws
|
nomulus.iws
|
||||||
|
|
||||||
|
|
|
@ -140,11 +140,13 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
||||||
transaction.stream()
|
transaction.stream()
|
||||||
.sorted(ReplayCommitLogsToSqlAction::compareByWeight)
|
.sorted(ReplayCommitLogsToSqlAction::compareByWeight)
|
||||||
.forEach(
|
.forEach(
|
||||||
versionedEntity ->
|
versionedEntity -> {
|
||||||
versionedEntity
|
if (versionedEntity.getEntity().isPresent()) {
|
||||||
.getEntity()
|
handleEntityPut(versionedEntity.getEntity().get());
|
||||||
.ifPresentOrElse(
|
} else {
|
||||||
this::handleEntityPut, () -> handleEntityDelete(versionedEntity)));
|
handleEntityDelete(versionedEntity);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleEntityPut(Entity entity) {
|
private void handleEntityPut(Entity entity) {
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class BackfillRegistryLocksCommand extends ConfirmingCommand
|
||||||
return domains.stream()
|
return domains.stream()
|
||||||
.filter(d -> d.getDeletionTime().isAfter(now))
|
.filter(d -> d.getDeletionTime().isAfter(now))
|
||||||
.filter(d -> d.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES))
|
.filter(d -> d.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES))
|
||||||
.filter(d -> RegistryLockDao.getMostRecentByRepoId(d.getRepoId()).isEmpty())
|
.filter(d -> !RegistryLockDao.getMostRecentByRepoId(d.getRepoId()).isPresent())
|
||||||
.collect(toImmutableList());
|
.collect(toImmutableList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Collector;
|
import java.util.stream.Collector;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
@ -244,7 +243,7 @@ public final class ImmutableObjectSubject extends Subject {
|
||||||
|
|
||||||
// We just need to check if there were any objects in "actual" that were not in "expected"
|
// We just need to check if there were any objects in "actual" that were not in "expected"
|
||||||
// (where "found" is a proxy for "expected").
|
// (where "found" is a proxy for "expected").
|
||||||
} else if (actual.stream().anyMatch(Predicate.not(found::contains))) {
|
} else if (!found.containsAll(actual)) {
|
||||||
return ComparisonResult.createFailure();
|
return ComparisonResult.createFailure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue