diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 888d6cfc470..0a11222c4a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ ubuntu-22.04 ] - jdk: [ 17.0.10, 21.0.2 ] + jdk: [ 17.0.10, 21.0.2, 22.0.2 ] distribution: [ temurin ] experimental: [ false ] include: diff --git a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java index dbef9d0e44e..e9cd1a4461a 100644 --- a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java +++ b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java @@ -21,7 +21,6 @@ import com.sun.tools.javac.code.Symbol.PackageSymbol; import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.Name; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectOutputStream; @@ -137,10 +136,10 @@ private static String toPackageName(ClassSymbol symbol) { return enclosingPackage == null ? "" : enclosingPackage.toString(); } - private static CharSequence toSimpleFlatName(ClassSymbol symbol) { - Name flatName = symbol.flatName(); + private static String toSimpleFlatName(ClassSymbol symbol) { + String flatName = symbol.flatName().toString(); int lastDot = flatName.lastIndexOf((byte) '.'); - return lastDot < 0 ? flatName : flatName.subSequence(lastDot + 1, flatName.length()); + return lastDot < 0 ? flatName : flatName.substring(lastDot + 1); } private static void outputCodeTransformer(CodeTransformer codeTransformer, FileObject target)