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.
This commit is contained in:
Sam Young 2014-11-24 09:51:14 -08:00 committed by Norman Maurer
parent a83a970276
commit 1c09bf86a4
2 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ public class PromiseAggregator<V, F extends Future<V>> implements GenericFutureL
/**
* Add the given {@link Promise}s to the aggregator.
*/
@SafeVarargs
public final PromiseAggregator<V, F> add(Promise<V>... promises) {
if (promises == null) {
throw new NullPointerException("promises");

View File

@ -31,6 +31,7 @@ public class PromiseNotifier<V, F extends Future<V>> implements GenericFutureLis
*
* @param promises the {@link Promise}s to notify once this {@link GenericFutureListener} is notified.
*/
@SafeVarargs
public PromiseNotifier(Promise<? super V>... promises) {
if (promises == null) {
throw new NullPointerException("promises");