From 3d7acf6af2fa47de1c2c5a1a2e584536c86c97db Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Wed, 28 Jul 2021 13:28:34 +0200 Subject: [PATCH 1/6] Refaster: fix expression matching in absence of additional syntactic context --- .../errorprone/refaster/RefasterScanner.java | 3 +- .../errorprone/refaster/UFreeIdent.java | 9 ++++++ .../refaster/TemplateIntegrationTest.java | 5 ++++ ...OnlyBeforeSimpleReturnTemplateExample.java | 24 +++++++++++++++ ...OnlyBeforeSimpleReturnTemplateExample.java | 24 +++++++++++++++ .../OnlyBeforeSimpleReturnTemplate.java | 30 +++++++++++++++++++ 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java create mode 100644 core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java create mode 100644 core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java diff --git a/core/src/main/java/com/google/errorprone/refaster/RefasterScanner.java b/core/src/main/java/com/google/errorprone/refaster/RefasterScanner.java index 95d0423888f..04828f74599 100644 --- a/core/src/main/java/com/google/errorprone/refaster/RefasterScanner.java +++ b/core/src/main/java/com/google/errorprone/refaster/RefasterScanner.java @@ -28,6 +28,7 @@ import com.sun.source.tree.DoWhileLoopTree; import com.sun.source.tree.IfTree; import com.sun.source.tree.MethodTree; +import com.sun.source.tree.PackageTree; import com.sun.source.tree.ParenthesizedTree; import com.sun.source.tree.SynchronizedTree; import com.sun.source.tree.Tree; @@ -98,7 +99,7 @@ public Void visitVariable(VariableTree node, Context context) { @Override public Void scan(Tree tree, Context context) { - if (tree == null) { + if (tree == null || tree instanceof PackageTree) { return null; } JCCompilationUnit compilationUnit = context.get(JCCompilationUnit.class); diff --git a/core/src/main/java/com/google/errorprone/refaster/UFreeIdent.java b/core/src/main/java/com/google/errorprone/refaster/UFreeIdent.java index ffe9391f4cf..ce36e1be62e 100644 --- a/core/src/main/java/com/google/errorprone/refaster/UFreeIdent.java +++ b/core/src/main/java/com/google/errorprone/refaster/UFreeIdent.java @@ -23,6 +23,8 @@ import com.sun.source.tree.Tree; import com.sun.source.util.TreeScanner; import com.sun.tools.javac.code.Symbol; +import com.sun.tools.javac.code.Symbol.MethodSymbol; +import com.sun.tools.javac.code.Symbol.TypeSymbol; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.util.Names; import javax.annotation.Nullable; @@ -99,7 +101,14 @@ public Boolean visitIdentifier(IdentifierTree ident, Void v) { if (!isGood) { return Choice.none(); } else if (currentBinding == null) { + Symbol currentExprSymbol = ASTHelpers.getSymbol(expression); + if (currentExprSymbol instanceof TypeSymbol + || (currentExprSymbol instanceof MethodSymbol && target instanceof IdentifierTree)) { + // The `JCExpression` by itself does not represent a valid Java expression. + return Choice.none(); + } unifier.putBinding(key(), expression); + return Choice.of(unifier); } else if (currentBinding.toString().equals(expression.toString())) { // TODO(lowasser): try checking types here in a way that doesn't reject diff --git a/core/src/test/java/com/google/errorprone/refaster/TemplateIntegrationTest.java b/core/src/test/java/com/google/errorprone/refaster/TemplateIntegrationTest.java index e9000acc4be..20c389c62ad 100644 --- a/core/src/test/java/com/google/errorprone/refaster/TemplateIntegrationTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/TemplateIntegrationTest.java @@ -374,4 +374,9 @@ public void suppressWarnings() throws IOException { public void typeArgumentsMethodInvocation() throws IOException { runTest("TypeArgumentsMethodInvocationTemplate"); } + + @Test + public void onlyBeforeSimpleReturnTemplate() throws IOException { + runTest("OnlyBeforeSimpleReturnTemplate"); + } } diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java new file mode 100644 index 00000000000..dd1d984a8e1 --- /dev/null +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java @@ -0,0 +1,24 @@ +/* + * Copyright 2022 The Error Prone Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.errorprone.refaster.testdata; + +/** Test data for {@code OnlyBeforeSimpleReturnTemplate}. */ +public class OnlyBeforeSimpleReturnTemplateExample { + public String foo(String s) { + return s; + } +} diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java new file mode 100644 index 00000000000..0c2e323c824 --- /dev/null +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java @@ -0,0 +1,24 @@ +/* + * Copyright 2022 The Error Prone Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.errorprone.refaster.testdata; + +/** Test data for {@code OnlyBeforeSimpleReturnTemplate}. */ +public class OnlyBeforeSimpleReturnTemplateExample { + public String foo(String s) { + return /* match found */ s; + } +} diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java b/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java new file mode 100644 index 00000000000..5bfc9694f04 --- /dev/null +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java @@ -0,0 +1,30 @@ +/* + * Copyright 2022 The Error Prone Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.errorprone.refaster.testdata.template; + +import com.google.errorprone.refaster.annotation.BeforeTemplate; + +/** + * Template that flags all string-typed expressions, irrespective of the syntactic context in which + * they occur. + */ +public class OnlyBeforeSimpleReturnTemplate { + @BeforeTemplate + String before(String s) { + return s; + } +} From bc7f2ec329f8bcb722758c9941ad0f0c608cd1a8 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Tue, 7 Jun 2022 09:26:57 +0200 Subject: [PATCH 2/6] Unify real expression in `U{FreeIdent,Repeated}Test` tests --- .../errorprone/refaster/UFreeIdentTest.java | 42 ++++++++++++++++--- .../errorprone/refaster/URepeatedTest.java | 42 ++++++++++++++++--- 2 files changed, 74 insertions(+), 10 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java index 7954f6888ab..2bce30d1a6c 100644 --- a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java @@ -17,10 +17,18 @@ package com.google.errorprone.refaster; import static com.google.common.truth.Truth.assertThat; +import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import com.google.common.testing.EqualsTester; import com.google.common.testing.SerializableTester; -import com.sun.tools.javac.tree.JCTree.JCExpression; +import com.google.errorprone.BugPattern; +import com.google.errorprone.CompilationTestHelper; +import com.google.errorprone.VisitorState; +import com.google.errorprone.bugpatterns.BugChecker; +import com.google.errorprone.bugpatterns.BugChecker.ExpressionStatementTreeMatcher; +import com.google.errorprone.matchers.Description; +import com.sun.source.tree.ExpressionStatementTree; +import com.sun.tools.javac.util.Context; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -41,10 +49,34 @@ public void inlinesExpression() { @Test public void binds() { - JCExpression expr = parseExpression("\"abcdefg\".charAt(x + 1)"); - UFreeIdent ident = UFreeIdent.create("foo"); - assertThat(ident.unify(expr, unifier)).isNotNull(); - assertThat(unifier.getBindings()).containsExactly(new UFreeIdent.Key("foo"), expr); + CompilationTestHelper.newInstance(DummyChecker.class, getClass()) + .addSourceLines( + "A.java", + "class A {", + " public void bar() {", + " int x = 0;", + " \"abcdefg\".charAt(x + 1);", + " }", + "}") + .doTest(); + } + + @BugPattern( + summary = "Verify that unifying the expression results in the correct binding", + explanation = "For test purposes only", + severity = SUGGESTION) + public static class DummyChecker extends BugChecker implements ExpressionStatementTreeMatcher { + @Override + public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { + Unifier unifier = new Unifier(new Context()); + UFreeIdent ident = UFreeIdent.create("foo"); + + assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); + assertThat(unifier.getBindings()) + .containsExactly(new UFreeIdent.Key("foo"), tree.getExpression()); + + return Description.NO_MATCH; + } } @Test diff --git a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java index 3e54de57179..67924b468be 100644 --- a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java @@ -17,10 +17,18 @@ package com.google.errorprone.refaster; import static com.google.common.truth.Truth.assertThat; +import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import com.google.common.testing.EqualsTester; import com.google.common.testing.SerializableTester; -import com.sun.tools.javac.tree.JCTree.JCExpression; +import com.google.errorprone.BugPattern; +import com.google.errorprone.CompilationTestHelper; +import com.google.errorprone.VisitorState; +import com.google.errorprone.bugpatterns.BugChecker; +import com.google.errorprone.bugpatterns.BugChecker.ExpressionStatementTreeMatcher; +import com.google.errorprone.matchers.Description; +import com.sun.source.tree.ExpressionStatementTree; +import com.sun.tools.javac.util.Context; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -31,10 +39,34 @@ public class URepeatedTest extends AbstractUTreeTest { @Test public void unifies() { - JCExpression expr = parseExpression("\"abcdefg\".charAt(x + 1)"); - URepeated ident = URepeated.create("foo", UFreeIdent.create("foo")); - assertThat(ident.unify(expr, unifier)).isNotNull(); - assertThat(unifier.getBindings()).containsExactly(new UFreeIdent.Key("foo"), expr); + CompilationTestHelper.newInstance(DummyChecker.class, getClass()) + .addSourceLines( + "A.java", + "class A {", + " public void bar() {", + " int x = 0;", + " \"abcdefg\".charAt(x + 1);", + " }", + "}") + .doTest(); + } + + @BugPattern( + summary = "Verify that unifying the expression results in the correct binding", + explanation = "For test purposes only", + severity = SUGGESTION) + public static class DummyChecker extends BugChecker implements ExpressionStatementTreeMatcher { + @Override + public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { + Unifier unifier = new Unifier(new Context()); + URepeated ident = URepeated.create("foo", UFreeIdent.create("foo")); + + assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); + assertThat(unifier.getBindings()) + .containsExactly(new UFreeIdent.Key("foo"), tree.getExpression()); + + return Description.NO_MATCH; + } } @Test From e0cd928b7c547522c0ab050779d66ad5e485ee80 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 9 Jun 2022 09:51:47 +0200 Subject: [PATCH 3/6] Rename and improve `BugChecker`s used for testing --- .../java/com/google/errorprone/refaster/UFreeIdentTest.java | 6 ++++-- .../java/com/google/errorprone/refaster/URepeatedTest.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java index 2bce30d1a6c..ad153d89c7e 100644 --- a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java @@ -49,7 +49,7 @@ public void inlinesExpression() { @Test public void binds() { - CompilationTestHelper.newInstance(DummyChecker.class, getClass()) + CompilationTestHelper.newInstance(UnificationChecker.class, getClass()) .addSourceLines( "A.java", "class A {", @@ -62,10 +62,12 @@ public void binds() { } @BugPattern( + name = "UnificationChecker", summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) - public static class DummyChecker extends BugChecker implements ExpressionStatementTreeMatcher { + public static class UnificationChecker extends BugChecker + implements ExpressionStatementTreeMatcher { @Override public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { Unifier unifier = new Unifier(new Context()); diff --git a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java index 67924b468be..9e09e254065 100644 --- a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java @@ -39,7 +39,7 @@ public class URepeatedTest extends AbstractUTreeTest { @Test public void unifies() { - CompilationTestHelper.newInstance(DummyChecker.class, getClass()) + CompilationTestHelper.newInstance(UnificationChecker.class, getClass()) .addSourceLines( "A.java", "class A {", @@ -52,10 +52,12 @@ public void unifies() { } @BugPattern( + name = "UnificationChecker", summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) - public static class DummyChecker extends BugChecker implements ExpressionStatementTreeMatcher { + public static class UnificationChecker extends BugChecker + implements ExpressionStatementTreeMatcher { @Override public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { Unifier unifier = new Unifier(new Context()); From 2d859ec0e2974e6012c289a0e1539705ae54c2fb Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Mon, 4 Jul 2022 06:21:30 +0200 Subject: [PATCH 4/6] Suggestions --- .../google/errorprone/refaster/UFreeIdentTest.java | 14 ++++++-------- .../google/errorprone/refaster/URepeatedTest.java | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java index ad153d89c7e..1e0840459b8 100644 --- a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java @@ -25,9 +25,9 @@ import com.google.errorprone.CompilationTestHelper; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker; -import com.google.errorprone.bugpatterns.BugChecker.ExpressionStatementTreeMatcher; +import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher; import com.google.errorprone.matchers.Description; -import com.sun.source.tree.ExpressionStatementTree; +import com.sun.source.tree.MethodInvocationTree; import com.sun.tools.javac.util.Context; import org.junit.Test; import org.junit.runner.RunWith; @@ -66,16 +66,14 @@ public void binds() { summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) - public static class UnificationChecker extends BugChecker - implements ExpressionStatementTreeMatcher { + public static class UnificationChecker extends BugChecker implements MethodInvocationTreeMatcher { @Override - public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { + public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { Unifier unifier = new Unifier(new Context()); UFreeIdent ident = UFreeIdent.create("foo"); - assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); - assertThat(unifier.getBindings()) - .containsExactly(new UFreeIdent.Key("foo"), tree.getExpression()); + assertThat(ident.unify(tree, unifier)).isNotNull(); + assertThat(unifier.getBindings()).containsExactly(new UFreeIdent.Key("foo"), tree); return Description.NO_MATCH; } diff --git a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java index 9e09e254065..c73a87d0a97 100644 --- a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java @@ -25,9 +25,9 @@ import com.google.errorprone.CompilationTestHelper; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker; -import com.google.errorprone.bugpatterns.BugChecker.ExpressionStatementTreeMatcher; +import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher; import com.google.errorprone.matchers.Description; -import com.sun.source.tree.ExpressionStatementTree; +import com.sun.source.tree.MethodInvocationTree; import com.sun.tools.javac.util.Context; import org.junit.Test; import org.junit.runner.RunWith; @@ -56,16 +56,14 @@ public void unifies() { summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) - public static class UnificationChecker extends BugChecker - implements ExpressionStatementTreeMatcher { + public static class UnificationChecker extends BugChecker implements MethodInvocationTreeMatcher { @Override - public Description matchExpressionStatement(ExpressionStatementTree tree, VisitorState state) { + public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { Unifier unifier = new Unifier(new Context()); URepeated ident = URepeated.create("foo", UFreeIdent.create("foo")); - assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); - assertThat(unifier.getBindings()) - .containsExactly(new UFreeIdent.Key("foo"), tree.getExpression()); + assertThat(ident.unify(tree, unifier)).isNotNull(); + assertThat(unifier.getBindings()).containsExactly(new UFreeIdent.Key("foo"), tree); return Description.NO_MATCH; } From b019a441c7a9f4ab970413684b734382424f4c13 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Mon, 4 Jul 2022 12:52:09 +0200 Subject: [PATCH 5/6] Remove `name` field from `@BugPattern` --- .../test/java/com/google/errorprone/refaster/UFreeIdentTest.java | 1 - .../test/java/com/google/errorprone/refaster/URepeatedTest.java | 1 - 2 files changed, 2 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java index 1e0840459b8..6ce0d80244b 100644 --- a/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/UFreeIdentTest.java @@ -62,7 +62,6 @@ public void binds() { } @BugPattern( - name = "UnificationChecker", summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) diff --git a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java index c73a87d0a97..b8528b030f1 100644 --- a/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java +++ b/core/src/test/java/com/google/errorprone/refaster/URepeatedTest.java @@ -52,7 +52,6 @@ public void unifies() { } @BugPattern( - name = "UnificationChecker", summary = "Verify that unifying the expression results in the correct binding", explanation = "For test purposes only", severity = SUGGESTION) From d3d6b1dc809efeaaad274a9c7d73a5bcf3206af7 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Mon, 9 Jan 2023 08:58:14 +0100 Subject: [PATCH 6/6] Update copyright year in new files --- .../testdata/input/OnlyBeforeSimpleReturnTemplateExample.java | 2 +- .../testdata/output/OnlyBeforeSimpleReturnTemplateExample.java | 2 +- .../testdata/template/OnlyBeforeSimpleReturnTemplate.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java index dd1d984a8e1..303cb00c9fc 100644 --- a/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/input/OnlyBeforeSimpleReturnTemplateExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Error Prone Authors. + * Copyright 2023 The Error Prone Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java index 0c2e323c824..f137caf1e06 100644 --- a/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/output/OnlyBeforeSimpleReturnTemplateExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Error Prone Authors. + * Copyright 2023 The Error Prone Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java b/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java index 5bfc9694f04..b30ee04781a 100644 --- a/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/template/OnlyBeforeSimpleReturnTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Error Prone Authors. + * Copyright 2023 The Error Prone Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.