Remove unnecessary generic declaration

This commit is contained in:
TheMode 2021-08-21 04:21:03 +02:00
parent c6cc96a5f9
commit a58e149918
2 changed files with 2 additions and 3 deletions

View File

@ -222,10 +222,9 @@ public interface EventNode<T extends Event> {
* has similar optimization built-in. * has similar optimization built-in.
* *
* @param handle the listener handle * @param handle the listener handle
* @param <E> the event type
* @return true if the event has 1 or more listeners * @return true if the event has 1 or more listeners
*/ */
<E extends T> boolean hasListener(@NotNull ListenerHandle<E> handle); boolean hasListener(@NotNull ListenerHandle<? extends T> handle);
/** /**
* Execute a cancellable event with a callback to execute if the event is successful. * Execute a cancellable event with a callback to execute if the event is successful.

View File

@ -58,7 +58,7 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
} }
@Override @Override
public <E extends T> boolean hasListener(@NotNull ListenerHandle<E> handle) { public boolean hasListener(@NotNull ListenerHandle<? extends T> handle) {
final Handle<T> castedHandle = (Handle<T>) handle; final Handle<T> castedHandle = (Handle<T>) handle;
if (!castedHandle.updated) castedHandle.update(); if (!castedHandle.updated) castedHandle.update();
return !castedHandle.listeners.isEmpty(); return !castedHandle.listeners.isEmpty();