Skip to content

Commit

Permalink
Start using Java > 11 language features in Error Prone tests
Browse files Browse the repository at this point in the history
This is a first step towards raising the minimum supported JDK version Error
Prone to JDK 17.

PiperOrigin-RevId: 673432814
  • Loading branch information
cushon authored and Error Prone Team committed Sep 11, 2024
1 parent 4b5ee1e commit 4e0b19c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion check_api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<id>default-compile</id>
<configuration>
<jdkToolchain>
<version>11</version>
<version>17</version>
</jdkToolchain>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,20 @@ public void lambda() {
compilationHelper
.addSourceLines(
"Test.java",
"class Test {",
" void f() {",
" try {",
" } catch (Throwable t) {",
" } finally {",
" Runnable r = () -> { return; };",
" }",
" }",
"}")
"""
class Test {
void f() {
try {
} catch (Throwable t) {
} finally {
Runnable r =
() -> {
return;
};
}
}
}
""")
.doTest();
}
}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
<parameters />
<compilerArgs>
<arg>--add-exports=java.base/jdk.internal.javac=ALL-UNNAMED</arg>
Expand Down Expand Up @@ -284,7 +284,7 @@
<configuration>
<toolchains>
<jdk>
<version>11</version>
<version>17</version>
<version>24</version>
</jdk>
</toolchains>
Expand Down

0 comments on commit 4e0b19c

Please sign in to comment.