Source:
<code>public Producer createProducer() throws Exception { final CamelContext camelContext = getCamelContext(); SSLContextParameters sslContextParameters = getSslContextParameters(); <START> if (sslContextParameters == null) { <END> sslContextParameters = component().getSslContextParameters(); } if (sslContextParameters == null) { sslContextParameters = camelContext.getSSLContextParameters(); } if (sslContextParameters == null) { sslContextParameters = component().retrieveGlobalSslContextParameters(); } final Swagger swagger = loadSpecificationFrom(camelContext, specificationUri, sslContextParameters); final Map<String, Path> paths = swagger.getPaths(); for (final Entry<String, Path> pathEntry : paths.entrySet()) { final Path path = pathEntry.getValue(); final Optional<Entry<HttpMethod, Operation>> maybeOperationEntry = path.getOperationMap().entrySet() .stream().filter(operationEntry -> operationId.equals(operationEntry.getValue().getOperationId())) .findAny(); if (maybeOperationEntry.isPresent()) { final Entry<HttpMethod, Operation> operationEntry = maybeOperationEntry.get(); final Operation operation = operationEntry.getValue(); final Map<String, Parameter> pathParameters = operation.getParameters().stream() .filter(p -> "path".equals(p.getIn())) .collect(Collectors.toMap(Parameter::getName, Function.identity())); final String uriTemplate = resolveUri(pathEntry.getKey(), pathParameters); final HttpMethod httpMethod = operationEntry.getKey(); final String method = httpMethod.name(); return createProducerFor(swagger, operation, method, uriTemplate); } } final String supportedOperations = paths.values().stream().flatMap(p -> p.getOperations().stream()) .map(Operation::getOperationId).collect(Collectors.joining(", ")); throw new IllegalArgumentException("The specified operation with ID: `" + operationId + "` cannot be found in the Swagger specification loaded from `" + specificationUri + "`. Operations defined in the specification are: " + supportedOperations); }</code><technical_language>IMHO, move sslContextParameters checks a separate function prefer if else in this context in order avoid null checks in case is assigned</technical_language>

Target:
public Producer createProducer() throws Exception { final CamelContext camelContext = getCamelContext(); final Swagger swagger = loadSpecificationFrom(camelContext, specificationUri, resolveSslContextParameters()); final Map<String, Path> paths = swagger.getPaths(); for (final Entry<String, Path> pathEntry : paths.entrySet()) { final Path path = pathEntry.getValue(); final Optional<Entry<HttpMethod, Operation>> maybeOperationEntry = path.getOperationMap().entrySet() .stream().filter(operationEntry -> operationId.equals(operationEntry.getValue().getOperationId())) .findAny(); if (maybeOperationEntry.isPresent()) { final Entry<HttpMethod, Operation> operationEntry = maybeOperationEntry.get(); final Operation operation = operationEntry.getValue(); final Map<String, Parameter> pathParameters = operation.getParameters().stream() .filter(p -> "path".equals(p.getIn())) .collect(Collectors.toMap(Parameter::getName, Function.identity())); final String uriTemplate = resolveUri(pathEntry.getKey(), pathParameters); final HttpMethod httpMethod = operationEntry.getKey(); final String method = httpMethod.name(); return createProducerFor(swagger, operation, method, uriTemplate); } } final String supportedOperations = paths.values().stream().flatMap(p -> p.getOperations().stream()) .map(Operation::getOperationId).collect(Collectors.joining(", ")); throw new IllegalArgumentException("The specified operation with ID: `" + operationId + "` cannot be found in the Swagger specification loaded from `" + specificationUri + "`. Operations defined in the specification are: " + supportedOperations); }