From e9a1faba553a98cb9ce4623316f27937f392690b Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Fri, 6 Dec 2024 16:14:30 -0800 Subject: [PATCH] improve test coverage --- .../src/test/java/com/uber/nullaway/AccessPathsTests.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nullaway/src/test/java/com/uber/nullaway/AccessPathsTests.java b/nullaway/src/test/java/com/uber/nullaway/AccessPathsTests.java index 9294e71e61..354b00cf35 100644 --- a/nullaway/src/test/java/com/uber/nullaway/AccessPathsTests.java +++ b/nullaway/src/test/java/com/uber/nullaway/AccessPathsTests.java @@ -447,6 +447,7 @@ public void mapKeysFromValueOf() { " private final Map map = new HashMap<>();", " private final Map longMap = new HashMap<>();", " static Integer valueOf(int i) { return 0; }", + " static Integer valueOf(int i, int j) { return i+j; }", " public void putThenGetIntegerValueOf() {", " map.put(Integer.valueOf(10), new Object());", " map.get(Integer.valueOf(10)).toString();", @@ -460,6 +461,10 @@ public void mapKeysFromValueOf() { " // Unknown valueOf method so we report a warning", " // BUG: Diagnostic contains: dereferenced expression map.get(valueOf(10)) is @Nullable", " map.get(valueOf(10)).toString();", + " map.put(valueOf(10,20), new Object());", + " // Unknown valueOf method so we report a warning", + " // BUG: Diagnostic contains: dereferenced expression map.get(valueOf(10,20)) is @Nullable", + " map.get(valueOf(10,20)).toString();", " }", "}") .doTest();