Source:
<code>public API setExtensionsToAPI(String apiDefinition, API api , boolean isBasepathExtractedFromSwagger) throws APIManagementException { Swagger swagger = getSwagger(apiDefinition); Map<String, Object> extensions = swagger.getVendorExtensions(); if (extensions == null) { return api; } String authHeader = OASParserUtil.getAuthorizationHeaderFromSwagger(extensions); if (authHeader != null) { api.setAuthorizationHeader(authHeader); } String mutualSSL = OASParserUtil.getMutualSSLEnabledFromSwagger(extensions); <START> if (mutualSSL != null) { <END> String securityList = api.getApiSecurity(); if ("".equals(securityList)) { securityList = APIConstants.DEFAULT_API_SECURITY_OAUTH2 ; } if (APIConstants.OPTIONAL.equals(mutualSSL)) { securityList = securityList + "," + APIConstants.API_SECURITY_MUTUAL_SSL; } else if (APIConstants.MANDATORY.equals(mutualSSL)) { securityList = securityList + "," + APIConstants.API_SECURITY_MUTUAL_SSL_MANDATORY; } api.setApiSecurity(securityList); } CORSConfiguration corsConfiguration = OASParserUtil.getCorsConfigFromSwagger(extensions); if (corsConfiguration != null) { api.setCorsConfiguration(corsConfiguration); } boolean responseCacheEnable = OASParserUtil.getResponseCacheFromSwagger(extensions); if (responseCacheEnable) { api.setResponseCache(APIConstants.ENABLED); } int cacheTimeOut = OASParserUtil.getCacheTimeOutFromSwagger(extensions); if (cacheTimeOut != 0) { api.setCacheTimeout(cacheTimeOut); } String transports = OASParserUtil.getTransportsFromSwagger(extensions); if (transports != null) { api.setTransports(transports); } String throttleTier = OASParserUtil.getTrottleTierFromSwagger(extensions); if (throttleTier != null) { api.setApiLevelPolicy(throttleTier); } String basePath = OASParserUtil.getBasePathFromSwagger(extensions); if (basePath != null && isBasepathExtractedFromSwagger) { basePath = basePath.replace("{version}",api.getId().getVersion()); api.setContextTemplate(basePath); api.setContext(basePath); } return api; }</code><technical_language>StringUtils.isBlank checks string is empty null both</technical_language>

Target:
public API setExtensionsToAPI(String apiDefinition, API api, boolean isBasepathExtractedFromSwagger) throws APIManagementException { Swagger swagger = getSwagger(apiDefinition); Map<String, Object> extensions = swagger.getVendorExtensions(); if (extensions == null) { return api; } String authHeader = OASParserUtil.getAuthorizationHeaderFromSwagger(extensions); if (authHeader != null) { api.setAuthorizationHeader(authHeader); } String mutualSSL = OASParserUtil.getMutualSSLEnabledFromSwagger(extensions); if (StringUtils.isBlank(mutualSSL)) { String securityList = api.getApiSecurity(); if (StringUtils.isBlank(securityList)) { securityList = APIConstants.DEFAULT_API_SECURITY_OAUTH2; } if (APIConstants.OPTIONAL.equals(mutualSSL)) { securityList = securityList + "," + APIConstants.API_SECURITY_MUTUAL_SSL; } else if (APIConstants.MANDATORY.equals(mutualSSL)) { securityList = securityList + "," + APIConstants.API_SECURITY_MUTUAL_SSL_MANDATORY; } api.setApiSecurity(securityList); } CORSConfiguration corsConfiguration = OASParserUtil.getCorsConfigFromSwagger(extensions); if (corsConfiguration != null) { api.setCorsConfiguration(corsConfiguration); } boolean responseCacheEnable = OASParserUtil.getResponseCacheFromSwagger(extensions); if (responseCacheEnable) { api.setResponseCache(APIConstants.ENABLED); } int cacheTimeOut = OASParserUtil.getCacheTimeOutFromSwagger(extensions); if (cacheTimeOut != 0) { api.setCacheTimeout(cacheTimeOut); } String transports = OASParserUtil.getTransportsFromSwagger(extensions); if (transports != null) { api.setTransports(transports); } String throttleTier = OASParserUtil.getThrottleTierFromSwagger(extensions); if (throttleTier != null) { api.setApiLevelPolicy(throttleTier); } String basePath = OASParserUtil.getBasePathFromSwagger(extensions); if (basePath != null && isBasepathExtractedFromSwagger) { basePath = basePath.replace("{version}", api.getId().getVersion()); api.setContextTemplate(basePath); api.setContext(basePath); } return api; }