You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/03/30 11:32:34 UTC
[camel] 04/04: Fixed CS
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 57aa798988dd01ac9b9a3b81e584fee999a92981
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 30 13:31:39 2021 +0200
Fixed CS
---
.../component/aws2/lambda/Lambda2Producer.java | 42 +++++++++++-----------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
index 3f3ed7c..04c87ab 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
@@ -370,37 +370,37 @@ public class Lambda2Producer extends DefaultProducer {
}
private void updateFunction(LambdaClient lambdaClient, Exchange exchange) throws Exception {
- UpdateFunctionCodeRequest request = null;
- UpdateFunctionCodeResponse result;
+ UpdateFunctionCodeRequest request = null;
+ UpdateFunctionCodeResponse result;
if (getConfiguration().isPojoRequest()) {
request = exchange.getIn().getMandatoryBody(UpdateFunctionCodeRequest.class);
} else {
- UpdateFunctionCodeRequest.Builder builder = UpdateFunctionCodeRequest.builder();
- builder.functionName(getEndpoint().getFunction());
+ UpdateFunctionCodeRequest.Builder builder = UpdateFunctionCodeRequest.builder();
+ builder.functionName(getEndpoint().getFunction());
- if (ObjectHelper.isEmpty(exchange.getIn().getBody())
- && (ObjectHelper.isEmpty(exchange.getIn().getHeader(Lambda2Constants.S3_BUCKET))
- && ObjectHelper.isEmpty(exchange.getIn().getHeader(Lambda2Constants.S3_KEY)))) {
- throw new IllegalArgumentException("At least S3 bucket/S3 key or zip file must be specified");
- }
+ if (ObjectHelper.isEmpty(exchange.getIn().getBody())
+ && (ObjectHelper.isEmpty(exchange.getIn().getHeader(Lambda2Constants.S3_BUCKET))
+ && ObjectHelper.isEmpty(exchange.getIn().getHeader(Lambda2Constants.S3_KEY)))) {
+ throw new IllegalArgumentException("At least S3 bucket/S3 key or zip file must be specified");
+ }
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(Lambda2Constants.PUBLISH))) {
- Boolean publish = exchange.getIn().getHeader(Lambda2Constants.PUBLISH, Boolean.class);
- builder.publish(publish);
- }
+ if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(Lambda2Constants.PUBLISH))) {
+ Boolean publish = exchange.getIn().getHeader(Lambda2Constants.PUBLISH, Boolean.class);
+ builder.publish(publish);
+ }
- request = builder.build();
+ request = builder.build();
}
try {
- result = lambdaClient.updateFunctionCode(request);
+ result = lambdaClient.updateFunctionCode(request);
- } catch (AwsServiceException ase) {
- LOG.trace("updateFunction command returned the error code {}", ase.awsErrorDetails().errorCode());
- throw ase;
- }
+ } catch (AwsServiceException ase) {
+ LOG.trace("updateFunction command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
}
private void createEventSourceMapping(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {