Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial checker framework configuration #690

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ plugins {

id 'checkstyle'

// Homepage: https://github.com/kelloggm/checkerframework-gradle-plugin
id 'org.checkerframework' version '0.6.40'

id 'project-report'

id 'idea'
Expand All @@ -38,6 +41,8 @@ apply plugin: XjcPlugin

apply from: 'eclipse.gradle'

apply plugin: 'org.checkerframework'

group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'

Expand Down Expand Up @@ -322,6 +327,11 @@ dependencies {
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
rewrite("org.openrewrite.recipe:rewrite-migrate-java")

// checker framework
compileOnly 'org.checkerframework:checker-qual:3.44.0'
testCompileOnly 'org.checkerframework:checker-qual:3.44.0'
checkerFramework 'org.checkerframework:checker:3.44.0'

configurations.checkstyle {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
Expand Down Expand Up @@ -614,6 +624,13 @@ checkstyle {
sourceSets = []
}

checkerFramework {
checkers = [
'org.checkerframework.checker.nullness.NullnessChecker'
]
excludeTests = true
}

rewrite {
activeRecipe(
'org.jabref.config.rewrite.cleanup'
Expand Down
1 change: 1 addition & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
uses org.eclipse.jgit.lib.GpgSigner;

requires transitive org.jspecify;
requires org.checkerframework.checker.qual;

// other libraries
requires org.antlr.antlr4.runtime;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/logic/pdf/search/PdfIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public class PdfIndexer {

private final FilePreferences filePreferences;

@Nullable
private final Directory indexDirectory;
private final @Nullable Directory indexDirectory;

private IndexReader reader;

Expand Down
Loading