@@ -340,52 +340,52 @@ private class ManagementImpl implements Management {
340340 private static final Function <Client .WithManagement , ? extends MessageTagManager > DEFAULT_MESSAGE_TAG_MANAGER = DefaultMessageTagManager ::new ;
341341 private static final Function <Client .WithManagement , ? extends ServerInfo .WithManagement > DEFAULT_SERVER_INFO = DefaultServerInfo ::new ;
342342
343- private String name = "Unnamed" ;
343+ String name = "Unnamed" ;
344344
345- private @ Nullable String bindHost ;
346- private int bindPort ;
345+ @ Nullable String bindHost ;
346+ int bindPort ;
347347
348- private HostWithPort serverHostWithPort = HostWithPort .of (DefaultBuilder .DEFAULT_SERVER_HOST , DefaultBuilder .DEFAULT_SERVER_PORT );
349- private @ Nullable String serverPassword = null ;
350- private boolean secure = true ;
351- private @ Nullable Path secureKeyCertChain = null ;
352- private @ Nullable Path secureKey = null ;
353- private @ Nullable String secureKeyPassword = null ;
354- private @ Nullable TrustManagerFactory secureTrustManagerFactory = null ;
348+ HostWithPort serverHostWithPort = HostWithPort .of (DefaultBuilder .DEFAULT_SERVER_HOST , DefaultBuilder .DEFAULT_SERVER_PORT );
349+ @ Nullable String serverPassword = null ;
350+ boolean secure = true ;
351+ @ Nullable Path secureKeyCertChain = null ;
352+ @ Nullable Path secureKey = null ;
353+ @ Nullable String secureKeyPassword = null ;
354+ @ Nullable TrustManagerFactory secureTrustManagerFactory = null ;
355355
356- private String nick = "Kitteh" ;
357- private String userString = "Kitteh" ;
358- private String realName = "KICL " + Version .getVersion () + " - kitteh.org" ;
356+ String nick = "Kitteh" ;
357+ String userString = "Kitteh" ;
358+ String realName = "KICL " + Version .getVersion () + " - kitteh.org" ;
359359
360360 // Listeners
361- private @ Nullable Consumer <Exception > exceptionListener = Throwable ::printStackTrace ;
362- private @ Nullable Consumer <String > inputListener = null ;
363- private @ Nullable Consumer <String > outputListener = null ;
361+ @ Nullable Consumer <Exception > exceptionListener = Throwable ::printStackTrace ;
362+ @ Nullable Consumer <String > inputListener = null ;
363+ @ Nullable Consumer <String > outputListener = null ;
364364
365365 // Proxy
366- private @ Nullable String proxyHost ;
367- private int proxyPort ;
368- private @ Nullable ProxyType proxyType ;
366+ @ Nullable String proxyHost ;
367+ int proxyPort ;
368+ @ Nullable ProxyType proxyType ;
369369
370370 // WebIRC
371- private @ Nullable String webircHost = null ;
372- private @ Nullable InetAddress webircIP = null ;
373- private @ Nullable String webircPassword = null ;
374- private @ Nullable String webircGateway = null ;
371+ @ Nullable String webircHost = null ;
372+ @ Nullable InetAddress webircIP = null ;
373+ @ Nullable String webircPassword = null ;
374+ @ Nullable String webircGateway = null ;
375375
376376 // Management
377- private Function <Client .WithManagement , ? extends ActorTracker > actorTracker = DefaultBuilder .DEFAULT_ACTOR_TRACKER ;
378- private Function <Client .WithManagement , ? extends AuthManager > authManager = DefaultBuilder .DEFAULT_AUTH_MANAGER ;
379- private Function <Client .WithManagement , ? extends CapabilityManager .WithManagement > capabilityManager = DefaultBuilder .DEFAULT_CAPABILITY_MANAGER ;
380- private @ Nullable DefaultMessageMap defaultMessageMap = null ;
381- private Function <Client .WithManagement , ? extends EventManager > eventManager = DefaultBuilder .DEFAULT_EVENT_MANAGER ;
382- private List <EventListenerSupplier > eventListeners = DefaultBuilder .DEFAULT_EVENT_LISTENERS ;
383- private Function <Client .WithManagement , ? extends ISupportManager > iSupportManager = DefaultBuilder .DEFAULT_ISUPPORT_MANAGER ;
384- private Function <Client .WithManagement , ? extends MessageSendingQueue > messageSendingQueue = DefaultBuilder .DEFAULT_MESSAGE_SENDING_QUEUE ;
385- private Function <Client .WithManagement , ? extends MessageTagManager > messageTagManager = DefaultBuilder .DEFAULT_MESSAGE_TAG_MANAGER ;
386- private NetworkHandler networkHandler = NettyNetworkHandler .getInstance ();
387- private Function <Client .WithManagement , ? extends ServerInfo .WithManagement > serverInfo = DefaultBuilder .DEFAULT_SERVER_INFO ;
388- private @ Nullable StsStorageManager stsStorageManager = null ;
377+ Function <Client .WithManagement , ? extends ActorTracker > actorTracker = DefaultBuilder .DEFAULT_ACTOR_TRACKER ;
378+ Function <Client .WithManagement , ? extends AuthManager > authManager = DefaultBuilder .DEFAULT_AUTH_MANAGER ;
379+ Function <Client .WithManagement , ? extends CapabilityManager .WithManagement > capabilityManager = DefaultBuilder .DEFAULT_CAPABILITY_MANAGER ;
380+ @ Nullable DefaultMessageMap defaultMessageMap = null ;
381+ Function <Client .WithManagement , ? extends EventManager > eventManager = DefaultBuilder .DEFAULT_EVENT_MANAGER ;
382+ List <EventListenerSupplier > eventListeners = DefaultBuilder .DEFAULT_EVENT_LISTENERS ;
383+ Function <Client .WithManagement , ? extends ISupportManager > iSupportManager = DefaultBuilder .DEFAULT_ISUPPORT_MANAGER ;
384+ Function <Client .WithManagement , ? extends MessageSendingQueue > messageSendingQueue = DefaultBuilder .DEFAULT_MESSAGE_SENDING_QUEUE ;
385+ Function <Client .WithManagement , ? extends MessageTagManager > messageTagManager = DefaultBuilder .DEFAULT_MESSAGE_TAG_MANAGER ;
386+ NetworkHandler networkHandler = NettyNetworkHandler .getInstance ();
387+ Function <Client .WithManagement , ? extends ServerInfo .WithManagement > serverInfo = DefaultBuilder .DEFAULT_SERVER_INFO ;
388+ @ Nullable StsStorageManager stsStorageManager = null ;
389389
390390 @ Override
391391 public @ NonNull DefaultBuilder name (@ NonNull String name ) {
@@ -447,28 +447,8 @@ private class ManagementImpl implements Management {
447447
448448 @ Override
449449 public @ NonNull Client build () {
450- if (this .stsStorageManager != null ) {
451- Sanity .truthiness (!SslUtil .isInsecure (this .secureTrustManagerFactory ), "Cannot use STS with an insecure trust manager." );
452- }
453-
454- HostWithPort proxyAddress = null ;
455- if ((this .proxyHost != null ) && (this .proxyPort > 0 )) {
456- proxyAddress = HostWithPort .of (this .proxyHost , this .proxyPort );
457- }
458- Client .WithManagement client = new DefaultClient ();
459- client .initialize (this .name , this .networkHandler ,
460- this .serverHostWithPort , this .serverPassword ,
461- this .getInetSocketAddress (this .bindHost , this .bindPort ),
462- proxyAddress , this .proxyType ,
463- this .nick , this .userString , this .realName ,
464- this .actorTracker .apply (client ),
465- this .authManager .apply (client ), this .capabilityManager .apply (client ), this .eventManager .apply (client ),
466- this .eventListeners , this .messageTagManager .apply (client ),
467- this .iSupportManager .apply (client ), this .defaultMessageMap , this .messageSendingQueue ,
468- this .serverInfo , this .exceptionListener , this .inputListener , this .outputListener , this .secure ,
469- this .secureKeyCertChain , this .secureKey , this .secureKeyPassword , this .secureTrustManagerFactory , this .stsStorageManager ,
470- this .webircHost , this .webircIP , this .webircPassword , this .webircGateway
471- );
450+ DefaultClient client = new DefaultClient (this );
451+ client .initialize (this );
472452
473453 return client ;
474454 }
@@ -485,7 +465,7 @@ private class ManagementImpl implements Management {
485465 return new ToStringer (this ).toString ();
486466 }
487467
488- private InetSocketAddress getInetSocketAddress (@ Nullable String host , int port ) {
468+ InetSocketAddress getInetSocketAddress (@ Nullable String host , int port ) {
489469 if (host != null ) {
490470 return new InetSocketAddress (host , port );
491471 } else {
0 commit comments