Skip to content

Commit 4e0b19c

Browse files
cushonError Prone Team
authored and
Error Prone Team
committed
Start using Java > 11 language features in Error Prone tests
This is a first step towards raising the minimum supported JDK version Error Prone to JDK 17. PiperOrigin-RevId: 673432814
1 parent 4b5ee1e commit 4e0b19c

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

check_api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<id>default-compile</id>
169169
<configuration>
170170
<jdkToolchain>
171-
<version>11</version>
171+
<version>17</version>
172172
</jdkToolchain>
173173
</configuration>
174174
</execution>

core/src/test/java/com/google/errorprone/bugpatterns/FinallyTest.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,20 @@ public void lambda() {
5555
compilationHelper
5656
.addSourceLines(
5757
"Test.java",
58-
"class Test {",
59-
" void f() {",
60-
" try {",
61-
" } catch (Throwable t) {",
62-
" } finally {",
63-
" Runnable r = () -> { return; };",
64-
" }",
65-
" }",
66-
"}")
58+
"""
59+
class Test {
60+
void f() {
61+
try {
62+
} catch (Throwable t) {
63+
} finally {
64+
Runnable r =
65+
() -> {
66+
return;
67+
};
68+
}
69+
}
70+
}
71+
""")
6772
.doTest();
6873
}
6974
}

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@
182182
<artifactId>maven-compiler-plugin</artifactId>
183183
<version>3.13.0</version>
184184
<configuration>
185-
<source>11</source>
186-
<target>11</target>
185+
<source>17</source>
186+
<target>17</target>
187187
<parameters />
188188
<compilerArgs>
189189
<arg>--add-exports=java.base/jdk.internal.javac=ALL-UNNAMED</arg>
@@ -284,7 +284,7 @@
284284
<configuration>
285285
<toolchains>
286286
<jdk>
287-
<version>11</version>
287+
<version>17</version>
288288
<version>24</version>
289289
</jdk>
290290
</toolchains>

0 commit comments

Comments
 (0)