[
https://issues.apache.org/jira/browse/IO-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17575583#comment-17575583
]
Rainer Hochreiter commented on IO-778:
--------------------------------------
found on
[Stackoverflow|https://stackoverflow.com/questions/824217/should-methods-that-throw-runtimeexception-indicate-it-in-method-signature]:
_I would not declare an unchecked exception in the signature, since it is
misleading to the user of that API. It is no longer obvious whether the
exception has to be explicitly handled._
_*Declaring it in the javadoc is a better approach since it allows someone to
handle it if they think it is necessary, but knowing they can ignore it if they
want.* This makes the separation between checked and unchecked clear._
> 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)