From 76bef1337763db5350e6dd13a563673c99ba9338 Mon Sep 17 00:00:00 2001 From: xDark <19853368+xxDark@users.noreply.github.com> Date: Fri, 31 Jul 2020 14:17:31 +0300 Subject: [PATCH] Remove deprecated members --- .../proxy/network/TransportType.java | 37 +++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java b/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java index 63c9c5eec..d241267b9 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java @@ -3,7 +3,6 @@ package com.velocitypowered.proxy.network; import com.velocitypowered.proxy.util.concurrent.VelocityNettyThreadFactory; import io.netty.channel.ChannelFactory; import io.netty.channel.EventLoopGroup; -import io.netty.channel.ReflectiveChannelFactory; import io.netty.channel.epoll.Epoll; import io.netty.channel.epoll.EpollDatagramChannel; import io.netty.channel.epoll.EpollEventLoopGroup; @@ -20,22 +19,16 @@ import java.util.concurrent.ThreadFactory; import java.util.function.BiFunction; enum TransportType { - NIO("NIO", NioServerSocketChannel::new, NioServerSocketChannel.class, - NioSocketChannel::new, NioSocketChannel.class, - NioDatagramChannel::new, NioDatagramChannel.class, + NIO("NIO", NioServerSocketChannel::new, + NioSocketChannel::new, + NioDatagramChannel::new, (name, type) -> new NioEventLoopGroup(0, createThreadFactory(name, type))), - EPOLL("epoll", EpollServerSocketChannel::new, EpollServerSocketChannel.class, - EpollSocketChannel::new, EpollSocketChannel.class, - EpollDatagramChannel::new, EpollDatagramChannel.class, + EPOLL("epoll", EpollServerSocketChannel::new, + EpollSocketChannel::new, + EpollDatagramChannel::new, (name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type))); final String name; - @Deprecated - final Class serverSocketChannelClass; - @Deprecated - final Class socketChannelClass; - @Deprecated - final Class datagramChannelClass; final ChannelFactory serverSocketChannelFactory; final ChannelFactory socketChannelFactory; final ChannelFactory datagramChannelFactory; @@ -43,34 +36,16 @@ enum TransportType { TransportType(final String name, final ChannelFactory serverSocketChannelFactory, - final Class serverSocketChannelClass, final ChannelFactory socketChannelFactory, - final Class socketChannelClass, final ChannelFactory datagramChannelFactory, - final Class datagramChannelClass, final BiFunction eventLoopGroupFactory) { this.name = name; - this.serverSocketChannelClass = serverSocketChannelClass; - this.socketChannelClass = socketChannelClass; - this.datagramChannelClass = datagramChannelClass; this.serverSocketChannelFactory = serverSocketChannelFactory; this.socketChannelFactory = socketChannelFactory; this.datagramChannelFactory = datagramChannelFactory; this.eventLoopGroupFactory = eventLoopGroupFactory; } - @Deprecated - TransportType(final String name, - final Class serverSocketChannelClass, - final Class socketChannelClass, - final Class datagramChannelClass, - final BiFunction eventLoopGroupFactory) { - this(name, new ReflectiveChannelFactory<>(serverSocketChannelClass), serverSocketChannelClass, - new ReflectiveChannelFactory<>(socketChannelClass), socketChannelClass, - new ReflectiveChannelFactory<>(datagramChannelClass), datagramChannelClass, - eventLoopGroupFactory); - } - @Override public String toString() { return this.name;