bkushigian / major-gradle-plugin

A Gradle plugin to integrate the Major Mutation Framework into Gradle builds
Apache License 2.0
0 stars 0 forks source link

Error building Spring Boot project #3

Closed bkushigian closed 3 years ago

bkushigian commented 3 years ago

Bug Inducing Input

I cloned the Spring Boot Project and hooked into the spring-boot-project:spring-boot-actuator-autoconfigure subproject with the following diffs:

Result

Caused by: java.lang.NullPointerException
        at org.mutationtesting.major.providers.ReflectionProvider.getField(ReflectionProvider.java:79)
        at org.mutationtesting.major.plugin.MajorPluginTaskListener.getEnv(MajorPluginTaskListener.java:131)
        at org.mutationtesting.major.plugin.MajorPluginTaskListener.finished(MajorPluginTaskListener.java:112)
bkushigian commented 3 years ago

Looking into Major, this stacktrace corresponds to the following code in MajorPluginTaskListener:

    Enter enter = (Enter) ReflectionProvider.getField(javac, "enter");
    Object typeEnvs = ReflectionProvider.getField(enter, "typeEnvs");

This looks up javac.enter.typeEnvs which is needed to create the Env<AttrContext> (which is what the Mutator needs to mutate stuff). For some reason, this is coming back null.

bkushigian commented 3 years ago

This is an error with Major (reproduced without Gradle build)