Source:
<code>public WorkflowVersion createVersionForWorkflow(String repository, String gitReference, Workflow workflow, SourceFile dockstoreYml) throws IOException { GHRepository ghRepository = getRepository(repository); Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; <START> LOG.info(msg); <END> throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchType = matcher.group(1); String gitBranchName = matcher.group(2); GHRef ghRef = ghRepository.getRef(gitBranchType + "/" + gitBranchName); Triple<String, Date, String> ref = getRef(ghRef, ghRepository); if (ref == null) { String msg = "Cannot retrieve the workflow reference from GitHub, ensure that " + gitReference + " is a valid branch/tag."; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } Optional<WorkflowVersion> existingVersion = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), gitBranchName)).findFirst(); if (existingVersion.isPresent()) { workflow.removeWorkflowVersion(existingVersion.get()); } Map<String, WorkflowVersion> existingDefaults = new HashMap<>(); existingVersion.ifPresent(workflowVersion -> existingDefaults.put(gitReference, workflowVersion)); return setupWorkflowVersionsHelper(ghRepository.getFullName(), workflow, ref, Optional.of(workflow), existingDefaults, ghRepository, dockstoreYml); }</code><technical_language>Suggest LOG.error</technical_language>

Target:
public WorkflowVersion createVersionForWorkflow(String repository, String gitReference, Workflow workflow, SourceFile dockstoreYml) throws IOException { GHRepository ghRepository = getRepository(repository); Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchType = matcher.group(1); String gitBranchName = matcher.group(2); GHRef ghRef = ghRepository.getRef(gitBranchType + "/" + gitBranchName); Triple<String, Date, String> ref = getRef(ghRef, ghRepository); if (ref == null) { String msg = "Cannot retrieve the workflow reference from GitHub, ensure that " + gitReference + " is a valid branch/tag."; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } Optional<WorkflowVersion> existingVersion = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), gitBranchName)).findFirst(); if (existingVersion.isPresent()) { workflow.removeWorkflowVersion(existingVersion.get()); } Map<String, WorkflowVersion> existingDefaults = new HashMap<>(); existingVersion.ifPresent(workflowVersion -> existingDefaults.put(gitReference, workflowVersion)); return setupWorkflowVersionsHelper(ghRepository.getFullName(), workflow, ref, Optional.of(workflow), existingDefaults, ghRepository, dockstoreYml); }