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

ASF subversion and git services commented on TAMAYA-198:
--------------------------------------------------------

Commit b9299af45221d0a6cb977d0823643a47a66d8f39 in 
incubator-tamaya-extensions's branch refs/heads/master from [~anatole]
[ 
https://git-wip-us.apache.org/repos/asf?p=incubator-tamaya-extensions.git;h=b9299af
 ]

TAMAYA-198: Reading input stream into resettable ByteArrayInputStream, so each 
format read can be explicitly reset and remote resources are read only once.


> tamaya-formats blindly tries (and failes) to parse a config file with 
> multiple formats
> --------------------------------------------------------------------------------------
>
>                 Key: TAMAYA-198
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-198
>             Project: Tamaya
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 0.3-incubating
>            Reporter: Thomas Liebetraut
>            Assignee: Anatole Tresch
>         Attachments: TAMAYA-198.patch
>
>
> BaseFormatPropertySourceProvider can handle multiple formats registered. This 
> is useful in my project because we actually support multiple formats for a 
> certain type of config file and this way we can implement one Provider which 
> can provide PropertySources for all of them.
> But {{getPropertySources()}} will
> # blindly try all files with all formats. E.g. if both, "properties" and 
> "ini" formats are registered, it will try all files with both formats without 
> checking {{format.accepts()}} first.
> # try all the formats with the same {{InputStream}}. If the previous format 
> does not reset the input stream, it is already at the end of the file and the 
> following formats don't have anything left to read, returning {{null}}. This 
> leads to some {{NullPointerException}}s being logged.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to