diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java index ad236877d51..8dc3170518e 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java @@ -15,7 +15,6 @@ */ package org.openrewrite.java.isolated; -import com.sun.tools.javac.code.BoundKind; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; @@ -141,12 +140,7 @@ public String classSignature(Object type) { @Override public String genericSignature(Object type) { Type.TypeVar generic = (Type.TypeVar) type; - String name; - if (generic instanceof Type.CapturedType && ((Type.CapturedType) generic).wildcard.kind == BoundKind.UNBOUND) { - name = "?"; - } else { - name = generic.tsym.name.toString(); - } + String name = generic instanceof Type.CapturedType ? "?" : generic.tsym.name.toString(); if (typeVariableNameStack == null) { typeVariableNameStack = new HashSet<>(); diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java index 4e232e1856e..06610776d12 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java @@ -15,7 +15,6 @@ */ package org.openrewrite.java.isolated; -import com.sun.tools.javac.code.BoundKind; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; @@ -141,12 +140,7 @@ public String classSignature(Object type) { @Override public String genericSignature(Object type) { Type.TypeVar generic = (Type.TypeVar) type; - String name; - if (generic instanceof Type.CapturedType && ((Type.CapturedType) generic).wildcard.kind == BoundKind.UNBOUND) { - name = "?"; - } else { - name = generic.tsym.name.toString(); - } + String name = generic instanceof Type.CapturedType ? "?" : generic.tsym.name.toString(); if (typeVariableNameStack == null) { typeVariableNameStack = new HashSet<>(); diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java index 6ae0e842497..77802291ed9 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java @@ -15,7 +15,6 @@ */ package org.openrewrite.java.isolated; -import com.sun.tools.javac.code.BoundKind; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; @@ -141,12 +140,7 @@ public String classSignature(Object type) { @Override public String genericSignature(Object type) { Type.TypeVar generic = (Type.TypeVar) type; - String name; - if (generic instanceof Type.CapturedType && ((Type.CapturedType) generic).wildcard.kind == BoundKind.UNBOUND) { - name = "?"; - } else { - name = generic.tsym.name.toString(); - } + String name = generic instanceof Type.CapturedType ? "?" : generic.tsym.name.toString(); if (typeVariableNameStack == null) { typeVariableNameStack = new HashSet<>(); diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java index dc92ba8f0d3..3fa76d17f42 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java @@ -15,7 +15,6 @@ */ package org.openrewrite.java; -import com.sun.tools.javac.code.BoundKind; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; @@ -140,12 +139,7 @@ public String classSignature(Object type) { @Override public String genericSignature(Object type) { Type.TypeVar generic = (Type.TypeVar) type; - String name; - if (generic instanceof Type.CapturedType && ((Type.CapturedType) generic).wildcard.kind == BoundKind.UNBOUND) { - name = "?"; - } else { - name = generic.tsym.name.toString(); - } + String name = generic instanceof Type.CapturedType ? "?" : generic.tsym.name.toString(); if (typeVariableNameStack == null) { typeVariableNameStack = new HashSet<>();