mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Add transactional import helper in RdeImportUtilsTest
This is needed to fix an inability in Java 8 to correctly infer the type when the transaction was being allowed to return the value it loaded. The error was: INFO: Compilation unit has error diagnostics: [third_party/java_src/gtld/javatests/google/registry/rde/imports/RdeImportUtilsTest.java:109: error: incompatible types: inference variable R has incompatible bounds ofy().transact(() -> rdeImportUtils.importEppResource(newContact)); ^ upper bounds: java.lang.Object lower bounds: void, third_party/java_src/gtld/javatests/google/registry/rde/imports/RdeImportUtilsTest.java:132: error: incompatible types: inference variable R has incompatible bounds ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179082154
This commit is contained in:
parent
9157930983
commit
c8059d4d8a
2 changed files with 22 additions and 11 deletions
|
@ -110,8 +110,8 @@ public class RdeImportUtils {
|
|||
* <p>If the resource is imported, {@link ForeignKeyIndex} and {@link EppResourceIndex} are also
|
||||
* created.
|
||||
*/
|
||||
public <T extends EppResource & ForeignKeyedEppResource> void
|
||||
importEppResource(final T resource) {
|
||||
public <T extends EppResource & ForeignKeyedEppResource> void importEppResource(
|
||||
final T resource) {
|
||||
Object existing = ofy.load().key(Key.create(resource)).now();
|
||||
if (existing != null) {
|
||||
// This will roll back the transaction and prevent duplicate history entries from being saved.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue