question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

minor mixin improvements

See original GitHub issue

enabling mixin debug output produces unnecessary log spam due to fabric api modules not following mixin guidelines.

  • @Shadow target fabric-registry-sync-v0.mixins.json:MixinIdList::idMap is final but shadow is not decorated with @Final
  • @Shadow target fabric-registry-sync-v0.mixins.json:MixinIdList::list is final but shadow is not decorated with @Final
  • @Shadow target fabric-resource-loader-v0.mixins.json:MixinReloadableResourceManagerImpl::type is final but shadow is not decorated with @Final
  • @Shadow target fabric-registry-sync-v0.mixins.json:client.MixinBlockColorMap::providers is final but shadow is not decorated with @Final
  • @Shadow target fabric-registry-sync-v0.mixins.json:client.MixinItemColorMap::providers is final but shadow is not decorated with @Final
  • @Shadow target fabric-registry-sync-v0.mixins.json:client.MixinItemModelMap::modelIds is final but shadow is not decorated with @Final
  • hadow target fabric-registry-sync-v0.mixins.json:client.MixinItemModelMap::models is final but shadow is not decorated with @Final
  • @Shadow target fabric-registry-sync-v0.mixins.json:client.MixinParticleManager::factories is final but shadow is not decorated with @Final

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Daomephstacommented, Jun 13, 2022

Is it a good idea to decorate these with @Final? What if another mod wants to AW them… wouldn’t that lead to crashes?

@Final doesn’t make a field final, it causes Mixin to prevent writes to the shadowed field within the mixin. Writes outside of that specific mixin are unaffected.

On an Shadow field, it can be used to raise an error-level log message if any write occurrences appear in the mixin bytecode. This can be used in place of declaring the field as actually final. This is required since it is normally desirable to remove the final modifier from shadow fields to avoid unwanted field initialisers. If MixinEnvironment.Option.DEBUG_VERIFY is true, then an InvalidMixinException is thrown.

https://jenkins.liteloader.com/view/Other/job/Mixin/javadoc/org/spongepowered/asm/mixin/Final.html

1reaction
haykam821commented, Jun 14, 2022

I wouldn’t follow the list given in this issue’s description given that it is about two years out of date. Could someone post an updated list for tracking here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Notes Mixin 0.8 · SpongePowered/Mixin Wiki - GitHub
Mixin is a trait/mixin and bytecode weaving framework for Java using ... minor bugs and improving general quality of life for mixin authors....
Read more >
The mixin pattern in TypeScript - all you need to know - Bryntum
In this blog post, we will deep dive into the mixin pattern in TypeScript that we use heavily at Bryntum for development of...
Read more >
A fresh look at JavaScript Mixins
In this article I'll explore JavaScript mixins in detail, ... A quick survey reveals some minor variations in this implementation.
Read more >
Tips to Help You Level Up Your Sass - SitePoint
It's useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Sass reference.
Read more >
Proposal: Mixins for C++ - Google Groups
The ability to inject additional code into a class is something that I have repeatedly missed. Aside from a number of minor uses,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found