Source:
<code>private void updateVersionMetadata(String filePath, Version version, DescriptorLanguage type, String repositoryId) { Set<SourceFile> sourceFiles = version.getSourceFiles(); String branch = version.getName(); if (Strings.isNullOrEmpty(filePath)) { String message = String.format("%s : No descriptor found for %s.", repositoryId, branch); LOG.info(message); } if (sourceFiles == null || sourceFiles.isEmpty()) { String message = String.format("%s : Error getting descriptor for %s with path %s", repositoryId, branch, filePath); LOG.info(message); if (version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); <START> if (readmeContent != null && !readmeContent.isBlank()) { <END> version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } return; } String fileContent; Optional<SourceFile> first = sourceFiles.stream().filter(file -> file.getPath().equals(filePath)).findFirst(); if (first.isPresent()) { fileContent = first.get().getContent(); LanguageHandlerInterface anInterface = LanguageHandlerFactory.getInterface(type); try { anInterface.parseWorkflowContent(filePath, fileContent, sourceFiles, version); } catch (StackOverflowError e) { LOG.error("Problems parsing workflow"); } if ((version.getDescription() == null || version.getDescription().isEmpty()) && version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (readmeContent != null && !readmeContent.isBlank()) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } } }</code><technical_language>optionally StringUtils.isNotBlank() instead, handle null check</technical_language>

Target:
private void updateVersionMetadata(String filePath, Version version, DescriptorLanguage type, String repositoryId) { Set<SourceFile> sourceFiles = version.getSourceFiles(); String branch = version.getName(); if (Strings.isNullOrEmpty(filePath)) { String message = String.format("%s : No descriptor found for %s.", repositoryId, branch); LOG.info(message); } if (sourceFiles == null || sourceFiles.isEmpty()) { String message = String.format("%s : Error getting descriptor for %s with path %s", repositoryId, branch, filePath); LOG.info(message); if (version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (StringUtils.isNotBlank(readmeContent)) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } return; } String fileContent; Optional<SourceFile> first = sourceFiles.stream().filter(file -> file.getPath().equals(filePath)).findFirst(); if (first.isPresent()) { fileContent = first.get().getContent(); LanguageHandlerInterface anInterface = LanguageHandlerFactory.getInterface(type); try { anInterface.parseWorkflowContent(filePath, fileContent, sourceFiles, version); } catch (StackOverflowError e) { LOG.error("Problems parsing workflow"); } if ((version.getDescription() == null || version.getDescription().isEmpty()) && version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (StringUtils.isNotBlank(readmeContent)) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } } }