Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChannelPromiseAggregator methods now have warnings #3147

Closed
Scottmitch opened this issue Nov 18, 2014 · 3 comments
Closed

ChannelPromiseAggregator methods now have warnings #3147

Scottmitch opened this issue Nov 18, 2014 · 3 comments
Assignees
Milestone

Comments

@Scottmitch
Copy link
Member

It seems like the generic base classes introduced by 8fbc513 now results in warnings at the call sites of some of the generic methods.

An example of a warning is here and the warning is Type safety: A generic array of Promise<Void> is created for a varargs parameter.

How should we be handling this (I'm assuming this applies to more methods and is impacting more calls sites)? Is there a better way to handle this rather than adding a @suppreswarning statement? Can this issue serve as the followup task for the related cleanup?

@Scottmitch
Copy link
Member Author

@ysammy and @normanmaurer FYI. Any thoughts?

@Scottmitch Scottmitch added this to the 5.0.0.Alpha3 milestone Nov 20, 2014
@ysammy
Copy link
Contributor

ysammy commented Nov 20, 2014

You can fix this in JDK7+ with @SafeVarargs on the method declaration for PromiseAggregator#add. I believe JDK6 and lower will ignore this. @normanmaurer, can you comment on whether this would be acceptable style for Netty?

normanmaurer pushed a commit that referenced this issue Dec 1, 2014
…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.
normanmaurer pushed a commit that referenced this issue Dec 1, 2014
…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.
normanmaurer pushed a commit that referenced this issue Dec 1, 2014
…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.
@normanmaurer
Copy link
Member

This was fixed by @3191

pulllock pushed a commit to pulllock/netty that referenced this issue Oct 19, 2023
…etty#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants