NPE with retrolambda
See original GitHub issueHi I am getting the following exception after upgrading to Kotlin v1.1:
Exception in thread "main" java.lang.NullPointerException
at org.pitest.mutationtest.filter.KotlinFilter$1.apply(KotlinFilter.java:34)
at org.pitest.mutationtest.filter.KotlinFilter$1.apply(KotlinFilter.java:31)
at org.pitest.functional.predicate.Not.apply(Not.java:33)
at org.pitest.functional.predicate.Not.apply(Not.java:23)
at org.pitest.functional.FCollection.filter(FCollection.java:84)
at org.pitest.functional.FCollection.filter(FCollection.java:77)
at org.pitest.mutationtest.filter.KotlinFilter.filter(KotlinFilter.java:27)
at org.pitest.mutationtest.filter.CompoundMutationFilter.filter(CompoundMutationFilter.java:22)
at org.pitest.mutationtest.build.MutationSource.createMutations(MutationSource.java:52)
at org.pitest.mutationtest.build.MutationTestBuilder$2.apply(MutationTestBuilder.java:100)
at org.pitest.mutationtest.build.MutationTestBuilder$2.apply(MutationTestBuilder.java:97)
at org.pitest.functional.FCollection.flatMapTo(FCollection.java:56)
at org.pitest.functional.FCollection.flatMap(FCollection.java:66)
at org.pitest.mutationtest.build.MutationTestBuilder.createMutationTestUnits(MutationTestBuilder.java:56)
at org.pitest.mutationtest.tooling.MutationCoverage.buildMutationTests(MutationCoverage.java:277)
at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:133)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:103)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:45)
at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:87)
at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)
I am running it with Gradle:
./gradlew clean pitest
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Retrolambda 3.3 in Android Studio 2.1.3: error configuring ...
Error:A problem occurred configuring project ':app'. I use Facebook and Twitter (fabric) dependencies. I removed apply plugin: 'me.tatarka.
Read more >lambda support for Android
Put rt8.jar and retrolambda.jar into your android project directory. Modify ant.properties file inside your android project adding these lines: java.target= ...
Read more >lombok.ast.TypeReference.rawParts java code examples | Tabnine
origin: me.tatarka.retrolambda.projectlombok/lombok.ast ... astValue(); return name.equals("void"); } catch (NullPointerException e) { return false; } }.
Read more >Keeping up with kotlin. “java is being forced to leave android…
Java 8 has been around for a while and we are only able to use a subset of it's APIs with compilers or...
Read more >android-retrolambda-lombok/src/main/lombok/ast/AbstractNode.java
if (position == null ) throw new NullPointerException( "position" );. this .position = position;. return this ;. } @Override public Position getPosition() {....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been fixed in Retrolambda 2.5.3
Thanks @8armed-monkey for SSCCE. It helped me to reproduce the issue.
First, I was suspecting that Kotlin is somehow leaking into the classpath use but PIT, but it’s not the case:
Later on, I realized that you mentioned that the problem occur even in projects which don’t use Kotlin (like that one 😃 ).
The NPE is in the line:
which suggests that a filename is null. I debugged that and the ill-fated object is:
The filename is null, but it shouldn’t. The problem may be related to retrolamba.
@8armed-monkey Could you check if the problem occurs also without retrolambda? If not, could you try to use the latest version of retrolambda (2.5.1) to verify that the problem hasn’t been already fixed? If not, it would be good to report it 😃.
@hcoles Maybe it would be good to perform a sanity check of (some) input parameters when
MutationDetails
is created to be able to fail fast with some more details about the context whereMutationDetails
was being created?Btw, just in case, as it may not be documented (yet), to debug PIT in a Gradle build it is enough to set: