Polishing

This commit is contained in:
Juergen Hoeller 2017-01-12 23:30:38 +01:00
parent e19dff179e
commit 743ce2cda6
13 changed files with 44 additions and 28 deletions

View File

@ -458,7 +458,7 @@ project("spring-beans-groovy") {
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
}
// this module's Java and Groovy sources need to be compiled together
// This module's Java and Groovy sources need to be compiled together.
compileJava.enabled = false
sourceSets {
main {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.

View File

@ -34,7 +34,7 @@ import org.springframework.jdbc.support.JdbcUtils;
*
* <p>The sequence is kept in a table; there should be one sequence table per
* table that needs an auto-generated key. The storage engine used by the sequence table
* can be MYISAM or INNODB since the sequences are allocated using a separate connection
* can be MYISAM or INNODB since the sequences are allocated using a separate connection
* without being affected by any other transactions that might be in progress.
*
* <p>Example:
@ -47,7 +47,7 @@ import org.springframework.jdbc.support.JdbcUtils;
* database. If the server or your application is stopped or crashes or a transaction
* is rolled back, the unused values will never be served. The maximum hole size in
* numbering is consequently the value of cacheSize.
*
*
* <p>It is possible to avoid acquiring a new connection for the incrementer by setting the
* "useNewConnection" property to false. In this case you <i>MUST</i> use a non-transactional
* storage engine like MYISAM when defining the incrementer table.

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -19,20 +19,23 @@ package org.springframework.messaging.simp.user;
import java.util.HashSet;
import java.util.Set;
/**
* @author Rossen Stoyanchev
*/
public class TestSimpSession implements SimpSession {
private String id;
private final String id;
private TestSimpUser user;
private Set<SimpSubscription> subscriptions = new HashSet<>();
private final Set<SimpSubscription> subscriptions = new HashSet<>();
public TestSimpSession(String id) {
this.id = id;
}
@Override
public String getId() {
return id;
@ -59,6 +62,7 @@ public class TestSimpSession implements SimpSession {
}
}
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof SimpSession && this.id.equals(((SimpSession) other).getId())));

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -13,25 +13,29 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.messaging.simp.user;
package org.springframework.messaging.simp.user;
import org.springframework.util.ObjectUtils;
/**
* @author Rossen Stoyanchev
*/
public class TestSimpSubscription implements SimpSubscription {
private String id;
private final String destination;
private final String id;
private TestSimpSession session;
private String destination;
public TestSimpSubscription(String id, String destination) {
this.destination = destination;
this.id = id;
}
@Override
public String getId() {
return id;
@ -51,6 +55,7 @@ public class TestSimpSubscription implements SimpSubscription {
return destination;
}
@Override
public boolean equals(Object other) {
if (this == other) {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.messaging.simp.user;
import java.util.HashMap;
@ -20,18 +21,21 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author Rossen Stoyanchev
*/
public class TestSimpUser implements SimpUser {
private String name;
private final String name;
private Map<String, SimpSession> sessions = new HashMap<>();
private final Map<String, SimpSession> sessions = new HashMap<>();
public TestSimpUser(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
@ -59,6 +63,7 @@ public class TestSimpUser implements SimpUser {
}
}
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof SimpUser && this.name.equals(((SimpUser) other).getName())));

View File

@ -541,10 +541,10 @@ public class MockHttpServletRequest implements HttpServletRequest {
for (String key : params.keySet()) {
Object value = params.get(key);
if (value instanceof String) {
this.addParameter(key, (String) value);
addParameter(key, (String) value);
}
else if (value instanceof String[]) {
this.addParameter(key, (String[]) value);
addParameter(key, (String[]) value);
}
else {
throw new IllegalArgumentException("Parameter map value must be single value " +

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 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.

View File

@ -541,10 +541,10 @@ public class MockHttpServletRequest implements HttpServletRequest {
for (String key : params.keySet()) {
Object value = params.get(key);
if (value instanceof String) {
this.addParameter(key, (String) value);
addParameter(key, (String) value);
}
else if (value instanceof String[]) {
this.addParameter(key, (String[]) value);
addParameter(key, (String[]) value);
}
else {
throw new IllegalArgumentException("Parameter map value must be single value " +

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -215,6 +215,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
return (int) this.contentLength;
}
@Override
public void setContentLengthLong(long contentLength) {
this.contentLength = contentLength;
doAddHeaderValue(CONTENT_LENGTH_HEADER, contentLength, true);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 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.
@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletResponse;
import com.rometools.rome.feed.rss.Channel;
import com.rometools.rome.feed.rss.Item;
import org.springframework.util.MimeTypeUtils;
import org.springframework.http.MediaType;
/**
* Abstract superclass for RSS Feed views, using the
@ -48,9 +48,10 @@ import org.springframework.util.MimeTypeUtils;
public abstract class AbstractRssFeedView extends AbstractFeedView<Channel> {
public AbstractRssFeedView() {
setContentType(MimeTypeUtils.APPLICATION_RSS_XML_VALUE);
setContentType(MediaType.APPLICATION_RSS_XML_VALUE);
}
/**
* Create a new Channel instance to hold the entries.
* <p>By default returns an RSS 2.0 channel, but the subclass can specify any channel.