From 26a0da54392b2ee3f2597bd955ddad8d9b67922d Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 6 Jul 2023 11:49:32 +0200 Subject: [PATCH] Suggestions --- .github/workflows/build-jdk11.yaml | 4 ++-- .../tech/picnic/errorprone/refasterrules/StringRules.java | 8 ++++---- pom.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-jdk11.yaml b/.github/workflows/build-jdk11.yaml index 16e69a1b5f0..780668694c5 100644 --- a/.github/workflows/build-jdk11.yaml +++ b/.github/workflows/build-jdk11.yaml @@ -14,11 +14,11 @@ jobs: # the code is compiled using JDK 17, while the tests are executed # using JDK 11. - name: Check out code - uses: actions/checkout@v3.1.0 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: | 11.0.19 diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java index 3d43a966688..7acfb7835b4 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java @@ -47,8 +47,8 @@ boolean after(String str) { /** Prefer a method reference to {@link String#isEmpty()} over the equivalent lambda function. */ // XXX: Now that we build with JDK 15+, this rule can be generalized to cover all `CharSequence` - // subtypes. But `CharSequence::isEmpty` isn't as nice as `String::isEmpty`, so we might want to - // introduce a rule that suggests `String::isEmpty` where possible. + // subtypes. However, `CharSequence::isEmpty` isn't as nice as `String::isEmpty`, so we might want + // to introduce a rule that suggests `String::isEmpty` where possible. // XXX: As it stands, this rule is a special case of what `MethodReferenceUsage` tries to achieve. // If/when `MethodReferenceUsage` becomes production ready, we should simply drop this check. static final class StringIsEmptyPredicate { @@ -65,8 +65,8 @@ Predicate after() { /** Prefer a method reference to {@link String#isEmpty()} over the equivalent lambda function. */ // XXX: Now that we build with JDK 15+, this rule can be generalized to cover all `CharSequence` - // subtypes. But `CharSequence::isEmpty` isn't as nice as `String::isEmpty`, so we might want to - // introduce a rule that suggests `String::isEmpty` where possible. + // subtypes. However, `CharSequence::isEmpty` isn't as nice as `String::isEmpty`, so we might want + // to introduce a rule that suggests `String::isEmpty` where possible. static final class StringIsNotEmptyPredicate { @BeforeTemplate Predicate before() { diff --git a/pom.xml b/pom.xml index c19bab7ef10..ea2fb187d2d 100644 --- a/pom.xml +++ b/pom.xml @@ -1892,10 +1892,10 @@ true + than what would normally be supported given the language + features used, but this causes Sonar to report parse errors. + So for Sonar builds we target a JDK version that is properly + compatible with the source code. --> ${version.jdk.source}