From a37c4ad7f4578f725831f4f989fa82f389e6bfc7 Mon Sep 17 00:00:00 2001 From: Sam Young Date: Mon, 24 Nov 2014 09:51:14 -0800 Subject: [PATCH] Add @SafeVarargs to PromiseAggregator#add and PromiseNotifier#(...) https://github.com/netty/netty/issues/3147 Motivation: 8fbc513 introduced stray warnings in callsites of PromiseAggregator#add and PromiseNotifier#(...). Modifications: This commit adds the @SafeVarargs annotation to PromiseAggregator#add and PromiseNotifier#(...). As Netty is built with JDK7, this is a recognized annotation and should not affect runtime VM versions 1.5 and 1.6. Result: Building Netty with JDK7 will no longer produce warnings in the callsites mentioned above. --- .../main/java/io/netty/util/concurrent/PromiseAggregator.java | 1 + .../src/main/java/io/netty/util/concurrent/PromiseNotifier.java | 1 + 2 files changed, 2 insertions(+) diff --git a/common/src/main/java/io/netty/util/concurrent/PromiseAggregator.java b/common/src/main/java/io/netty/util/concurrent/PromiseAggregator.java index 62fb29e967..3e8d8979e7 100644 --- a/common/src/main/java/io/netty/util/concurrent/PromiseAggregator.java +++ b/common/src/main/java/io/netty/util/concurrent/PromiseAggregator.java @@ -58,6 +58,7 @@ public class PromiseAggregator> implements GenericFutureL /** * Add the given {@link Promise}s to the aggregator. */ + @SafeVarargs public final PromiseAggregator add(Promise... promises) { if (promises == null) { throw new NullPointerException("promises"); diff --git a/common/src/main/java/io/netty/util/concurrent/PromiseNotifier.java b/common/src/main/java/io/netty/util/concurrent/PromiseNotifier.java index 0a2e3482fd..da54edc121 100644 --- a/common/src/main/java/io/netty/util/concurrent/PromiseNotifier.java +++ b/common/src/main/java/io/netty/util/concurrent/PromiseNotifier.java @@ -31,6 +31,7 @@ public class PromiseNotifier> implements GenericFutureLis * * @param promises the {@link Promise}s to notify once this {@link GenericFutureListener} is notified. */ + @SafeVarargs public PromiseNotifier(Promise... promises) { if (promises == null) { throw new NullPointerException("promises");