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

typetools/checker-framework 3.49.1 release #1153

Merged
merged 5 commits into from
Mar 17, 2025
Merged
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
18 changes: 9 additions & 9 deletions .azure/azure-pipelines-daily.yml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:

- job: canary_jobs
dependsOn:
- junit_jdk21
- nonjunit_jdk21
- inference_part1_jdk21
- inference_part2_jdk21
- typecheck_part1_jdk21
- typecheck_part2_jdk21
- junit_jdk[]canary_version
- nonjunit_jdk[]canary_version
- inference_part1_jdk[]canary_version
- inference_part2_jdk[]canary_version
- typecheck_part1_jdk[]canary_version
- typecheck_part2_jdk[]canary_version
pool:
vmImage: 'ubuntu-latest'
steps:
Expand All @@ -50,20 +50,20 @@ nonjunit_job(23)
# So use a timeout of 90 minutes, and hope that is enough.
inference_job(11)
inference_job(17)
inference_job_lts(21)
inference_job_split(21)
inference_job(23)

# Do not run misc_job daily, because it does diffs that assume it is running in
# a pull request.

typecheck_job(11)
typecheck_job(17)
typecheck_job_lts(21)
typecheck_job_split(21)
typecheck_job(23)

daikon_job(11)
daikon_job(17)
daikon_job_lts(21)
daikon_job_split(21)
daikon_job(23)

## I'm not sure why the guava_jdk11 job is failing (it's due to Error Prone).
Expand Down
22 changes: 11 additions & 11 deletions .azure/azure-pipelines.yml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:

- job: canary_jobs
dependsOn:
- junit_jdk21
- nonjunit_jdk21
- inference_part1_jdk21
- inference_part2_jdk21
- typecheck_part1_jdk21
- typecheck_part2_jdk21
- misc_jdk21
- misc_jdk23
- junit_jdk[]canary_version
- nonjunit_jdk[]canary_version
- inference_part1_jdk[]canary_version
- inference_part2_jdk[]canary_version
- typecheck_part1_jdk[]canary_version
- typecheck_part2_jdk[]canary_version
- misc_jdk[]canary_version
- misc_jdk[]latest_version
pool:
vmImage: 'ubuntu-latest'
steps:
Expand All @@ -43,17 +43,17 @@ nonjunit_job(21)
# takes much longer to complete than normal, and this Azure job times out.
# When there is a timeout, one cannot examine wpi or wpi-many logs.
# So use a timeout of 90 minutes, and hope that is enough.
inference_job_lts(21)
inference_job_split(21)

# Unlimited fetchDepth for misc_jobs, because of need to make contributors.tex
misc_job(11)
misc_job(17)
misc_job(21)
misc_job(23)

typecheck_job_lts(21)
typecheck_job_split(21)

daikon_job_lts(21)
daikon_job_split(21)

