@@ -278,7 +278,7 @@ public Duration getShutdownDuration() {
278278 }
279279
280280 /**
281- * @return The HTTP unexpected exception handler for this server or null if a default was not set .
281+ * @return The HTTP unexpected exception handler for this server. Never null.
282282 */
283283 public HTTPUnexpectedExceptionHandler getUnexpectedExceptionHandler () {
284284 return unexpectedExceptionHandler ;
@@ -343,7 +343,7 @@ public HTTPServerConfiguration withContextPath(String contextPath) {
343343 */
344344 @ Override
345345 public HTTPServerConfiguration withExpectValidator (ExpectValidator validator ) {
346- Objects .requireNonNull (handler , "You cannot set ExpectValidator to null" );
346+ Objects .requireNonNull (validator , "You cannot set the expect validator to null" );
347347 this .expectValidator = validator ;
348348 return this ;
349349 }
@@ -353,7 +353,7 @@ public HTTPServerConfiguration withExpectValidator(ExpectValidator validator) {
353353 */
354354 @ Override
355355 public HTTPServerConfiguration withHandler (HTTPHandler handler ) {
356- Objects .requireNonNull (handler , "You cannot set HTTPHandler to null" );
356+ Objects .requireNonNull (handler , "You cannot set the handler to null" );
357357 this .handler = handler ;
358358 return this ;
359359 }
@@ -363,7 +363,7 @@ public HTTPServerConfiguration withHandler(HTTPHandler handler) {
363363 */
364364 @ Override
365365 public HTTPServerConfiguration withInitialReadTimeout (Duration duration ) {
366- Objects .requireNonNull (duration , "You cannot set the client timeout to null" );
366+ Objects .requireNonNull (duration , "You cannot set the client read timeout duration to null" );
367367 if (duration .isZero () || duration .isNegative ()) {
368368 throw new IllegalArgumentException ("The client timeout duration must be greater than 0" );
369369 }
@@ -388,7 +388,6 @@ public HTTPServerConfiguration withInstrumenter(Instrumenter instrumenter) {
388388 @ Override
389389 public HTTPServerConfiguration withKeepAliveTimeoutDuration (Duration duration ) {
390390 Objects .requireNonNull (duration , "You cannot set the keep-alive timeout duration to null" );
391-
392391 if (duration .isZero () || duration .isNegative ()) {
393392 throw new IllegalArgumentException ("The keep-alive timeout duration must be grater than 0" );
394393 }
@@ -402,7 +401,7 @@ public HTTPServerConfiguration withKeepAliveTimeoutDuration(Duration duration) {
402401 */
403402 @ Override
404403 public HTTPServerConfiguration withListener (HTTPListenerConfiguration listener ) {
405- Objects .requireNonNull (listener , "You cannot set HTTPListenerConfiguration to null" );
404+ Objects .requireNonNull (listener , "You cannot add a null HTTPListenerConfiguration " );
406405 this .listeners .add (listener );
407406 return this ;
408407 }
@@ -412,7 +411,7 @@ public HTTPServerConfiguration withListener(HTTPListenerConfiguration listener)
412411 */
413412 @ Override
414413 public HTTPServerConfiguration withLoggerFactory (LoggerFactory loggerFactory ) {
415- Objects .requireNonNull (loggerFactory , "You cannot set LoggerFactory to null" );
414+ Objects .requireNonNull (loggerFactory , "You cannot set the logger factory to null" );
416415 this .loggerFactory = loggerFactory ;
417416 return this ;
418417 }
@@ -506,7 +505,6 @@ public HTTPServerConfiguration withMultipartBufferSize(int multipartBufferSize)
506505 @ Override
507506 public HTTPServerConfiguration withMultipartConfiguration (MultipartConfiguration multipartStreamConfiguration ) {
508507 Objects .requireNonNull (multipartStreamConfiguration , "You cannot set the multipart stream configuration to null" );
509-
510508 this .multipartStreamConfiguration = multipartStreamConfiguration ;
511509 return this ;
512510 }
@@ -517,7 +515,6 @@ public HTTPServerConfiguration withMultipartConfiguration(MultipartConfiguration
517515 @ Override
518516 public HTTPServerConfiguration withProcessingTimeoutDuration (Duration duration ) {
519517 Objects .requireNonNull (duration , "You cannot set the processing timeout duration to null" );
520-
521518 if (duration .isZero () || duration .isNegative ()) {
522519 throw new IllegalArgumentException ("The processing timeout duration must be grater than 0" );
523520 }
@@ -532,7 +529,6 @@ public HTTPServerConfiguration withProcessingTimeoutDuration(Duration duration)
532529 @ Override
533530 public HTTPServerConfiguration withReadThroughputCalculationDelayDuration (Duration duration ) {
534531 Objects .requireNonNull (duration , "You cannot set the read throughput delay duration to null" );
535-
536532 if (duration .isZero () || duration .isNegative ()) {
537533 throw new IllegalArgumentException ("The read throughput delay duration must be grater than 0" );
538534 }
@@ -573,7 +569,6 @@ public HTTPServerConfiguration withResponseBufferSize(int responseBufferSize) {
573569 @ Override
574570 public HTTPServerConfiguration withShutdownDuration (Duration duration ) {
575571 Objects .requireNonNull (duration , "You cannot set the shutdown duration to null" );
576-
577572 if (duration .isZero () || duration .isNegative ()) {
578573 throw new IllegalArgumentException ("The shutdown duration must be grater than 0" );
579574 }
@@ -587,6 +582,7 @@ public HTTPServerConfiguration withShutdownDuration(Duration duration) {
587582 */
588583 @ Override
589584 public HTTPServerConfiguration withUnexpectedExceptionHandler (HTTPUnexpectedExceptionHandler unexpectedExceptionHandler ) {
585+ Objects .requireNonNull (unexpectedExceptionHandler , "You cannot set the unexpected exception handler to null" );
590586 this .unexpectedExceptionHandler = unexpectedExceptionHandler ;
591587 return this ;
592588 }
@@ -597,7 +593,6 @@ public HTTPServerConfiguration withUnexpectedExceptionHandler(HTTPUnexpectedExce
597593 @ Override
598594 public HTTPServerConfiguration withWriteThroughputCalculationDelayDuration (Duration duration ) {
599595 Objects .requireNonNull (duration , "You cannot set the write throughput delay duration to null" );
600-
601596 if (duration .isZero () || duration .isNegative ()) {
602597 throw new IllegalArgumentException ("The write throughput delay duration must be grater than 0" );
603598 }
0 commit comments