@@ -506,21 +506,22 @@ void authenticate(CredentialsProvider credentialsProvider) {
506
506
} else if (saslAuthenticateResponse .isChallenge ()) {
507
507
challenge = saslAuthenticateResponse .challenge ;
508
508
} else if (saslAuthenticateResponse .isAuthenticationFailure ()) {
509
- String message =
510
- "Unexpected response code during authentication: "
511
- + formatConstant (saslAuthenticateResponse .getResponseCode ());
509
+ StringBuilder message =
510
+ new StringBuilder (
511
+ "Unexpected response code during authentication: "
512
+ + formatConstant (saslAuthenticateResponse .getResponseCode ()));
512
513
if (saslAuthenticateResponse .getResponseCode ()
513
514
== RESPONSE_CODE_AUTHENTICATION_FAILURE_LOOPBACK ) {
514
- message +=
515
- ". The user is not authorized to connect from a remote host. "
516
- + "If the broker is running locally, make sure the '"
517
- + this .host
518
- + "' hostname is resolved to "
519
- + "the loopback interface (localhost, 127.0.0.1, ::1). "
520
- + "See https://www.rabbitmq.com/access-control.html#loopback-users." ;
515
+ message
516
+ . append ( ". The user is not authorized to connect from a remote host. " )
517
+ . append ( "If the broker is running locally, make sure the '" )
518
+ . append ( this .host )
519
+ . append ( "' hostname is resolved to " )
520
+ . append ( "the loopback interface (localhost, 127.0.0.1, ::1). " )
521
+ . append ( "See https://www.rabbitmq.com/access-control.html#loopback-users." ) ;
521
522
}
522
523
throw new AuthenticationFailureException (
523
- message , saslAuthenticateResponse .getResponseCode ());
524
+ message . toString () , saslAuthenticateResponse .getResponseCode ());
524
525
} else {
525
526
throw new StreamException (
526
527
"Unexpected response code during authentication: "
0 commit comments