Source:
<code>public String submit(BulkCommand command) { log.debug("Run action with command={}", command); BulkAdminService adminService = Framework.getService(BulkAdminService.class); if (!adminService.getActions().contains(command.getAction())) { throw new IllegalArgumentException("Unknown action for command: " + command); } BulkActionValidation actionValidation = adminService.getActionValidation(command.getAction()); if (actionValidation != null) { actionValidation.validate(command); } RepositoryManager repoManager = Framework.getService(RepositoryManager.class); if (repoManager != null) { <START> if (isBlank(command.getRepository())) { command.setRepository(repoManager.getDefaultRepositoryName()); } else { if (repoManager.getRepository(command.getRepository()) == null) { throw new IllegalArgumentException("Unknown repository: " + command); <END> } } } if (command.getBucketSize() == 0 || command.getBatchSize() == 0) { if (command.getBucketSize() == 0) { command.setBucketSize(adminService.getBucketSize(command.getAction())); } if (command.getBatchSize() == 0) { command.setBatchSize(adminService.getBatchSize(command.getAction())); } } if (command.getScroller() == null) { String actionScroller = adminService.getDefaultScroller(command.getAction()); if (!isBlank(actionScroller)) { command.setScroller(actionScroller); } } checkIfScrollerExists(command); BulkStatus status = new BulkStatus(command.getId()); status.setState(SCHEDULED); status.setAction(command.getAction()); status.setUsername(command.getUsername()); status.setSubmitTime(Instant.now()); setStatus(status); byte[] commandAsBytes = setCommand(command); String shardKey; if (adminService.isSequentialCommands(command.getAction())) { shardKey = command.getAction(); } else { shardKey = command.getId(); } log.debug("Submit action with command: {}", command); return submit(shardKey, command.getId(), commandAsBytes); }</code><technical_language>put command.getRepository() in a local variable, a else if for part ? isBlank isEmpty wrong for check, == null instead</technical_language>

Target:
public String submit(BulkCommand command) { log.debug("Run action with command={}", command); BulkAdminService adminService = Framework.getService(BulkAdminService.class); if (!adminService.getActions().contains(command.getAction())) { throw new IllegalArgumentException("Unknown action for command: " + command); } BulkActionValidation actionValidation = adminService.getActionValidation(command.getAction()); if (actionValidation != null) { actionValidation.validate(command); } RepositoryManager repoManager = Framework.getService(RepositoryManager.class); if (repoManager != null) { if (isEmpty(command.getRepository())) { command.setRepository(repoManager.getDefaultRepositoryName()); } else if (repoManager.getRepository(command.getRepository()) == null) { throw new IllegalArgumentException("Unknown repository: " + command); } } if (command.getBucketSize() == 0 || command.getBatchSize() == 0) { if (command.getBucketSize() == 0) { command.setBucketSize(adminService.getBucketSize(command.getAction())); } if (command.getBatchSize() == 0) { command.setBatchSize(adminService.getBatchSize(command.getAction())); } } if (command.getScroller() == null) { String actionScroller = adminService.getDefaultScroller(command.getAction()); if (!isBlank(actionScroller)) { command.setScroller(actionScroller); } } checkIfScrollerExists(command); BulkStatus status = new BulkStatus(command.getId()); status.setState(SCHEDULED); status.setAction(command.getAction()); status.setUsername(command.getUsername()); status.setSubmitTime(Instant.now()); setStatus(status); byte[] commandAsBytes = setCommand(command); String shardKey; if (adminService.isSequentialCommands(command.getAction())) { shardKey = command.getAction(); } else { shardKey = command.getId(); } log.debug("Submit action with command: {}", command); return submit(shardKey, command.getId(), commandAsBytes); }