Skip to content

Mismatched checker-qual artifact example#1318

Open
ShahriarAhnaf wants to merge 10 commits intoeisop:masterfrom
ShahriarAhnaf:annotation_subpackage
Open

Mismatched checker-qual artifact example#1318
ShahriarAhnaf wants to merge 10 commits intoeisop:masterfrom
ShahriarAhnaf:annotation_subpackage

Conversation

@ShahriarAhnaf
Copy link
Copy Markdown

@ShahriarAhnaf ShahriarAhnaf commented Jul 5, 2025

#1107 creating an example to recreate the crash. Copied from ErrorProne example. Using for test validation of the subpackage graceful handling in the case of a mismatch.

Fixes #1243

@ShahriarAhnaf
Copy link
Copy Markdown
Author

This is for #1243 subtask.

@ShahriarAhnaf ShahriarAhnaf marked this pull request as ready for review July 5, 2025 19:21
Copy link
Copy Markdown
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this!
Please add #1243 to the changelog.

To fix the misc failure, follow the steps from the error message:

+ git diff --exit-code docs/manual/contributors.tex
diff --git a/docs/manual/contributors.tex b/docs/manual/contributors.tex
index 8852dac7f..579eabdc2 100644
--- a/docs/manual/contributors.tex
+++ b/docs/manual/contributors.tex
@@ -1,6 +1,7 @@
 Abraham Lin,
 Adian Qian,
 Aditya Singh,
+Ahnaf Shahriar,
 Akash Srivastava,
 Alex Cook,
 Alex Liu,
+ set +x
docs/manual/contributors.tex is not up to date.
If the above suggestion is appropriate, run: make -C docs/manual contributors.tex
If the suggestion contains a username rather than a human name, then do all the following:
  * Update your git configuration by running:  git config --global user.name "YOURFULLNAME"
  * Add your name to your GitHub account profile at https://github.com/settings/profile
  * Make a pull request to add your GitHub ID to
    https://github.com/eisop-plume-lib/git-scripts/blob/master/git-authors.sed
    and remake contributors.tex after that pull request is merged.

@wmdietl wmdietl changed the title Annotation sub package crash example Mismatched checker-qual artifact example Sep 1, 2025
Copy link
Copy Markdown
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the extra test!

docs/examples/errorprone/.gradle/
docs/examples/errorprone/Out.txt
docs/examples/nullaway/.gradle/
docs/examples/Wrong-Checker-Qual/Out.txt
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docs/examples/Wrong-Checker-Qual/Out.txt
docs/examples/mismatched-checker-qual/Out.txt

$(MAKE) -C BazelExample clean
$(MAKE) -C nullaway clean
$(MAKE) -C jspecify clean
$(MAKE) -C mismatched-checker-qual clean No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$(MAKE) -C mismatched-checker-qual clean
$(MAKE) -C mismatched-checker-qual clean

'org.checkerframework.checker.nullness.NullnessChecker',
]
extraJavacArgs = ['-Aversion']
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}


.PHONY: all clean

ifeq ($(shell test $(JAVA_VER) -lt 17; echo $$?),0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test isn't using errorprone, so this can be simplified.

else
all:
- ../../../gradlew build > Out.txt 2>&1
# Check for crash due to mismatched Checker Qualifiers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO, here or somewhere else, that explains that we would want more graceful behavior.


ext {
versions = [
eisopVersion: '3.49.3-eisop1',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eisopVersion: '3.49.3-eisop1',
eisopVersion: '3.49.3-eisop1',
typetoolsVersion: '3.49.1',

Comment on lines +24 to +25
compileOnly "org.checkerframework:checker-qual:3.49.1"
testCompileOnly "org.checkerframework:checker-qual:3.49.1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compileOnly "org.checkerframework:checker-qual:3.49.1"
testCompileOnly "org.checkerframework:checker-qual:3.49.1"
compileOnly "org.checkerframework:checker-qual:${versions.typetoolsVersion}"
testCompileOnly "org.checkerframework:checker-qual:${versions.typetoolsVersion}"

apply plugin: 'org.checkerframework'

dependencies {
// Without the same checker qualifiers, Nullness Checker should gracefully issue warnings
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the beginning of the file, where it is currently not clear what the intended behavior is.


dependencies {
// Without the same checker qualifiers, Nullness Checker should gracefully issue warnings
// Use Typetools checker-qual (original) for qualifiers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Use Typetools checker-qual (original) for qualifiers
// Mismatch between `checker-qual` and `checker` artifacts.


public class Demo {
void demo(Set<Short> s, short i) {
s.remove(i - 1); // Error Prone error
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't use errorprone, so we can simplify this. Keep just a Nullness Checker example, for which we can test once the "graceful" behavior is implemented.

@wmdietl
Copy link
Copy Markdown
Member

wmdietl commented Mar 23, 2026

@thisisalexandercook Could you take over this PR (probably opening a PR from your own branch) and help get it merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write a test case that has an invalid combination of typetools checker-qual and eisop checker, illustrating the crash

2 participants