MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
509 stars 437 forks source link

Should `@SubscribeEvent` automatically apply `@SuppressWarnings("unused") #839

Closed a2435191 closed 2 years ago

a2435191 commented 2 years ago

Title. Since Forge's event handler accesses the @SubscribeEvent-annotated methods of a mod class in a way most static analysis tools can't see, would it make sense to have it apply @SuppressWarnings("unused") to its method?

TheCurle commented 2 years ago

It's a good idea in theory, but IDEs are known to be picky about how they detect something being used. It needs some testing, but I think it'd be worth a shot.

LexManos commented 2 years ago

If you care about the warning, you can suppress it yourself easily enough. Adding extra processing on our end will just cause more of a maintenance nightmare then it's worth. Not to mention, it hides unused warnings inside the methods. Which I wouldn't want to do.