NullPointerException in convertBlockCoverageToLineCoverageForClass (compiled JDK7, running JDK11)
See original GitHub issueWhile moving the Java 7 / Android branch of my code from Travis to Azure Pipelines, I needed to update the Java runtime for PIT to JDK 11 to fix JVM crashes (see https://jaxenter.com/nobody-puts-java-container-139373.html for the probable reason), which due to various dependencies, meant updating PIT to version 1.4.7. I’m now getting:
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.7:mutationCoverage (default-cli) on project BetterRandom-Java7: Execution default-cli of goal org.pitest:pitest-maven:1.4.7:mutationCoverage failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.4.7:mutationCoverage (default-cli) on project BetterRandom-Java7: Execution default-cli of goal org.pitest:pitest-maven:1.4.7:mutationCoverage failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.pitest:pitest-maven:1.4.7:mutationCoverage failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException
at org.pitest.coverage.CoverageData.lambda$isFor$6 (CoverageData.java:329)
at org.pitest.functional.FCollection.filter (FCollection.java:86)
at org.pitest.functional.FCollection.filter (FCollection.java:79)
at org.pitest.coverage.CoverageData.convertBlockCoverageToLineCoverageForClass (CoverageData.java:271)
at org.pitest.coverage.CoverageData.getTestsForClassName (CoverageData.java:265)
at org.pitest.coverage.CoverageData.getTestsForClassLine (CoverageData.java:78)
at org.pitest.mutationtest.build.DefaultTestPrioritiser.pickTests (DefaultTestPrioritiser.java:44)
at org.pitest.mutationtest.build.DefaultTestPrioritiser.assignTests (DefaultTestPrioritiser.java:39)
at org.pitest.mutationtest.build.MutationSource.assignTestsToMutations (MutationSource.java:78)
at org.pitest.mutationtest.build.MutationSource.createMutations (MutationSource.java:68)
at org.pitest.mutationtest.build.MutationTestBuilder.lambda$classToMutations$1 (MutationTestBuilder.java:94)
at org.pitest.functional.FCollection.flatMapTo (FCollection.java:58)
at org.pitest.functional.FCollection.flatMap (FCollection.java:68)
at org.pitest.mutationtest.build.MutationTestBuilder.createMutationTestUnits (MutationTestBuilder.java:58)
at org.pitest.mutationtest.tooling.MutationCoverage.buildMutationTests (MutationCoverage.java:281)
at org.pitest.mutationtest.tooling.MutationCoverage.runReport (MutationCoverage.java:135)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:120)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:50)
at org.pitest.maven.RunPitStrategy.execute (RunPitStrategy.java:35)
at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:466)
at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:407)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
NullPointerException (Java SE 12 & JDK 12 )
Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of...
Read more >java - What is a NullPointerException, and how do I fix it?
A null pointer exception is thrown when an application attempts to use null in a case where an object is required. These include:...
Read more >java.lang.NullPointerException from jstack on compiled frame
NullPointerException from jstack on compiled frame. Type: Bug; Component: core-svc; Sub-Component: tools; Affected Version: 5.0.
Read more >How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is ... is null, running the above code causes a NullPointerException :
Read more >Run time exceptions while compiling the models - IBM
Sometimes a null pointer exception is thrown (java.lang.NullPointerException). This could be due to many reasons. One of the most common reason ...
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
Sorry, this does indeed look like something that I introduced in 1.4.7, although there was also another issue (which was causing the failure on 1.4.6). The changes in my fork issue-597 seem to resolve both issues - I will open a PR.
1.4.8 fixes the NPE, but gives me the same “duplicate class definition” error as 1.4.6. Since you said that was a separate bug, I’ve filed it as #613.