[ 
https://issues.apache.org/jira/browse/IO-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17575983#comment-17575983
 ] 

Gilles Sadowski commented on IO-778:
------------------------------------

Maybe I was not clear; I agree that unchecked exceptions should be documented 
(as per the best practice explained in "Effective Java").

The second remark was about whether or not to state the obvious: If you pass 
{{null}} to a method, it is expected, by default, that NPE will occur; hence 
those cases are self-documented by the method signature. IOW: Don't pass a null 
argument, unless such a use case is explicitly documented.
{quote}[...] unchecked exceptions should be documented to avoid programming 
errors!
{quote}
They won't prevent programming errors; but they will make finding them easier.

> FileUtils.copyFile(File srcFile, File destFile): Missing 
> IllegalArgumentException in Javadoc
> --------------------------------------------------------------------------------------------
>
>                 Key: IO-778
>                 URL: https://issues.apache.org/jira/browse/IO-778
>             Project: Commons IO
>          Issue Type: Wish
>          Components: Utilities
>    Affects Versions: 2.11.0
>            Reporter: Rainer Hochreiter
>            Priority: Trivial
>
> Method {{FileUtils.copyFile(File srcFile, File destFile)}} throws  
> {{{}IllegalArgumentException{}}}, when called with identical files. This is 
> not documented in Javadoc.
> The {{IllegalArgumentException}} is thrown by 
> {{FileUtils.requireCanonicalPathsNotEquals(File file1, File file2)}} in 
> {{FileUtils.copyFile(File srcFile, File destFile, final CopyOption... 
> copyOptions).}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to