From 8b2ed720a9885b41129ac6314771368508ca41b3 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 18 Sep 2022 08:35:18 -0400 Subject: [PATCH] AboutJavaVersion --- .../openrewrite/java/migrate/lombok/LombokValToFinalVar.java | 2 +- .../openrewrite/java/migrate/search/AboutJavaVersion.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java index 18b39f5ddb..821ada9a9a 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java @@ -46,7 +46,7 @@ public String getDescription() { @Override protected TreeVisitor getSingleSourceApplicableTest() { return Applicability.and( - new UsesJavaVersion<>(11), +// new UsesJavaVersion<>(11), new UsesType<>(LOMBOK_VAL)); } diff --git a/src/main/java/org/openrewrite/java/migrate/search/AboutJavaVersion.java b/src/main/java/org/openrewrite/java/migrate/search/AboutJavaVersion.java index 1cc65c7afb..6bc004acf7 100644 --- a/src/main/java/org/openrewrite/java/migrate/search/AboutJavaVersion.java +++ b/src/main/java/org/openrewrite/java/migrate/search/AboutJavaVersion.java @@ -15,6 +15,7 @@ */ package org.openrewrite.java.migrate.search; +import io.micrometer.core.instrument.util.StringUtils; import lombok.EqualsAndHashCode; import lombok.Value; import org.openrewrite.ExecutionContext; @@ -43,12 +44,12 @@ public String getDisplayName() { @Override public String getDescription() { - return super.getDescription(); + return "A diagnostic for studying the applicability of Java version constraints."; } @Override protected @Nullable TreeVisitor getSingleSourceApplicableTest() { - return whenUsesType == null ? null : new UsesType<>(whenUsesType); + return StringUtils.isBlank(whenUsesType) ? null : new UsesType<>(whenUsesType); } @Override