-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for AWS Lambda Function SDK V2 #2130
Merged
sdelamo
merged 52 commits into
micronaut-projects:4.7.x
from
driverpt:function-client-sdk-v2
Aug 20, 2024
Merged
Changes from 12 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
bb91ea5
Add Support for AWS Lambda Function SDK V2
driverpt ac22ee8
Make Spotless happy
driverpt 51f58c1
Fix compilation issues
driverpt 640f53c
Initial Commit for Tests
driverpt 83fd2d2
Add Lambda Code for Testing with LocalStack
driverpt 7458176
Add Integration Tests for Function Client for AWS SDK V2
driverpt 054a4e6
Add missing Function Client Configuration
driverpt 1755112
Update Javadoc
driverpt e11a6bf
Merge branch '4.7.x' into pr/2130
sdelamo 1149df3
add javadoc, test and @Factory
sdelamo 361a8e3
Update aws-sdk-v2/src/main/java/io/micronaut/aws/sdk/v2/service/lambd…
sdelamo c42b086
Update aws-sdk-v2/src/main/java/io/micronaut/aws/sdk/v2/service/lambd…
sdelamo b6f4639
Update function-client-aws-v2/src/main/java/io/micronaut/function/cli…
sdelamo 592e3e6
Update function-client-aws-v2/src/main/java/io/micronaut/function/cli…
sdelamo 5f03912
Update function-client-aws-v2/src/main/java/io/micronaut/function/cli…
sdelamo a79b204
Update function-client-aws-v2/src/main/java/io/micronaut/function/cli…
sdelamo 9256c52
Use AwsInvokeRequestDefinition in javadoc
sdelamo 38d17d6
document Lambda Client
sdelamo 3e446f5
dependencies should be testImplementation
sdelamo 7d6c3cf
remove testContainers version
sdelamo 7545215
doc: how to use function-client-v2
sdelamo 9d51b0f
use micronautFunctionClientAwsV2 in test-suite
sdelamo a704fde
add logback to src/test/resources
sdelamo b6de860
don’t use compress
sdelamo 91c9b78
remove zip
sdelamo 6fb0c0e
Fix lambda code
driverpt 1b6d770
Add AWS SDK IAM to Tests
driverpt bec81a3
Remove @Internal from Lambda Factory
driverpt 1b35302
Properly Map Lambda Function Name and extra attributes
driverpt e51547a
Fix failing tests
driverpt 1af4c14
change javadoc
sdelamo fd01b82
revert v2 dependency
sdelamo cd94423
set AwsLambdaFunctionExecutor as @Internal
sdelamo 3be9d9c
dont add jackson.databind use JsonMediaTypeCodec
sdelamo b8d9c51
move to package v2
sdelamo 651614b
change javadoc
sdelamo 421ae9d
add test
sdelamo 764bd31
remove @Introspected annotation
sdelamo 497a8e8
remove raw use of parameterized
sdelamo 022ef66
use BLOCKING instead of IO
sdelamo 560e00d
remove raw use parameterized
sdelamo 5b00e50
use conversionService
sdelamo c54ed50
add reactive test
sdelamo a78e20b
fix: run Junit4 test into Junit5 test
sdelamo 4799024
test-suite for function-client-aws v1 and v2
sdelamo 95b58d8
disable binary compatibility
sdelamo 615d2bc
improve docs
sdelamo 9472988
add javadoc
sdelamo cf924e3
fix checkstyle
sdelamo 3446aee
add javadoc
sdelamo 07c5629
Merge branch '4.7.x' into pr/2130
sdelamo 9c814af
disabled tests
sdelamo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
aws-sdk-v2/src/main/java/io/micronaut/aws/sdk/v2/service/lambda/LambdaClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.aws.sdk.v2.service.lambda; | ||
|
||
import io.micronaut.aws.sdk.v2.service.AWSServiceConfiguration; | ||
import io.micronaut.aws.sdk.v2.service.AwsClientFactory; | ||
import io.micronaut.aws.ua.UserAgentProvider; | ||
import io.micronaut.context.annotation.Bean; | ||
import io.micronaut.context.annotation.Factory; | ||
import io.micronaut.context.annotation.Requires; | ||
import io.micronaut.core.annotation.Internal; | ||
import io.micronaut.core.annotation.Nullable; | ||
import jakarta.inject.Named; | ||
import jakarta.inject.Singleton; | ||
import software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.regions.providers.AwsRegionProviderChain; | ||
import software.amazon.awssdk.services.lambda.LambdaAsyncClient; | ||
import software.amazon.awssdk.services.lambda.LambdaAsyncClientBuilder; | ||
import software.amazon.awssdk.services.lambda.LambdaClient; | ||
import software.amazon.awssdk.services.lambda.LambdaClientBuilder; | ||
|
||
/** | ||
* Factory that creates {@link LambdaClient} and {@link LambdaAsyncClient}. | ||
* @since 4.7.0 | ||
*/ | ||
@Factory | ||
@Internal | ||
class LambdaClientFactory extends AwsClientFactory<LambdaClientBuilder, LambdaAsyncClientBuilder, LambdaClient, LambdaAsyncClient> { | ||
/** | ||
* Constructor. | ||
* | ||
* @param credentialsProvider The credentials provider | ||
* @param regionProvider The region provider | ||
* @param userAgentProvider User-Agent Provider | ||
* @param awsServiceConfiguration AWS Service Configuration | ||
*/ | ||
protected LambdaClientFactory(AwsCredentialsProviderChain credentialsProvider, | ||
AwsRegionProviderChain regionProvider, | ||
@Nullable UserAgentProvider userAgentProvider, | ||
@Nullable @Named(LambdaClient.SERVICE_NAME) AWSServiceConfiguration awsServiceConfiguration) { | ||
super(credentialsProvider, regionProvider, userAgentProvider, awsServiceConfiguration); | ||
} | ||
|
||
@Override | ||
protected LambdaClientBuilder createSyncBuilder() { | ||
return LambdaClient.builder(); | ||
} | ||
|
||
@Override | ||
protected LambdaAsyncClientBuilder createAsyncBuilder() { | ||
return LambdaAsyncClient.builder(); | ||
} | ||
|
||
@Override | ||
@Singleton | ||
public LambdaClientBuilder syncBuilder(SdkHttpClient httpClient) { | ||
return super.syncBuilder(httpClient); | ||
} | ||
|
||
@Override | ||
@Bean(preDestroy = "close") | ||
@Singleton | ||
public LambdaClient syncClient(LambdaClientBuilder builder) { | ||
return super.syncClient(builder); | ||
} | ||
|
||
@Override | ||
@Singleton | ||
@Requires(beans = SdkAsyncHttpClient.class) | ||
public LambdaAsyncClientBuilder asyncBuilder(SdkAsyncHttpClient httpClient) { | ||
return super.asyncBuilder(httpClient); | ||
} | ||
|
||
@Override | ||
@Bean(preDestroy = "close") | ||
@Singleton | ||
@Requires(beans = SdkAsyncHttpClient.class) | ||
public LambdaAsyncClient asyncClient(LambdaAsyncClientBuilder builder) { | ||
return super.asyncClient(builder); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
aws-sdk-v2/src/main/java/io/micronaut/aws/sdk/v2/service/lambda/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Lambda client factory. | ||
* @author Luis Duarte | ||
* @since 4.7.0 | ||
*/ | ||
@Requires(classes = {LambdaClient.class, LambdaAsyncClient.class}) | ||
@Configuration | ||
package io.micronaut.aws.sdk.v2.service.lambda; | ||
|
||
import io.micronaut.context.annotation.Configuration; | ||
import io.micronaut.context.annotation.Requires; | ||
import software.amazon.awssdk.services.lambda.LambdaAsyncClient; | ||
import software.amazon.awssdk.services.lambda.LambdaClient; |
20 changes: 20 additions & 0 deletions
20
aws-sdk-v2/src/test/groovy/io/micronaut/aws/sdk/v2/service/LambdaClientSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.micronaut.aws.sdk.v2.service | ||
|
||
import software.amazon.awssdk.services.lambda.LambdaAsyncClient | ||
import software.amazon.awssdk.services.lambda.LambdaClient | ||
|
||
class LambdaClientSpec extends ServiceClientSpec<LambdaClient, LambdaAsyncClient> { | ||
@Override | ||
protected String serviceName() { | ||
return LambdaClient.SERVICE_NAME | ||
} | ||
|
||
@Override | ||
protected LambdaClient getClient() { | ||
applicationContext.getBean(LambdaClient) | ||
} | ||
|
||
protected LambdaAsyncClient getAsyncClient() { | ||
applicationContext.getBean(LambdaAsyncClient) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
plugins { | ||
id("io.micronaut.build.internal.aws-module") | ||
} | ||
|
||
dependencies { | ||
api(projects.micronautAwsSdkV2) | ||
implementation(libs.awssdk.lambda) | ||
implementation(mn.reactor) | ||
api(mn.micronaut.function.client) | ||
implementation(mn.micronaut.jackson.databind) | ||
testAnnotationProcessor(mn.micronaut.inject.java) | ||
testImplementation(mn.micronaut.inject.java) | ||
testImplementation(mnSerde.micronaut.serde.api) | ||
testImplementation(mn.micronaut.http.server.netty) | ||
testImplementation(mn.micronaut.function.web) | ||
testImplementation(mnGroovy.micronaut.function.groovy) | ||
testImplementation(mnGroovy.micronaut.runtime.groovy) | ||
testImplementation(libs.commons.compress) | ||
// TODO: Switch to Test Resources, once Lambda Client is also included in Service Override | ||
implementation(platform(libs.boms.testcontainers)) | ||
implementation(libs.testcontainers) | ||
implementation(libs.testcontainers.localstack) | ||
implementation(libs.testcontainers.junit) | ||
implementation(libs.testcontainers.spock) | ||
} |
46 changes: 46 additions & 0 deletions
46
...ent-aws-v2/src/main/java/io/micronaut/function/client/aws/AwsInvokeRequestDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2017-2020 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.function.client.aws; | ||
|
||
import io.micronaut.context.annotation.EachProperty; | ||
import io.micronaut.context.annotation.Parameter; | ||
import io.micronaut.function.client.FunctionDefinition; | ||
|
||
/** | ||
* Builds an {@link InvokeRequest} for each definition under {@code aws.lambda.functions}. | ||
* | ||
* @author graemerocher | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @since 1.0 | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
@EachProperty(AwsInvokeRequestDefinition.AWS_LAMBDA_FUNCTIONS) | ||
public class AwsInvokeRequestDefinition implements FunctionDefinition { | ||
public static final String AWS_LAMBDA_FUNCTIONS = "aws.lambda.functions"; | ||
|
||
private final String name; | ||
|
||
/** | ||
* Constructor. | ||
* @param name configured name from a property | ||
*/ | ||
public AwsInvokeRequestDefinition(@Parameter String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.name; | ||
} | ||
} |
138 changes: 138 additions & 0 deletions
138
...ient-aws-v2/src/main/java/io/micronaut/function/client/aws/AwsLambdaFunctionExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/* | ||
* Copyright 2017-2020 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.function.client.aws; | ||
|
||
import io.micronaut.context.annotation.Requires; | ||
import io.micronaut.core.async.publisher.Publishers; | ||
import io.micronaut.core.convert.ConversionService; | ||
import io.micronaut.core.io.buffer.ByteBufferFactory; | ||
import io.micronaut.core.type.Argument; | ||
import io.micronaut.function.client.FunctionDefinition; | ||
import io.micronaut.function.client.FunctionInvoker; | ||
import io.micronaut.function.client.FunctionInvokerChooser; | ||
import io.micronaut.function.client.exceptions.FunctionExecutionException; | ||
import io.micronaut.jackson.codec.JsonMediaTypeCodec; | ||
import io.micronaut.scheduling.TaskExecutors; | ||
import jakarta.inject.Named; | ||
import jakarta.inject.Singleton; | ||
import reactor.core.publisher.Mono; | ||
import reactor.core.scheduler.Schedulers; | ||
import software.amazon.awssdk.core.SdkBytes; | ||
import software.amazon.awssdk.services.lambda.LambdaAsyncClient; | ||
import software.amazon.awssdk.services.lambda.LambdaClient; | ||
import software.amazon.awssdk.services.lambda.model.InvokeRequest; | ||
import software.amazon.awssdk.services.lambda.model.InvokeResponse; | ||
|
||
import java.nio.ByteBuffer; | ||
import java.util.Optional; | ||
import java.util.concurrent.ExecutorService; | ||
|
||
/** | ||
* A {@link FunctionInvoker} for invoking functions on AWS. | ||
* | ||
* @param <I> input type | ||
* @param <O> output type | ||
* @author graemerocher | ||
* @since 1.0 | ||
*/ | ||
@Requires(beans = LambdaAsyncClient.class) | ||
@Singleton | ||
public class AwsLambdaFunctionExecutor<I, O> implements FunctionInvoker<I, O>, FunctionInvokerChooser { | ||
|
||
private static final int STATUS_CODE_ERROR = 300; | ||
private final LambdaClient syncClient; | ||
private final LambdaAsyncClient asyncClient; | ||
private final ByteBufferFactory byteBufferFactory; | ||
private final JsonMediaTypeCodec jsonMediaTypeCodec; | ||
private final ExecutorService ioExecutor; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param asyncClient asyncClient | ||
* @param byteBufferFactory byteBufferFactory | ||
* @param jsonMediaTypeCodec jsonMediaTypeCodec | ||
* @param ioExecutor ioExecutor | ||
*/ | ||
protected AwsLambdaFunctionExecutor( | ||
LambdaClient syncClient, | ||
LambdaAsyncClient asyncClient, | ||
ByteBufferFactory byteBufferFactory, | ||
JsonMediaTypeCodec jsonMediaTypeCodec, | ||
@Named(TaskExecutors.IO) ExecutorService ioExecutor) { | ||
this.syncClient = syncClient; | ||
this.asyncClient = asyncClient; | ||
this.byteBufferFactory = byteBufferFactory; | ||
this.jsonMediaTypeCodec = jsonMediaTypeCodec; | ||
this.ioExecutor = ioExecutor; | ||
} | ||
|
||
@Override | ||
public O invoke(FunctionDefinition definition, I input, Argument<O> outputType) { | ||
if (!(definition instanceof AwsInvokeRequestDefinition)) { | ||
throw new IllegalArgumentException("Function definition must be a AWSInvokeRequestDefinition"); | ||
} | ||
|
||
boolean isReactiveType = Publishers.isConvertibleToPublisher(outputType.getType()); | ||
SdkBytes sdkBytes = encodeInput(input); | ||
InvokeRequest invokeRequest = InvokeRequest.builder() | ||
.functionName(definition.getName()) | ||
.payload(sdkBytes) | ||
.build(); | ||
if (isReactiveType) { | ||
Mono<Object> invokeFlowable = Mono.fromFuture(asyncClient.invoke(invokeRequest)) | ||
.map(invokeResult -> | ||
decodeResult(definition, (Argument<O>) outputType.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT), invokeResult)) | ||
.onErrorResume(throwable -> Mono.error(new FunctionExecutionException("Error executing AWS Lambda [" + definition.getName() + "]: " + throwable.getMessage(), throwable))) | ||
.subscribeOn(Schedulers.fromExecutor(ioExecutor)); | ||
return ConversionService.SHARED.convert(invokeFlowable, outputType).orElseThrow(() -> new IllegalArgumentException("Unsupported Reactive type: " + outputType)); | ||
} else { | ||
InvokeResponse invokeResult = syncClient.invoke(invokeRequest); | ||
try { | ||
return (O) decodeResult(definition, outputType, invokeResult); | ||
} catch (Exception e) { | ||
throw new FunctionExecutionException("Error executing AWS Lambda [" + definition.getName() + "]: " + e.getMessage(), e); | ||
} | ||
} | ||
} | ||
|
||
private Object decodeResult(FunctionDefinition definition, Argument<O> outputType, InvokeResponse invokeResult) { | ||
Integer statusCode = invokeResult.statusCode(); | ||
if (statusCode >= STATUS_CODE_ERROR) { | ||
throw new FunctionExecutionException("Error executing AWS Lambda [" + definition.getName() + "]: " + invokeResult.functionError()); | ||
} | ||
io.micronaut.core.io.buffer.ByteBuffer byteBuffer = byteBufferFactory.copiedBuffer(invokeResult.payload().asByteArray()); | ||
|
||
return jsonMediaTypeCodec.decode(outputType, byteBuffer); | ||
} | ||
|
||
private SdkBytes encodeInput(I input) { | ||
if (input != null) { | ||
ByteBuffer nioBuffer = jsonMediaTypeCodec.encode(input, byteBufferFactory).asNioBuffer(); | ||
return SdkBytes.fromByteBuffer(nioBuffer); | ||
} | ||
return null; | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public <I1, O2> Optional<FunctionInvoker<I1, O2>> choose(FunctionDefinition definition) { | ||
if (definition instanceof AwsInvokeRequestDefinition) { | ||
return Optional.of((FunctionInvoker) this); | ||
} | ||
return Optional.empty(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
function-client-aws-v2/src/main/java/io/micronaut/function/client/aws/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Function AWS lamda configuration. | ||
* | ||
* @author graemerocher | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @since 1.0 | ||
sdelamo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
package io.micronaut.function.client.aws; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the javadoc correct here?