Ruiqi Dong created CSV-319: ------------------------------ Summary: CSVException constructor JavaDoc should document potential NullPointerException Key: CSV-319 URL: https://issues.apache.org/jira/browse/CSV-319 Project: Commons CSV Issue Type: Improvement Affects Versions: 1.14.0 Reporter: Ruiqi Dong
The {{CSVException}} constructor uses {{String.format()}} internally but its JavaDoc doesn't document the exceptions that can be thrown when invalid arguments are provided. Current JavaDoc: {code:java} /** * Constructs a new instance with a formatted message. * * @param format A {@link Formatter} format string. * @param args See {@link String#format(String, Object...)}. * @throws IllegalFormatException See {@link String#format(String, Object...)}. */ {code} *Issue:* A {{NullPointerException}} will be thrown if the format parameter is null *Test case demonstrating the behavior:* {code:java} @Test void testCSVExceptionThrowsNPEWithNullFormat() { // This throws NullPointerException but is not documented assertThrows(NullPointerException.class, () -> new CSVException(null, "arg")); }{code} -- This message was sent by Atlassian Jira (v8.20.10#820010)