google-nomulus/java/google/registry/rde
mcilwain 4491b7b909 Make loadByForeignKey() and related methods return Optional
This is safer and addresses a common source of confusion in the codebase because it's always explicit that the resource returned may not be present, whether because it's soft-deleted when projected to the given time or because it never existed in the first place.

In production code, the presence of the returned value is always checked. In test code, its presence is assumed using .get() where that is expected and convenient, as it not being present will throw an NPE that will cause the test to fail anyway.

Note that the roughly equivalent reloadResourceByForeignKey(), which is widely used in test code, is not having this same treatment applied to it. That is out of the scope of this CL, and has much smaller returns anyway because it's only used in tests (where the unexpected absence of a given resource would just cause the test to fail).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=225424002
2018-12-14 11:24:49 -05:00
..
imports Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
BrdaCopyAction.java Simplify the RyDE API 2018-07-17 22:03:53 -04:00
BUILD Improve internal build system speed 2018-06-27 15:28:52 -04:00
ContactResourceToXjcConverter.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
DepositFragment.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
DomainResourceToXjcConverter.java Migrate to Flogger (green) 2018-05-30 12:18:54 -04:00
EscrowTaskRunner.java Don't retry RDE upload tasks that have failed dependencies 2018-06-27 15:28:52 -04:00
Ghostryde.java Move the RDE PGP file encoding to a dedicated file 2018-08-10 13:44:25 -04:00
HostResourceToXjcConverter.java Remove the ofy().load() inside of HostResource.cloneProjectedAtTime 2017-03-13 11:22:55 -04:00
JSchModule.java Remove JSch threading hack 2018-01-19 14:48:15 -05:00
JSchSftpChannel.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
JSchSshSession.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
LoggingSftpProgressMonitor.java Periodically log transfer progress for RDE SFTP uploads 2018-06-27 15:28:52 -04:00
package-info.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
PendingDeposit.java Format some imports using fix_imports.py 2017-10-24 16:53:47 -04:00
PendingDepositChecker.java Refactor Guava functional methods to use lambdas 2017-12-01 22:14:05 -05:00
PgpUtils.java Move PGP object factory code into a dedicated Utils class 2018-08-10 13:44:25 -04:00
RdeAdapter.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
RdeCounter.java Use Java 8 streams in RdeCounter 2017-12-01 22:14:06 -05:00
RdeMarshaller.java Migrate to Flogger (green) 2018-05-30 12:18:54 -04:00
RdeModule.java Remove transition code for set of parameter refactoring 2018-07-14 01:37:03 -04:00
RdeReportAction.java Simplify the Ghostryde API 2018-06-27 15:28:53 -04:00
RdeReporter.java Migrate to Flogger (green) 2018-05-30 12:18:54 -04:00
RdeResourceType.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00
RdeStagingAction.java Consolidate all Set parameter parsing 2018-06-06 15:04:02 -04:00
RdeStagingMapper.java Add counters to the RdeStaging mapreduce 2018-04-10 16:09:46 -04:00
RdeStagingReducer.java Move the RDE encryption to a dedicated file 2018-08-10 13:44:25 -04:00
RdeUploadAction.java Simplify the RyDE API 2018-07-17 22:03:53 -04:00
RdeUploadUrl.java Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
RdeUtil.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00
RegistrarToXjcConverter.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
RydeCompression.java Move the RDE compression to a dedicated file 2018-08-10 13:44:25 -04:00
RydeEncoder.java Move the RDE TAR file encoding to a dedicated file 2018-08-10 13:46:48 -04:00
RydeEncryption.java Move the RDE encryption to a dedicated file 2018-08-10 13:44:25 -04:00
RydeFileEncoding.java Move the RDE PGP file encoding to a dedicated file 2018-08-10 13:44:25 -04:00
RydePgpSigningOutputStream.java Simplify the RyDE API 2018-07-17 22:03:53 -04:00
RydeTar.java Move the RDE TAR file encoding to a dedicated file 2018-08-10 13:46:48 -04:00