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

Introducing improved Optional Checker #6901

Open
wants to merge 522 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
522 commits
Select commit Hold shift + click to select a range
592bbba
Move Aliasing Checker as a subchecker of the Optional Checker
jyoo980 Jun 5, 2024
2101dd7
Fix type
mernst Jun 5, 2024
3b5d95e
Correct methodinvocation transfer code
smillst Jun 5, 2024
507d3aa
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 5, 2024
3aff94e
Fix test that did not account for varargs calls
mernst Jun 6, 2024
afeda02
Remove diagnostic
mernst Jun 6, 2024
bf9f812
Javadoc
mernst Jun 6, 2024
66d2e41
Handle empty args
mernst Jun 6, 2024
334be86
Merge ../checker-framework-fork-smillst-branch-vararg-issue into yoo/…
mernst Jun 6, 2024
8b6ed16
Make Non-Empty test cases pass
jyoo980 Jun 6, 2024
2ac26c9
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jun 6, 2024
4621f38
Merge ../checker-framework-branch-master into yoo/standalone-nonempty…
mernst Jun 6, 2024
eaffe73
Tweak documentation
mernst Jun 6, 2024
1808286
Tweak documentation
mernst Jun 6, 2024
4c918a4
Merge branch 'yoo/standalone-nonempty-checker' of github.com:jyoo980/…
mernst Jun 6, 2024
8b64298
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 6, 2024
204b5d5
Satisfy Nullness Checker in CI
jyoo980 Jun 6, 2024
5d1cc35
Rename `fieldsFromTree()` to `fieldsFromClassTree()`
mernst Jun 6, 2024
28d969c
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 6, 2024
463600f
Simplifications
mernst Jun 6, 2024
65dac96
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 6, 2024
a96cf3e
Suppress false positive in test
jyoo980 Jun 6, 2024
d9f25d7
Merge branch 'yoo/standalone-nonempty-checker' into yoo/nonempty-opti…
jyoo980 Jun 6, 2024
b9434cf
Suppress false positive in test
jyoo980 Jun 6, 2024
99750ad
Merge branch 'yoo/standalone-nonempty-checker' into yoo/nonempty-opti…
jyoo980 Jun 6, 2024
eb50d1f
Merge branch 'master' into yoo/standalone-nonempty-checker
jyoo980 Jun 6, 2024
6313350
Update comment, kickoff CI
jyoo980 Jun 6, 2024
799ddf4
Merge branch 'yoo/standalone-nonempty-checker' into yoo/nonempty-opti…
jyoo980 Jun 6, 2024
bf88ade
Correction.
smillst Jun 7, 2024
b794b63
Add test case that was failing.
smillst Jun 7, 2024
54fc7a2
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 7, 2024
4e0eec9
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 7, 2024
422a20c
Merge ../checker-framework-fork-jyoo980-branch-yoo-standalone-nonempt…
mernst Jun 7, 2024
49be724
Avoid nested test directory structure
jyoo980 Jun 7, 2024
75b1776
Correct Javadoc
jyoo980 Jun 7, 2024
2790e5c
Merge remote-tracking branch 'typetools/master' into yoo/standalone-n…
jyoo980 Jun 9, 2024
3898747
Merge branch 'yoo/standalone-nonempty-checker' into yoo/nonempty-opti…
jyoo980 Jun 9, 2024
e972047
Improve naming
jyoo980 Jun 9, 2024
23582ec
Add rely--guarantee test for Optional Checker
jyoo980 Jun 9, 2024
2653a87
Improve message
mernst Jun 24, 2024
cdb5cc4
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jun 25, 2024
a7ee06f
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jun 26, 2024
707c793
Change "-AdisableOptionalChecker" to "-ArunAsOptionalChecker"
mernst Jun 26, 2024
4be9002
Documentation
mernst Jun 26, 2024
7adcbf6
Fix `super` call
mernst Jun 26, 2024
e31c5e2
Use methods that take a collection
mernst Jun 26, 2024
f7b4875
Tweak
mernst Jun 26, 2024
3f00236
Tweak
mernst Jun 26, 2024
f1285ac
Documentation
mernst Jun 26, 2024
164bf8e
Clarify that method trees are declarations
mernst Jun 26, 2024
b40432e
Documentation
mernst Jun 26, 2024
2803c1a
Fix variable use
mernst Jun 26, 2024
52da7d2
Undo efficiency
mernst Jun 26, 2024
5586258
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 26, 2024
6558f07
Use terminology "callers" and "callees"
mernst Jun 26, 2024
650f123
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 26, 2024
60a0da5
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 26, 2024
e936fd3
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jun 27, 2024
7923e92
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 27, 2024
fd6c40a
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jun 29, 2024
cfd5df6
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 29, 2024
9bf2c2f
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 29, 2024
1f49898
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 29, 2024
40e0dba
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jun 29, 2024
1e50657
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 2, 2024
18436a9
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 2, 2024
e1e01c3
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 2, 2024
1876cc2
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 2, 2024
fd1d59d
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 2, 2024
f52c321
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 4, 2024
73e2762
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 4, 2024
dbfc5f2
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
3be76a1
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
bc4312f
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
da35f9c
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
2f06c53
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 4, 2024
3e1df52
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
c797805
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
ac3ec3c
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
aa0c22b
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 4, 2024
aa02fc0
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 5, 2024
845c9fe
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 5, 2024
71b9a86
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 5, 2024
e704084
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 5, 2024
fbe8639
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 5, 2024
affdb91
Address review comments in `JavaExpression`
jyoo980 Jul 6, 2024
049d2b9
Address review comment for `CFAbstractTransfer`
jyoo980 Jul 6, 2024
c06a912
Use terminology "callers" and "callees"
jyoo980 Jul 6, 2024
27edf3d
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 6, 2024
edf1b53
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 6, 2024
6b95b3b
Address review comments for `OptionalVisitor`
jyoo980 Jul 6, 2024
0df969f
Update `@skip-test` comment in `OptionalRelyGuaranteeTest`
jyoo980 Jul 7, 2024
20e60ee
Change "-AdisableOptionalChecker" to "-ArunAsOptionalChecker"
jyoo980 Jul 7, 2024
118fefa
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' in…
jyoo980 Jul 7, 2024
78529a5
Use methods that take a collection
jyoo980 Jul 7, 2024
9114b21
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 7, 2024
b9cdbdc
Merge ../checker-framework-fork-mernst-branch-yoo-nonempty-optional-t…
mernst Jul 7, 2024
ab3b320
Clarify that method trees are declarations
jyoo980 Jul 7, 2024
ecf7170
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 8, 2024
771b267
Introduce boolean variable
mernst Jul 8, 2024
32d2fcd
Simplify variable name
mernst Jul 8, 2024
dddf1a8
Renamings
mernst Jul 8, 2024
1f20bec
Comments
mernst Jul 8, 2024
c6ce0d1
Fix Javadoc
mernst Jul 8, 2024
aa601ec
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 9, 2024
12b7a22
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 11, 2024
6c1e80f
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 12, 2024
e03d24a
Address review comment in `NonEmptyChecker.java`
jyoo980 Jul 14, 2024
615ebb9
Short-circuit callee check in methods for Non-Empty Checker in `Optio…
jyoo980 Jul 14, 2024
ec7ee6e
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 14, 2024
d9dbca2
Remove import statement
mernst Jul 15, 2024
c79a6bf
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 15, 2024
6655d09
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 16, 2024
37b8631
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 18, 2024
4ec8b51
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 19, 2024
5fa3ea1
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 19, 2024
4bf42ef
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Jul 19, 2024
d2045b3
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 20, 2024
c02ad4a
Add a TODO to re-name the `RevisedOptionalChecker`
jyoo980 Jul 21, 2024
bf48327
Refactor `OptionalTransfer.getReceiverDeclaration`
jyoo980 Jul 21, 2024
1392abf
Update documentation for where a method call receiver is being looked up
jyoo980 Jul 21, 2024
f6829f3
Make compile.
smillst Jul 23, 2024
ee92c77
Fix Could not instantiate bug.
smillst Jul 23, 2024
5d63542
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 26, 2024
d13d050
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Jul 31, 2024
12e119d
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 2, 2024
0f468a0
Renaming `OptionalTransfer#getReceiverDeclaration` to `getLeftmostRec…
jyoo980 Aug 4, 2024
8870ab9
Merge branch 'master' into yoo/nonempty-optional-transfer-nonempty-in…
jyoo980 Aug 4, 2024
0864ddc
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 5, 2024
6acef19
Code review changes
mernst Aug 5, 2024
847993e
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Aug 5, 2024
6403155
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 6, 2024
52b79b5
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 7, 2024
b7466db
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 10, 2024
6b3763f
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 11, 2024
8ffa05b
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 15, 2024
12e3a1e
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 15, 2024
bc8f3a4
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 19, 2024
61e2ba1
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 20, 2024
4d224b2
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 20, 2024
cf07601
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Aug 20, 2024
3d22c3f
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Aug 21, 2024
83220f4
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 1, 2024
eeb7c5d
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 2, 2024
97b7ba0
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 2, 2024
78f953a
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 3, 2024
c1a25f3
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 4, 2024
80c8b1c
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 4, 2024
2254dc9
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 5, 2024
8a2736f
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 5, 2024
745398b
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 9, 2024
34aaf06
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 9, 2024
933adea
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 9, 2024
28eb6f1
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 9, 2024
5f4bcc3
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 9, 2024
b1757fe
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Sep 9, 2024
28fa63d
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 11, 2024
b1cd688
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 13, 2024
0a97b27
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 13, 2024
4c5dc52
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 16, 2024
7a22e43
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 17, 2024
9d2539a
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 17, 2024
9e8f230
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 18, 2024
2834594
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 19, 2024
bd930aa
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 22, 2024
800d7cd
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 24, 2024
f79489a
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 24, 2024
19c8a2c
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 26, 2024
5b028dd
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 26, 2024
a2597a5
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Sep 29, 2024
b35bfa2
Merge remote-tracking branch 'typetools/master' into yoo/nonempty-opt…
jyoo980 Oct 1, 2024
bfceeb9
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Oct 2, 2024
0b59d45
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 2, 2024
3ad3815
Fixing compilation issue
jyoo980 Oct 2, 2024
5e2baa7
Merge branch 'master' into yoo/nonempty-optional-transfer-nonempty-in…
jyoo980 Oct 2, 2024
4a4f1a9
Avoiding crash when Non-Empty Checker is run
jyoo980 Oct 2, 2024
a20fcd7
Adding comment to `NonEmptyChecker#RUN_AS_OPTIONAL_CHECKER_KEY`
jyoo980 Oct 3, 2024
1af5e66
Merge branch 'typetools:master' into yoo/nonempty-optional-transfer-n…
jyoo980 Oct 3, 2024
fb42285
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Oct 3, 2024
0af1fa4
Avoiding re-computation of the `-ArunAsOptionalChecker` value
jyoo980 Oct 3, 2024
db2fc1f
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 4, 2024
1d839d8
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 4, 2024
94d873a
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 4, 2024
296646d
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 5, 2024
bb8aaa8
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 5, 2024
aca6845
Code review tweaks
mernst Oct 5, 2024
75edf7d
Code review tweaks
mernst Oct 5, 2024
600d90f
Addressing comments in `NonEmptyChecker.java`
jyoo980 Oct 5, 2024
f0b4bff
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 7, 2024
27ce48d
Merge branch 'master' into yoo/nonempty-optional-transfer-nonempty-in…
jyoo980 Oct 7, 2024
f750dfb
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Oct 7, 2024
650f334
Fixing compilation issue
jyoo980 Oct 7, 2024
f6d6316
Merge branch 'yoo/nonempty-optional-transfer-nonempty-information' of…
mernst Oct 7, 2024
5f5099b
Addressing some comments in `OptionalVisitor.java`
jyoo980 Oct 7, 2024
37de026
Renaming `JavaExpression#getReceiverDeclarationInClass` to `JavaExpre…
jyoo980 Oct 7, 2024
ffe250d
Merge branch 'master' into yoo/nonempty-optional-transfer-nonempty-in…
jyoo980 Oct 7, 2024
0daa5e5
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 8, 2024
3127f48
Add todo note for work to eliminate false positive
jyoo980 Oct 8, 2024
83d1b6c
Merge ../checker-framework-branch-master into yoo/nonempty-optional-t…
mernst Oct 9, 2024
5c915d4
Merge remote-tracking branch 'typetools/master' into yoo/nonempty-opt…
jyoo980 Oct 9, 2024
60295ad
Merge remote-tracking branch 'typetools/master' into yoo/optional-che…
jyoo980 Nov 13, 2024
e164966
Re-start refactoring
jyoo980 Nov 13, 2024
3d4c756
Recover post-refactoring changes from other branch
mernst Nov 14, 2024
8290828
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 17, 2024
4edeeee
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 20, 2024
21dc00e
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 20, 2024
2e32f9b
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 20, 2024
827392b
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 20, 2024
3fd57c8
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 21, 2024
4e3b335
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 22, 2024
4406957
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 22, 2024
f242bc8
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Nov 22, 2024
eb57863
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
mernst Nov 22, 2024
3fd5455
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
mernst Nov 22, 2024
bc3d3f9
Fixing compilation error
jyoo980 Nov 22, 2024
42c38b5
Ensuring `OptionalImplChecker` respects `optional` prefix
jyoo980 Nov 22, 2024
8242e12
Enabling rely-guarantee test case for `Optional Checker`
jyoo980 Nov 22, 2024
7398b1b
Merge remote-tracking branch 'typetools/master' into yoo/optional-che…
jyoo980 Nov 23, 2024
b974dd8
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
mernst Nov 23, 2024
27313f7
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
mernst Nov 23, 2024
2bb39d2
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 23, 2024
ec084f9
Making the Non-Empty test suite pass
jyoo980 Nov 24, 2024
b15e916
Updating Non-Empty Checker manual entry with `-AcheckAllDefs`
jyoo980 Nov 24, 2024
275d99a
Work around crash
mernst Nov 25, 2024
8270335
Removing outdated documentation for the Optional Checker
jyoo980 Nov 25, 2024
5248e71
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Nov 25, 2024
9b721c0
Undo a change
mernst Nov 26, 2024
e021997
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
mernst Nov 26, 2024
7c738f1
Updating documentation, removing unnecessary override
jyoo980 Nov 27, 2024
afa8daa
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Nov 27, 2024
a0909b7
Removing unnecessary `-AcheckAllDefs` flag in Non-Empty Checker
jyoo980 Nov 27, 2024
2acbc8a
Adding documentation for parent checker check in `NonEmptyChecker#sho…
jyoo980 Nov 27, 2024
dee9c8c
Storing method name strings, not entire method trees
jyoo980 Nov 27, 2024
d263ad1
Addressing additional comments
jyoo980 Nov 28, 2024
de5ed5c
Abstracting out message key for Rule 3
jyoo980 Nov 28, 2024
3160d2c
Annotate parameter with `@CompilerMessageKey`
jyoo980 Nov 28, 2024
52acc85
Merge ../checker-framework-branch-master into yoo/optional-checker-la…
mernst Dec 2, 2024
5219851
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Dec 2, 2024
738452b
Adding additional check for "prefer.map.and.orelse"
jyoo980 Dec 2, 2024
0c130e0
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Dec 2, 2024
9fd4bd9
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Dec 2, 2024
769d3c2
Fixing Javadoc
jyoo980 Dec 2, 2024
6b7213a
Merge branch 'yoo/optional-checker-latest' of github.com:jyoo980/chec…
jyoo980 Dec 2, 2024
73ebbbe
Passing `framework:checkOptional` task
jyoo980 Dec 3, 2024
d00de27
Addressing PR comment
jyoo980 Dec 3, 2024
401588e
Adding comment to `OptionalImplTypeValidator` constructor
jyoo980 Dec 3, 2024
add5c7a
Merge branch 'master' into yoo/optional-checker-latest
jyoo980 Dec 3, 2024
f57b895
Updating Javadoc
jyoo980 Dec 3, 2024
d6e84e0
Whitespace fixes
mernst Dec 3, 2024
e6ed51e
Typo fix
mernst Dec 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import org.checkerframework.framework.qual.SubtypeOf;

