Skip to content

Commit 52ba3d5

Browse files
committed
Revert "Contain the use of reflection in amazon-lambda"
This reverts commit 56470f2. Fixes #49413
1 parent 557e77a commit 52ba3d5

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ List<AmazonLambdaBuildItem> discover(CombinedIndexBuildItem combinedIndexBuildIt
114114
final DotName name = info.name();
115115
final String lambda = name.toString();
116116
builder.addBeanClass(lambda);
117+
reflectiveClassBuildItemBuildProducer
118+
.produce(ReflectiveClassBuildItem.builder(lambda).methods().build());
117119

118120
String cdiName = null;
119121
AnnotationInstance named = info.declaredAnnotation(NAMED);
@@ -148,18 +150,9 @@ List<AmazonLambdaBuildItem> discover(CombinedIndexBuildItem combinedIndexBuildIt
148150
}
149151
}
150152
}
151-
if (!done) {
152-
current = combinedIndexBuildItem.getIndex().getClassByName(current.superName());
153-
}
154-
}
155-
if (done) {
156-
String handlerClass = current.name().toString();
157-
ret.add(new AmazonLambdaBuildItem(handlerClass, cdiName, streamHandler));
158-
reflectiveClassBuildItemBuildProducer.produce(ReflectiveClassBuildItem.builder(handlerClass).methods()
159-
.reason(getClass().getName()
160-
+ ": reflectively accessed in io.quarkus.amazon.lambda.runtime.AmazonLambdaRecorder.discoverHandlerMethod")
161-
.build());
153+
current = combinedIndexBuildItem.getIndex().getClassByName(current.superName());
162154
}
155+
ret.add(new AmazonLambdaBuildItem(lambda, cdiName, streamHandler));
163156
}
164157
additionalBeanBuildItemBuildProducer.produce(builder.build());
165158
reflectiveClassBuildItemBuildProducer

extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AmazonLambdaRecorder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void handle(InputStream inputStream, OutputStream outputStream, Co
8888
}
8989

9090
private static Method discoverHandlerMethod(Class<? extends RequestHandler<?, ?>> handlerClass) {
91-
final Method[] methods = handlerClass.getDeclaredMethods();
91+
final Method[] methods = handlerClass.getMethods();
9292
Method method = null;
9393
for (int i = 0; i < methods.length && method == null; i++) {
9494
if (methods[i].getName().equals("handleRequest")) {

0 commit comments

Comments
 (0)