File tree Expand file tree Collapse file tree
playtime-core/src/main/java/com/github/imdmk/playtime/core/injector/subscriber Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ public final class LocalPublisher implements Publisher {
1313
1414 private final Injector injector ;
1515
16- private final Map <Class <? extends SubscribeEvent >, List <SubscriberMethod >> subscribers = new HashMap <>();
16+ private final Map <Class <? extends SubscribeEvent >, List <SubscriberMethod >>
17+ subscribers = new HashMap <>();
1718
1819 public LocalPublisher (Injector injector ) {
1920 this .injector = injector ;
@@ -27,11 +28,10 @@ public void subscribe(Object instance) {
2728 continue ;
2829 }
2930
30- Class <? extends SubscribeEvent > eventType = subscribe .event ();
3131 method .setAccessible (true );
3232
3333 subscribers
34- .computeIfAbsent (eventType , k -> new ArrayList <>())
34+ .computeIfAbsent (subscribe . event () , k -> new ArrayList <>())
3535 .add (new SubscriberMethod (instance , method ));
3636 }
3737 }
@@ -53,6 +53,7 @@ public <E extends SubscribeEvent> E publish(E event) {
5353 return event ;
5454 }
5555
56- private record SubscriberMethod (Object instance , Method method ) { }
56+ private record SubscriberMethod (Object instance , Method method ) {
57+ }
5758}
5859
Original file line number Diff line number Diff line change 22
33import com .github .imdmk .playtime .core .injector .subscriber .event .SubscribeEvent ;
44
5-
65public interface Publisher {
76
87 void subscribe (Object subscriber );
You can’t perform that action at this time.
0 commit comments