Skip to content

Commit 7e7c987

Browse files
java-team-github-botError Prone Team
authored and
Error Prone Team
committed
Add "public" to constructors in constructor_withAtInject and ignoresAutoFactory tests.
These tests were passing not only because of the annotations present in the code, but because the constructors were not public. PiperOrigin-RevId: 736293055
1 parent bbb0fe5 commit 7e7c987

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

core/src/test/java/com/google/errorprone/bugpatterns/TooManyParametersTest.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ public ConstructorTest(int a, int b) {}
114114
public ConstructorTest(int a, int b, int c) {}
115115
116116
@Inject
117-
ConstructorTest(int a, int b, int c, int d) {}
117+
public ConstructorTest(int a, int b, int c, int d) {}
118+
119+
// BUG: Diagnostic contains: 4 parameters
120+
public ConstructorTest(short a, short b, short c, short d) {}
118121
}
119122
""")
120123
.doTest();
@@ -136,7 +139,15 @@ public void ignoresAutoFactory() {
136139
"""
137140
@com.google.auto.factory.AutoFactory
138141
public class Test {
139-
Test(int a, int b, int c, int d) {}
142+
public Test(int a, int b, int c, int d) {}
143+
}
144+
""")
145+
.addSourceLines(
146+
"TestWithoutAutoFactory.java",
147+
"""
148+
public class TestWithoutAutoFactory {
149+
// BUG: Diagnostic contains: 4 parameters
150+
public TestWithoutAutoFactory(int a, int b, int c, int d) {}
140151
}
141152
""")
142153
.doTest();

0 commit comments

Comments
 (0)