Open dvandenham opened 4 days ago
The following tests should also be changed when this is fixed:
https://github.com/dvandenham/EventBus/blob/1c37ef09cb306cb826cfb691abb68d77f58b53d6/src/test/java/SubscriberTest.java#L88 https://github.com/dvandenham/EventBus/blob/1c37ef09cb306cb826cfb691abb68d77f58b53d6/src/test/java/SubscriberTest.java#L89
https://github.com/dvandenham/EventBus/blob/05d5682a4221388ff1c851e326394f89bdc8579a/src/main/java/nl/appelgebakje22/eventbus/EventBus.java#L58
The registration of
MyClass::myListener
andMyClass::myListener
won't cause an error since the runtime identity will be different each time. This will need to fixed eventually.Storing it as a variable
Consumer<MyEvent> sub = MyClass::myListener
and registering the variablesub
twice causes an error like expected.