aws / aws/aws-lambda-snapstart-java-rules

Rules do not scan dependency injection without a handler

Open
#35 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
53
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Problem: You can run standard Spring Boot applications via the [Serverless Java Container](https://github.com/aws/serverless-java-container) or the [Lambda Web Adapter.](https://github.com/awslabs/aws-lambda-web-adapter) In that case, no specific handler interface needs to be implemented. Currently the SnapStart rules would therefore not recognize any violation of the rules:

```java
public class UnicornControllerHandler {

private final UnicornService unicornService;
private final UUID uuid;
private static final Logger logger = LoggerFactory.getLogger(UnicornControllerHandler.class);

public UnicornControllerHandler(UnicornService unicornService) {
this.unicornService = unicornService;
uuid = UUID.randomUUID();
}
}

```

This is somehow related to https://github.com/aws/aws-lambda-snapstart-java-rules/issues/24 but the checks seem to only apply when the class and the method have a specific name.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.