What previous javac errors prevent a checkerFramework checker from running in a class?

267 Views Asked by At

I am using the checkerFramework gradle plugin to statically analyze nullness and tainting in my code. When I run the checker via gradle, only one of my classes are properly checked. All the other classes return with the ambiguous error about the checker not running:

error: [type.checking.not.run] NullnessChecker did not run because of a previous error issued by ja
vac
public class Main {
       ^

The manual linked does not metion what potentially causes this. I had some @Nullable annotations prepended to some static instance variables of the primary class I am using, but undoing those did not fix the issue.

My build.gradle is set up like so:

plugins {
    // Checker Framework pluggable type-checking
    id 'org.checkerframework' version '0.6.3'
}

checkerFramework {
checkers = [
        'org.checkerframework.checker.nullness.NullnessChecker',
        'org.checkerframework.checker.tainting.TaintingChecker'
           ]
}


apply plugin: 'org.checkerframework'

Where do I find more detail on this error?

1

There are 1 best solutions below

1
mernst On

You didn't show the full javac output. The relevant errors should be just above the error: [type.checking.not.run] line that you did show.

The Checker Framework runs as a plugin to javac. When javac issues an error in one class (including any Checker Framework error), javac may or may not process other classes. Unfortunately, there is no good way for a user to predict how far javac will get. Your best bet is to focus on the code that matters most to you, and resolve each error in turn before proceeding to other classes.

Update: The Checker Framework no longer issues type.checking.not.run errors.