Skip to content

Commit bd0e096

Browse files
committed
Squash spotbugs warning
1 parent 20f52e0 commit bd0e096

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/main/java/com/rabbitmq/stream/impl/Client.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -506,21 +506,22 @@ void authenticate(CredentialsProvider credentialsProvider) {
506506
} else if (saslAuthenticateResponse.isChallenge()) {
507507
challenge = saslAuthenticateResponse.challenge;
508508
} 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()));
512513
if (saslAuthenticateResponse.getResponseCode()
513514
== 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.");
521522
}
522523
throw new AuthenticationFailureException(
523-
message, saslAuthenticateResponse.getResponseCode());
524+
message.toString(), saslAuthenticateResponse.getResponseCode());
524525
} else {
525526
throw new StreamException(
526527
"Unexpected response code during authentication: "

0 commit comments

Comments
 (0)