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

Use LoadingCache instead of HashMap for CableBusBakedModel #385

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

serenibyss
Copy link
Member

Supersedes #362

Uses a cache instead of a hashmap to avoid a CME in java 9+.

New impl in this PR vs #362 implements the cache non-statically, since the baked model is only baked once, and allows us to use a LoadingCache instead of a standard cache, giving us access to getUnchecked(). Additionally this no longer necessitates a resource reload listener, since the model will be automatically rebaked on a resource reload, letting GC clean up the old cache instead of needing to clear it on reload

@serenibyss serenibyss requested a review from NotMyWing January 28, 2024 19:02
@NotMyWing NotMyWing added bug Something isn't working enhancement New feature or request labels Jan 30, 2024
@NotMyWing NotMyWing merged commit 3495d3d into master Jan 30, 2024
AE2-Enthusiast pushed a commit to AE2-Enthusiast/AE2-UEL that referenced this pull request Apr 14, 2024
@serenibyss serenibyss deleted the sb-cable-bus-model-fix-2 branch June 8, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants