Skip to content

Commit c81f1f5

Browse files
authored
filter synthetic bridge methods during method detection for java Lambda full handler syntax (#79)
1 parent 478f868 commit c81f1f5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Simply add the following dependency to your `pom.xml` file:
6060
<dependency>
6161
<groupId>cloud.localstack</groupId>
6262
<artifactId>localstack-utils</artifactId>
63-
<version>0.2.16</version>
63+
<version>0.2.17</version>
6464
</dependency>
6565
```
6666

@@ -108,6 +108,7 @@ make build
108108

109109
## Change Log
110110

111+
* v0.2.17: Fix issue with using :: to specify lambda handler which implements the RequestHandler interface, revert removal of EC2HostNameResolver annotation
111112
* v0.2.16: Add support for :: notation for Java Lambda handler specification, fix failing QLDB tests, fix failing tests with Jexter rules/extensions
112113
* v0.2.15: Fix Kinesis CBOR tests; fix project setup and classpath for SDK v1/v2 utils; fix awaiting results in tests using async clients; refactor classpath setup for v1/v2 SDKs; fall back to using edge port if port mapping cannot be determined from container
113114
* v0.2.14: Add ability to get handler class name through `_HANDLER` environment variable like on real AWS and Lambci environment

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>cloud.localstack</groupId>
55
<artifactId>localstack-utils</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.2.16</version>
7+
<version>0.2.17</version>
88
<name>localstack-utils</name>
99

1010
<description>Java utilities for the LocalStack platform.</description>

src/main/java/cloud/localstack/LambdaExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ public static void main(String[] args) throws Exception {
143143
*/
144144
private static Method getHandlerMethodByName(Object handler, String handlerMethodName) throws MultipleMatchingHandlersException, NoMatchingHandlerException {
145145
List<Method> handlerMethods = Arrays.stream(handler.getClass().getMethods())
146-
.filter(method -> method.getName().equals(handlerMethodName))
146+
.filter(method -> method.getName().equals(handlerMethodName) && !method.isBridge()) // we do not want bridge methods here
147147
.collect(Collectors.toList());
148148
if (handlerMethods.size() > 1) {
149-
throw new MultipleMatchingHandlersException("Multiple matching headers: " + handlerMethods);
149+
throw new MultipleMatchingHandlersException("Multiple matching handlers: " + handlerMethods);
150150
} else if (handlerMethods.isEmpty()) {
151151
throw new NoMatchingHandlerException("No matching handlers for method name: "
152152
+ handlerMethodName);

0 commit comments

Comments
 (0)