Skip to content

Commit 187b5dd

Browse files
committed
More failing tests
1 parent 3e44d67 commit 187b5dd

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/IllegalSafeLoggingArgumentTest.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,49 @@ public void disagreeingSafetyAnnotations() {
13831383
.doTest();
13841384
}
13851385

1386+
@Test
1387+
public void testDisagreeingSafetyAnnotations_argument() {
1388+
helper().addSourceLines(
1389+
"Test.java",
1390+
// language=Java
1391+
"""
1392+
import com.palantir.logsafe.*;
1393+
import java.util.function.*;
1394+
1395+
@Unsafe
1396+
class MyObject {}
1397+
1398+
class Test {
1399+
// BUG: Diagnostic contains: Dangerous
1400+
void f(@Safe Object o) {}
1401+
}
1402+
""")
1403+
.doTest();
1404+
}
1405+
1406+
@Test
1407+
public void testDisagreeingSafetyAnnotations_return() {
1408+
helper().addSourceLines(
1409+
"Test.java",
1410+
// language=Java
1411+
"""
1412+
import com.palantir.logsafe.*;
1413+
import java.util.function.*;
1414+
1415+
@Unsafe
1416+
class MyObject {}
1417+
1418+
class Test {
1419+
// BUG: Diagnostic contains: Dangerous
1420+
@Safe
1421+
MyObject g() {
1422+
return null;
1423+
}
1424+
}
1425+
""")
1426+
.doTest();
1427+
}
1428+
13861429
@Test
13871430
public void testOptionalUnwrapping() {
13881431
helper().addSourceLines(

0 commit comments

Comments
 (0)