From 0201ab71829eab18757a7571914ddf60495337e3 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 8 Dec 2021 10:33:45 -0800 Subject: [PATCH] Remove source compatibility with JDK 8 remove JDK 8 from external CI, and add a use of a JDK 11 API (Optional.isEmpty) to confirm. https://github.com/google/error-prone/issues/2730 PiperOrigin-RevId: 415040230 --- .github/workflows/ci.yml | 6 +++--- .../com/google/errorprone/bugpatterns/inlineme/Inliner.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f88be2d958a..233441ab04c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - java: [ 17, 11, 8 ] + java: [ 17, 11 ] experimental: [ false ] # Only test on macos and windows with a single recent JDK to avoid a # combinatorial explosion of test configurations. @@ -63,10 +63,10 @@ jobs: steps: - name: 'Check out repository' uses: actions/checkout@v2 - - name: 'Set up JDK 8' + - name: 'Set up JDK 11' uses: actions/setup-java@v2 with: - java-version: 8 + java-version: 11 distribution: 'zulu' cache: 'maven' server-id: ossrh diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/inlineme/Inliner.java b/core/src/main/java/com/google/errorprone/bugpatterns/inlineme/Inliner.java index 066b86cb6cd..3cc5677603f 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/inlineme/Inliner.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/inlineme/Inliner.java @@ -147,7 +147,7 @@ private Description match( ExpressionTree receiver, VisitorState state) { Optional inlineMe = InlineMeData.createFromSymbol(symbol); - if (!inlineMe.isPresent()) { + if (inlineMe.isEmpty()) { return Description.NO_MATCH; }