diff --git a/java/typeMigration/testData/intentions/threadLocal/afterCycle.java b/java/typeMigration/testData/intentions/threadLocal/afterCycle.java new file mode 100644 index 000000000000..b2d5d06814ba --- /dev/null +++ b/java/typeMigration/testData/intentions/threadLocal/afterCycle.java @@ -0,0 +1,8 @@ +// "Convert to ThreadLocal" "true" +import java.util.Arrays; + +class Foo { + private final ThreadLocal lookahead = ThreadLocal.withInitial(() -> new char[0]); + + { lookahead.set(Arrays.copyOf(lookahead.get(), 42));} +} \ No newline at end of file diff --git a/java/typeMigration/testData/intentions/threadLocal/beforeCycle.java b/java/typeMigration/testData/intentions/threadLocal/beforeCycle.java new file mode 100644 index 000000000000..257fdfd4e425 --- /dev/null +++ b/java/typeMigration/testData/intentions/threadLocal/beforeCycle.java @@ -0,0 +1,8 @@ +// "Convert to ThreadLocal" "true" +import java.util.Arrays; + +class Foo { + private char[] lookahead = new char[0]; + + { lookahead = Arrays.copyOf(lookahead, 42);} +} \ No newline at end of file