[
https://issues.apache.org/jira/browse/HTTPCORE-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16962431#comment-16962431
]
Gary D. Gregory commented on HTTPCORE-611:
------------------------------------------
Hi again,
I this PR: [https://github.com/apache/httpcomponents-core/pull/156]
I've made it more obvious that Locale's matter by adding `parse(String,
Locale)` to `toString(Locale)`. Which makes me wonder if the class should have
a Locale instance variable...
WRT comment in general I am wondering about whether we should take inspiration
from java.time and it's "Local" (not Locale) and "Zoned" classes and offer
another class/subclass that handles/does not handle separators/locales or some
such.
> Minor glitches with TimeValue
> -----------------------------
>
> Key: HTTPCORE-611
> URL: https://issues.apache.org/jira/browse/HTTPCORE-611
> Project: HttpComponents HttpCore
> Issue Type: Improvement
> Components: HttpCore
> Affects Versions: 5.0-beta9
> Reporter: Michael Osipov
> Assignee: Gary D. Gregory
> Priority: Major
> Fix For: 5.0-beta11
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The {{TimeValue}} looks like a very good thing. Some nits can be improved:
> * {{NEG_ONE_*SECONDS}} uses plural for the scale of one, but should use
> singular
> * {{defaultsToZeroMillis}} is not consistent with
> {{defaultsToNegativeOneSecond}}. It should be {{defaultsToZeroMilliseconds}}
> * {{parse()}} uses {{String.format()}} but never passes value to the format.
> {{%s}} is missing.
> * {{parse()}} should parse with {{Long.parseLong()}} instead of a biased
> locale. 1,200 SECONDS for me is one second and 200 milliseconds. Thus, it
> should be language agnostic.
> * {{toString()}} should also do at most {{%d}} or {{%s}}.
> * {{toMillis()}} and other second fractions use inconsistent naming. I'd
> expect it to be {{toMilliseconds()}} and so forth.
> [~ggregory]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]