From 4ba7aa40abbb220113b2f37879fae104b04d2262 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 16 Mar 2025 22:38:19 -0400 Subject: [PATCH 1/5] typetools/checker-framework 3.49.1 release (#1152) Co-authored-by: Suzanne Millstein Co-authored-by: Michael Ernst Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .azure/azure-pipelines-daily.yml.m4 | 18 ++-- .azure/azure-pipelines.yml.m4 | 22 ++--- .azure/defs.m4 | 43 ++++---- build.gradle | 4 +- .../optional/OptionalImplTransfer.java | 30 +++--- checker/tests/optional/Issue6970.java | 18 ++++ .../signature/SignatureTypeFactoryTest.java | 97 +++++++++++++++++++ docs/CHANGELOG.md | 9 ++ docs/manual/faq.tex | 4 +- 9 files changed, 187 insertions(+), 58 deletions(-) create mode 100644 checker/tests/optional/Issue6970.java diff --git a/.azure/azure-pipelines-daily.yml.m4 b/.azure/azure-pipelines-daily.yml.m4 index 028bc0788383..46c19e2eefb1 100644 --- a/.azure/azure-pipelines-daily.yml.m4 +++ b/.azure/azure-pipelines-daily.yml.m4 @@ -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: @@ -50,7 +50,7 @@ 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 @@ -58,12 +58,12 @@ inference_job(23) 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). diff --git a/.azure/azure-pipelines.yml.m4 b/.azure/azure-pipelines.yml.m4 index bde72748de82..7c312fc7c68d 100644 --- a/.azure/azure-pipelines.yml.m4 +++ b/.azure/azure-pipelines.yml.m4 @@ -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: @@ -43,7 +43,7 @@ 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) @@ -51,9 +51,9 @@ 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) diff --git a/.azure/defs.m4 b/.azure/defs.m4 index 0bf7bfc628dd..472dbf9d0438 100644 --- a/.azure/defs.m4 +++ b/.azure/defs.m4 @@ -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' @@ -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' @@ -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: @@ -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' @@ -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' @@ -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' @@ -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 @@ -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 @@ -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 @@ -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' @@ -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' diff --git a/build.gradle b/build.gradle index f17b5c330dab..d27b37c56dc1 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { plugins { // https://plugins.gradle.org/plugin/com.gradleup.shadow - id 'com.gradleup.shadow' version '8.3.1' + id 'com.gradleup.shadow' version '8.3.6' // https://plugins.gradle.org/plugin/de.undercouch.download id 'de.undercouch.download' version '5.6.0' id 'java' @@ -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 diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java index 7099656989ff..1966dae4af9f 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java @@ -217,23 +217,27 @@ private TransferResult 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; } } diff --git a/checker/tests/optional/Issue6970.java b/checker/tests/optional/Issue6970.java new file mode 100644 index 000000000000..25435b3028e7 --- /dev/null +++ b/checker/tests/optional/Issue6970.java @@ -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 getPaths() { + throw new RuntimeException(""); + } +} diff --git a/checker/tests/signature/SignatureTypeFactoryTest.java b/checker/tests/signature/SignatureTypeFactoryTest.java index 3b4a18e1fc93..a54ceb58782b 100644 --- a/checker/tests/signature/SignatureTypeFactoryTest.java +++ b/checker/tests/signature/SignatureTypeFactoryTest.java @@ -103,6 +103,7 @@ void m() { @ClassGetSimpleName String sn; @FqBinaryName String fbn; @BinaryName String bn; + @Identifier String i; // not public, so a user can't write it. // @SignatureBottom String sb; @@ -115,6 +116,7 @@ void m() { sn = s1; bn = s1; fbn = s1; + i = s1; us = s2; fqn = s2; @@ -127,6 +129,8 @@ void m() { sn = s2; bn = s2; fbn = s2; + // :: error: (assignment) + i = s2; us = s3; fqn = s3; @@ -139,6 +143,8 @@ void m() { sn = s3; bn = s3; fbn = s3; + // :: error: (assignment) + i = s3; us = s4; fqn = s4; @@ -148,6 +154,7 @@ void m() { sn = s4; bn = s4; fbn = s4; + i = s4; us = s5; // :: error: (assignment.type.incompatible) @@ -162,6 +169,8 @@ void m() { bn = s5; // :: error: (assignment.type.incompatible) fbn = s5; + // :: error: (assignment) + i = s5; us = s6; // :: error: (assignment.type.incompatible) @@ -177,6 +186,8 @@ void m() { bn = s6; // :: error: (assignment.type.incompatible) fbn = s6; + // :: error: (assignment) + i = s6; us = s7; // :: error: (assignment.type.incompatible) @@ -192,6 +203,8 @@ void m() { bn = s7; // :: error: (assignment.type.incompatible) fbn = s7; + // :: error: (assignment) + i = s7; us = s8; // :: error: (assignment.type.incompatible) @@ -208,6 +221,8 @@ void m() { bn = s8; // :: error: (assignment.type.incompatible) fbn = s8; + // :: error: (assignment) + i = s8; us = s9; fqn = s9; @@ -220,6 +235,8 @@ void m() { sn = s9; bn = s9; fbn = s9; + // :: error: (assignment) + i = s9; us = s10; fqn = s10; @@ -230,6 +247,7 @@ void m() { sn = s10; bn = s10; fbn = s10; + i = s10; us = s11; fqn = s11; @@ -239,6 +257,7 @@ void m() { sn = s11; bn = s11; fbn = s11; + i = s11; us = s12; fqn = s12; @@ -253,6 +272,8 @@ void m() { // :: error: (assignment.type.incompatible) bn = s12; fbn = s12; + // :: error: (assignment) + i = s12; us = s13; fqn = s13; @@ -267,6 +288,8 @@ void m() { // :: error: (assignment.type.incompatible) bn = s13; fbn = s13; + // :: error: (assignment) + i = s13; us = s14; // :: error: (assignment.type.incompatible) @@ -282,6 +305,8 @@ void m() { bn = s14; // :: error: (assignment.type.incompatible) fbn = s14; + // :: error: (assignment) + i = s14; us = s15; // :: error: (assignment.type.incompatible) @@ -297,6 +322,8 @@ void m() { bn = s15; // :: error: (assignment.type.incompatible) fbn = s15; + // :: error: (assignment) + i = s15; us = s16; // :: error: (assignment.type.incompatible) @@ -312,6 +339,8 @@ void m() { bn = s16; // :: error: (assignment.type.incompatible) fbn = s16; + // :: error: (assignment) + i = s16; us = s17; // :: error: (assignment.type.incompatible) @@ -327,6 +356,8 @@ void m() { bn = s17; // :: error: (assignment.type.incompatible) fbn = s17; + // :: error: (assignment) + i = s17; us = s18; // :: error: (assignment.type.incompatible) @@ -343,6 +374,8 @@ void m() { bn = s18; // :: error: (assignment.type.incompatible) fbn = s18; + // :: error: (assignment) + i = s18; us = s19; // :: error: (assignment.type.incompatible) @@ -359,6 +392,8 @@ void m() { bn = s19; // :: error: (assignment.type.incompatible) fbn = s19; + // :: error: (assignment) + i = s19; us = s20; fqn = s20; @@ -371,6 +406,8 @@ void m() { // :: error: (assignment.type.incompatible) bn = s20; fbn = s20; + // :: error: (assignment) + i = s20; us = s21; // :: error: (assignment.type.incompatible) @@ -387,6 +424,8 @@ void m() { bn = s21; // :: error: (assignment.type.incompatible) fbn = s21; + // :: error: (assignment) + i = s21; us = s22; // :: error: (assignment.type.incompatible) @@ -403,6 +442,8 @@ void m() { bn = s22; // :: error: (assignment.type.incompatible) fbn = s22; + // :: error: (assignment) + i = s22; // Examples from the manual start here @@ -417,6 +458,8 @@ void m() { // :: error: (assignment.type.incompatible) bn = t13; fbn = t13; + // :: error: (assignment) + i = t13; us = t14; fqn = t14; @@ -438,6 +481,7 @@ void m() { sn = t1; bn = t1; fbn = t1; + i = t1; us = t12; // :: error: (assignment.type.incompatible) @@ -452,6 +496,8 @@ void m() { bn = t12; // :: error: (assignment.type.incompatible) fbn = t12; + // :: error: (assignment) + i = t12; us = t5; fqn = t5; @@ -462,6 +508,7 @@ void m() { sn = t5; bn = t5; fbn = t5; + i = t5; us = t2; // :: error: (assignment.type.incompatible) @@ -477,6 +524,8 @@ void m() { bn = t2; // :: error: (assignment.type.incompatible) fbn = t2; + // :: error: (assignment) + i = t2; us = t6; fqn = t6; @@ -490,6 +539,8 @@ void m() { // :: error: (assignment.type.incompatible) bn = t6; fbn = t6; + // :: error: (assignment) + i = t6; us = t7; // :: error: (assignment.type.incompatible) @@ -504,6 +555,8 @@ void m() { bn = t7; // :: error: (assignment.type.incompatible) fbn = t7; + // :: error: (assignment) + i = t7; us = t29; // :: error: (assignment.type.incompatible) @@ -519,6 +572,8 @@ void m() { bn = t29; // :: error: (assignment.type.incompatible) fbn = t29; + // :: error: (assignment) + i = t29; us = t33; // :: error: (assignment.type.incompatible) @@ -534,6 +589,8 @@ void m() { bn = t33; // :: error: (assignment.type.incompatible) fbn = t33; + // :: error: (assignment) + i = t33; us = t15; fqn = t15; @@ -546,6 +603,8 @@ void m() { sn = t15; bn = t15; fbn = t15; + // :: error: (assignment) + i = t15; us = t16; fqn = t16; @@ -574,6 +633,8 @@ void m() { bn = t22; // :: error: (assignment.type.incompatible) fbn = t22; + // :: error: (assignment) + i = t22; us = t23; // :: error: (assignment.type.incompatible) @@ -590,6 +651,8 @@ void m() { bn = t23; // :: error: (assignment.type.incompatible) fbn = t23; + // :: error: (assignment) + i = t23; us = t3; // :: error: (assignment.type.incompatible) @@ -605,6 +668,8 @@ void m() { bn = t3; // :: error: (assignment.type.incompatible) fbn = t3; + // :: error: (assignment) + i = t3; us = t8; // :: error: (assignment.type.incompatible) @@ -620,6 +685,8 @@ void m() { bn = t8; // :: error: (assignment.type.incompatible) fbn = t8; + // :: error: (assignment) + i = t8; us = t9; // :: error: (assignment.type.incompatible) @@ -635,6 +702,8 @@ void m() { bn = t9; // :: error: (assignment.type.incompatible) fbn = t9; + // :: error: (assignment) + i = t9; us = t24; // :: error: (assignment.type.incompatible) @@ -650,6 +719,8 @@ void m() { bn = t24; // :: error: (assignment.type.incompatible) fbn = t24; + // :: error: (assignment) + i = t24; us = t25; // :: error: (assignment.type.incompatible) @@ -666,6 +737,8 @@ void m() { bn = t25; // :: error: (assignment.type.incompatible) fbn = t25; + // :: error: (assignment) + i = t25; us = t28; // :: error: (assignment.type.incompatible) @@ -681,6 +754,8 @@ void m() { bn = t28; // :: error: (assignment.type.incompatible) fbn = t28; + // :: error: (assignment) + i = t28; us = t27; // :: error: (assignment.type.incompatible) @@ -696,6 +771,8 @@ void m() { bn = t27; // :: error: (assignment.type.incompatible) fbn = t27; + // :: error: (assignment) + i = t27; us = t26; fqn = t26; @@ -708,6 +785,8 @@ void m() { sn = t26; bn = t26; fbn = t26; + // :: error: (assignment) + i = t26; us = t32; // :: error: (assignment.type.incompatible) @@ -724,6 +803,8 @@ void m() { bn = t32; // :: error: (assignment.type.incompatible) fbn = t32; + // :: error: (assignment) + i = t32; us = t30; fqn = t30; @@ -752,6 +833,8 @@ void m() { bn = t31; // :: error: (assignment.type.incompatible) fbn = t31; + // :: error: (assignment) + i = t31; us = t34; fqn = t34; @@ -764,6 +847,8 @@ void m() { sn = t34; bn = t34; fbn = t34; + // :: error: (assignment) + i = t34; us = t17; fqn = t17; @@ -776,6 +861,8 @@ void m() { sn = t17; bn = t17; fbn = t17; + // :: error: (assignment) + i = t17; us = t18; fqn = t18; @@ -801,6 +888,8 @@ void m() { sn = t19; bn = t19; fbn = t19; + // :: error: (assignment) + i = t19; us = t21; fqn = t21; @@ -830,6 +919,8 @@ void m() { bn = t20; // :: error: (assignment.type.incompatible) fbn = t20; + // :: error: (assignment) + i = t20; us = t10; // :: error: (assignment.type.incompatible) @@ -845,6 +936,8 @@ void m() { bn = t10; // :: error: (assignment.type.incompatible) fbn = t10; + // :: error: (assignment) + i = t10; us = t4; // :: error: (assignment.type.incompatible) @@ -860,6 +953,8 @@ void m() { bn = t4; // :: error: (assignment.type.incompatible) fbn = t4; + // :: error: (assignment) + i = t4; us = t11; // :: error: (assignment.type.incompatible) @@ -875,5 +970,7 @@ void m() { bn = t11; // :: error: (assignment.type.incompatible) fbn = t11; + // :: error: (assignment) + i = t11; } } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9595dd3e80c3..bd9cd762824f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,11 @@ +Version 3.49.1 (March 3, 2025) +------------------------------ + +**Closed issues:** + +#6970, #6974. + + Version 3.49.0-eisop1 (February ??, 2025) ----------------------------------------- @@ -35,6 +43,7 @@ The JavaStubifier implementation now appears in package `org.checkerframework.framework.stubifier.JavaStubifier`. **Closed issues:** + #6935, #6936, #6939. diff --git a/docs/manual/faq.tex b/docs/manual/faq.tex index 449a61889c53..e5d8eaa1d034 100644 --- a/docs/manual/faq.tex +++ b/docs/manual/faq.tex @@ -1545,8 +1545,8 @@ \subsectionAndLabel{How should I annotate code that uses generics?}{faq-writing-generics} -Suppose unannotated code contains a type parameter \code{}. How should -you annotate that? +Suppose unannotated code contains a declaration of a type parameter +\code{}. How should you annotate that declaration? This is really a question about Java's generic types, so if you understand Java generics, this question is moot. However, Java generics can be hard From ef791e3d45a65fb1a88fe1129a4afc2f612e1986 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 16 Mar 2025 22:51:19 -0400 Subject: [PATCH 2/5] Code comment formatting --- .../checker/optional/OptionalImplTransfer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java index 1966dae4af9f..75b95cb67c58 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalImplTransfer.java @@ -227,11 +227,10 @@ private TransferResult refineNonEmptyToPresentStreamResult( private boolean isReceiverParameterNonEmpty(MethodInvocationNode methodInvok) { 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. + // 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. + // 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) { From 13643d53d1d932564bd97fe142228cc68a76fab5 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 16 Mar 2025 22:51:38 -0400 Subject: [PATCH 3/5] Adapt error keys --- .../signature/SignatureTypeFactoryTest.java | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/checker/tests/signature/SignatureTypeFactoryTest.java b/checker/tests/signature/SignatureTypeFactoryTest.java index a54ceb58782b..be60819c91a3 100644 --- a/checker/tests/signature/SignatureTypeFactoryTest.java +++ b/checker/tests/signature/SignatureTypeFactoryTest.java @@ -129,7 +129,7 @@ void m() { sn = s2; bn = s2; fbn = s2; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s2; us = s3; @@ -143,7 +143,7 @@ void m() { sn = s3; bn = s3; fbn = s3; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s3; us = s4; @@ -169,7 +169,7 @@ void m() { bn = s5; // :: error: (assignment.type.incompatible) fbn = s5; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s5; us = s6; @@ -186,7 +186,7 @@ void m() { bn = s6; // :: error: (assignment.type.incompatible) fbn = s6; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s6; us = s7; @@ -203,7 +203,7 @@ void m() { bn = s7; // :: error: (assignment.type.incompatible) fbn = s7; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s7; us = s8; @@ -221,7 +221,7 @@ void m() { bn = s8; // :: error: (assignment.type.incompatible) fbn = s8; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s8; us = s9; @@ -235,7 +235,7 @@ void m() { sn = s9; bn = s9; fbn = s9; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s9; us = s10; @@ -272,7 +272,7 @@ void m() { // :: error: (assignment.type.incompatible) bn = s12; fbn = s12; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s12; us = s13; @@ -288,7 +288,7 @@ void m() { // :: error: (assignment.type.incompatible) bn = s13; fbn = s13; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s13; us = s14; @@ -305,7 +305,7 @@ void m() { bn = s14; // :: error: (assignment.type.incompatible) fbn = s14; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s14; us = s15; @@ -322,7 +322,7 @@ void m() { bn = s15; // :: error: (assignment.type.incompatible) fbn = s15; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s15; us = s16; @@ -339,7 +339,7 @@ void m() { bn = s16; // :: error: (assignment.type.incompatible) fbn = s16; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s16; us = s17; @@ -356,7 +356,7 @@ void m() { bn = s17; // :: error: (assignment.type.incompatible) fbn = s17; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s17; us = s18; @@ -374,7 +374,7 @@ void m() { bn = s18; // :: error: (assignment.type.incompatible) fbn = s18; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s18; us = s19; @@ -392,7 +392,7 @@ void m() { bn = s19; // :: error: (assignment.type.incompatible) fbn = s19; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s19; us = s20; @@ -406,7 +406,7 @@ void m() { // :: error: (assignment.type.incompatible) bn = s20; fbn = s20; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s20; us = s21; @@ -424,7 +424,7 @@ void m() { bn = s21; // :: error: (assignment.type.incompatible) fbn = s21; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s21; us = s22; @@ -442,7 +442,7 @@ void m() { bn = s22; // :: error: (assignment.type.incompatible) fbn = s22; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = s22; // Examples from the manual start here @@ -458,7 +458,7 @@ void m() { // :: error: (assignment.type.incompatible) bn = t13; fbn = t13; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t13; us = t14; @@ -496,7 +496,7 @@ void m() { bn = t12; // :: error: (assignment.type.incompatible) fbn = t12; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t12; us = t5; @@ -524,7 +524,7 @@ void m() { bn = t2; // :: error: (assignment.type.incompatible) fbn = t2; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t2; us = t6; @@ -539,7 +539,7 @@ void m() { // :: error: (assignment.type.incompatible) bn = t6; fbn = t6; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t6; us = t7; @@ -555,7 +555,7 @@ void m() { bn = t7; // :: error: (assignment.type.incompatible) fbn = t7; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t7; us = t29; @@ -572,7 +572,7 @@ void m() { bn = t29; // :: error: (assignment.type.incompatible) fbn = t29; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t29; us = t33; @@ -589,7 +589,7 @@ void m() { bn = t33; // :: error: (assignment.type.incompatible) fbn = t33; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t33; us = t15; @@ -603,7 +603,7 @@ void m() { sn = t15; bn = t15; fbn = t15; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t15; us = t16; @@ -633,7 +633,7 @@ void m() { bn = t22; // :: error: (assignment.type.incompatible) fbn = t22; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t22; us = t23; @@ -651,7 +651,7 @@ void m() { bn = t23; // :: error: (assignment.type.incompatible) fbn = t23; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t23; us = t3; @@ -668,7 +668,7 @@ void m() { bn = t3; // :: error: (assignment.type.incompatible) fbn = t3; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t3; us = t8; @@ -685,7 +685,7 @@ void m() { bn = t8; // :: error: (assignment.type.incompatible) fbn = t8; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t8; us = t9; @@ -702,7 +702,7 @@ void m() { bn = t9; // :: error: (assignment.type.incompatible) fbn = t9; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t9; us = t24; @@ -719,7 +719,7 @@ void m() { bn = t24; // :: error: (assignment.type.incompatible) fbn = t24; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t24; us = t25; @@ -737,7 +737,7 @@ void m() { bn = t25; // :: error: (assignment.type.incompatible) fbn = t25; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t25; us = t28; @@ -754,7 +754,7 @@ void m() { bn = t28; // :: error: (assignment.type.incompatible) fbn = t28; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t28; us = t27; @@ -771,7 +771,7 @@ void m() { bn = t27; // :: error: (assignment.type.incompatible) fbn = t27; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t27; us = t26; @@ -785,7 +785,7 @@ void m() { sn = t26; bn = t26; fbn = t26; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t26; us = t32; @@ -803,7 +803,7 @@ void m() { bn = t32; // :: error: (assignment.type.incompatible) fbn = t32; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t32; us = t30; @@ -833,7 +833,7 @@ void m() { bn = t31; // :: error: (assignment.type.incompatible) fbn = t31; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t31; us = t34; @@ -847,7 +847,7 @@ void m() { sn = t34; bn = t34; fbn = t34; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t34; us = t17; @@ -861,7 +861,7 @@ void m() { sn = t17; bn = t17; fbn = t17; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t17; us = t18; @@ -888,7 +888,7 @@ void m() { sn = t19; bn = t19; fbn = t19; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t19; us = t21; @@ -919,7 +919,7 @@ void m() { bn = t20; // :: error: (assignment.type.incompatible) fbn = t20; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t20; us = t10; @@ -936,7 +936,7 @@ void m() { bn = t10; // :: error: (assignment.type.incompatible) fbn = t10; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t10; us = t4; @@ -953,7 +953,7 @@ void m() { bn = t4; // :: error: (assignment.type.incompatible) fbn = t4; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t4; us = t11; @@ -970,7 +970,7 @@ void m() { bn = t11; // :: error: (assignment.type.incompatible) fbn = t11; - // :: error: (assignment) + // :: error: (assignment.type.incompatible) i = t11; } } From 88c0458308bb2e4c788821a769a8f201e78a0725 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 16 Mar 2025 22:52:02 -0400 Subject: [PATCH 4/5] Move changelog entry --- docs/CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bd9cd762824f..dec2f4b5db13 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,13 +1,5 @@ -Version 3.49.1 (March 3, 2025) ------------------------------- - -**Closed issues:** - -#6970, #6974. - - -Version 3.49.0-eisop1 (February ??, 2025) ------------------------------------------ +Version 3.49.1-eisop1 (March 17, 2025) +-------------------------------------- **User-visible changes:** @@ -25,6 +17,14 @@ bounds are used. eisop#1003, eisop#1033, eisop#1058. +Version 3.49.1 (March 3, 2025) +------------------------------ + +**Closed issues:** + +#6970, #6974. + + Version 3.49.0 (February 3, 2025) --------------------------------- From 8d3ba45cb4fe1074c37b04e687f371e3de63e98a Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 16 Mar 2025 22:53:56 -0400 Subject: [PATCH 5/5] Stay compatible with Java 8 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d27b37c56dc1..89c5cbe36caf 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { plugins { // https://plugins.gradle.org/plugin/com.gradleup.shadow - id 'com.gradleup.shadow' version '8.3.6' + id 'com.gradleup.shadow' version '8.3.1' // https://plugins.gradle.org/plugin/de.undercouch.download id 'de.undercouch.download' version '5.6.0' id 'java'