-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
StackTraceAnalyser class "getMethod" calls "callingClass.getSuperclass"(Line 36), and passes to extractMethod. But its not necessary that there be superclass(Inner nested single interface lambda implementation). Leads to Nullpointer #2229
Comments
Can you propose a PR to fix? |
@wakaleo Sure. Should i just handle the "null" returned in "callingClass.getSuperclass" or should i pass the ReflectiveInterceptorCall reference too to the extractMethod? I am not sure whether we need to dig in to these classes as these are core Junit5 classes and no logical need to in this usecase. However if there is some nested single method lambda interface defined in a class where a "screenshot" annotation is applied then we ideally should(I am not sure whether thats a valid use case) |
I would just handle the null by ignoring it, as this code is to detect annotations in the test code itself, not in JUnit code. |
Thanks @wakaleo . Will raise PR to handle this |
… classes without a superclass (serenity-bdd#2229) * no tests adjusted as I did not find tests for the different cases in StackTraceAnalyser
Had the same issue: StackTraceAnalyser runs into a |
This is working as expected now. Hence closing this issue. Thank you @fabianlinz and @wakaleo |
StackTraceAnalyser class "getMethod" calls callingClass.getSuperclass, and passes it to extractMethod. But its not necessary that there be superclass. Leads to Nullpointer. Especially when the call is from Junit 5 execution engine I am getting Nullpointer for "ExecutableInvoker" class which has a inner interface single method implementation for "ReflectiveInterceptorCall" which does not have a super class. Leading to Nullpointer exception in "extractMethod" because callingClass is passed as null.
The text was updated successfully, but these errors were encountered: