I'm adding obfuscation via proguard/maven to a java application as we prepare it for distribution. During the process, it errors out with:
Note: ...eventlib.EventManager accesses a declared method 'getHandlerList()' dynamically
It then lists a dozen classes with that method with Maybe this is... and it recommends using -keep to avoid the problem.
When I do add -keep public class my.package.info.eventlib.HandlerList { *; } to the build process, the error goes away, but I see the following notices:
[proguard] Note: the configuration keeps the entry point 'events.TransactionEvent { TransactionEvent(my.package.info.inventory.Inventory,my.package.info.inventory.Inventory$TransactionType,my.package.info.inventory.ItemDefinition,short); }', but not the descriptor class 'my.package.info.inventory.Inventory'
When I run the application, it errors out with an NPE (which it doesn't do when run without obfuscation):
Caused by: java.lang.NullPointerException at java.util.EnumMap.<init>(EnumMap.java:113) at my.package.info.eventlib.HandlerList.<init>(Unknown Source) at my.package.info.events.CollisionEvent.<clinit>(Unknown Source) It's all tied to the events. How can I resolve this without telling proguard to keep everything tied to them?
Here's a full example of the original error: http://pste.me/m9BsY/
The event system is based on lahwran's fastevents