-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix NPE on MethodFormat.getCodeSource #751
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
With some custom classloader
|
On what platform is this NPE happening? |
Well I was testing Cucumber-jvm with Robolectric classloader AsmInstrumentingClassLoader, see my post: https://groups.google.com/forum/#!topic/cukes/Eq4AG4bMo9E The problem with Why not just use? :
|
@bySabi the old code gives the path to the source file. Your PR looks good. It's a good fallback for when the source is unavailable. |
If I read the comments correctly,
(the fallback
where the second |
Your are right @brasmusson |
I create a new PR: #757 when suggested @brasmusson |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When use a custom classloader
protectionDomain.getCodeSource().getLocation()
can return null.