Polishing

This commit is contained in:
Juergen Hoeller
2019-03-07 18:43:02 +01:00
parent 2b5434e46c
commit a94c12ff9a
10 changed files with 103 additions and 103 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -65,18 +65,20 @@ import org.springframework.validation.Validator;
* protocols such as STOMP.
*
* <p>{@link #clientInboundChannel()} and {@link #clientOutboundChannel()} deliver
* messages to and from remote clients to several message handlers such as
* messages to and from remote clients to several message handlers such as the
* following.
* <ul>
* <li>{@link #simpAnnotationMethodMessageHandler()}</li>
* <li>{@link #simpleBrokerMessageHandler()}</li>
* <li>{@link #stompBrokerRelayMessageHandler()}</li>
* <li>{@link #userDestinationMessageHandler()}</li>
* </ul>
* while {@link #brokerChannel()} delivers messages from within the application to the
*
* <p>{@link #brokerChannel()} delivers messages from within the application to the
* the respective message handlers. {@link #brokerMessagingTemplate()} can be injected
* into any application component to send messages.
*
* <p>Subclasses are responsible for the part of the configuration that feed messages
* <p>Subclasses are responsible for the parts of the configuration that feed messages
* to and from the client inbound/outbound channels (e.g. STOMP over WebSocket).
*
* @author Rossen Stoyanchev
@@ -387,7 +389,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
* Override this method to add custom message converters.
* @param messageConverters the list to add converters to, initially empty
* @return {@code true} if default message converters should be added to list,
* {@code false} if no more converters should be added.
* {@code false} if no more converters should be added
*/
protected boolean configureMessageConverters(List<MessageConverter> messageConverters) {
return true;
@@ -410,7 +412,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
}
/**
* Create the user registry that provides access to the local users.
* Create the user registry that provides access to local users.
*/
protected abstract SimpUserRegistry createLocalUserRegistry();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -258,7 +258,7 @@ public class StompDecoder {
if (index + 1 >= inString.length()) {
throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
}
Character c = inString.charAt(index + 1);
char c = inString.charAt(index + 1);
if (c == 'r') {
sb.append('\r');
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
* Create an instance wrapping the local user registry.
*/
public MultiServerUserRegistry(SimpUserRegistry localRegistry) {
Assert.notNull(localRegistry, "'localRegistry' is required.");
Assert.notNull(localRegistry, "'localRegistry' is required");
this.id = generateId();
this.localRegistry = localRegistry;
this.delegateApplicationEvents = this.localRegistry instanceof SmartApplicationListener;
@@ -274,10 +274,10 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
private String name;
/* User sessions from "this" registry only (i.e. one server) */
// User sessions from "this" registry only (i.e. one server)
private Set<TransferSimpSession> sessions;
/* Cross-server session lookup (e.g. user connected to multiple servers) */
// Cross-server session lookup (e.g. user connected to multiple servers)
private SessionLookup sessionLookup;
/**
@@ -518,13 +518,13 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
return false;
}
SimpSubscription otherSubscription = (SimpSubscription) other;
return (ObjectUtils.nullSafeEquals(getSession(), otherSubscription.getSession()) &&
this.id.equals(otherSubscription.getId()));
return (getId().equals(otherSubscription.getId()) &&
ObjectUtils.nullSafeEquals(getSession(), otherSubscription.getSession()));
}
@Override
public int hashCode() {
return this.id.hashCode() * 31 + ObjectUtils.nullSafeHashCode(getSession());
return getId().hashCode() * 31 + ObjectUtils.nullSafeHashCode(getSession());
}
@Override