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

Oliver Heger commented on CONFIGURATION-521:
--------------------------------------------

I understand the motivation to keep the code as close to the origin as possible 
so that it is easier to detect deviations in future. However, for multiple 
reasons I am not happy with the current state of the solution:
* Having a single method in a class formatted differently looks strange. There 
is a high probability that it is reformatted later, maybe by accident.
* Checkstyle will complain. (I am not sure whether it is possible to filter on 
specific methods.)
* The method name {{toFile()}} is not very speaking. It makes sense in the 
context of {{FileUtils}} where there is a bunch of overloaded conversion 
methods, but for {{ConfigurationUtils}} you don't see on a single glance what 
it is expected to do.

How about the following compromise:
* We create a new class {{FileUtils}} next to {{ConfigurationUtils}} with 
default visibility so that it does not become part of the public API.
* In the Javadoc of this class it is stated that it contains code copied from 
Commons IO.
* The {{toFile()}} method is copied literally.
* {{ConfigurationUtils}} keeps its {{fileFromURL()}} method, but the 
implementation delegates to {{FileUtils}}.
* In the checkstyle suppression configuration the {{FileUtils}} class can be 
excluded.

Does this make sense?
                
> fileFromUrl: decoding of encoded % character does not work
> ----------------------------------------------------------
>
>                 Key: CONFIGURATION-521
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-521
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.9
>            Reporter: Oliver Kopp
>         Attachments: fileFromUrl.patch, 
> update-to-FileUtils-rev1349509-keepting-name-fileFromUrl.patch, 
> update-to-FileUtils-rev1349509.patch
>
>
> If ConfigurationUtils.fileFromUrl(URL) should create a file from a URL 
> containing an enoced % sign (%25), then it does not work.
> I saw that the code apache.commons.io now is really different, but seems to 
> work. Why isn't apache.commons.io directly used?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to