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

clean up static Map/Set/etc to avoid races and leaks #198

Merged
merged 4 commits into from
Dec 19, 2022

Conversation

mistmist
Copy link
Contributor

Hopefully the OdfNamespace one won't grow to any measurable size, otherwise will have to be moved somewhere non-static.

The "javax.activation" package was removed from JDK9, and is now
maintained by Eclipse, and is surely excessive for this functionality.

The fallback code here that is using a static map is mainly for file
types one would expect to be common on a 1990s Solaris workstation.

It turns out that there is a URLConnection.guessContentTypeFromName()
since forever so just use that.
mUrlToPrefix looks safe currently, might get inited twice but not a
problem.
Copy link
Contributor

@svanteschubert svanteschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Michael!

@svanteschubert svanteschubert merged commit 07eccbf into master Dec 19, 2022
@svanteschubert svanteschubert deleted the static-maps branch December 19, 2022 18:54
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.

2 participants