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

JointJavacJavaParserVisitor now handles switch expressions #4988

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c9f2248
Check switch expressions.
smillst Dec 8, 2021
106047c
Add expected errors.
smillst Dec 8, 2021
37608e0
Fix error.
smillst Dec 8, 2021
fc23027
Add FunctionSwitchExpressionScanner.
smillst Dec 9, 2021
10d97d2
Tweaks.
smillst Dec 9, 2021
ca0918d
Fix expected error location.
smillst Dec 9, 2021
aaf2b21
Reformat.
smillst Dec 9, 2021
7843188
Use the term "selector expression" from the Java 17 version of the JLS.
smillst Dec 9, 2021
af9c380
Use the Java 17 term selector expression.
smillst Dec 10, 2021
0af409c
Tmp
smillst Dec 10, 2021
b045bd0
Merge branch 'switch-selector' into switch-expressions-dataflow
smillst Dec 10, 2021
715ab33
Correct name.
smillst Dec 10, 2021
9e8c351
Merge branch 'switch-selector' into switch-expressions-dataflow
smillst Dec 10, 2021
917c0a1
Use field.
smillst Dec 10, 2021
94feba2
Make new method.
smillst Dec 10, 2021
36c5da7
Merge branch 'switch-selector' into switch-expressions-dataflow
smillst Dec 10, 2021
0fca774
Checkpoint.
smillst Dec 10, 2021
a91f369
Handle yield in SwitchExpressions.
smillst Dec 10, 2021
b07926c
Fix error.
smillst Dec 10, 2021
c3d6b37
Fix error.
smillst Dec 10, 2021
06897ed
Javadoc.
smillst Dec 10, 2021
44e29c5
Merge remote-tracking branch 'origin/master' into switch-expressions-…
smillst Dec 10, 2021
23b04ba
Add skip test.
smillst Dec 10, 2021
55a1c16
Javadoc.
smillst Dec 10, 2021
a98585e
Merge ../checker-framework-branch-master into switch-expressions-check
mernst Dec 10, 2021
224c085
More javadoc.
smillst Dec 10, 2021
320b4a5
Fix typo
mernst Dec 10, 2021
28614ba
Add more javadoc.
smillst Dec 10, 2021
e0ec4a1
Minor edits
mernst Dec 11, 2021
1943e54
Merge branch 'switch-expressions-check' of github.com:smillst/checker…
mernst Dec 11, 2021
cfe8d36
Merge ../checker-framework-fork-smillst-branch-switch-expressions-che…
mernst Dec 11, 2021
10fd9fd
Minor edits
mernst Dec 11, 2021
8e90ca3
Minor edits
mernst Dec 11, 2021
8dae16b
Remove skip require javadoc.
smillst Dec 13, 2021
452e390
Add comments.
smillst Dec 13, 2021
da4aa4a
Add comments.
smillst Dec 13, 2021
d460864
Code review.
smillst Dec 13, 2021
c8a55bc
Merge ../checker-framework-branch-master into switch-expressions-check
mernst Dec 13, 2021
fda126f
Correction.
smillst Dec 13, 2021
77db775
Don't fall through for switch rules.
smillst Dec 13, 2021
c574cb8
Add skip.
smillst Dec 13, 2021
df7ac4d
Add skip.
smillst Dec 13, 2021
0fe0631
Remove skip javadoc.
smillst Dec 13, 2021
60a345c
Put skip javadoc back.
smillst Dec 13, 2021
75b6d97
Merge remote-tracking branch 'origin/master' into switch-expressions-…
smillst Dec 15, 2021
9efc15b
Merge branch 'switch-expressions-check' into switch-expressions-dataflow
smillst Dec 15, 2021
a3f07ea
Add changelog entry.
smillst Dec 15, 2021
c2f0921
Merge branch 'switch-expressions-check' into switch-expressions-dataflow
smillst Dec 15, 2021
35ec20b
Add changelog.
smillst Dec 15, 2021
214addd
JointJavacJavaParserVisitor now handles switch expressions
smillst Dec 15, 2021
176a87d
Revert a change.
smillst Dec 15, 2021
a04acc7
Add Javadoc.
smillst Dec 15, 2021
7714124
Remove comment.
smillst Dec 16, 2021
ddda03f
Merge remote-tracking branch 'origin/master' into switch-expressions-…
smillst Dec 16, 2021
2a24de1
Fix comment.
smillst Dec 16, 2021
6fe065e
Merge branch 'switch-expressions-dataflow' into switch-statement-rule
smillst Dec 16, 2021
9b7932b
Merge remote-tracking branch 'origin/master' into switch-statement-rule
smillst Dec 16, 2021
2ba8d35
Add test case.
smillst Dec 16, 2021
c32115f
Merge remote-tracking branch 'origin/master' into switch-statement-rule
smillst Dec 16, 2021
30dccf2
Merge branch 'switch-statement-rule' into switch-expressions-jjjpv-3
smillst Dec 16, 2021
bec1333
Revert "Merge branch 'switch-statement-rule' into switch-expressions-…
smillst Dec 16, 2021
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
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import de.undercouch.gradle.tasks.download.Download

plugins {
// https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow (v5 requires Gradle 5)
id 'com.github.johnrengelman.shadow' version '7.1.1'
id 'com.github.johnrengelman.shadow' version '7.1.0'
// https://plugins.gradle.org/plugin/de.undercouch.download
id "de.undercouch.download" version "4.1.2"
id 'java'
Expand Down Expand Up @@ -690,11 +690,15 @@ subprojects {
// * Temporarily comment out "-Werror" elsewhere in this file
// * Repeatedly run `./gradlew clean compileJava` and fix all errors
// * Uncomment "-Werror"
ext.errorproneVersion = '2.10.0'
errorprone group: 'com.google.errorprone', name: 'error_prone_core', version: errorproneVersion
// * Don't edit framework/build.gradle to use the same version number
// (it is updated when the annotated version of Guava is updated).
errorprone group: 'com.google.errorprone', name: 'error_prone_core', version: '2.10.0'

// TODO: it's a bug that annotatedlib:guava requires the error_prone_annotations dependency.
annotatedGuava "com.google.errorprone:error_prone_annotations:${errorproneVersion}"
// Update the next two version numbers in tandem. Get the Error Prone version from the "compile
// dependencies" section of https://mvnrepository.com/artifact/com.google.guava/guava/30.1.1-jre .
// (It isn't at https://mvnrepository.com/artifact/org.checkerframework.annotatedlib/guava/30.1.1-jre, which is the bug.)
annotatedGuava 'com.google.errorprone:error_prone_annotations:2.5.1'
annotatedGuava ('org.checkerframework.annotatedlib:guava:30.1.1-jre') {
// So long as Guava only uses annotations from checker-qual, excluding it should not cause problems.
exclude group: 'org.checkerframework'
Expand Down
4 changes: 4 additions & 0 deletions checker/tests/nullness/java17/NullnessSwitchExpressions.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void method2() {
default -> throw new IllegalStateException("Invalid day: " + day);
};

// TODO: This is a false positive.
// :: error: (dereference.of.nullable)
o.toString();
}

Expand All @@ -49,6 +51,8 @@ void method3() {
String s = null;
if (day == Day.THURSDAY) {
s = "hello";
// TODO: This is a false positive.
// :: error: (dereference.of.nullable)
s.toString();
}
yield s;
Expand Down
27 changes: 0 additions & 27 deletions checker/tests/nullness/java17/SwitchExpressionInvariant.java

This file was deleted.

Loading