RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11]
Archie Cobbs
acobbs at openjdk.org
Mon Sep 22 00:33:34 UTC 2025
On Sun, 21 Sep 2025 15:02:55 GMT, Stephan Schroevers <duke at openjdk.org> wrote:
>> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove unused field from "LintRange" record.
>
> Alright, run the following script in an empty directory to create a `pom.xml` and `src/main/java/com/example/Reproducer.java`:
>
> #!/usr/bin/env bash
>
> set -euo pipefail
>
> # Creates files in the current directory to reproduce the issue.
> # This script writes `pom.xml` and `src/main/java/com/example/Reproducer.java`.
>
> mkdir -p src/main/java/com/example
>
> cat > pom.xml <<'POM_EOF'
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>com.example</groupId>
> <artifactId>reproducer</artifactId>
> <version>0.0.1-SNAPSHOT</version>
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.google.errorprone</groupId>
> <artifactId>error_prone_core</artifactId>
> <version>2.42.0</version>
> </dependency>
> <dependency>
> <groupId>javax.annotation</groupId>
> <artifactId>javax.annotation-api</artifactId>
> <version>1.3.2</version>
> </dependency>
> <dependency>
> <groupId>org.assertj</groupId>
> <artifactId>assertj-bom</artifactId>
> <version>3.27.4</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> <dependency>
> <groupId>org.openrewrite.recipe</groupId>
> <artifactId>rewrite-recipe-bom</artifactId>
> <version>3.14.0</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> </dependencies>
> </dependencyManagement>
>
> <dependencies>
> <dependency>
> <groupId>com.google.errorprone</groupId>
> <artifactId>error_prone_core</artifactId>
> </dependency>
> <dependency>
> <groupId>javax.annotation</groupId>
> <artifactId>javax.annotation-api</artifactId>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.assertj</groupId>
> <artifactId>assertj-core</artifactId>
> </dependency>
> <dependency>
> <groupId>org.openrewrite</gr...
Hi @Stephan202,
This annotation processor is importing internal javac classes that are not guaranteed to provide stable API's. So this problem is likely a result of these API's changing in the refactoring associated with this PR. To confirm that, try recompiling the annotation processor against JDK 25 (just released) - the reproducer should no longer work. To state the obvious, the reason internal API's are not supported is to allow for refactoring; they're kept stable only on a "best effort" basis.
On the other hand, if you can reproduce the problem using only code that depends on supported APIs, then that would indeed be a bug and we'll track it down. That certainly could also be the case here (I haven't tried to determine that). Thanks.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3316393228
More information about the compiler-dev
mailing list