-
Notifications
You must be signed in to change notification settings - Fork 255
Use CopyOnWriteArrayList in PrettyTime. #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Use CopyOnWriteArrayList in PrettyTime. #256
Conversation
|
Hey @Isira-Seneviratne - Are you working on something new? :) Anything I should be aware of? |
Yeah, I used |
b3eb48a to
a916579
Compare
|
Interesting. Can you tell me the reasons you went with this List implementation? I can guess, but I just want to make sure :) |
It's actually a Also, IntelliJ recommended using a thread-safe type instead of a volatile field. |
|
Thanks, that helps me understand. There isn't technically anything wrong with I would consider this... Unfortunately, however, this PR breaks the tests (the ones that are passing) for TimeUnit configuration: Note that order of TimeUnits matters, and the default configuration does something a bit strange, providing the "JustNow" This TimeUnit is responsible for the default behavior (overriding Milliseconds and Seconds) by default so that anything less than a minute ago/from now shows 'just now' - a more human readable time measure for "short durations". With your PR, that unit is sorted to somewhere near If you can figure out a way to do this without breaking the order of the default units, then let's do it. To be honest -- it's been a while since I coded that part of PrettyTime, so it might be worth re-visiting how unit order is preserved and set anyway. |
a916579 to
76dbc99
Compare
76dbc99 to
19ae748
Compare
|
Sorry for the delay on this @Isira-Seneviratne - I will work on it ASAP. Life has gotten a bit unpredictable here. |
b3f94df to
bbc0c21
Compare
No description provided.