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

Canonical loading of location4j.bin file from classpath #10

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

tomaytotomato
Copy link
Owner

@tomaytotomato tomaytotomato commented Aug 9, 2024

fixes #9

Ensures the binary file is located and loaded from the jar before anything else, or any other file with same name.

Copy link

sonarqubecloud bot commented Aug 9, 2024

@tomaytotomato tomaytotomato merged commit 51b3d14 into master Aug 9, 2024
3 checks passed
@jottinger
Copy link
Contributor

I know this is closed, but I don't think this actually solves the problem. To test, you could put another jar with "/locations4j.bin" or whatever the filename is in front of the locations4j.jar file (thus, earlier in the classpath) and see if the right data is present; I think this is going to load the file in classpath order. You could get the URL from findResource and compare the schema (which would show the jar file) and if they don't match, fail (this is a suggestion from ernimril on IRC, not me); you could also measure the impact of parsing the json and just deliver it in text format (or compress it, as I'd also suggested) which would avoid the whole "serialization is a giant security hole through which battleships could sail easily" problem.

@tomaytotomato tomaytotomato deleted the 9-canonical-loading branch August 10, 2024 14:27
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.

[IMPROVEMENT] use .bin for location4j data instead of the json
2 participants