mirror of
https://github.com/google/nomulus
synced 2026-01-10 07:57:58 +00: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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user