forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 29
Mismatched checker-qual artifact example
#1318
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
Open
ShahriarAhnaf
wants to merge
10
commits into
eisop:master
Choose a base branch
from
ShahriarAhnaf:annotation_subpackage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
021f7bd
#1107: Adding example for wrong checker qualifier crash.
ShahriarAhnaf 325cb6a
Cleaning up .gitignore for easier example addition with less overhead…
ShahriarAhnaf 5c3da59
Merge branch 'master' into annotation_subpackage
ShahriarAhnaf 0cb6d74
Update .gitignore for organization
ShahriarAhnaf 863cc48
applying changes to example name and attemping version mismatch for q…
ShahriarAhnaf a2c359c
update contributers for pull request checks
ShahriarAhnaf 42024f8
using typetools qualifiers to cause the subpackage missing crash
ShahriarAhnaf 45b117f
Merge branch 'master' into annotation_subpackage
ShahriarAhnaf 3a311f5
Merge branch 'master' into annotation_subpackage
wmdietl 444f157
Merge branch 'master' into annotation_subpackage
wmdietl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| JAVA_VER := $(shell java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1 | sed 's/-ea//' | sed 's/-beta//') | ||
|
|
||
| .PHONY: all clean | ||
|
|
||
| ifeq ($(shell test $(JAVA_VER) -lt 17; echo $$?),0) | ||
| all: | ||
| @echo "Skipping test because errorprone does not work under Java ${JAVA_VER}" | ||
| else | ||
| all: | ||
| - ../../../gradlew build > Out.txt 2>&1 | ||
| grep -qF "Exception: org.checkerframework.javacutil.BugInCF:" Out.txt | ||
| endif | ||
|
|
||
| clean: | ||
| - ../../../gradlew clean | ||
| rm -f Out.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // /////////////////////////////////////////////////////////////////////////// | ||
| // Checker Framework pluggable type-checking and Error Prone example | ||
|
ShahriarAhnaf marked this conversation as resolved.
Outdated
|
||
| // | ||
|
|
||
| plugins { | ||
| id 'java' | ||
| id 'net.ltgt.errorprone' version '4.2.0' | ||
| // Checker Framework pluggable type-checking | ||
| id 'org.checkerframework' version '0.6.53' apply false | ||
| } | ||
|
|
||
| ext { | ||
| versions = [ | ||
| eisopVersion: '3.49.3-eisop1', | ||
| ] | ||
| } | ||
|
|
||
| apply plugin: 'org.checkerframework' | ||
| if (false) { | ||
|
ShahriarAhnaf marked this conversation as resolved.
Outdated
|
||
| def cfHome = "${projectDir}/../../.." | ||
| dependencies { | ||
| compileOnly files(cfHome + '/checker/dist/checker-qual.jar') | ||
| testCompileOnly files(cfHome + '/checker/dist/checker-qual.jar') | ||
| checkerFramework files(cfHome + '/checker/dist/checker.jar') | ||
| } | ||
| } else { | ||
| dependencies { | ||
| // Without the proper checker qualifiers, Nullness Checker should gracefully issue warnings | ||
|
ShahriarAhnaf marked this conversation as resolved.
Outdated
|
||
| // compileOnly "io.github.eisop:checker-qual:${versions.eisopVersion}" | ||
| // testCompileOnly "io.github.eisop:checker-qual:${versions.eisopVersion}" | ||
| checkerFramework "io.github.eisop:checker-qual:${versions.eisopVersion}" | ||
| checkerFramework "io.github.eisop:checker:${versions.eisopVersion}" | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| if (JavaVersion.current() >= JavaVersion.VERSION_17) { | ||
| errorprone 'com.google.errorprone:error_prone_core:2.38.0' | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| // mavenLocal() // Use local Maven repository first for testing | ||
| mavenCentral() | ||
| } | ||
|
|
||
| checkerFramework { | ||
| checkers = [ | ||
| 'org.checkerframework.checker.nullness.NullnessChecker', | ||
| ] | ||
| extraJavacArgs = ['-Aversion'] | ||
| } | ||
|
|
||
| compileJava { | ||
| options.errorprone.enabled = (JavaVersion.current() >= JavaVersion.VERSION_17) | ||
| // A checker will only run if Error Prone does not issue any warnings. So | ||
| // convert the expected error to a warning to test that both Error Prone | ||
| // and the Nullness Checker run. | ||
| options.errorprone.warn('CollectionIncompatibleType') | ||
| } | ||
Empty file.
10 changes: 10 additions & 0 deletions
10
docs/examples/Wrong-Checker-Qual/src/main/java/com/example/Demo.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.example; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| public class Demo { | ||
| void demo(Set<Short> s, short i) { | ||
| s.remove(i - 1); // Error Prone error | ||
| s.add(null); // Nullness Checker error | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.