Skip to content

Commit d7d7b59

Browse files
committed
docs(config): expand Error Prone profile rationales and citations
Add comprehensive comments explaining the necessity of legacy Error Prone version downgrades (`2.38.0`, `2.42.0`) for Java 8+ build compatibility. Clarify that `-XDaddTypeAnnotationsToSymbol=true` is scoped specifically to JDK 21 execution per Error Prone Issue #5426 and is omitted on JDK 22+ where the attribution fix is enabled natively by default. BUG=b/481669998 TAG=agy CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
1 parent d466a78 commit d7d7b59

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

google-cloud-pom-parent/pom.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@
134134
</build>
135135
</profile>
136136
<profile>
137-
<!-- For JDK < 17 (JDK 8 and 11), downgrade to Error Prone 2.38.0. -->
137+
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
138+
Because our SDK client libraries actively support building and running on Java 8+,
139+
we must downgrade to legacy Error Prone 2.38.0 when compiling under JDK < 17. -->
138140
<id>errorprone-jdk11</id>
139141
<activation>
140142
<jdk>[1.8,17)</jdk>
@@ -145,7 +147,8 @@
145147
</properties>
146148
</profile>
147149
<profile>
148-
<!-- For JDK 17, downgrade to Error Prone 2.42.0 (latest supporting JDK 17). -->
150+
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
151+
When compiling under JDK 17, we downgrade to Error Prone 2.42.0 (the final release supporting JDK 17). -->
149152
<id>errorprone-jdk17</id>
150153
<activation>
151154
<jdk>[17,21)</jdk>
@@ -156,9 +159,13 @@
156159
</properties>
157160
</profile>
158161
<profile>
159-
<!-- Error Prone 2.43.0+ requires JDK 21+ to run (older JDKs unsupported).
160-
On JDK 21 specifically, we require '-XDaddTypeAnnotationsToSymbol=true'.
161-
On JDK 22+ (including 25 and 26), the fix is enabled by default in javac. -->
162+
<!-- On JDK 21 specifically (21.0.8+), we require '-XDaddTypeAnnotationsToSymbol=true'
163+
to force Javac to eagerly attach JSR-308 type-use annotations to AST compiler symbols across
164+
compilation boundaries, avoiding internal NullPointerExceptions in Error Prone plugin evaluations.
165+
Ref: https://github.com/google/error-prone/issues/5426
166+
167+
On JDK 22+ (including 25 and 26), OpenJDK enables this cross-boundary symbol attribution fix
168+
natively by default in standard javac executions. Therefore, the flag is omitted. -->
162169
<id>errorprone-jdk21</id>
163170
<activation>
164171
<jdk>21</jdk>

0 commit comments

Comments
 (0)