@@ -35,13 +35,13 @@ public class ExpensiveLenientFormatStringTest {
3535 public void refactoring () {
3636 refactoringHelper
3737 .addInputLines (
38- "PreconditionsExpensiveStringTest .java" ,
38+ "Test .java" ,
3939"""
4040package com.google.devtools.javatools.refactory.refaster.cleanups;
4141
4242import static com.google.common.base.Preconditions.checkNotNull;
4343
44- class PreconditionsExpensiveStringTest {
44+ class Test {
4545 void f() {
4646 checkNotNull(this, "%s", "hello");
4747 }
@@ -60,13 +60,13 @@ void i() {
6060}
6161""" )
6262 .addOutputLines (
63- "PreconditionsExpensiveStringTest .java" ,
63+ "Test .java" ,
6464"""
6565package com.google.devtools.javatools.refactory.refaster.cleanups;
6666
6767import static com.google.common.base.Preconditions.checkNotNull;
6868
69- class PreconditionsExpensiveStringTest {
69+ class Test {
7070 void f() {
7171 checkNotNull(this, "%s", "hello");
7272 }
@@ -91,18 +91,16 @@ void i() {
9191 public void positive () {
9292 testHelper
9393 .addSourceLines (
94- "PreconditionsExpensiveStringPositiveCase1 .java" ,
94+ "Test .java" ,
9595"""
9696package com.google.errorprone.bugpatterns.testdata;
9797
9898import com.google.common.base.Preconditions;
9999
100100/**
101101 * Test for methodIs call involving String.format() and %s
102- *
103- * @author [email protected] (Simon Nickerson) 104102 */
105- public class PreconditionsExpensiveStringPositiveCase1 {
103+ public class Test {
106104 public void error() {
107105 int foo = 42;
108106 int bar = 78;
@@ -118,18 +116,16 @@ public void error() {
118116 public void negative1 () {
119117 testHelper
120118 .addSourceLines (
121- "PreconditionsExpensiveStringNegativeCase1 .java" ,
119+ "Test .java" ,
122120"""
123121package com.google.errorprone.bugpatterns.testdata;
124122
125123import com.google.common.base.Preconditions;
126124
127125/**
128126 * Preconditions calls which shouldn't be picked up for expensive string operations
129- *
130- * @author [email protected] (Simon Nickerson) 131127 */
132- public class PreconditionsExpensiveStringNegativeCase1 {
128+ public class Test {
133129 public void error() {
134130 int foo = 42;
135131 Preconditions.checkState(true, "The foo %s foo is not a good foo", foo);
@@ -150,7 +146,7 @@ public void error() {
150146 public void negative2 () {
151147 testHelper
152148 .addSourceLines (
153- "PreconditionsExpensiveStringNegativeCase2 .java" ,
149+ "Test .java" ,
154150"""
155151package com.google.errorprone.bugpatterns.testdata;
156152
@@ -159,10 +155,8 @@ public void negative2() {
159155/**
160156 * Test for methodIs call including string concatenation. (Not yet supported, so this is a negative
161157 * case)
162- *
163- * @author [email protected] (Simon Nickerson) 164158 */
165- public class PreconditionsExpensiveStringNegativeCase2 {
159+ public class Test {
166160 public void error() {
167161 int foo = 42;
168162 Preconditions.checkState(true, "The foo" + foo + " is not a good foo");
0 commit comments