🎨 Use method reference instead of anonymous class
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Sep 2021 15:57:11 +0000 (17:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Sep 2021 15:57:11 +0000 (17:57 +0200)
src/main/java/net/pterodactylus/irc/DefaultConnection.java

index 79ab87b..39908ef 100644 (file)
@@ -98,13 +98,7 @@ public class DefaultConnection extends AbstractExecutionThreadService implements
        private final int port;
 
        /** The nickname chooser. */
-       private NicknameChooser nicknameChooser = new NicknameChooser() {
-
-               @Override
-               public String getNickname() {
-                       return RandomNickname.get();
-               }
-       };
+       private NicknameChooser nicknameChooser = RandomNickname::get;
 
        /** The nickname. */
        private String nickname = null;