Skip to content

Fix: Prioritize searching for singletons in all class types when determining best creators - #3664

Closed
justcarlux wants to merge 1 commit into
dmulloy2:masterfrom
justcarlux:master
Closed

Fix: Prioritize searching for singletons in all class types when determining best creators#3664
justcarlux wants to merge 1 commit into
dmulloy2:masterfrom
justcarlux:master

Conversation

@justcarlux

Copy link
Copy Markdown
Contributor

This addresses the following issue: #3663

For more information about this issue, please refer to my minimal reproducible example's README: https://github.com/justcarlux/protocollib-overriding-1.8-world-types-example

@dmulloy2

Copy link
Copy Markdown
Owner

Expanding this branch to every class makes StructureCache.newInstance() return any public static self-typed object, even when the class is mutable. Because StructureCache::newInstance is also the destination factory used by FieldCloner, deep cloning such a value can write into shared global state.

I think we can make this work for the most part by tieing it together with ImmutableDetector. I'll make a follow up commit and credit you as a co-author

@dmulloy2 dmulloy2 closed this Aug 23, 2026
@justcarlux

Copy link
Copy Markdown
Contributor Author

Yeah, I knew that I might've had other side effects, I admit it was a rushed solution since I didn't take the time to read into the rest of the codebase properly. Thanks for looking into it though.

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