Skip to content
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

Remove static locale state, fixes #358 #360

Closed
wants to merge 1 commit into from
Closed

Conversation

nja
Copy link

@nja nja commented May 19, 2020

Remove the foot gun.

@tonyqus tonyqus added this to the NPOI 2.5.2 milestone May 19, 2020
@tonyqus
Copy link
Member

tonyqus commented Aug 17, 2020

LocaleUtil.SetUserTimeZone is still necessary to allow user to use various timezone. I'll try to reimplement it.

@tonyqus tonyqus closed this Aug 17, 2020
@nja
Copy link
Author

nja commented Aug 18, 2020

I would advice you to reconsider. You'll be "reimplementing" a variable. Don't waste effort holding static state for the caller. It's better to let the caller decide the details like scope of their own variables. When you try to decide these things for the caller, you will get bugs like the #358 we started with. It's a foot gun.

@mgraf1
Copy link

mgraf1 commented Aug 31, 2020

I agree with the creator of this PR. I just got burned by this issue and was completely surprised to see this library manipulating static state. It basically caused an operation to succeed once and then fail the next time for the exact same inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants