Fixes the static modifier check

This commit is contained in:
Zontreck 2023-10-14 14:23:27 -07:00
parent 00ce1750c5
commit 0146cb6473

View file

@ -40,12 +40,12 @@ public class Bus {
List<Method> nonStaticMethods = Arrays.stream(clazz.getMethods())
.filter(x -> x.isAnnotationPresent(Subscribe.class))
.filter(x -> x.getModifiers() != Modifier.STATIC)
.filter(x -> (x.getModifiers() & Modifier.STATIC) != Modifier.STATIC)
.toList();
List<Method> staticMethods = Arrays.stream(clazz.getMethods())
.filter(x -> x.isAnnotationPresent(Subscribe.class))
.filter(x -> x.getModifiers() == Modifier.STATIC)
.filter(x -> (x.getModifiers() & Modifier.STATIC) == Modifier.STATIC)
.toList();
// Register the non-static methods if applicable