diff --git a/build.gradle b/build.gradle index cdc95e1..d486022 100644 --- a/build.gradle +++ b/build.gradle @@ -101,7 +101,6 @@ dependencies { implementation('org.apache.logging.log4j:log4j-api:2.11.+') implementation('cpw.mods:modlauncher:6.1.+:api') implementation('com.google.code.findbugs:jsr305:3.0.2') - // TODO: Remove in 1.17 api('net.jodah:typetools:0.8.+') jmhImplementation('cpw.mods:modlauncher:6.1.+') jmhImplementation("org.powermock:powermock-core:2.0.+") diff --git a/src/main/java/net/minecraftforge/eventbus/EventBus.java b/src/main/java/net/minecraftforge/eventbus/EventBus.java index 247386f..23bb75c 100644 --- a/src/main/java/net/minecraftforge/eventbus/EventBus.java +++ b/src/main/java/net/minecraftforge/eventbus/EventBus.java @@ -158,7 +158,6 @@ private , F> Predicate passGenericFilter( return e->e.getGenericType() == type; } - @Deprecated // TODO: Remove in 1.17 private void checkNotGeneric(final Consumer consumer) { checkNotGeneric(getEventClass(consumer)); } @@ -169,7 +168,6 @@ private void checkNotGeneric(final Class eventType) { } } - @Deprecated // TODO: Remove in 1.17 @Override public void addListener(final Consumer consumer) { checkNotGeneric(consumer); @@ -182,7 +180,6 @@ public void addListener(final Class eventType, final Consum addListener(EventPriority.NORMAL, eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @Override public void addListener(final EventPriority priority, final Consumer consumer) { checkNotGeneric(consumer); @@ -195,7 +192,6 @@ public void addListener(final EventPriority priority, final Cl addListener(priority, false, eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @Override public void addListener(final EventPriority priority, final boolean receiveCancelled, final Consumer consumer) { checkNotGeneric(consumer); @@ -208,7 +204,6 @@ public void addListener(final EventPriority priority, final bo addListener(priority, passCancelled(receiveCancelled), eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @Override public , F> void addGenericListener(final Class genericClassFilter, final Consumer consumer) { addGenericListener(genericClassFilter, EventPriority.NORMAL, consumer); @@ -219,7 +214,6 @@ public , F> void addGenericListener(final Cl addGenericListener(genericClassFilter, EventPriority.NORMAL, eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @Override public , F> void addGenericListener(final Class genericClassFilter, final EventPriority priority, final Consumer consumer) { addGenericListener(genericClassFilter, priority, false, consumer); @@ -230,7 +224,6 @@ public , F> void addGenericListener(final Cl addGenericListener(genericClassFilter, priority, false, eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @Override public , F> void addGenericListener(final Class genericClassFilter, final EventPriority priority, final boolean receiveCancelled, final Consumer consumer) { addListener(priority, passGenericFilter(genericClassFilter).and(passCancelled(receiveCancelled)), consumer); @@ -241,7 +234,6 @@ public , F> void addGenericListener(final Cl addListener(priority, passGenericFilter(genericClassFilter).and(passCancelled(receiveCancelled)), eventType, consumer); } - @Deprecated // TODO: Remove in 1.17 @SuppressWarnings("unchecked") private Class getEventClass(Consumer consumer) { final Class eventClass = (Class) TypeResolver.resolveRawArgument(Consumer.class, consumer.getClass()); @@ -252,7 +244,6 @@ private Class getEventClass(Consumer consumer) { return eventClass; } - @Deprecated // TODO: Remove in 1.17 private void addListener(final EventPriority priority, final Predicate filter, final Consumer consumer) { Class eventClass = getEventClass(consumer); if (Objects.equals(eventClass, Event.class)) diff --git a/src/main/java/net/minecraftforge/eventbus/api/IEventBus.java b/src/main/java/net/minecraftforge/eventbus/api/IEventBus.java index e9fab19..4e812b3 100644 --- a/src/main/java/net/minecraftforge/eventbus/api/IEventBus.java +++ b/src/main/java/net/minecraftforge/eventbus/api/IEventBus.java @@ -36,9 +36,7 @@ public interface IEventBus { * * @param consumer Callback to invoke when a matching event is received * @param The {@link Event} subclass to listen for - * @deprecated Use {@link #addListener(Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 void addListener(Consumer consumer); /** @@ -56,9 +54,7 @@ public interface IEventBus { * @param priority {@link EventPriority} for this listener * @param consumer Callback to invoke when a matching event is received * @param The {@link Event} subclass to listen for - * @deprecated Use {@link #addListener(EventPriority, Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 void addListener(EventPriority priority, Consumer consumer); /** @@ -78,9 +74,7 @@ public interface IEventBus { * @param receiveCancelled Indicate if this listener should receive events that have been {@link Cancelable} cancelled * @param consumer Callback to invoke when a matching event is received * @param The {@link Event} subclass to listen for - * @deprecated Use {@link #addListener(EventPriority, boolean, Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 void addListener(EventPriority priority, boolean receiveCancelled, Consumer consumer); /** @@ -105,9 +99,7 @@ public interface IEventBus { * @param consumer Callback to invoke when a matching event is received * @param The {@link GenericEvent} subclass to listen for * @param The {@link Class} to filter the {@link GenericEvent} for - * @deprecated Use {@link #addGenericListener(Class, Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 , F> void addGenericListener(Class genericClassFilter, Consumer consumer); /** @@ -132,9 +124,7 @@ public interface IEventBus { * @param consumer Callback to invoke when a matching event is received * @param The {@link GenericEvent} subclass to listen for * @param The {@link Class} to filter the {@link GenericEvent} for - * @deprecated Use {@link #addGenericListener(Class, EventPriority, Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 , F> void addGenericListener(Class genericClassFilter, EventPriority priority, Consumer consumer); /** @@ -161,9 +151,7 @@ public interface IEventBus { * @param consumer Callback to invoke when a matching event is received * @param The {@link GenericEvent} subclass to listen for * @param The {@link Class} to filter the {@link GenericEvent} for - * @deprecated Use {@link #addGenericListener(Class, EventPriority, boolean, Class, Consumer)} */ - @Deprecated // TODO: Remove in 1.17 , F> void addGenericListener(Class genericClassFilter, EventPriority priority, boolean receiveCancelled, Consumer consumer); /** diff --git a/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/BenchmarkArmsLength.java b/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/BenchmarkArmsLength.java index 230c968..7850540 100644 --- a/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/BenchmarkArmsLength.java +++ b/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/BenchmarkArmsLength.java @@ -10,7 +10,6 @@ public class BenchmarkArmsLength implements Callable { private static IEventBus staticSubscriberBus; private static IEventBus dynamicSubscriberBus; - @Deprecated private static IEventBus lambdaSubscriberBus; private static IEventBus classLambdaSubscriberBus; private static IEventBus combinedSubscriberBus; diff --git a/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/SubscriberLambda.java b/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/SubscriberLambda.java index 7a3edca..c13042f 100644 --- a/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/SubscriberLambda.java +++ b/src/testJars/java/net/minecraftforge/eventbus/benchmarks/compiled/SubscriberLambda.java @@ -2,7 +2,6 @@ import net.minecraftforge.eventbus.api.IEventBus; -@Deprecated public class SubscriberLambda {