Fix some warnings at generics usage

Motivation:

Existing warnings from java compiler

Modifications:

Add/fix type parameters

Result:

Less warnings
This commit is contained in:
Nikolay Fedorovskikh 2017-02-21 23:56:57 +05:00 committed by Norman Maurer
parent ce222308a6
commit 634a8afa53
5 changed files with 8 additions and 9 deletions

View File

@ -38,7 +38,7 @@ public class XmlDecoder extends ByteToMessageDecoder {
private static final AsyncXMLInputFactory XML_INPUT_FACTORY = new InputFactoryImpl();
private static final XmlDocumentEnd XML_DOCUMENT_END = XmlDocumentEnd.INSTANCE;
private final AsyncXMLStreamReader streamReader = XML_INPUT_FACTORY.createAsyncForByteArray();
private final AsyncXMLStreamReader<AsyncByteArrayFeeder> streamReader = XML_INPUT_FACTORY.createAsyncForByteArray();
private final AsyncByteArrayFeeder streamFeeder = (AsyncByteArrayFeeder) streamReader.getInputFeeder();
@Override

View File

@ -478,7 +478,7 @@ public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
if (listeners instanceof DefaultFutureListeners) {
notifyListeners0((DefaultFutureListeners) listeners);
} else {
notifyListener0(this, (GenericFutureListener<? extends Future<V>>) listeners);
notifyListener0(this, (GenericFutureListener<?>) listeners);
}
synchronized (this) {
if (this.listeners == null) {
@ -516,7 +516,7 @@ public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
} else if (listeners instanceof DefaultFutureListeners) {
((DefaultFutureListeners) listeners).add(listener);
} else {
listeners = new DefaultFutureListeners((GenericFutureListener<? extends Future<V>>) listeners, listener);
listeners = new DefaultFutureListeners((GenericFutureListener<?>) listeners, listener);
}
}

View File

@ -210,8 +210,8 @@ public class HeadersBenchmark extends AbstractMicrobenchmark {
}
private static final class SlowHeaders implements Headers<CharSequence, CharSequence, SlowHeaders> {
private final Headers<CharSequence, CharSequence, ? extends Headers> delegate;
private SlowHeaders(Headers<CharSequence, CharSequence, ? extends Headers> delegate) {
private final Headers<CharSequence, CharSequence, ? extends Headers<?, ?, ?>> delegate;
private SlowHeaders(Headers<CharSequence, CharSequence, ? extends Headers<?, ?, ?>> delegate) {
this.delegate = delegate;
}

View File

@ -68,7 +68,7 @@ public final class CompositeNameResolver<T> extends SimpleNameResolver<T> {
if (resolverIndex >= resolvers.length) {
promise.setFailure(lastFailure);
} else {
NameResolver resolver = resolvers[resolverIndex];
NameResolver<T> resolver = resolvers[resolverIndex];
resolver.resolve(inetHost).addListener(new FutureListener<T>() {
@Override
public void operationComplete(Future<T> future) throws Exception {
@ -94,7 +94,7 @@ public final class CompositeNameResolver<T> extends SimpleNameResolver<T> {
if (resolverIndex >= resolvers.length) {
promise.setFailure(lastFailure);
} else {
NameResolver resolver = resolvers[resolverIndex];
NameResolver<T> resolver = resolvers[resolverIndex];
resolver.resolveAll(inetHost).addListener(new FutureListener<List<T>>() {
@Override
public void operationComplete(Future<List<T>> future) throws Exception {

View File

@ -24,7 +24,6 @@ import io.netty.util.Recycler.Handle;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.concurrent.FastThreadLocal;
import io.netty.util.internal.InternalThreadLocalMap;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.PromiseNotificationUtil;
import io.netty.util.internal.SystemPropertyUtil;
import io.netty.util.internal.logging.InternalLogger;
@ -755,7 +754,7 @@ public final class ChannelOutboundBuffer {
static final class Entry {
private static final Recycler<Entry> RECYCLER = new Recycler<Entry>() {
@Override
protected Entry newObject(Handle handle) {
protected Entry newObject(Handle<Entry> handle) {
return new Entry(handle);
}
};