## I'm not sure why the guava_jdk11 job is failing (it's due to Error Prone).
guava_job(21)
Expand Down
43 changes: 22 additions & 21 deletions .azure/defs.m4
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
changequote
changequote(`[',`]')dnl
define([lts_version], [21])dnl
ifelse([The "dnl" m4 macro means "discard to end of line",])dnl
define([canary_version], [21])dnl
define([latest_version], [23])dnl
ifelse([each macro takes one argument, the JDK version])dnl
dnl
define([junit_job], [dnl
- job: junit_jdk$1
ifelse($1,lts_version,,[ dependsOn:
ifelse($1,canary_version,,[ dependsOn:
- canary_jobs
- junit_jdk21
- junit_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -22,9 +23,9 @@ ifelse($1,lts_version,,[ dependsOn:
dnl
define([nonjunit_job], [dnl
- job: nonjunit_jdk$1
ifelse($1,lts_version,,[ dependsOn:
ifelse($1,canary_version,,[ dependsOn:
- canary_jobs
- nonjunit_jdk21
- nonjunit_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -35,7 +36,7 @@ ifelse($1,lts_version,,[ dependsOn:
- bash: ./checker/bin-devel/test-cftests-nonjunit.sh
displayName: test-cftests-nonjunit.sh])dnl
dnl
define([inference_job_lts], [dnl
define([inference_job_split], [dnl
# Split into part1 and part2 only for the inference job that "canary_jobs" depends on.
- job: inference_part1_jdk$1
pool:
Expand All @@ -61,10 +62,10 @@ define([inference_job_lts], [dnl
dnl
define([inference_job], [dnl
- job: inference_jdk$1
ifelse($1,lts_version,,[ dependsOn:
ifelse($1,canary_version,,[ dependsOn:
- canary_jobs
- inference_part1_jdk21
- inference_part2_jdk21
- inference_part1_jdk[]canary_version
- inference_part2_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -79,9 +80,9 @@ ifelse($1,lts_version,,[ dependsOn:
dnl
define([misc_job], [dnl
- job: misc_jdk$1
ifelse($1,lts_version,,$1,latest_version,,[ dependsOn:
ifelse($1,canary_version,,$1,latest_version,,[ dependsOn:
- canary_jobs
- misc_jdk21
- misc_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -91,7 +92,7 @@ ifelse($1,lts_version,,$1,latest_version,,[ dependsOn:
- bash: ./checker/bin-devel/test-misc.sh
displayName: test-misc.sh])dnl
dnl
define([typecheck_job_lts], [dnl
define([typecheck_job_split], [dnl
- job: typecheck_part1_jdk$1
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -115,8 +116,8 @@ define([typecheck_job], [dnl
- job: typecheck_jdk$1
dependsOn:
- canary_jobs
- typecheck_part1_jdk21
- typecheck_part2_jdk21
- typecheck_part1_jdk[]canary_version
- typecheck_part2_jdk[]canary_version
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk$1-plus:latest
Expand All @@ -126,7 +127,7 @@ define([typecheck_job], [dnl
- bash: ./checker/bin-devel/test-typecheck.sh
displayName: test-typecheck.sh])dnl
dnl
define([daikon_job_lts], [dnl
define([daikon_job_split], [dnl
- job: daikon_part1_jdk$1
dependsOn:
- canary_jobs
Expand Down Expand Up @@ -156,8 +157,8 @@ define([daikon_job], [dnl
- job: daikon_jdk$1
dependsOn:
- canary_jobs
- daikon_part1_jdk21
- daikon_part2_jdk21
- daikon_part1_jdk[]canary_version
- daikon_part2_jdk[]canary_version
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk$1:latest
Expand All @@ -172,8 +173,8 @@ define([guava_job], [dnl
- job: guava_jdk$1
dependsOn:
- canary_jobs
ifelse($1,lts_version,,[dnl
- guava_jdk21
ifelse($1,canary_version,,[dnl
- guava_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -189,8 +190,8 @@ define([plume_lib_job], [dnl
- job: plume_lib_jdk$1
dependsOn:
- canary_jobs
ifelse($1,lts_version,,[dnl
- plume_lib_jdk21
ifelse($1,canary_version,,[dnl
- plume_lib_jdk[]canary_version
])dnl
pool:
vmImage: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ allprojects { currentProj ->
// * any new checkers have been added, or
// * backward-incompatible changes have been made to APIs or elsewhere.
// To make a snapshot release, version should end in "-SNAPSHOT", then: ./gradlew publish
version = '3.49.0'
version = '3.49.1'

tasks.withType(JavaCompile).configureEach {
options.fork = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,26 @@ private TransferResult<CFValue, CFStore> refineNonEmptyToPresentStreamResult(
}

/**
* Returns true if the receiver parameter of the method being invoked is explicitly annotated
* with @{@link NonEmpty}.
* Returns true if the receiver parameter of the first method being invoked is explicitly
* annotated with @{@link NonEmpty}.
*
* @param methodInvok a method invocation node
* @return true if the receiver parameter of the method being invoked is explicitly annotated
* with @{@link NonEmpty}
* @return true if the receiver parameter of the first method being invoked is explicitly
* annotated with @{@link NonEmpty}
*/
private boolean isReceiverParameterNonEmpty(MethodInvocationNode methodInvok) {
ExpressionTree receiverTree = TreeUtils.getReceiverTree(methodInvok.getTree());
if (receiverTree instanceof MethodInvocationTree) {
// TODO(https://github.com/typetools/checker-framework/issues/6848): this logic needs
// further refinement to eliminate a source of false positives in the Optional Checker.
// Also see the discussion in:
// https://github.com/typetools/checker-framework/pull/6685#discussion_r1788632663 for
// additional context.
while (receiverTree instanceof MethodInvocationTree) {
receiverTree = TreeUtils.getReceiverTree(receiverTree);
ExpressionTree receiverTree = methodInvok.getTree();
// TODO(https://github.com/typetools/checker-framework/issues/6848): this logic needs
// further refinement to eliminate a source of false positives in the Optional Checker.
// Also see the discussion in:
// https://github.com/typetools/checker-framework/pull/6685#discussion_r1788632663
// for additional context.
while (receiverTree instanceof MethodInvocationTree) {
ExpressionTree newReceiverTree = TreeUtils.getReceiverTree(receiverTree);
if (newReceiverTree == null) {
break;
} else {
receiverTree = newReceiverTree;
}
}

Expand Down
18 changes: 18 additions & 0 deletions checker/tests/optional/Issue6970.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.nio.file.Path;
import java.util.Locale;
import java.util.Set;

public class Issue6970 {

public static Path getPath(String moduleName) {
final String fileNamePattern = ".*[\\\\/]" + moduleName.toLowerCase(Locale.ROOT) + "\\..*";
return getPaths().stream()
.filter(path -> path.toString().matches(fileNamePattern))
.findFirst()
.orElse(null);
}

private static Set<Path> getPaths() {
throw new RuntimeException("");
}
}
Loading
Loading