Source:
<code>private static ImportConfiguration checkImportProcessorConfiguration(ImportConfigurationType importConfiguration) { String importBundleUrl = importConfiguration.getModule(); if (!importConfiguration.isEnabled()) { return null; } switch(importConfiguration.getType()) { case CUSTOM: break; case KAFKA: importBundleUrl = "kafkastream.jar"; break; default: throw new DeploymentCheckException("Import Configuration type must be specified."); } Properties moduleProp = new Properties(); Properties formatterProp = new Properties(); String formatBundle = importConfiguration.getFormat(); if (formatBundle != null && formatBundle.trim().length() > 0) { <START> if (formatBundle.equalsIgnoreCase("csv") || formatBundle.equalsIgnoreCase("tsv")) { <END> formatterProp.setProperty(ImportDataProcessor.IMPORT_FORMAT_TYPE, formatBundle); formatBundle = "volt-formatter.jar"; } else if (formatBundle.matches("*.jar/*")) { String[] formatSplit = formatBundle.split("/"); if (formatSplit.length != 2) throw new DeploymentCheckException("Import format " + formatBundle + " not valid."); formatterProp.setProperty(ImportDataProcessor.IMPORT_FORMAT_TYPE, formatSplit[1]); formatBundle = formatSplit[0]; } else { throw new DeploymentCheckException("Import format " + formatBundle + " not valid."); } formatterProp.setProperty(ImportDataProcessor.IMPORT_FORMATTER, buildBundleURL(formatBundle)); } if (importBundleUrl != null && importBundleUrl.trim().length() > 0) { moduleProp.setProperty(ImportDataProcessor.IMPORT_MODULE, buildBundleURL(importBundleUrl)); } List<PropertyType> importProperties = importConfiguration.getProperty(); if (importProperties != null && ! importProperties.isEmpty()) { for( PropertyType prop: importProperties) { String key = prop.getName(); String value = prop.getValue(); if (!key.toLowerCase().contains("passw")) { moduleProp.setProperty(key, value.trim()); } else { moduleProp.setProperty(key, value); } } } List<PropertyType> formatProperties = importConfiguration.getFormatProperty(); if (formatProperties != null && ! formatProperties.isEmpty()) { for( PropertyType prop: formatProperties) { String key = prop.getName(); String value = prop.getValue(); formatterProp.setProperty(key, value); } } return new ImportConfiguration(moduleProp, formatterProp); }</code><technical_language>Define constants</technical_language>

Target:
private static ImportConfiguration checkImportProcessorConfiguration(ImportConfigurationType importConfiguration) { String importBundleUrl = importConfiguration.getModule(); if (!importConfiguration.isEnabled()) { return null; } switch(importConfiguration.getType()) { case CUSTOM: break; case KAFKA: importBundleUrl = "kafkastream.jar"; break; default: throw new DeploymentCheckException("Import Configuration type must be specified."); } Properties moduleProps = new Properties(); Properties formatterProps = new Properties(); String formatBundle = importConfiguration.getFormat(); String formatName = null; if (formatBundle != null && formatBundle.trim().length() > 0) { if ("csv".equalsIgnoreCase(formatBundle) || "tsv".equalsIgnoreCase(formatBundle)) { formatName = formatBundle; formatBundle = "voltcsvformatter.jar"; } else if (JAR_EXTENSION_RE.matcher(formatBundle).matches()) { int typeIndex = formatBundle.lastIndexOf("/"); formatName = formatBundle.substring(typeIndex + 1); formatBundle = formatBundle.substring(0, typeIndex); } else { throw new DeploymentCheckException("Import format " + formatBundle + " not valid."); } formatterProps.setProperty(ImportDataProcessor.IMPORT_FORMATTER, buildBundleURL(formatBundle, true)); } if (importBundleUrl != null && importBundleUrl.trim().length() > 0) { moduleProps.setProperty(ImportDataProcessor.IMPORT_MODULE, buildBundleURL(importBundleUrl, false)); } List<PropertyType> importProperties = importConfiguration.getProperty(); if (importProperties != null && ! importProperties.isEmpty()) { for( PropertyType prop: importProperties) { String key = prop.getName(); String value = prop.getValue(); if (!key.toLowerCase().contains("passw")) { moduleProps.setProperty(key, value.trim()); } else { moduleProps.setProperty(key, value); } } } List<PropertyType> formatProperties = importConfiguration.getFormatProperty(); if (formatProperties != null && ! formatProperties.isEmpty()) { for( PropertyType prop: formatProperties) { formatterProps.setProperty(prop.getName(), prop.getValue()); } } return new ImportConfiguration(formatName, moduleProps, formatterProps); }