Fixed NullPointerException in ClasspathMethodScanner when having interface in glue code package #201

Merged
merged 1 commit into from Feb 15, 2012

Projects

None yet

2 participants

@vladimirkl
Contributor

Hi,

I've got NullPointerException when having interface definition in java glue code package. Fixed this by ignoring interfaces while scanning glue code. I didn't write any additional tests for this issue - because ClasspathMethodScannerTest failed after adding interface and passed after fix

@vladimirkl vladimirkl Fixed NullPointerException in ClasspathMethodScanner
Got NullPointerException when having interface in glue code package.
Fixed this by ignoring interfaces while scanning glue code.
6ec33aa
@aslakhellesoy

I think perhaps it would be better to put the isInterface() check inside isInstantiable()

Can you check if that works and update your pullreq if it does?

Owner

Putting isInterface() check to isInstantiable() won't work. isInstantiable() already returns false for interface. Exception occurs because glueCodeClass.getSuperclass() returns null. I may put several null checks instead checking isInterface() but this seems to be more intrusive refactoring.

@aslakhellesoy aslakhellesoy merged commit 6ec33aa into cucumber:master Feb 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment