Source:
<code>public Metacard toQueryTemplateMetacard(Map<String, Object> formTemplate) { try { Map<String, Object> filterJson = (Map) formTemplate.get("filterTemplate"); if (filterJson == null) { return null; } String title = (String) formTemplate.get("title"); <START> if (title == null || title.trim().isEmpty()) { <END> throw new IllegalArgumentException("Search forms must have a non-empty title"); } String description = (String) formTemplate.get("description"); String id = (String) formTemplate.get("id"); TransformVisitor<JAXBElement> visitor = new TransformVisitor<>(new XmlModelBuilder()); VisitableJsonElementImpl.create(new FilterNodeMapImpl(filterJson)).accept(visitor); JAXBElement filter = visitor.getResult(); if (!filter.getDeclaredType().equals(FilterType.class)) { LOGGER.error( "Error occurred during filter processing, root type should be a but was {}", FilterType.class.getName(), filter.getDeclaredType().getName()); return null; } QueryTemplateMetacard metacard = (id == null) ? new QueryTemplateMetacard(title, description) : new QueryTemplateMetacard(title, description, id); String filterXml = writer.marshal(filter); metacard.setFormsFilter(filterXml); Map<String, Object> querySettings = (Map<String, Object>) formTemplate.get("querySettings"); if (querySettings != null) { metacard.setQuerySettings(querySettings); } return metacard; } catch (JAXBException e) { LOGGER.error("XML generation failed for query template metacard's filter", e); } catch (FilterProcessingException e) { LOGGER.error("Could not use filter JSON for template - {}", e.getMessage()); } return null; }</code><technical_language>if (StringUtils.isBlank(title))</technical_language>

Target:
public Metacard toQueryTemplateMetacard(Map<String, Object> formTemplate) { try { Map<String, Object> filterJson = (Map) formTemplate.get("filterTemplate"); if (filterJson == null) { return null; } String title = (String) formTemplate.get("title"); if (StringUtils.isBlank(title)) { throw new IllegalArgumentException("Search form title cannot be blank"); } String description = (String) formTemplate.get("description"); String id = (String) formTemplate.get("id"); TransformVisitor<JAXBElement> visitor = new TransformVisitor<>(new XmlModelBuilder()); VisitableJsonElementImpl.create(new FilterNodeMapImpl(filterJson)).accept(visitor); JAXBElement filter = visitor.getResult(); if (!filter.getDeclaredType().equals(FilterType.class)) { LOGGER.error( "Error occurred during filter processing, root type should be a but was {}", FilterType.class.getName(), filter.getDeclaredType().getName()); return null; } QueryTemplateMetacard metacard = (id == null) ? new QueryTemplateMetacard(title, description) : new QueryTemplateMetacard(title, description, id); String filterXml = writer.marshal(filter); metacard.setFormsFilter(filterXml); Map<String, Object> querySettings = (Map<String, Object>) formTemplate.get("querySettings"); if (querySettings != null) { metacard.setQuerySettings(querySettings); } return metacard; } catch (JAXBException e) { LOGGER.error("XML generation failed for query template metacard's filter", e); } catch (FilterProcessingException e) { LOGGER.error("Could not use filter JSON for template - {}", e.getMessage()); } return null; }