[
https://issues.apache.org/jira/browse/TAMAYA-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16350646#comment-16350646
]
ASF GitHub Bot commented on TAMAYA-327:
---------------------------------------
Github user peculater commented on a diff in the pull request:
https://github.com/apache/incubator-tamaya/pull/11#discussion_r165699393
--- Diff:
code/api/src/main/java/org/apache/tamaya/spi/ConversionContext.java ---
@@ -145,7 +145,7 @@ public ConfigurationContext getConfigurationContext() {
/** The injection target (only set with injection used). */
private AnnotatedElement annotatedElement;
/** The ordered list of formats tried. */
- private final Set<String> supportedFormats = new HashSet<>();
+ private final List<String> supportedFormats = new ArrayList<>();
--- End diff --
It would. We'd also want to change
https://github.com/apache/incubator-tamaya/pull/11/files#diff-0ff94b3abf9ec69ee193d9ecdaad4936R42
to make it consistent.
> Inconsistent signature for creating ConversionContext
> -----------------------------------------------------
>
> Key: TAMAYA-327
> URL: https://issues.apache.org/jira/browse/TAMAYA-327
> Project: Tamaya
> Issue Type: Bug
> Reporter: William Lieurance
> Priority: Major
>
> During some additional testing in the API added as part of TAMAYA-288, I came
> across an inconsistency between the ConversionContext and the
> ConversionContext.Builder. Namely, the comments say that supportedFormats
> have their order maintained, which is consistent with the use of an ArrayList
> here
> [https://github.com/apache/incubator-tamaya/blob/master/code/api/src/main/java/org/apache/tamaya/spi/ConversionContext.java#L42]
> . The builder, however implements the same supportedFormats with a HashSet,
> which does not ensure order. See
> [https://github.com/apache/incubator-tamaya/blob/master/code/api/src/main/java/org/apache/tamaya/spi/ConversionContext.java#L148]
> .
> I'm planning on creating a pull request with the additional tests for that
> object as well as a patch to more consistently maintain order (all
> ArrayLists). Please let me know if the better answer is to more consistently
> leave order unspecified (all HashSets).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)