Skip to content

Commit

Permalink
Add test case for pmd#4277
Browse files Browse the repository at this point in the history
  • Loading branch information
jsotuyod committed Mar 18, 2024
1 parent 6be72b2 commit a267175
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ final class Test {
public static String foo(ResultSet r) throws SQLException {
return r.getString("bar").toLowerCase();
}
}
]]></code>
</test-code>

<test-code>
<description>#4277 FP when invoking a method called toLowerCase on a non-String class</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
public static String generateUlid(boolean uppercase) {
Ulid ulid = new Ulid();
return uppercase ? ulid.toString() : ulid.toLowerCase(); // not a String, should be ok
}
private static class Ulid {
public Strinc toLowerCase() {
return null;
}
}
}
]]></code>
</test-code>
Expand Down

0 comments on commit a267175

Please sign in to comment.