This doesn't change the end result of a successful run, though this is what a typical flow looks like prior to this fix:
Consider a sheet with 10 data rows (+ 1 header row = 11). A 10-row data set will call worksheet.setRowCount(10), which truncates the last row of the existing sheet. This row will eventually be added again in the last for loop, but if the synchronizer fails mid-sync, this last row will remain dropped. This fix will prevent this last row from being dropped.
This doesn't fix the broader issue of SheetSynchronizer not behaving transactionally -- that's a different can of worms.
See the linked bug for an instance where the synchronizer failed mid-run and dropped a data row as a result.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136398109
The dark lord Gosling designed the Java package naming system so that
ownership flows from the DNS system. Since we own the domain name
registry.google, it seems only appropriate that we should use
google.registry as our package name.
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00
Renamed from java/com/google/domain/registry/export/sheet/SheetSynchronizer.java (Browse further)