/**
* The {@link java.util.Collection Collection}, {@link java.util.Iterator Iterator}, {@link
* java.lang.Iterable Iterable}, or {@link java.util.Map Map} is definitely non-empty.
* The {@link java.util.Collection Collection}, {@link java.util.Iterator Iterator}, {@link Iterable
* Iterable}, or {@link java.util.Map Map}, or {@link java.util.stream.Stream Stream} is definitely
* non-empty.
*
* @checker_framework.manual #non-empty-checker Non-Empty Checker
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

/**
* The {@link java.util.Collection Collection}, {@link java.util.Iterator Iterator}, {@link
* java.lang.Iterable Iterable}, or {@link java.util.Map Map} may or may not be empty.
* java.lang.Iterable Iterable}, {@link java.util.Map Map}, or {@link java.util.stream.Stream
* Stream} may or may not be empty.
*
* @checker_framework.manual #non-empty-checker Non-Empty Checker
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,67 @@
package org.checkerframework.checker.nonempty;

import com.sun.source.tree.MethodTree;
import java.util.Set;
import org.checkerframework.checker.optional.OptionalChecker;
import org.checkerframework.checker.optional.OptionalImplChecker;
import org.checkerframework.checker.optional.OptionalImplVisitor;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.source.SourceChecker;
import org.checkerframework.framework.source.SupportedOptions;

/**
* A type-checker that prevents {@link java.util.NoSuchElementException} in the use of container
* classes.
*
* <p>Runs the {@link org.checkerframework.checker.optional.OptionalImplChecker} (as a subchecker),
* using explicitly-written (i.e., programmer-written) annotations from the Non-Empty type system to
* refine the Optional analysis. This improves analysis of operations on containers (e.g., Streams,
* Collections) that result in values of type Optional.
*
* @checker_framework.manual #non-empty-checker Non-Empty Checker
*/
@SupportedOptions("checkAllDefs")
public class NonEmptyChecker extends BaseTypeChecker {

/** Creates a NonEmptyChecker. */
public NonEmptyChecker() {
super();
}

@Override
protected Set<Class<? extends SourceChecker>> getImmediateSubcheckerClasses() {
Set<Class<? extends SourceChecker>> checkers = super.getImmediateSubcheckerClasses();
// Ideally, the OptionalImplChecker should only be added as a subchecker if this Non-Empty
// Checker is being run in aggregate with the top-level Optional Checker
// However, it appears that this information (via SourceChecker#getParentChecker()) is not
// available at the time when this method is called.
checkers.add(OptionalImplChecker.class);
return checkers;
}

@Override
public boolean shouldSkipDefs(MethodTree tree) {
if (!(this.getParentChecker() instanceof OptionalChecker)) {
// If the parent checker is null, or if it is NOT an instance of the top-level Optional
// Checker,
// this indicates that this Non-Empty Checker is being run independently. In this case, check
// all definitions, not just the ones related to the Optional Checker's guarantee.
return false;
}
return !getMethodsToVerify().contains(tree.getName().toString());
}

/**
* Obtains the methods to verify w.r.t. the Non-Empty type system from the Optional Checker.
*
* @return the set of names of the methods to be verified by the Non-Empty Checker
* @throws AssertionError if invoked when the {@link OptionalImplChecker} is not set as a
* subchecker of this checker
*/
private Set<String> getMethodsToVerify() {
OptionalImplChecker optionalCheckerImpl = getSubchecker(OptionalImplChecker.class);
assert optionalCheckerImpl != null;
OptionalImplVisitor optionalVisitor = (OptionalImplVisitor) optionalCheckerImpl.getVisitor();
return optionalVisitor.getNamesOfMethodsToVerifyWithNonEmptyChecker();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ private boolean isAccessOfNonEmptyCollection(
TransferInput<CFValue, CFStore> in, MethodInvocationNode methodAccessNode) {
Node receiver = methodAccessNode.getTarget().getReceiver();

return aTypeFactory.containsSameByClass(
in.getValueOfSubNode(receiver).getAnnotations(), NonEmpty.class);
CFValue receiverValue = in.getValueOfSubNode(receiver);
return receiverValue != null
&& aTypeFactory.containsSameByClass(receiverValue.getAnnotations(), NonEmpty.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
package org.checkerframework.checker.optional;

import java.util.Optional;
import java.util.Set;
import org.checkerframework.common.aliasing.AliasingChecker;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.qual.RelevantJavaTypes;
import org.checkerframework.framework.qual.StubFiles;
import java.util.ArrayList;
import java.util.Collection;
import org.checkerframework.checker.nonempty.NonEmptyChecker;
import org.checkerframework.framework.source.AggregateChecker;
import org.checkerframework.framework.source.SourceChecker;
import org.checkerframework.framework.source.SupportedOptions;

/**
* A type-checker that prevents misuse of the {@link java.util.Optional} class.
* A type-checker that prevents {@link java.util.NoSuchElementException} in the use of the {@link
* java.util.Optional} class.
*
* @checker_framework.manual #optional-checker Optional Checker
*/
// TODO: For a call to `@Optional#ofNullable`, if the argument has type
// @NonNull, make the return type have type @Present.
@RelevantJavaTypes(Optional.class)
@StubFiles({"javaparser.astub"})
@SupportedOptions("optionalMapAssumeNonNull")
public class OptionalChecker extends BaseTypeChecker {
/** Create an OptionalChecker. */
public class OptionalChecker extends AggregateChecker {

/** Creates a new {@link org.checkerframework.checker.optional.OptionalChecker} */
public OptionalChecker() {}

@Override
protected Set<Class<? extends SourceChecker>> getImmediateSubcheckerClasses() {
Set<Class<? extends SourceChecker>> subcheckers = super.getImmediateSubcheckerClasses();
subcheckers.add(AliasingChecker.class);
return subcheckers;
protected Collection<Class<? extends SourceChecker>> getSupportedCheckers() {
Collection<Class<? extends SourceChecker>> checkers = new ArrayList<>(2);
checkers.add(NonEmptyChecker.class);
return checkers;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.checkerframework.javacutil.AnnotationBuilder;
import org.checkerframework.javacutil.TreeUtils;

/** OptionalAnnotatedTypeFactory for the Optional Checker. */
public class OptionalAnnotatedTypeFactory extends BaseAnnotatedTypeFactory {
/** OptionalImplAnnotatedTypeFactory for the OptionalImplChecker. */
public class OptionalImplAnnotatedTypeFactory extends BaseAnnotatedTypeFactory {

/** The element for java.util.Optional.map(). */
private final ExecutableElement optionalMap;
Expand All @@ -31,11 +31,12 @@ public class OptionalAnnotatedTypeFactory extends BaseAnnotatedTypeFactory {
protected final AnnotationMirror PRESENT = AnnotationBuilder.fromClass(elements, Present.class);

/**
* Creates an OptionalAnnotatedTypeFactory.
* Creates an OptionalImplAnnotatedTypeFactory.
*
* @param checker the Optional Checker associated with this type factory
* @param checker the {@link org.checkerframework.checker.optional.OptionalImplChecker} associated
* with this type factory
*/
public OptionalAnnotatedTypeFactory(BaseTypeChecker checker) {
public OptionalImplAnnotatedTypeFactory(BaseTypeChecker checker) {
super(checker);
postInit();
optionalMap = TreeUtils.getMethodOrNull("java.util.Optional", "map", 1, getProcessingEnv());
Expand Down Expand Up @@ -128,6 +129,6 @@ private boolean containsNullable(Collection<? extends AnnotationMirror> annos) {
@Override
public CFTransfer createFlowTransferFunction(
CFAbstractAnalysis<CFValue, CFStore, CFTransfer> analysis) {
return new OptionalTransfer(analysis);
return new OptionalImplTransfer(analysis);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.checkerframework.checker.optional;

import java.util.NavigableSet;
import java.util.Optional;
import java.util.Set;
import org.checkerframework.common.aliasing.AliasingChecker;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.qual.RelevantJavaTypes;
import org.checkerframework.framework.qual.StubFiles;
import org.checkerframework.framework.source.SourceChecker;
import org.checkerframework.framework.source.SupportedOptions;

/**
* The implementation of a type-checker that prevents misuse of the {@link java.util.Optional}
* class.
*
* @checker_framework.manual #optional-checker Optional Checker
*/
// TODO: For a call to `@Optional#ofNullable`, if the argument has type
// @NonNull, make the return type have type @Present.
@RelevantJavaTypes(Optional.class)
@StubFiles({"javaparser.astub"})
@SupportedOptions("optionalMapAssumeNonNull")
public class OptionalImplChecker extends BaseTypeChecker {
/** Create an OptionalImplChecker. */
public OptionalImplChecker() {}

@Override
protected Set<Class<? extends SourceChecker>> getImmediateSubcheckerClasses() {
Set<Class<? extends SourceChecker>> subcheckers = super.getImmediateSubcheckerClasses();
subcheckers.add(AliasingChecker.class);
return subcheckers;
}

/**
* Use the "optional", rather than the "optionalimpl" prefix as the argument to a {@link
* SuppressWarnings} annotation,
*
* @return the set of suppress warnings prefixes that are respected by this checker
*/
@Override
public NavigableSet<String> getSuppressWarningsPrefixes() {
NavigableSet<String> prefixes = super.getSuppressWarningsPrefixes();
prefixes.add("optional");
return prefixes;
}
}
Loading