Source:
private SingularityExecutorTaskDefinition withDefaults(SingularityExecutorTaskDefinition oldDefinition) { return new SingularityExecutorTaskDefinition( oldDefinition.getTaskId(), new SingularityTaskExecutorData( oldDefinition.getExecutorData(), oldDefinition.getExecutorData().getS3UploaderAdditionalFiles() == null ? cleanupConfiguration.getS3UploaderAdditionalFiles() : oldDefinition.getExecutorData().getS3UploaderAdditionalFiles(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getDefaultS3Bucket()) ? cleanupConfiguration.getDefaultS3Bucket() : oldDefinition.getExecutorData().getDefaultS3Bucket(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getS3UploaderKeyPattern()) ? cleanupConfiguration.getS3KeyFormat(): oldDefinition.getExecutorData().getS3UploaderKeyPattern(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getServiceLog()) ? cleanupConfiguration.getDefaultServiceLog() : oldDefinition.getExecutorData().getServiceLog(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getServiceFinishedTailLog()) ? cleanupConfiguration.getDefaultServiceFinishedTailLog() : oldDefinition.getExecutorData().getServiceFinishedTailLog(), oldDefinition.getExecutorData().getRequestGroup(), oldDefinition.getExecutorData().getS3StorageClass(), oldDefinition.getExecutorData().getApplyS3StorageClassAfterBytes(), oldDefinition.getExecutorData().getCpuHardLimit(), oldDefinition.getExecutorData().getHealthCheckResultFilePath().isPresent() ? oldDefinition.getExecutorData().getHealthCheckResultFilePath() : cleanupConfiguration.getHealthCheckResultFilePath(), oldDefinition.getExecutorData().getHealthCheckOptions().isPresent() ? oldDefinition.getExecutorData().getHealthCheckOptions() : cleanupConfiguration.getHealthCheckOptions() ), oldDefinition.getTaskDirectory(), oldDefinition.getExecutorPid(), Strings.isNullOrEmpty(oldDefinition.getServiceLogFileName()) ? cleanupConfiguration.getDefaultServiceLog() :oldDefinition.getServiceLogFileName(), oldDefinition.getServiceLogOutExtension(), Strings.isNullOrEmpty(oldDefinition.getServiceFinishedTailLogFileName()) ? cleanupConfiguration.getDefaultServiceFinishedTailLog() : oldDefinition.getServiceFinishedTailLogFileName(), oldDefinition.getTaskAppDirectory(), oldDefinition.getExecutorBashOut(), oldDefinition.getLogrotateStateFile(), oldDefinition.getSignatureVerifyOut() ); }

Target:
private SingularityExecutorTaskDefinition withDefaults(SingularityExecutorTaskDefinition oldDefinition) { return new SingularityExecutorTaskDefinition( oldDefinition.getTaskId(), new SingularityTaskExecutorData( oldDefinition.getExecutorData(), oldDefinition.getExecutorData().getS3UploaderAdditionalFiles() == null ? cleanupConfiguration.getS3UploaderAdditionalFiles() : oldDefinition.getExecutorData().getS3UploaderAdditionalFiles(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getDefaultS3Bucket()) ? cleanupConfiguration.getDefaultS3Bucket() : oldDefinition.getExecutorData().getDefaultS3Bucket(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getS3UploaderKeyPattern()) ? cleanupConfiguration.getS3KeyFormat(): oldDefinition.getExecutorData().getS3UploaderKeyPattern(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getServiceLog()) ? cleanupConfiguration.getDefaultServiceLog() : oldDefinition.getExecutorData().getServiceLog(), Strings.isNullOrEmpty(oldDefinition.getExecutorData().getServiceFinishedTailLog()) ? cleanupConfiguration.getDefaultServiceFinishedTailLog() : oldDefinition.getExecutorData().getServiceFinishedTailLog(), oldDefinition.getExecutorData().getRequestGroup(), oldDefinition.getExecutorData().getS3StorageClass(), oldDefinition.getExecutorData().getApplyS3StorageClassAfterBytes(), oldDefinition.getExecutorData().getCpuHardLimit(), Optional.absent() ), oldDefinition.getTaskDirectory(), oldDefinition.getExecutorPid(), Strings.isNullOrEmpty(oldDefinition.getServiceLogFileName()) ? cleanupConfiguration.getDefaultServiceLog() :oldDefinition.getServiceLogFileName(), oldDefinition.getServiceLogOutExtension(), Strings.isNullOrEmpty(oldDefinition.getServiceFinishedTailLogFileName()) ? cleanupConfiguration.getDefaultServiceFinishedTailLog() : oldDefinition.getServiceFinishedTailLogFileName(), oldDefinition.getTaskAppDirectory(), oldDefinition.getExecutorBashOut(), oldDefinition.getLogrotateStateFile(), oldDefinition.getSignatureVerifyOut() ); }