Use static imports for Colectors.*

This commit is contained in:
games647 committed 2018-02-05 12:54:35 +01:00
1 parent 0c550edb05
commit d0d5bd300b
7 files changed
+20 -10

No files matched your search

+1
View File
@@ -38,6 +38,7 @@
<version>1.7.25</version>
</dependency>
<!--GSON is not at the right position for Minecraft 1.7-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
@@ -22,13 +22,15 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
/**
* @param <P> GameProfile class
* @param <C> CommandSender
@@ -63,7 +65,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
messages.getKeys()
.stream()
.filter(key -> messages.get(key) != null)
.collect(Collectors.toMap(Function.identity(), messages::get))
.collect(toMap(identity(), messages::get))
.forEach((key, message) -> {
String colored = CommonUtil.translateColorCodes((String) message);
if (!colored.isEmpty()) {
@@ -77,7 +79,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
List<String> ipAddresses = config.getStringList("ip-addresses");
int requestLimit = config.getInt("mojang-request-limit");
List<String> proxyList = config.get("proxies", new ArrayList<>());
List<HostAndPort> proxies = proxyList.stream().map(HostAndPort::fromString).collect(Collectors.toList());
List<HostAndPort> proxies = proxyList.stream().map(HostAndPort::fromString).collect(toList());
this.apiConnector = plugin.makeApiConnector(ipAddresses, requestLimit, proxies);
}