language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | spring-projects | spring-framework | d40c8cfc58298f3c5f0fea5870d0aed495ba3fb9.json | Fix broken Castor URLs in ref docs and mapping XML
Issue: SPR-10189 | spring-oxm/src/main/java/org/springframework/oxm/castor/package-info.java | @@ -1,7 +1,7 @@
/**
*
- * Package providing integration of <a href="http://www.castor.org/xml-mapping.html">Castor</a> within Springs O/X Mapping
+ * Package providing integration of <a href="http://castor.codehaus.org/xml-mapping.html">Castor</a> within Springs O/X Mapping
* support
*
*/ | true |
Other | spring-projects | spring-framework | d40c8cfc58298f3c5f0fea5870d0aed495ba3fb9.json | Fix broken Castor URLs in ref docs and mapping XML
Issue: SPR-10189 | spring-oxm/src/test/resources/org/springframework/oxm/castor/mapping.xml | @@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.org/mapping.dtd">
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.codehaus.org/mapping.dtd">
<mapping>
<description>Castor generated mapping file</description>
<class name="org.springframework.oxm.castor.Flights">
@@ -28,4 +28,4 @@
xmlns:tns="http://samples.springframework.org/flight"/>
</field>
</class>
-</mapping>
\ No newline at end of file
+</mapping> | true |
Other | spring-projects | spring-framework | d40c8cfc58298f3c5f0fea5870d0aed495ba3fb9.json | Fix broken Castor URLs in ref docs and mapping XML
Issue: SPR-10189 | src/reference/docbook/oxm.xml | @@ -438,7 +438,7 @@ public class Application {
though a mapping file can be used to have more control over the behavior of Castor.
</para>
<para>
- For more information on Castor, refer to the <link xl:href="http://castor.org/xml-framework.html">
+ For more information on Castor, refer to the <link xl:href="http://castor.codehaus.org/xml-framework.html">
<citetitle>Castor web site</citetitle></link>. The Spring integration classes reside in the
<package>org.springframework.oxm.castor</package> package.
</para>
@@ -462,7 +462,7 @@ public class Application {
<para>
Although it is possible to rely on Castor's default marshalling behavior, it might be necessary to have
more control over it. This can be accomplished using a Castor mapping file. For more information, refer
- to <link xl:href="http://castor.org/xml-mapping.html">Castor XML Mapping</link>.
+ to <link xl:href="http://castor.codehaus.org/xml-mapping.html">Castor XML Mapping</link>.
</para>
<para>
The mapping can be set using the <property>mappingLocation</property> resource property, indicated | true |
Other | spring-projects | spring-framework | 24cc33306def7aff4aa2c797cd4aea320a4f8523.json | Fix typo in reference documentation
Issue: SPR-10171 | src/reference/docbook/overview.xml | @@ -362,7 +362,7 @@ TR: OK. Added to diagram.--></para>
places:<itemizedlist>
<listitem>
<para>On the community download site <link
- xl:href="http://www.springsource.org/downloads/community">http://www.springsource.org/downloads/community</link>.
+ xl:href="http://www.springsource.org/download/community">http://www.springsource.org/download/community</link>.
Here you find all the Spring jars bundled together into a zip file
for easy download. The names of the jars here since version 3.0
are in the form | false |
Other | spring-projects | spring-framework | 5360bd899d68bf01ec916c429296735b34e172c3.json | Fix warnings and polish LocalSessionFactoryBuilder | org.springframework.orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java | @@ -47,13 +47,14 @@
* adding {@link SpringSessionContext} as a default and providing convenient ways
* to specify a DataSource and an application class loader.
*
- * <p>This is designed for programmatic use, e.g. in <code>@Bean</code> factory methods.
+ * <p>This is designed for programmatic use, e.g. in {@code @Bean} factory methods.
* Consider using {@link LocalSessionFactoryBean} for XML bean definition files.
*
* @author Juergen Hoeller
* @since 3.1
* @see LocalSessionFactoryBean
*/
+@SuppressWarnings("serial")
public class LocalSessionFactoryBuilder extends Configuration {
private static final String RESOURCE_PATTERN = "/**/*.class";
@@ -108,7 +109,7 @@ public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resource
* @see #addAnnotatedClass
* @see #scanPackages
*/
- public LocalSessionFactoryBuilder addAnnotatedClasses(Class... annotatedClasses) {
+ public LocalSessionFactoryBuilder addAnnotatedClasses(Class<?>... annotatedClasses) {
for (Class<?> annotatedClass : annotatedClasses) {
ReflectionUtils.invokeMethod(addAnnotatedClassMethod, this, annotatedClass);
}
@@ -129,7 +130,7 @@ public LocalSessionFactoryBuilder addPackages(String... annotatedPackages) {
/**
* Perform Spring-based scanning for entity classes, registering them
- * as annotated classes with this <code>Configuration</code>.
+ * as annotated classes with this {@code Configuration}.
* @param packagesToScan one or more Java package names
* @throws HibernateException if scanning fails for any reason
*/
@@ -175,7 +176,7 @@ private boolean matchesFilter(MetadataReader reader, MetadataReaderFactory reade
/**
- * Build the <code>SessionFactory</code>.
+ * Build the {@code SessionFactory}.
*/
@Override
@SuppressWarnings("deprecation") | false |
Other | spring-projects | spring-framework | 17ce06acec364959e491db65196a61e199bf3f5c.json | Update changelog re destroy method inference
Issue: SPR-8751 | build-spring-framework/resources/changelog.txt | @@ -11,6 +11,7 @@ Changes in version 3.1 RC1 (2011-10-11)
* support for load-time weaving on WebSphere 7 and 8
* updated JBossLoadTimeWeaver to automatically detect and support JBoss AS 7 as well
* added support for Hibernate 4.0 (HibernateJpaDialect as well as natively in orm.hibernate4)
+* added 'destroy method inference' (SPR-8751)
* prepared Spring's DataSource and RowSet adapters for forward compatibility with JDBC 4.1
* introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6)
* introduced extended WritableResource interface | false |
Other | spring-projects | spring-framework | 8cafb7ee13b68ce8f21b01c49d2feba7a818b1ed.json | Fix warnings in DisposableBeanAdapter | org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java | @@ -54,6 +54,7 @@
* @see org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
* @see AbstractBeanDefinition#getDestroyMethodName()
*/
+@SuppressWarnings("serial")
class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
private static final Log logger = LogFactory.getLog(DisposableBeanAdapter.class);
@@ -106,7 +107,7 @@ public DisposableBeanAdapter(Object bean, String beanName, RootBeanDefinition be
}
}
else {
- Class[] paramTypes = this.destroyMethod.getParameterTypes();
+ Class<?>[] paramTypes = this.destroyMethod.getParameterTypes();
if (paramTypes.length > 1) {
throw new BeanDefinitionValidationException("Method '" + destroyMethodName + "' of bean '" +
beanName + "' has more than one parameter - not supported as destroy method");
@@ -239,7 +240,7 @@ private Method findDestroyMethod() {
* assuming a "force" parameter), else logging an error.
*/
private void invokeCustomDestroyMethod(final Method destroyMethod) {
- Class[] paramTypes = destroyMethod.getParameterTypes();
+ Class<?>[] paramTypes = destroyMethod.getParameterTypes();
final Object[] args = new Object[paramTypes.length];
if (paramTypes.length == 1) {
args[0] = Boolean.TRUE; | false |
Other | spring-projects | spring-framework | d09faabcb6b1629361d4e58dd957a1de83407078.json | Update changelog re @EnableAspectJAutoProxy
Issue: SPR-8138 | build-spring-framework/resources/changelog.txt | @@ -12,6 +12,7 @@ Changes in version 3.1 RC1 (2011-10-11)
* updated JBossLoadTimeWeaver to automatically detect and support JBoss AS 7 as well
* added support for Hibernate 4.0 (HibernateJpaDialect as well as natively in orm.hibernate4)
* prepared Spring's DataSource and RowSet adapters for forward compatibility with JDBC 4.1
+* introduced @EnableAspectJAutoProxy
* introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6)
* introduced extended WritableResource interface
* DefaultListableBeanFactory is only deserializable through a SerializedBeanFactoryReference | false |
Other | spring-projects | spring-framework | 5377fae7f5c17c90aeca90d97b9d1d70fbc6a434.json | Remove duplicate Javadoc line from PathResource
Remove duplicate Javadoc comment from PathResource that was
accidentally introduced during the merge.
Issue: SPR-10608 | spring-core/src/main/java/org/springframework/core/io/PathResource.java | @@ -58,7 +58,6 @@ public PathResource(Path path) {
}
/**
- * Create a new PathResource from a Path handle.
* Create a new PathResource from a Path handle.
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources
* via {@link #createRelative}, the relative path will be built <i>underneath</i> the | false |
Other | spring-projects | spring-framework | ecf8464d2fc5233d4a75de5a99cd871d07c82de1.json | Replace MaxPermSize use in build scripts
Since JDK 8 is required to build Spring framework 4, and permanent
generation is gone from Java 8, to eliminate warnings about no longer
available MaxPermSize switch, it should be removed or replaced with new
MaxMetaspaceSize switch.
This fix replaces old with new switch to limit the amount of native
memory used for class metadata.
Issue: SPR-10571 | build.gradle | @@ -961,7 +961,7 @@ configure(rootProject) {
gradleVersion = "1.6"
doLast() {
- def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m"
+ def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
File wrapperFile = file("gradlew")
wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=", | true |
Other | spring-projects | spring-framework | ecf8464d2fc5233d4a75de5a99cd871d07c82de1.json | Replace MaxPermSize use in build scripts
Since JDK 8 is required to build Spring framework 4, and permanent
generation is gone from Java 8, to eliminate warnings about no longer
available MaxPermSize switch, it should be removed or replaced with new
MaxMetaspaceSize switch.
This fix replaces old with new switch to limit the amount of native
memory used for class metadata.
Issue: SPR-10571 | gradlew | @@ -7,7 +7,7 @@
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-GRADLE_OPTS="-XX:MaxPermSize=1024m -Xmx1024m $GRADLE_OPTS"
+GRADLE_OPTS="-XX:MaxMetaspaceSize=1024m -Xmx1024m $GRADLE_OPTS"
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle" | true |
Other | spring-projects | spring-framework | ecf8464d2fc5233d4a75de5a99cd871d07c82de1.json | Replace MaxPermSize use in build scripts
Since JDK 8 is required to build Spring framework 4, and permanent
generation is gone from Java 8, to eliminate warnings about no longer
available MaxPermSize switch, it should be removed or replaced with new
MaxMetaspaceSize switch.
This fix replaces old with new switch to limit the amount of native
memory used for class metadata.
Issue: SPR-10571 | gradlew.bat | @@ -9,7 +9,7 @@
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set GRADLE_OPTS=-XX:MaxPermSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%
+set GRADLE_OPTS=-XX:MaxMetaspaceSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/StompCommand.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.web.stomp;
+package org.springframework.web.messaging.stomp;
/** | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/StompException.java | @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.web.stomp;
+package org.springframework.web.messaging.stomp;
import org.springframework.core.NestedRuntimeException;
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/StompHeaders.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.web.stomp;
+package org.springframework.web.messaging.stomp;
import java.io.Serializable;
import java.util.Collection; | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/StompMessage.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.web.stomp;
+package org.springframework.web.messaging.stomp;
import java.nio.charset.Charset;
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/StompSession.java | @@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.web.stomp;
+package org.springframework.web.messaging.stomp;
import java.io.IOException;
/**
- *
* @author Rossen Stoyanchev
* @since 4.0
*/
@@ -28,9 +27,15 @@ public interface StompSession {
String getId();
/**
+ * TODO...
+ * <p>
* If the message is a STOMP ERROR message, the session will also be closed.
- *
*/
void sendMessage(StompMessage message) throws IOException;
+ /**
+ * Register a task to be invoked if the underlying connection is closed.
+ */
+ void registerConnectionClosedCallback(Runnable task);
+
} | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/adapter/StompMessageHandler.java | @@ -14,20 +14,18 @@
* limitations under the License.
*/
-package org.springframework.web.stomp.adapter;
+package org.springframework.web.messaging.stomp.adapter;
-import org.springframework.web.stomp.StompMessage;
-import org.springframework.web.stomp.StompSession;
+import org.springframework.web.messaging.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompSession;
/**
* @author Rossen Stoyanchev
* @since 4.0
*/
-public interface StompMessageProcessor {
+public interface StompMessageHandler {
- void processMessage(StompSession stompSession, StompMessage message);
-
- void processConnectionClosed(StompSession stompSession);
+ void handleMessage(StompSession stompSession, StompMessage message);
} | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/adapter/StompWebSocketHandler.java | @@ -13,39 +13,38 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.web.stomp.adapter;
+package org.springframework.web.messaging.stomp.adapter;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.util.Assert;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompHeaders;
+import org.springframework.web.messaging.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompSession;
+import org.springframework.web.messaging.stomp.support.StompMessageConverter;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.adapter.TextWebSocketHandlerAdapter;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompHeaders;
-import org.springframework.web.stomp.StompMessage;
-import org.springframework.web.stomp.StompSession;
-import org.springframework.web.stomp.support.StompMessageConverter;
/**
- *
* @author Rossen Stoyanchev
* @since 4.0
*/
public class StompWebSocketHandler extends TextWebSocketHandlerAdapter {
- private final StompMessageProcessor messageProcessor;
+ private final StompMessageHandler messageHandler;
private final StompMessageConverter messageConverter = new StompMessageConverter();
- private final Map<String, StompSession> sessions = new ConcurrentHashMap<String, StompSession>();
+ private final Map<String, WebSocketStompSession> sessions = new ConcurrentHashMap<String, WebSocketStompSession>();
- public StompWebSocketHandler(StompMessageProcessor messageProcessor) {
- this.messageProcessor = messageProcessor;
+ public StompWebSocketHandler(StompMessageHandler messageHandler) {
+ this.messageHandler = messageHandler;
}
@@ -68,7 +67,7 @@ protected void handleTextMessage(WebSocketSession session, TextMessage message)
// TODO: validate size limits
// http://stomp.github.io/stomp-specification-1.2.html#Size_Limits
- this.messageProcessor.processMessage(stompSession, stompMessage);
+ this.messageHandler.handleMessage(stompSession, stompMessage);
// TODO: send RECEIPT message if incoming message has "receipt" header
// http://stomp.github.io/stomp-specification-1.2.html#Header_receipt
@@ -89,9 +88,9 @@ protected void handleTextMessage(WebSocketSession session, TextMessage message)
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
- StompSession stompSession = this.sessions.remove(session.getId());
+ WebSocketStompSession stompSession = this.sessions.remove(session.getId());
if (stompSession != null) {
- this.messageProcessor.processConnectionClosed(stompSession);
+ stompSession.handleConnectionClosed();
}
}
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/adapter/WebSocketStompSession.java | @@ -14,18 +14,20 @@
* limitations under the License.
*/
-package org.springframework.web.stomp.adapter;
+package org.springframework.web.messaging.stomp.adapter;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import org.springframework.util.Assert;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompSession;
+import org.springframework.web.messaging.stomp.support.StompMessageConverter;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompMessage;
-import org.springframework.web.stomp.StompSession;
-import org.springframework.web.stomp.support.StompMessageConverter;
/**
@@ -40,6 +42,8 @@ public class WebSocketStompSession implements StompSession {
private final StompMessageConverter messageConverter;
+ private final List<Runnable> connectionClosedTasks = new ArrayList<Runnable>();
+
public WebSocketStompSession(WebSocketSession webSocketSession, StompMessageConverter messageConverter) {
Assert.notNull(webSocketSession, "webSocketSession is required");
@@ -70,4 +74,19 @@ public void sendMessage(StompMessage message) throws IOException {
}
}
+ public void registerConnectionClosedCallback(Runnable task) {
+ this.connectionClosedTasks.add(task);
+ }
+
+ public void handleConnectionClosed() {
+ for (Runnable task : this.connectionClosedTasks) {
+ try {
+ task.run();
+ }
+ catch (Throwable t) {
+ // ignore
+ }
+ }
+ }
+
}
\ No newline at end of file | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/server/RelayStompService.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.web.stomp.server;
+package org.springframework.web.messaging.stomp.server;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -31,10 +31,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.core.task.TaskExecutor;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompHeaders;
-import org.springframework.web.stomp.StompMessage;
-import org.springframework.web.stomp.support.StompMessageConverter;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompHeaders;
+import org.springframework.web.messaging.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.support.StompMessageConverter;
import reactor.Fn;
import reactor.core.Reactor;
@@ -47,9 +47,9 @@
* @author Rossen Stoyanchev
* @since 4.0
*/
-public class RelayStompReactorService {
+public class RelayStompService {
- private static final Log logger = LogFactory.getLog(RelayStompReactorService.class);
+ private static final Log logger = LogFactory.getLog(RelayStompService.class);
private final Reactor reactor;
@@ -61,7 +61,7 @@ public class RelayStompReactorService {
private final TaskExecutor taskExecutor;
- public RelayStompReactorService(Reactor reactor, TaskExecutor executor) {
+ public RelayStompService(Reactor reactor, TaskExecutor executor) {
this.reactor = reactor;
this.taskExecutor = executor; // For now, a naively way to manage socket reading
@@ -91,7 +91,7 @@ private void relayStompMessage(RelaySession session, StompMessage stompMessage)
}
private RelaySession getRelaySession(String stompSessionId) {
- RelaySession session = RelayStompReactorService.this.relaySessions.get(stompSessionId);
+ RelaySession session = RelayStompService.this.relaySessions.get(stompSessionId);
Assert.notNull(session, "RelaySession not found");
return session;
}
@@ -188,8 +188,8 @@ public void run() {
}
else if (b == 0x00) {
byte[] bytes = out.toByteArray();
- StompMessage message = RelayStompReactorService.this.converter.toStompMessage(bytes);
- RelayStompReactorService.this.reactor.notify(replyTo, Fn.event(message));
+ StompMessage message = RelayStompService.this.converter.toStompMessage(bytes);
+ RelayStompService.this.reactor.notify(replyTo, Fn.event(message));
out.reset();
}
else {
@@ -209,7 +209,7 @@ private void sendLostConnectionErrorMessage() {
StompHeaders headers = new StompHeaders();
headers.setMessage("Lost connection");
StompMessage errorMessage = new StompMessage(StompCommand.ERROR, headers);
- RelayStompReactorService.this.reactor.notify(replyTo, Fn.event(errorMessage));
+ RelayStompService.this.reactor.notify(replyTo, Fn.event(errorMessage));
}
}
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/server/ServerStompMessageHandler.java | @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.web.stomp.server;
+package org.springframework.web.messaging.stomp.server;
import java.io.IOException;
import java.util.ArrayList;
@@ -25,12 +25,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.CollectionUtils;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompException;
-import org.springframework.web.stomp.StompHeaders;
-import org.springframework.web.stomp.StompMessage;
-import org.springframework.web.stomp.StompSession;
-import org.springframework.web.stomp.adapter.StompMessageProcessor;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompException;
+import org.springframework.web.messaging.stomp.StompHeaders;
+import org.springframework.web.messaging.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompSession;
+import org.springframework.web.messaging.stomp.adapter.StompMessageHandler;
import reactor.Fn;
import reactor.core.Reactor;
@@ -43,24 +43,26 @@
* @author Rossen Stoyanchev
* @since 4.0
*/
-public class ReactorServerStompMessageProcessor implements StompMessageProcessor {
+public class ServerStompMessageHandler implements StompMessageHandler {
- private static Log logger = LogFactory.getLog(ReactorServerStompMessageProcessor.class);
+ private static Log logger = LogFactory.getLog(ServerStompMessageHandler.class);
private final Reactor reactor;
- private Map<String, List<Registration<?>>> registrationsBySession = new ConcurrentHashMap<String, List<Registration<?>>>();
+ private Map<String, List<Registration<?>>> registrationsBySession =
+ new ConcurrentHashMap<String, List<Registration<?>>>();
- public ReactorServerStompMessageProcessor(Reactor reactor) {
+ public ServerStompMessageHandler(Reactor reactor) {
this.reactor = reactor;
}
- public void processMessage(StompSession session, StompMessage message) {
+ public void handleMessage(StompSession session, StompMessage message) {
try {
StompCommand command = message.getCommand();
if (StompCommand.CONNECT.equals(command) || StompCommand.STOMP.equals(command)) {
+ registerConnectionClosedCallback(session);
connect(session, message);
}
else if (StompCommand.SUBSCRIBE.equals(command)) {
@@ -92,6 +94,16 @@ else if (StompCommand.BEGIN.equals(command) || StompCommand.COMMIT.equals(comman
}
}
+ private void registerConnectionClosedCallback(final StompSession session) {
+ session.registerConnectionClosedCallback(new Runnable() {
+ @Override
+ public void run() {
+ removeSubscriptions(session);
+ reactor.notify("CONNECTION_CLOSED", Fn.event(session.getId()));
+ }
+ });
+ }
+
private void handleError(final StompSession session, Throwable t) {
logger.error("Terminating STOMP session due to failure to send message: ", t);
sendErrorMessage(session, t.getMessage());
@@ -233,10 +245,4 @@ private boolean removeSubscriptions(StompSession session) {
return true;
}
- @Override
- public void processConnectionClosed(StompSession session) {
- removeSubscriptions(session);
- this.reactor.notify("CONNECTION_CLOSED", Fn.event(session.getId()));
- }
-
} | true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/server/SimpleStompService.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.web.stomp.server;
+package org.springframework.web.messaging.stomp.server;
import java.util.ArrayList;
import java.util.List;
@@ -23,9 +23,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompHeaders;
-import org.springframework.web.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompHeaders;
+import org.springframework.web.messaging.stomp.StompMessage;
import reactor.Fn;
import reactor.core.Reactor;
@@ -38,16 +38,16 @@
* @author Rossen Stoyanchev
* @since 4.0
*/
-public class SimpleStompReactorService {
+public class SimpleStompService {
- private static final Log logger = LogFactory.getLog(SimpleStompReactorService.class);
+ private static final Log logger = LogFactory.getLog(SimpleStompService.class);
private final Reactor reactor;
private Map<String, List<Registration<?>>> subscriptionsBySession = new ConcurrentHashMap<String, List<Registration<?>>>();
- public SimpleStompReactorService(Reactor reactor) {
+ public SimpleStompService(Reactor reactor) {
this.reactor = reactor;
this.reactor.on(Fn.$(StompCommand.SUBSCRIBE), new SubscribeConsumer());
this.reactor.on(Fn.$(StompCommand.SEND), new SendConsumer());
@@ -85,7 +85,7 @@ public void accept(Event<StompMessage> event) {
logger.debug("Subscribe " + message);
}
- Registration<?> registration = SimpleStompReactorService.this.reactor.on(
+ Registration<?> registration = SimpleStompService.this.reactor.on(
Fn.$("destination:" + message.getHeaders().getDestination()),
new Consumer<Event<StompMessage>>() {
@Override
@@ -94,7 +94,7 @@ public void accept(Event<StompMessage> event) {
StompHeaders headers = new StompHeaders();
headers.setDestination(inMessage.getHeaders().getDestination());
StompMessage outMessage = new StompMessage(StompCommand.MESSAGE, headers, inMessage.getPayload());
- SimpleStompReactorService.this.reactor.notify(event.getReplyTo(), Fn.event(outMessage));
+ SimpleStompService.this.reactor.notify(event.getReplyTo(), Fn.event(outMessage));
}
});
@@ -110,7 +110,7 @@ public void accept(Event<StompMessage> event) {
logger.debug("Message received: " + message);
String destination = message.getHeaders().getDestination();
- SimpleStompReactorService.this.reactor.notify("destination:" + destination, Fn.event(message));
+ SimpleStompService.this.reactor.notify("destination:" + destination, Fn.event(message));
}
}
@@ -119,7 +119,7 @@ private final class DisconnectConsumer implements Consumer<Event<String>> {
@Override
public void accept(Event<String> event) {
String sessionId = event.getData();
- SimpleStompReactorService.this.removeSubscriptions(sessionId);
+ SimpleStompService.this.removeSubscriptions(sessionId);
}
}
| true |
Other | spring-projects | spring-framework | 69ef364ef9b874db3c88f7a3f84f6ab5182d22c7.json | Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp
Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed. | spring-websocket/src/main/java/org/springframework/web/messaging/stomp/support/StompMessageConverter.java | @@ -13,18 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.web.stomp.support;
+package org.springframework.web.messaging.stomp.support;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map.Entry;
import org.springframework.util.Assert;
-import org.springframework.web.stomp.StompCommand;
-import org.springframework.web.stomp.StompException;
-import org.springframework.web.stomp.StompHeaders;
-import org.springframework.web.stomp.StompMessage;
+import org.springframework.web.messaging.stomp.StompCommand;
+import org.springframework.web.messaging.stomp.StompException;
+import org.springframework.web.messaging.stomp.StompHeaders;
+import org.springframework.web.messaging.stomp.StompMessage;
/**
* @author Gary Russell | true |
Other | spring-projects | spring-framework | 3c73a8fc4f2f4a5e6f1751d01c3ec6493f65eff1.json | Instruct contributors to branch from master | CONTRIBUTING.md | @@ -47,13 +47,11 @@ future pull requests as well, simply so that the Spring Framework team knows
immediately that this process is complete.
-## Create your branch from `3.2.x`
+## Create your branch from `master`
-If your pull request addresses a bug or improvement, please create your branch
-from Spring Framework's `3.2.x` branch. `master` is reserved for work on new features
-for the next major version of the framework. Rest assured that if your pull
-request is accepted and merged into `3.2.x`, these changes will also eventually
-be merged into `master`.
+Master currently represents work toward Spring Framework 4.0. Please submit
+all pull requests there, even bug fixes and minor improvements. Backports to
+`3.2.x` will be considered on a case-by-case basis.
## Use short branch names
@@ -129,7 +127,7 @@ e.g.
* ...
*
* @author First Last
- * @since 3.2
+ * @since 4.0
* @see ...
*/
``` | false |
Other | spring-projects | spring-framework | 00fea1f7155b9537b4a847cdae09274b6cf902ca.json | Fix minor typo in README.md | README.md | @@ -39,7 +39,7 @@ a cross-platform, self-contained bootstrap mechanism for the build.
[Git][] and [Early Access build of OpenJDK 1.8 build 88][JDK18 build 88]
> **Note:** Do not use the "lambda" edition of JDK b88 when building the
-ramework, as it still causes some errors. It should be fine, however, to
+framework, as it still causes some errors. It should be fine, however, to
*run* against various versions of OpenJDK 1.8, lambda or otherwise.
Be sure that your `JAVA_HOME` environment variable points to the `jdk1.8.0` folder | false |
Other | spring-projects | spring-framework | d97f6cf5b8d1e3e18ace9d4b5a3e112c1f986b7b.json | Clarify instructions for building from source
Re-order subsections to make it clear that running a full
`./gradlew build` is not necessary just to import projects
into your IDE or to build and install jars to your .m2 cache. | README.md | @@ -42,14 +42,14 @@ a cross-platform, self-contained bootstrap mechanism for the build.
### check out sources
`git clone git://github.com/SpringSource/spring-framework.git`
-### compile and test, build all jars, distribution zips and docs
-`./gradlew build`
+### import sources into your IDE
+Run `./import-into-eclipse.sh` or read `import-into-idea.md` as appropriate.
### install all spring-\* jars into your local Maven cache
`./gradlew install`
-### import sources into your IDE
-Run `./import-into-eclipse.sh` or read `import-into-idea.md` as appropriate.
+### compile and test, build all jars, distribution zips and docs
+`./gradlew build`
... and discover more commands with `./gradlew tasks`. See also the [Gradle
build and release FAQ][]. | false |
Other | spring-projects | spring-framework | 9ee292aaf79649a3ce86c184ec91cf0928fedac3.json | Release version 4.0.0.M1 | gradle.properties | @@ -1 +1 @@
-version=4.0.0.BUILD-SNAPSHOT
+version=4.0.0.M1 | false |
Other | spring-projects | spring-framework | 6fe50b502fa2a564692be3419d7f21d96b6c5f64.json | Enforce JDK version on CI server
Add a test to ensure that the CI server does not accidentally build
with the wrong JDK version.
Issue: SPR-10569 | spring-core/src/test/java/org/springframework/tests/BuildTests.java | @@ -0,0 +1,36 @@
+/*
+ * Copyright 2002-2013 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.tests;
+
+import org.junit.Test;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+
+/**
+ * General build related tests. Part of spring-core to ensure that they run early in the
+ * build process.
+ */
+public class BuildTests {
+
+ @Test
+ public void javaVersion() throws Exception {
+ Assume.group(TestGroup.CI);
+ assertThat("Java Version", JavaVersion.runningVersion(), equalTo(JavaVersion.JAVA_18));
+ }
+
+} | true |
Other | spring-projects | spring-framework | 6fe50b502fa2a564692be3419d7f21d96b6c5f64.json | Enforce JDK version on CI server
Add a test to ensure that the CI server does not accidentally build
with the wrong JDK version.
Issue: SPR-10569 | spring-core/src/test/java/org/springframework/tests/TestGroup.java | @@ -54,7 +54,12 @@ public enum TestGroup {
* Tests requiring the presence of jmxremote_optional.jar in jre/lib/ext in order to
* avoid "Unsupported protocol: jmxmp" errors.
*/
- JMXMP;
+ JMXMP,
+
+ /**
+ * Tests that should only be run on the continuous integration server.
+ */
+ CI;
/** | true |
Other | spring-projects | spring-framework | 6fe50b502fa2a564692be3419d7f21d96b6c5f64.json | Enforce JDK version on CI server
Add a test to ensure that the CI server does not accidentally build
with the wrong JDK version.
Issue: SPR-10569 | spring-core/src/test/java/org/springframework/tests/TestGroupTests.java | @@ -64,7 +64,7 @@ public void parseMissing() throws Exception {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Unable to find test group 'missing' when parsing " +
"testGroups value: 'performance, missing'. Available groups include: " +
- "[LONG_RUNNING,PERFORMANCE,JMXMP]");
+ "[LONG_RUNNING,PERFORMANCE,JMXMP,CI]");
TestGroup.parse("performance, missing");
}
| true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java | @@ -16,8 +16,6 @@
package org.springframework.web.socket;
-import java.io.Reader;
-import java.io.StringReader;
/**
* A {@link WebSocketMessage} that contains a textual {@link String} payload.
@@ -46,13 +44,6 @@ public TextMessage(CharSequence payload, boolean isLast) {
super(payload.toString(), isLast);
}
- /**
- * Returns access to the message payload as a {@link Reader}.
- */
- public Reader getReader() {
- return new StringReader(getPayload());
- }
-
@Override
protected int getPayloadSize() {
return getPayload().length(); | true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java | @@ -24,7 +24,6 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketSession;
-import org.springframework.web.socket.support.ExceptionWebSocketHandlerDecorator;
import org.springframework.web.socket.support.LoggingWebSocketHandlerDecorator;
/**
@@ -61,11 +60,9 @@ public WebSocketConnectionManager(WebSocketClient client,
/**
* Decorate the WebSocketHandler provided to the class constructor.
* <p>
- * By default {@link ExceptionWebSocketHandlerDecorator} and
- * {@link LoggingWebSocketHandlerDecorator} are applied are added.
+ * By default {@link LoggingWebSocketHandlerDecorator} is added.
*/
protected WebSocketHandler decorateWebSocketHandler(WebSocketHandler handler) {
- handler = new ExceptionWebSocketHandlerDecorator(handler);
return new LoggingWebSocketHandlerDecorator(handler);
}
| true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java | @@ -33,6 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpHeaders;
+import org.springframework.util.Assert;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.adapter.StandardEndpointAdapter;
@@ -53,49 +54,57 @@ public class StandardWebSocketClient implements WebSocketClient {
private static final Log logger = LogFactory.getLog(StandardWebSocketClient.class);
- private WebSocketContainer webSocketContainer;
+ private final WebSocketContainer webSocketContainer;
- public WebSocketContainer getWebSocketContainer() {
- if (this.webSocketContainer == null) {
- this.webSocketContainer = ContainerProvider.getWebSocketContainer();
- }
- return this.webSocketContainer;
+ public StandardWebSocketClient() {
+ this.webSocketContainer = ContainerProvider.getWebSocketContainer();
}
- public void setWebSocketContainer(WebSocketContainer container) {
- this.webSocketContainer = container;
+ public StandardWebSocketClient(WebSocketContainer webSocketContainer) {
+ Assert.notNull(webSocketContainer, "webSocketContainer is required");
+ this.webSocketContainer = webSocketContainer;
}
@Override
public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVariables)
throws WebSocketConnectFailureException {
+ Assert.notNull(uriTemplate, "uriTemplate is required");
UriComponents uriComponents = UriComponentsBuilder.fromUriString(uriTemplate).buildAndExpand(uriVariables).encode();
- return doHandshake(webSocketHandler, null, uriComponents);
+ return doHandshake(webSocketHandler, null, uriComponents.toUri());
}
@Override
public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, HttpHeaders httpHeaders, URI uri)
throws WebSocketConnectFailureException {
+ Assert.notNull(webSocketHandler, "webSocketHandler is required");
+ Assert.notNull(uri, "uri is required");
+
+ httpHeaders = (httpHeaders != null) ? httpHeaders : new HttpHeaders();
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Connecting to " + uri);
+ }
+
StandardWebSocketSessionAdapter session = new StandardWebSocketSessionAdapter();
session.setUri(uri);
session.setRemoteHostName(uri.getHost());
- Endpoint endpoint = new StandardEndpointAdapter(webSocketHandler, session);
ClientEndpointConfig.Builder configBuidler = ClientEndpointConfig.Builder.create();
- if (httpHeaders != null) {
- List<String> protocols = httpHeaders.getSecWebSocketProtocol();
- if (!protocols.isEmpty()) {
- configBuidler.preferredSubprotocols(protocols);
- }
- configBuidler.configurator(new StandardWebSocketClientConfigurator(httpHeaders));
+ configBuidler.configurator(new StandardWebSocketClientConfigurator(httpHeaders));
+
+ List<String> protocols = httpHeaders.getSecWebSocketProtocol();
+ if (!protocols.isEmpty()) {
+ configBuidler.preferredSubprotocols(protocols);
}
try {
// TODO: do not block
+ Endpoint endpoint = new StandardEndpointAdapter(webSocketHandler, session);
this.webSocketContainer.connectToServer(endpoint, configBuidler.build(), uri);
+
return session;
}
catch (Exception e) {
@@ -128,14 +137,14 @@ public void beforeRequest(Map<String, List<String>> headers) {
headers.put(headerName, value);
}
}
- if (logger.isTraceEnabled()) {
- logger.trace("Handshake request headers: " + headers);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Handshake request headers: " + headers);
}
}
@Override
public void afterResponse(HandshakeResponse handshakeResponse) {
- if (logger.isTraceEnabled()) {
- logger.trace("Handshake response headers: " + handshakeResponse.getHeaders());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Handshake response headers: " + handshakeResponse.getHeaders());
}
}
} | true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java | @@ -22,6 +22,7 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.context.SmartLifecycle;
import org.springframework.http.HttpHeaders;
+import org.springframework.util.Assert;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.adapter.JettyWebSocketListenerAdapter;
@@ -126,13 +127,20 @@ public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, String ur
throws WebSocketConnectFailureException {
UriComponents uriComponents = UriComponentsBuilder.fromUriString(uriTemplate).buildAndExpand(uriVariables).encode();
- return doHandshake(webSocketHandler, null, uriComponents);
+ return doHandshake(webSocketHandler, null, uriComponents.toUri());
}
@Override
public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, HttpHeaders headers, URI uri)
throws WebSocketConnectFailureException {
+ Assert.notNull(webSocketHandler, "webSocketHandler is required");
+ Assert.notNull(uri, "uri is required");
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Connecting to " + uri);
+ }
+
// TODO: populate headers
JettyWebSocketSessionAdapter session = new JettyWebSocketSessionAdapter(); | true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/test/java/org/springframework/web/socket/client/WebSocketConnectionManagerTests.java | @@ -27,7 +27,6 @@
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.adapter.WebSocketHandlerAdapter;
-import org.springframework.web.socket.support.ExceptionWebSocketHandlerDecorator;
import org.springframework.web.socket.support.LoggingWebSocketHandlerDecorator;
import org.springframework.web.socket.support.WebSocketHandlerDecorator;
@@ -69,11 +68,7 @@ public void openConnection() throws Exception {
WebSocketHandlerDecorator loggingHandler = captor.getValue();
assertEquals(LoggingWebSocketHandlerDecorator.class, loggingHandler.getClass());
- WebSocketHandlerDecorator exceptionHandler = (WebSocketHandlerDecorator) loggingHandler.getDelegate();
- assertNotNull(exceptionHandler);
- assertEquals(ExceptionWebSocketHandlerDecorator.class, exceptionHandler.getClass());
-
- assertSame(handler, exceptionHandler.getDelegate());
+ assertSame(handler, loggingHandler.getDelegate());
}
@Test | true |
Other | spring-projects | spring-framework | 87a9602f65c430f34ccc291676a890054ba3ddea.json | Fix bug in WebSocketClient implementations | spring-websocket/src/test/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClientTests.java | @@ -34,7 +34,6 @@
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.adapter.StandardEndpointAdapter;
import org.springframework.web.socket.adapter.WebSocketHandlerAdapter;
-import org.springframework.web.socket.client.endpoint.StandardWebSocketClient;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
@@ -60,18 +59,15 @@ public void doHandshake() throws Exception {
WebSocketHandler handler = new WebSocketHandlerAdapter();
WebSocketContainer webSocketContainer = mock(WebSocketContainer.class);
- StandardWebSocketClient client = new StandardWebSocketClient();
- client.setWebSocketContainer(webSocketContainer);
+ StandardWebSocketClient client = new StandardWebSocketClient(webSocketContainer);
WebSocketSession session = client.doHandshake(handler, headers, uri);
ArgumentCaptor<Endpoint> endpointArg = ArgumentCaptor.forClass(Endpoint.class);
ArgumentCaptor<ClientEndpointConfig> configArg = ArgumentCaptor.forClass(ClientEndpointConfig.class);
ArgumentCaptor<URI> uriArg = ArgumentCaptor.forClass(URI.class);
-
verify(webSocketContainer).connectToServer(endpointArg.capture(), configArg.capture(), uriArg.capture());
-
assertNotNull(endpointArg.getValue());
assertEquals(StandardEndpointAdapter.class, endpointArg.getValue().getClass());
@@ -86,4 +82,5 @@ public void doHandshake() throws Exception {
assertEquals(uri, session.getUri());
assertEquals("example.com", session.getRemoteHostName());
}
+
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java | @@ -15,8 +15,6 @@
*/
package org.springframework.web.socket;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.nio.ByteBuffer;
@@ -34,20 +32,36 @@ public final class BinaryMessage extends WebSocketMessage<ByteBuffer> {
/**
* Create a new {@link BinaryMessage} instance.
* @param payload a non-null payload
- * @param isLast if the message is the last of a series of partial messages
*/
public BinaryMessage(ByteBuffer payload) {
- super(payload);
- this.bytes = null;
+ this(payload, true);
}
/**
* Create a new {@link BinaryMessage} instance.
* @param payload a non-null payload
* @param isLast if the message is the last of a series of partial messages
*/
+ public BinaryMessage(ByteBuffer payload, boolean isLast) {
+ super(payload, isLast);
+ this.bytes = null;
+ }
+
+ /**
+ * Create a new {@link BinaryMessage} instance.
+ * @param payload a non-null payload
+ */
public BinaryMessage(byte[] payload) {
- this(payload, 0, (payload == null ? 0 : payload.length));
+ this(payload, 0, (payload == null ? 0 : payload.length), true);
+ }
+
+ /**
+ * Create a new {@link BinaryMessage} instance.
+ * @param payload a non-null payload
+ * @param isLast if the message is the last of a series of partial messages
+ */
+ public BinaryMessage(byte[] payload, boolean isLast) {
+ this(payload, 0, (payload == null ? 0 : payload.length), isLast);
}
/**
@@ -58,8 +72,8 @@ public BinaryMessage(byte[] payload) {
* @param len the length of the array considered for the payload
* @param isLast if the message is the last of a series of partial messages
*/
- public BinaryMessage(byte[] payload, int offset, int len) {
- super(payload != null ? ByteBuffer.wrap(payload, offset, len) : null);
+ public BinaryMessage(byte[] payload, int offset, int len, boolean isLast) {
+ super(payload != null ? ByteBuffer.wrap(payload, offset, len) : null, isLast);
if(offset == 0 && len == payload.length) {
this.bytes = payload;
}
@@ -82,18 +96,9 @@ private byte[] getRemainingBytes(ByteBuffer payload) {
return result;
}
- /**
- * Returns access to the message payload as an {@link InputStream}.
- */
- public InputStream getInputStream() {
- byte[] array = getByteArray();
- return (array != null) ? new ByteArrayInputStream(array) : null;
- }
-
@Override
- public String toString() {
- int size = (getPayload() != null) ? getPayload().remaining() : 0;
- return "WebSocket binary message size=" + size;
+ protected int getPayloadSize() {
+ return (getPayload() != null) ? getPayload().remaining() : 0;
}
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java | @@ -27,12 +27,23 @@
*/
public final class TextMessage extends WebSocketMessage<String> {
+
/**
* Create a new {@link TextMessage} instance.
* @param payload the payload
+ * @param isLast whether this the last part of a message received or transmitted in parts
*/
public TextMessage(CharSequence payload) {
- super(payload.toString());
+ super(payload.toString(), true);
+ }
+
+ /**
+ * Create a new {@link TextMessage} instance.
+ * @param payload the payload
+ * @param isLast whether this the last part of a message received or transmitted in parts
+ */
+ public TextMessage(CharSequence payload, boolean isLast) {
+ super(payload.toString(), isLast);
}
/**
@@ -42,4 +53,9 @@ public Reader getReader() {
return new StringReader(getPayload());
}
+ @Override
+ protected int getPayloadSize() {
+ return getPayload().length();
+ }
+
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java | @@ -73,4 +73,9 @@ public interface WebSocketHandler {
*/
void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception;
+ /**
+ * Whether the WebSocketHandler handles messages in parts.
+ */
+ boolean supportsPartialMessages();
+
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/WebSocketMessage.java | @@ -31,14 +31,17 @@
private final T payload;
+ private final boolean last;
+
/**
* Create a new {@link WebSocketMessage} instance with the given payload.
* @param payload a non-null payload
*/
- WebSocketMessage(T payload) {
+ WebSocketMessage(T payload, boolean isLast) {
Assert.notNull(payload, "Payload must not be null");
this.payload = payload;
+ this.last = isLast;
}
/**
@@ -48,9 +51,13 @@ public T getPayload() {
return this.payload;
}
- @Override
- public String toString() {
- return getClass().getSimpleName() + " [payload=" + this.payload + "]";
+ /**
+ * Whether this is the last part of a message, when partial message support on a
+ * {@link WebSocketHandler} is enabled. If partial message support is not enabled the
+ * returned value is always {@code true}.
+ */
+ public boolean isLast() {
+ return this.last;
}
@Override
@@ -70,4 +77,11 @@ public boolean equals(Object other) {
return ObjectUtils.nullSafeEquals(this.payload, otherMessage.payload);
}
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + " [payload length=" + getPayloadSize() + ", last=" + isLast() + "]";
+ }
+
+ protected abstract int getPayloadSize();
+
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/adapter/JettyWebSocketListenerAdapter.java | @@ -74,7 +74,7 @@ public void onWebSocketText(String payload) {
@Override
public void onWebSocketBinary(byte[] payload, int offset, int len) {
- BinaryMessage message = new BinaryMessage(payload, offset, len);
+ BinaryMessage message = new BinaryMessage(payload, offset, len, true);
try {
this.webSocketHandler.handleMessage(this.wsSession, message);
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/adapter/StandardEndpointAdapter.java | @@ -61,30 +61,46 @@ public void onOpen(final javax.websocket.Session session, EndpointConfig config)
this.wsSession.initSession(session);
+ if (this.handler.supportsPartialMessages()) {
+ session.addMessageHandler(new MessageHandler.Partial<String>() {
+ @Override
+ public void onMessage(String message, boolean isLast) {
+ handleTextMessage(session, message, isLast);
+ }
+ });
+ session.addMessageHandler(new MessageHandler.Partial<ByteBuffer>() {
+ @Override
+ public void onMessage(ByteBuffer message, boolean isLast) {
+ handleBinaryMessage(session, message, isLast);
+ }
+ });
+ }
+ else {
+ session.addMessageHandler(new MessageHandler.Whole<String>() {
+ @Override
+ public void onMessage(String message) {
+ handleTextMessage(session, message, true);
+ }
+ });
+ session.addMessageHandler(new MessageHandler.Whole<ByteBuffer>() {
+ @Override
+ public void onMessage(ByteBuffer message) {
+ handleBinaryMessage(session, message, true);
+ }
+ });
+ }
+
try {
this.handler.afterConnectionEstablished(this.wsSession);
}
catch (Throwable t) {
ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, t, logger);
return;
}
-
- session.addMessageHandler(new MessageHandler.Whole<String>() {
- @Override
- public void onMessage(String message) {
- handleTextMessage(session, message);
- }
- });
- session.addMessageHandler(new MessageHandler.Whole<ByteBuffer>() {
- @Override
- public void onMessage(ByteBuffer message) {
- handleBinaryMessage(session, message);
- }
- });
}
- private void handleTextMessage(javax.websocket.Session session, String payload) {
- TextMessage textMessage = new TextMessage(payload);
+ private void handleTextMessage(javax.websocket.Session session, String payload, boolean isLast) {
+ TextMessage textMessage = new TextMessage(payload, isLast);
try {
this.handler.handleMessage(this.wsSession, textMessage);
}
@@ -93,8 +109,8 @@ private void handleTextMessage(javax.websocket.Session session, String payload)
}
}
- private void handleBinaryMessage(javax.websocket.Session session, ByteBuffer payload) {
- BinaryMessage binaryMessage = new BinaryMessage(payload);
+ private void handleBinaryMessage(javax.websocket.Session session, ByteBuffer payload, boolean isLast) {
+ BinaryMessage binaryMessage = new BinaryMessage(payload, isLast);
try {
this.handler.handleMessage(this.wsSession, binaryMessage);
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/adapter/StandardWebSocketSessionAdapter.java | @@ -110,12 +110,12 @@ public boolean isOpen() {
@Override
protected void sendTextMessage(TextMessage message) throws IOException {
- this.session.getBasicRemote().sendText(message.getPayload());
+ this.session.getBasicRemote().sendText(message.getPayload(), message.isLast());
}
@Override
protected void sendBinaryMessage(BinaryMessage message) throws IOException {
- this.session.getBasicRemote().sendBinary(message.getPayload());
+ this.session.getBasicRemote().sendBinary(message.getPayload(), message.isLast());
}
@Override | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/adapter/WebSocketHandlerAdapter.java | @@ -38,15 +38,14 @@ public void afterConnectionEstablished(WebSocketSession session) throws Exceptio
}
@Override
- public final void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
+ public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
if (message instanceof TextMessage) {
handleTextMessage(session, (TextMessage) message);
}
else if (message instanceof BinaryMessage) {
handleBinaryMessage(session, (BinaryMessage) message);
}
else {
- // should not happen
throw new IllegalStateException("Unexpected WebSocket message type: " + message);
}
}
@@ -65,4 +64,9 @@ public void handleTransportError(WebSocketSession session, Throwable exception)
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
}
+ @Override
+ public boolean supportsPartialMessages() {
+ return false;
+ }
+
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/support/LoggingWebSocketHandlerDecorator.java | @@ -50,8 +50,8 @@ public void afterConnectionEstablished(WebSocketSession session) throws Exceptio
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
- if (logger.isTraceEnabled()) {
- logger.trace("Received " + message + ", " + session);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Received " + message + ", " + session);
}
super.handleMessage(session, message);
} | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java | @@ -57,9 +57,16 @@ public class PerConnectionWebSocketHandler implements WebSocketHandler, BeanFact
private final Map<WebSocketSession, WebSocketHandler> handlers =
new ConcurrentHashMap<WebSocketSession, WebSocketHandler>();
+ private final boolean supportsPartialMessages;
+
public PerConnectionWebSocketHandler(Class<? extends WebSocketHandler> handlerType) {
+ this(handlerType, false);
+ }
+
+ public PerConnectionWebSocketHandler(Class<? extends WebSocketHandler> handlerType, boolean supportsPartialMessages) {
this.provider = new BeanCreatingHandlerProvider<WebSocketHandler>(handlerType);
+ this.supportsPartialMessages = supportsPartialMessages;
}
@Override
@@ -112,6 +119,11 @@ private void destroy(WebSocketSession session) {
}
}
+ @Override
+ public boolean supportsPartialMessages() {
+ return this.supportsPartialMessages;
+ }
+
@Override
public String toString() {
return "PerConnectionWebSocketHandlerProxy [handlerType=" + this.provider.getHandlerType() + "]"; | true |
Other | spring-projects | spring-framework | fb4e34fce486315935a0292ac0dbe7e0b1497f7f.json | Add partial WebSocketMessage support | spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHandlerDecorator.java | @@ -62,6 +62,12 @@ public void afterConnectionClosed(WebSocketSession session, CloseStatus closeSta
this.delegate.afterConnectionClosed(session, closeStatus);
}
+ @Override
+ public boolean supportsPartialMessages() {
+ return this.delegate.supportsPartialMessages();
+ }
+
+
@Override
public String toString() {
return getClass().getSimpleName() + " [delegate=" + this.delegate + "]"; | true |
Other | spring-projects | spring-framework | 81bce424cb0abac468ea5c5e1cfa6f8d071e48ba.json | Fix bug with deriving SockJS path | spring-websocket/src/main/java/org/springframework/web/socket/sockjs/AbstractSockJsService.java | @@ -82,9 +82,9 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
private final TaskScheduler taskScheduler;
- private final List<String> sockJsPrefixes = new ArrayList<String>();
+ private final List<String> validSockJsPrefixes = new ArrayList<String>();
- private final Set<String> sockJsPathCache = new CopyOnWriteArraySet<String>();
+ private final Set<String> knownSockJsPrefixes = new CopyOnWriteArraySet<String>();
public AbstractSockJsService(TaskScheduler scheduler) {
@@ -119,16 +119,16 @@ public String getName() {
*/
public void setValidSockJsPrefixes(String... prefixes) {
- this.sockJsPrefixes.clear();
+ this.validSockJsPrefixes.clear();
for (String prefix : prefixes) {
if (prefix.endsWith("/") && (prefix.length() > 1)) {
prefix = prefix.substring(0, prefix.length() - 1);
}
- this.sockJsPrefixes.add(prefix);
+ this.validSockJsPrefixes.add(prefix);
}
// sort with longest prefix at the top
- Collections.sort(this.sockJsPrefixes, Collections.reverseOrder(new Comparator<String>() {
+ Collections.sort(this.validSockJsPrefixes, Collections.reverseOrder(new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return new Integer(o1.length()).compareTo(new Integer(o2.length()));
@@ -323,11 +323,11 @@ private String getSockJsPath(ServerHttpRequest request) {
String path = request.getURI().getPath();
// SockJS prefix hints?
- if (!this.sockJsPrefixes.isEmpty()) {
- for (String prefix : this.sockJsPrefixes) {
+ if (!this.validSockJsPrefixes.isEmpty()) {
+ for (String prefix : this.validSockJsPrefixes) {
int index = path.indexOf(prefix);
if (index != -1) {
- this.sockJsPathCache.add(path.substring(0, index + prefix.length()));
+ this.knownSockJsPrefixes.add(path.substring(0, index + prefix.length()));
return path.substring(index + prefix.length());
}
}
@@ -336,29 +336,34 @@ private String getSockJsPath(ServerHttpRequest request) {
// SockJS info request?
if (path.endsWith("/info")) {
- this.sockJsPathCache.add(path.substring(0, path.length() - 6));
+ this.knownSockJsPrefixes.add(path.substring(0, path.length() - "/info".length()));
return "/info";
}
// Have we seen this prefix before (following the initial /info request)?
String match = null;
- for (String sockJsPath : this.sockJsPathCache) {
+ for (String sockJsPath : this.knownSockJsPrefixes) {
if (path.startsWith(sockJsPath)) {
if ((match == null) || (match.length() < sockJsPath.length())) {
match = sockJsPath;
}
}
}
if (match != null) {
- return path.substring(match.length());
+ String result = path.substring(match.length());
+ Assert.isTrue(result.charAt(0) == '/', "Invalid SockJS path extracted from incoming path \"" +
+ path + "\". The extracted SockJS path is \"" + result +
+ "\". It was extracted from these known SockJS prefixes " + this.knownSockJsPrefixes +
+ ". Consider setting 'validSockJsPrefixes' on DefaultSockJsService.");
+ return result;
}
// SockJS greeting?
String pathNoSlash = path.endsWith("/") ? path.substring(0, path.length() - 1) : path;
String lastSegment = pathNoSlash.substring(pathNoSlash.lastIndexOf('/') + 1);
if ((TransportType.fromValue(lastSegment) == null) && !lastSegment.startsWith("iframe")) {
- this.sockJsPathCache.add(path);
+ this.knownSockJsPrefixes.add(path);
return "";
}
| true |
Other | spring-projects | spring-framework | 81bce424cb0abac468ea5c5e1cfa6f8d071e48ba.json | Fix bug with deriving SockJS path | spring-websocket/src/test/java/org/springframework/web/socket/sockjs/AbstractSockJsServiceTests.java | @@ -71,13 +71,20 @@ public void getSockJsPathForGreetingRequest() throws Exception {
public void getSockJsPathForInfoRequest() throws Exception {
handleRequest("GET", "/a/info", HttpStatus.OK);
+
assertTrue(this.servletResponse.getContentAsString().startsWith("{\"entropy\":"));
+ handleRequest("GET", "/a/server/session/xhr", HttpStatus.OK);
+
+ assertEquals("session", this.service.sessionId);
+ assertEquals(TransportType.XHR, this.service.transportType);
+ assertSame(this.handler, this.service.handler);
+
this.service.setValidSockJsPrefixes("/b");
handleRequest("GET", "/a/info", HttpStatus.NOT_FOUND);
-
handleRequest("GET", "/b/info", HttpStatus.OK);
+
assertTrue(this.servletResponse.getContentAsString().startsWith("{\"entropy\":"));
}
| true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java | @@ -157,6 +157,10 @@ public BeanDefinition parse(Element element, ParserContext parserContext) {
handlerMappingDef.getPropertyValues().add("order", 0);
handlerMappingDef.getPropertyValues().add("contentNegotiationManager", contentNegotiationManager);
String methodMappingName = parserContext.getReaderContext().registerWithGeneratedName(handlerMappingDef);
+ if (element.hasAttribute("enableMatrixVariables")) {
+ Boolean enableMatrixVariables = Boolean.valueOf(element.getAttribute("enableMatrixVariables"));
+ handlerMappingDef.getPropertyValues().add("removeSemicolonContent", !enableMatrixVariables);
+ }
RuntimeBeanReference conversionService = getConversionService(element, source, parserContext);
RuntimeBeanReference validator = getValidator(element, source, parserContext); | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java | @@ -128,7 +128,7 @@ public void setUrlDecode(boolean urlDecode) {
/**
* Set if ";" (semicolon) content should be stripped from the request URI.
- * <p>The default value is {@code false}.
+ * <p>The default value is {@code true}.
* @see org.springframework.web.util.UrlPathHelper#setRemoveSemicolonContent(boolean)
*/
public void setRemoveSemicolonContent(boolean removeSemicolonContent) { | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java | @@ -25,6 +25,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -37,7 +38,6 @@
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.HandlerMethodSelector;
import org.springframework.web.servlet.HandlerMapping;
-import org.springframework.web.util.UrlPathHelper;
/**
* Abstract base class for {@link HandlerMapping} implementations that define a
@@ -62,12 +62,6 @@
private final MultiValueMap<String, T> urlMap = new LinkedMultiValueMap<String, T>();
- public AbstractHandlerMethodMapping() {
- UrlPathHelper pathHelper = new UrlPathHelper();
- pathHelper.setRemoveSemicolonContent(false);
- setUrlPathHelper(pathHelper);
- }
-
/**
* Whether to detect handler methods in beans in ancestor ApplicationContexts.
* <p>Default is "false": Only beans in the current ApplicationContext are | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java | @@ -42,13 +42,6 @@
*/
public final class PatternsRequestCondition extends AbstractRequestCondition<PatternsRequestCondition> {
- private static UrlPathHelper pathHelperNoSemicolonContent;
-
- static {
- pathHelperNoSemicolonContent = new UrlPathHelper();
- pathHelperNoSemicolonContent.setRemoveSemicolonContent(true);
- }
-
private final Set<String> patterns;
private final UrlPathHelper pathHelper;
@@ -217,15 +210,10 @@ public PatternsRequestCondition getMatchingCondition(HttpServletRequest request)
}
String lookupPath = this.pathHelper.getLookupPathForRequest(request);
- String lookupPathNoSemicolonContent = (lookupPath.indexOf(';') != -1) ?
- pathHelperNoSemicolonContent.getLookupPathForRequest(request) : null;
List<String> matches = new ArrayList<String>();
for (String pattern : patterns) {
String match = getMatchingPattern(pattern, lookupPath);
- if (match == null && lookupPathNoSemicolonContent != null) {
- match = getMatchingPattern(pattern, lookupPathNoSemicolonContent);
- }
if (match != null) {
matches.add(match);
} | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-3.2.xsd | @@ -231,6 +231,17 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="enableMatrixVariables" type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation><![CDATA[
+ Matrix variables can appear in any path segment, each matrix variable separated with a ";" (semicolon).
+ For example "/cars;color=red;year=2012". By default they're removed from the URL. If this property
+ is set to true, matrix variables are not removed from the URL, and the request mapping pattern
+ must use URI variable in path segments where matrix variables are expected. For example "/{cars}".
+ Matrix variables can then be injected into a controller method with @MatrixVariable.
+ ]]></xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
<xsd:attribute name="ignoreDefaultModelOnRedirect" type="xsd:boolean">
<xsd:annotation>
<xsd:documentation><![CDATA[ | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.0.xsd | @@ -231,6 +231,17 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="enableMatrixVariables" type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation><![CDATA[
+ Matrix variables can appear in any path segment, each matrix variable separated with a ";" (semicolon).
+ For example "/cars;color=red;year=2012". By default they're removed from the URL. If this property
+ is set to true, matrix variables are not removed from the URL, and the request mapping pattern
+ must use URI variable in path segments where matrix variables are expected. For example "/{cars}".
+ Matrix variables can then be injected into a controller method with @MatrixVariable.
+ ]]></xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
<xsd:attribute name="ignoreDefaultModelOnRedirect" type="xsd:boolean">
<xsd:annotation>
<xsd:documentation><![CDATA[ | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java | @@ -16,20 +16,14 @@
package org.springframework.web.servlet.config;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Locale;
+
import javax.servlet.RequestDispatcher;
import javax.validation.constraints.NotNull;
@@ -86,6 +80,8 @@
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
import org.springframework.web.servlet.theme.ThemeChangeInterceptor;
+import static org.junit.Assert.*;
+
/**
* @author Keith Donald
* @author Arjen Poutsma
@@ -117,6 +113,7 @@ public void testDefaultConfig() throws Exception {
RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
assertNotNull(mapping);
assertEquals(0, mapping.getOrder());
+ assertTrue(mapping.getUrlPathHelper().shouldRemoveSemicolonContent());
mapping.setDefaultHandler(handlerMethod);
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/foo.json");
@@ -182,6 +179,10 @@ public void testCustomConversionService() throws Exception {
public void testCustomValidator() throws Exception {
loadBeanDefinitions("mvc-config-custom-validator.xml", 12);
+ RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
+ assertNotNull(mapping);
+ assertFalse(mapping.getUrlPathHelper().shouldRemoveSemicolonContent());
+
RequestMappingHandlerAdapter adapter = appContext.getBean(RequestMappingHandlerAdapter.class);
assertNotNull(adapter);
assertEquals(true, new DirectFieldAccessor(adapter).getPropertyValue("ignoreDefaultModelOnRedirect")); | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/PatternsRequestConditionTests.java | @@ -16,18 +16,15 @@
package org.springframework.web.servlet.mvc.condition;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.junit.Test;
import org.springframework.mock.web.test.MockHttpServletRequest;
-import org.springframework.web.util.UrlPathHelper;
+
+import static org.junit.Assert.*;
/**
* @author Rossen Stoyanchev
@@ -186,16 +183,6 @@ public void matchPatternContainsExtension() {
assertNull(match);
}
- @Test
- public void matchIgnorePathParams() {
- UrlPathHelper pathHelper = new UrlPathHelper();
- pathHelper.setRemoveSemicolonContent(false);
- PatternsRequestCondition condition = new PatternsRequestCondition(new String[] {"/foo/bar"}, pathHelper, null, true, true);
- PatternsRequestCondition match = condition.getMatchingCondition(new MockHttpServletRequest("GET", "/foo;q=1/bar;s=1"));
-
- assertNotNull(match);
- }
-
@Test
public void compareEqualPatterns() {
PatternsRequestCondition c1 = new PatternsRequestCondition("/foo*"); | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java | @@ -16,13 +16,6 @@
package org.springframework.web.servlet.mvc.method;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
@@ -61,6 +54,8 @@
import org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition;
import org.springframework.web.util.UrlPathHelper;
+import static org.junit.Assert.*;
+
/**
* Test fixture with {@link RequestMappingInfoHandlerMapping}.
*
@@ -90,6 +85,7 @@ public void setUp() throws Exception {
this.handlerMapping = new TestRequestMappingInfoHandlerMapping();
this.handlerMapping.registerHandler(testController);
+ this.handlerMapping.setRemoveSemicolonContent(false);
}
@Test | true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | spring-webmvc/src/test/resources/org/springframework/web/servlet/config/mvc-config-custom-validator.xml | @@ -3,9 +3,10 @@
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
+ http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
- <mvc:annotation-driven validator="validator" ignoreDefaultModelOnRedirect="true" />
+ <mvc:annotation-driven validator="validator"
+ ignoreDefaultModelOnRedirect="true" enableMatrixVariables="true" />
<bean id="validator" class="org.springframework.web.servlet.config.MvcNamespaceTests$TestValidator" />
| true |
Other | spring-projects | spring-framework | d23de282a668bbfc271575cff091d7c8c971fbf2.json | Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).
This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.
The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.
Issue: SPR-10427, SPR-10234 | src/reference/docbook/mvc.xml | @@ -1173,9 +1173,7 @@ public void findPet(
<para>Note that to enable the use of matrix variables, you must set the
<classname>removeSemicolonContent</classname> property of
<classname>RequestMappingHandlerMapping</classname> to <code>false</code>.
- By default it is set to <code>true</code> with the exception of the
- MVC namespace and the MVC Java config both of which automatically enable
- the use of matrix variables.</para>
+ By default it is set to <code>false</code>.</para>
</section>
| true |
Other | spring-projects | spring-framework | db596d23dea7a8f35b52581d92b00a18c3f45335.json | Fix deadlock issue in DeferredResult
Previously DeferredResult locked around the setting of the result
including handling up to the part of submitting a dispatch. This
can cause a deadlock if a timeout occurs at the same time since
the Tomcat timeout thread has its own locking that permits only
one thread to do timeout or dispatch processing.
The fix reduces the locking to cover only the attempt to set the
DeferredResult but not the dispatching.
Issue: SPR-10485 | spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java | @@ -173,9 +173,9 @@ private boolean setResultInternal(Object result) {
return false;
}
this.result = result;
- if (this.resultHandler != null) {
- this.resultHandler.handleResult(this.result);
- }
+ }
+ if (this.resultHandler != null) {
+ this.resultHandler.handleResult(this.result);
}
return true;
} | false |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java | @@ -31,53 +31,24 @@ public final class BinaryMessage extends WebSocketMessage<ByteBuffer> {
private byte[] bytes;
- private final boolean last;
-
-
- /**
- * Create a new {@link BinaryMessage} instance.
- * @param payload a non-null payload
- */
- public BinaryMessage(ByteBuffer payload) {
- this(payload, true);
- }
/**
* Create a new {@link BinaryMessage} instance.
* @param payload a non-null payload
* @param isLast if the message is the last of a series of partial messages
*/
- public BinaryMessage(ByteBuffer payload, boolean isLast) {
+ public BinaryMessage(ByteBuffer payload) {
super(payload);
this.bytes = null;
- this.last = isLast;
- }
-
- /**
- * Create a new {@link BinaryMessage} instance.
- * @param payload a non-null payload
- */
- public BinaryMessage(byte[] payload) {
- this(payload, true);
}
/**
* Create a new {@link BinaryMessage} instance.
* @param payload a non-null payload
* @param isLast if the message is the last of a series of partial messages
*/
- public BinaryMessage(byte[] payload, boolean isLast) {
- this(payload, 0, (payload == null ? 0 : payload.length), isLast);
- }
-
- /**
- * Create a new {@link BinaryMessage} instance by wrapping an existing byte array.
- * @param payload a non-null payload, NOTE: this value is not copied so care must be
- * taken not to modify the array.
- * @param isLast if the message is the last of a series of partial messages
- */
- public BinaryMessage(byte[] payload, int offset, int len) {
- this(payload, offset, len, true);
+ public BinaryMessage(byte[] payload) {
+ this(payload, 0, (payload == null ? 0 : payload.length));
}
/**
@@ -88,20 +59,11 @@ public BinaryMessage(byte[] payload, int offset, int len) {
* @param len the length of the array considered for the payload
* @param isLast if the message is the last of a series of partial messages
*/
- public BinaryMessage(byte[] payload, int offset, int len, boolean isLast) {
+ public BinaryMessage(byte[] payload, int offset, int len) {
super(payload != null ? ByteBuffer.wrap(payload, offset, len) : null);
if(offset == 0 && len == payload.length) {
this.bytes = payload;
}
- this.last = isLast;
- }
-
- /**
- * Returns if this is the last part in a series of partial messages. If this is
- * not a partial message this method will return {@code true}.
- */
- public boolean isLast() {
- return this.last;
}
/** | true |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java | @@ -72,9 +72,4 @@ public interface WebSocketHandler {
*/
void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception;
- /**
- * Whether this WebSocketHandler wishes to receive messages broken up in parts.
- */
- boolean isStreaming();
-
} | true |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/adapter/StandardEndpointAdapter.java | @@ -75,24 +75,12 @@ public void onMessage(String message) {
handleTextMessage(session, message);
}
});
-
- if (!this.handler.isStreaming()) {
- session.addMessageHandler(new MessageHandler.Whole<ByteBuffer>() {
- @Override
- public void onMessage(ByteBuffer message) {
- handleBinaryMessage(session, message, true);
- }
- });
- }
- else {
- session.addMessageHandler(new MessageHandler.Partial<ByteBuffer>() {
- @Override
- public void onMessage(ByteBuffer messagePart, boolean isLast) {
- handleBinaryMessage(session, messagePart, isLast);
- }
- });
- }
-
+ session.addMessageHandler(new MessageHandler.Whole<ByteBuffer>() {
+ @Override
+ public void onMessage(ByteBuffer message) {
+ handleBinaryMessage(session, message);
+ }
+ });
}
private void handleTextMessage(javax.websocket.Session session, String payload) {
@@ -105,8 +93,8 @@ private void handleTextMessage(javax.websocket.Session session, String payload)
}
}
- private void handleBinaryMessage(javax.websocket.Session session, ByteBuffer payload, boolean isLast) {
- BinaryMessage binaryMessage = new BinaryMessage(payload, isLast);
+ private void handleBinaryMessage(javax.websocket.Session session, ByteBuffer payload) {
+ BinaryMessage binaryMessage = new BinaryMessage(payload);
try {
this.handler.handleMessage(this.wsSession, binaryMessage);
} | true |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/adapter/WebSocketHandlerAdapter.java | @@ -68,9 +68,4 @@ public void handleTransportError(WebSocketSession session, Throwable exception)
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
}
- @Override
- public boolean isStreaming() {
- return false;
- }
-
} | true |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java | @@ -57,22 +57,9 @@ public class PerConnectionWebSocketHandler implements WebSocketHandler, BeanFact
private final Map<WebSocketSession, WebSocketHandler> handlers =
new ConcurrentHashMap<WebSocketSession, WebSocketHandler>();
- private final boolean streaming;
-
public PerConnectionWebSocketHandler(Class<? extends WebSocketHandler> handlerType) {
- this(handlerType, false);
- }
-
- public PerConnectionWebSocketHandler(Class<? extends WebSocketHandler> handlerType, boolean isStreaming) {
this.provider = new BeanCreatingHandlerProvider<WebSocketHandler>(handlerType);
- this.streaming = isStreaming;
- }
-
-
- @Override
- public boolean isStreaming() {
- return this.streaming;
}
@Override | true |
Other | spring-projects | spring-framework | 278a5924cb530f5b232e5af0f9ab04bd239600c8.json | Remove isLast flag from WebSocketMessage | spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHandlerDecorator.java | @@ -62,11 +62,6 @@ public void afterConnectionClosed(WebSocketSession session, CloseStatus closeSta
this.delegate.afterConnectionClosed(session, closeStatus);
}
- @Override
- public boolean isStreaming() {
- return this.delegate.isStreaming();
- }
-
@Override
public String toString() {
return getClass().getSimpleName() + " [delegate=" + this.delegate + "]"; | true |
Other | spring-projects | spring-framework | 9ca03cf7724e74d20643299a79557d24ebaa6083.json | Upgrade spring-websocket to Jetty 9.0.3 | build.gradle | @@ -477,11 +477,11 @@ project("spring-websocket") {
}
optional("org.glassfish.tyrus:tyrus-websocket-core:1.0-SNAPSHOT")
optional("org.glassfish.tyrus:tyrus-container-servlet:1.0-SNAPSHOT")
- optional("org.eclipse.jetty:jetty-webapp:9.0.1.v20130408") {
+ optional("org.eclipse.jetty:jetty-webapp:9.0.3.v20130506") {
exclude group: "org.eclipse.jetty.orbit", module: "javax.servlet"
}
- optional("org.eclipse.jetty.websocket:websocket-server:9.0.1.v20130408")
- optional("org.eclipse.jetty.websocket:websocket-client:9.0.1.v20130408")
+ optional("org.eclipse.jetty.websocket:websocket-server:9.0.3.v20130506")
+ optional("org.eclipse.jetty.websocket:websocket-client:9.0.3.v20130506")
optional("com.fasterxml.jackson.core:jackson-databind:2.2.0") // required for SockJS support currently
}
| false |
Other | spring-projects | spring-framework | 23737a4516a2e582b2010ea58cf10d25620035b1.json | Update the README to use JDK1.8 b88 | README.md | @@ -37,7 +37,7 @@ a cross-platform, self-contained bootstrap mechanism for the build.
### prerequisites
-[Git][] and the latest [Early Access build of OpenJDK 1.8][JDK18].
+[Git][] and [Early Access build of OpenJDK 1.8 build 88][JDK18 build 88].
### check out sources
`git clone git://github.com/SpringSource/spring-framework.git`
@@ -85,7 +85,7 @@ The Spring Framework is released under version 2.0 of the [Apache License][].
[Gradle]: http://gradle.org
[`./gradlew`]: http://vimeo.com/34436402
[Git]: http://help.github.com/set-up-git-redirect
-[JDK18]: http://jdk8.java.net/download.html
+[JDK18 build 88]: https://jdk8.java.net/archive/8-b88.html
[Gradle build and release FAQ]: https://github.com/SpringSource/spring-framework/wiki/Gradle-build-and-release-FAQ
[Pull requests]: http://help.github.com/send-pull-requests
[contributor guidelines]: https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md | false |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/TargetSource.java | @@ -39,6 +39,7 @@ public interface TargetSource extends TargetClassAware {
* target class.
* @return the type of targets returned by this {@link TargetSource}
*/
+ @Override
Class<?> getTargetClass();
/** | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java | @@ -34,6 +34,7 @@ class TrueClassFilter implements ClassFilter, Serializable {
private TrueClassFilter() {
}
+ @Override
public boolean matches(Class clazz) {
return true;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java | @@ -35,14 +35,17 @@ class TrueMethodMatcher implements MethodMatcher, Serializable {
private TrueMethodMatcher() {
}
+ @Override
public boolean isRuntime() {
return false;
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return true;
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
// Should never be invoked as isRuntime returns false.
throw new UnsupportedOperationException(); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/TruePointcut.java | @@ -34,10 +34,12 @@ class TruePointcut implements Pointcut, Serializable {
private TruePointcut() {
}
+ @Override
public ClassFilter getClassFilter() {
return ClassFilter.TRUE;
}
+ @Override
public MethodMatcher getMethodMatcher() {
return MethodMatcher.TRUE;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java | @@ -203,6 +203,7 @@ public final ClassLoader getAspectClassLoader() {
return this.aspectInstanceFactory.getAspectClassLoader();
}
+ @Override
public int getOrder() {
return this.aspectInstanceFactory.getOrder();
}
@@ -212,6 +213,7 @@ public void setAspectName(String name) {
this.aspectName = name;
}
+ @Override
public String getAspectName() {
return this.aspectName;
}
@@ -223,6 +225,7 @@ public void setDeclarationOrder(int order) {
this.declarationOrder = order;
}
+ @Override
public int getDeclarationOrder() {
return this.declarationOrder;
}
@@ -678,6 +681,7 @@ public AdviceExcludingMethodMatcher(Method adviceMethod) {
this.adviceMethod = adviceMethod;
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return !this.adviceMethod.equals(method);
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java | @@ -222,6 +222,7 @@ public void setThrowingName(String throwingName) {
* @param method the target {@link Method}
* @return the parameter names
*/
+ @Override
public String[] getParameterNames(Method method) {
this.argumentTypes = method.getParameterTypes();
this.numberOfRemainingUnboundArguments = this.argumentTypes.length;
@@ -309,6 +310,7 @@ public String[] getParameterNames(Method method) {
* @throws UnsupportedOperationException if
* {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true}
*/
+ @Override
public String[] getParameterNames(Constructor ctor) {
if (this.raiseExceptions) {
throw new UnsupportedOperationException("An advice method can never be a constructor"); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java | @@ -37,6 +37,7 @@ public AspectJAfterAdvice(
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
try {
return mi.proceed();
@@ -46,10 +47,12 @@ public Object invoke(MethodInvocation mi) throws Throwable {
}
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java | @@ -40,10 +40,12 @@ public AspectJAfterReturningAdvice(
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
}
@@ -53,6 +55,7 @@ public void setReturningName(String name) {
setReturningNameNoCheck(name);
}
+ @Override
public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
if (shouldInvokeOnReturnValueOf(method, returnValue)) {
invokeAdviceMethod(getJoinPointMatch(), returnValue, null); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java | @@ -37,10 +37,12 @@ public AspectJAfterThrowingAdvice(
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
}
@@ -50,6 +52,7 @@ public void setThrowingName(String name) {
setThrowingNameNoCheck(name);
}
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
try {
return mi.proceed(); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAroundAdvice.java | @@ -41,10 +41,12 @@ public AspectJAroundAdvice(
super(aspectJAroundAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return false;
}
@@ -55,6 +57,7 @@ protected boolean supportsProceedingJoinPoint() {
}
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
if (!(mi instanceof ProxyMethodInvocation)) {
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java | @@ -155,16 +155,19 @@ public void setParameterTypes(Class[] types) {
this.pointcutParameterTypes = types;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
+ @Override
public ClassFilter getClassFilter() {
checkReadyToMatch();
return this;
}
+ @Override
public MethodMatcher getMethodMatcher() {
checkReadyToMatch();
return this;
@@ -244,6 +247,7 @@ public PointcutExpression getPointcutExpression() {
return this.pointcutExpression;
}
+ @Override
public boolean matches(Class targetClass) {
checkReadyToMatch();
try {
@@ -267,6 +271,7 @@ public boolean matches(Class targetClass) {
}
}
+ @Override
public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions) {
checkReadyToMatch();
Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
@@ -287,15 +292,18 @@ else if (shadowMatch.neverMatches()) {
}
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return matches(method, targetClass, false);
}
+ @Override
public boolean isRuntime() {
checkReadyToMatch();
return this.pointcutExpression.mayNeedDynamicTest();
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
checkReadyToMatch();
ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method);
@@ -506,10 +514,12 @@ private class BeanNamePointcutDesignatorHandler implements PointcutDesignatorHan
private static final String BEAN_DESIGNATOR_NAME = "bean";
+ @Override
public String getDesignatorName() {
return BEAN_DESIGNATOR_NAME;
}
+ @Override
public ContextBasedMatcher parse(String expression) {
return new BeanNameContextMatcher(expression);
}
@@ -531,22 +541,27 @@ public BeanNameContextMatcher(String expression) {
this.expressionPattern = new NamePattern(expression);
}
+ @Override
public boolean couldMatchJoinPointsInType(Class someClass) {
return (contextMatch(someClass) == FuzzyBoolean.YES);
}
+ @Override
public boolean couldMatchJoinPointsInType(Class someClass, MatchingContext context) {
return (contextMatch(someClass) == FuzzyBoolean.YES);
}
+ @Override
public boolean matchesDynamically(MatchingContext context) {
return true;
}
+ @Override
public FuzzyBoolean matchesStatically(MatchingContext context) {
return contextMatch(null);
}
+ @Override
public boolean mayNeedDynamicTest() {
return false;
}
@@ -611,18 +626,22 @@ public DefensiveShadowMatch(ShadowMatch primary, ShadowMatch other) {
this.other = other;
}
+ @Override
public boolean alwaysMatches() {
return primary.alwaysMatches();
}
+ @Override
public boolean maybeMatches() {
return primary.maybeMatches();
}
+ @Override
public boolean neverMatches() {
return primary.neverMatches();
}
+ @Override
public JoinPointMatch matchesJoinPoint(Object thisObject,
Object targetObject, Object[] args) {
try {
@@ -632,6 +651,7 @@ public JoinPointMatch matchesJoinPoint(Object thisObject,
}
}
+ @Override
public void setMatchingContext(MatchingContext aMatchContext) {
primary.setMatchingContext(aMatchContext);
other.setMatchingContext(aMatchContext); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java | @@ -31,6 +31,7 @@ public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdv
private final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.java | @@ -35,14 +35,17 @@ public AspectJMethodBeforeAdvice(
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public void before(Method method, Object[] args, Object target) throws Throwable {
invokeAdviceMethod(getJoinPointMatch(), null, null);
}
+ @Override
public boolean isBeforeAdvice() {
return true;
}
+ @Override
public boolean isAfterAdvice() {
return false;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java | @@ -56,18 +56,22 @@ public void setOrder(int order) {
}
+ @Override
public boolean isPerInstance() {
return true;
}
+ @Override
public Advice getAdvice() {
return this.advice;
}
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
}
+ @Override
public int getOrder() {
if (this.order != null) {
return this.order; | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java | @@ -48,6 +48,7 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver");
+ @Override
public boolean handleMessage(IMessage message) throws AbortException {
Kind messageKind = message.getKind();
@@ -89,15 +90,18 @@ private String makeMessageFor(IMessage aMessage) {
return AJ_ID + aMessage.getMessage();
}
+ @Override
public boolean isIgnoring(Kind messageKind) {
// We want to see everything, and allow configuration of log levels dynamically.
return false;
}
+ @Override
public void dontIgnore(Kind messageKind) {
// We weren't ignoring anything anyway...
}
+ @Override
public void ignore(Kind kind) {
// We weren't ignoring anything anyway...
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java | @@ -77,6 +77,7 @@ private DeclareParentsAdvisor(Class interfaceType, String typePattern, Class imp
// Excludes methods implemented.
ClassFilter exclusion = new ClassFilter() {
+ @Override
public boolean matches(Class clazz) {
return !(introducedInterface.isAssignableFrom(clazz));
}
@@ -87,22 +88,27 @@ public boolean matches(Class clazz) {
}
+ @Override
public ClassFilter getClassFilter() {
return this.typePatternClassFilter;
}
+ @Override
public void validateInterfaces() throws IllegalArgumentException {
// Do nothing
}
+ @Override
public boolean isPerInstance() {
return true;
}
+ @Override
public Advice getAdvice() {
return this.advice;
}
+ @Override
public Class[] getInterfaces() {
return new Class[] {this.introducedInterface};
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java | @@ -72,14 +72,17 @@ public MethodInvocationProceedingJoinPoint(ProxyMethodInvocation methodInvocatio
this.methodInvocation = methodInvocation;
}
+ @Override
public void set$AroundClosure(AroundClosure aroundClosure) {
throw new UnsupportedOperationException();
}
+ @Override
public Object proceed() throws Throwable {
return this.methodInvocation.invocableClone().proceed();
}
+ @Override
public Object proceed(Object[] arguments) throws Throwable {
Assert.notNull(arguments, "Argument array passed to proceed cannot be null");
if (arguments.length != this.methodInvocation.getArguments().length) {
@@ -94,17 +97,20 @@ public Object proceed(Object[] arguments) throws Throwable {
/**
* Returns the Spring AOP proxy. Cannot be {@code null}.
*/
+ @Override
public Object getThis() {
return this.methodInvocation.getProxy();
}
/**
* Returns the Spring AOP target. May be {@code null} if there is no target.
*/
+ @Override
public Object getTarget() {
return this.methodInvocation.getThis();
}
+ @Override
public Object[] getArgs() {
if (this.defensiveCopyOfArgs == null) {
Object[] argsSource = this.methodInvocation.getArguments();
@@ -114,41 +120,49 @@ public Object[] getArgs() {
return this.defensiveCopyOfArgs;
}
+ @Override
public Signature getSignature() {
if (this.signature == null) {
this.signature = new MethodSignatureImpl();
}
return signature;
}
+ @Override
public SourceLocation getSourceLocation() {
if (this.sourceLocation == null) {
this.sourceLocation = new SourceLocationImpl();
}
return this.sourceLocation;
}
+ @Override
public String getKind() {
return ProceedingJoinPoint.METHOD_EXECUTION;
}
+ @Override
public int getId() {
// TODO: It's just an adapter but returning 0 might still have side effects...
return 0;
}
+ @Override
public JoinPoint.StaticPart getStaticPart() {
return this;
}
+ @Override
public String toShortString() {
return "execution(" + getSignature().toShortString() + ")";
}
+ @Override
public String toLongString() {
return "execution(" + getSignature().toLongString() + ")";
}
+ @Override
public String toString() {
return "execution(" + getSignature().toString() + ")";
}
@@ -161,53 +175,65 @@ private class MethodSignatureImpl implements MethodSignature {
private volatile String[] parameterNames;
+ @Override
public String getName() {
return methodInvocation.getMethod().getName();
}
+ @Override
public int getModifiers() {
return methodInvocation.getMethod().getModifiers();
}
+ @Override
public Class getDeclaringType() {
return methodInvocation.getMethod().getDeclaringClass();
}
+ @Override
public String getDeclaringTypeName() {
return methodInvocation.getMethod().getDeclaringClass().getName();
}
+ @Override
public Class getReturnType() {
return methodInvocation.getMethod().getReturnType();
}
+ @Override
public Method getMethod() {
return methodInvocation.getMethod();
}
+ @Override
public Class[] getParameterTypes() {
return methodInvocation.getMethod().getParameterTypes();
}
+ @Override
public String[] getParameterNames() {
if (this.parameterNames == null) {
this.parameterNames = (new LocalVariableTableParameterNameDiscoverer()).getParameterNames(getMethod());
}
return this.parameterNames;
}
+ @Override
public Class[] getExceptionTypes() {
return methodInvocation.getMethod().getExceptionTypes();
}
+ @Override
public String toShortString() {
return toString(false, false, false, false);
}
+ @Override
public String toLongString() {
return toString(true, true, true, true);
}
+ @Override
public String toString() {
return toString(false, true, false, true);
}
@@ -267,21 +293,25 @@ private void appendType(StringBuilder sb, Class<?> type, boolean useLongTypeName
*/
private class SourceLocationImpl implements SourceLocation {
+ @Override
public Class getWithinType() {
if (methodInvocation.getThis() == null) {
throw new UnsupportedOperationException("No source location joinpoint available: target is null");
}
return methodInvocation.getThis().getClass();
}
+ @Override
public String getFileName() {
throw new UnsupportedOperationException();
}
+ @Override
public int getLine() {
throw new UnsupportedOperationException();
}
+ @Override
public int getColumn() {
throw new UnsupportedOperationException();
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java | @@ -106,35 +106,44 @@ private static class TestVisitorAdapter implements ITestVisitor {
protected static final int AT_TARGET_VAR = 4;
protected static final int AT_ANNOTATION_VAR = 8;
+ @Override
public void visit(And e) {
e.getLeft().accept(this);
e.getRight().accept(this);
}
+ @Override
public void visit(Or e) {
e.getLeft().accept(this);
e.getRight().accept(this);
}
+ @Override
public void visit(Not e) {
e.getBody().accept(this);
}
+ @Override
public void visit(Instanceof i) {
}
+ @Override
public void visit(Literal literal) {
}
+ @Override
public void visit(Call call) {
}
+ @Override
public void visit(FieldGetCall fieldGetCall) {
}
+ @Override
public void visit(HasAnnotation hasAnnotation) {
}
+ @Override
public void visit(MatchingContextBasedTest matchingContextTest) {
}
| true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java | @@ -49,6 +49,7 @@ public final Class getAspectClass() {
}
+ @Override
public final Object getAspectInstance() {
try {
return this.aspectClass.newInstance();
@@ -61,6 +62,7 @@ public final Object getAspectInstance() {
}
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.aspectClass.getClassLoader();
}
@@ -73,6 +75,7 @@ public ClassLoader getAspectClassLoader() {
* @see org.springframework.core.Ordered
* @see #getOrderForAspectClass
*/
+ @Override
public int getOrder() {
return getOrderForAspectClass(this.aspectClass);
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java | @@ -44,10 +44,12 @@ public SingletonAspectInstanceFactory(Object aspectInstance) {
}
+ @Override
public final Object getAspectInstance() {
return this.aspectInstance;
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.aspectInstance.getClass().getClassLoader();
}
@@ -60,6 +62,7 @@ public ClassLoader getAspectClassLoader() {
* @see org.springframework.core.Ordered
* @see #getOrderForAspectClass
*/
+ @Override
public int getOrder() {
if (this.aspectInstance instanceof Ordered) {
return ((Ordered) this.aspectInstance).getOrder(); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java | @@ -93,6 +93,7 @@ public String getTypePattern() {
* @return whether the advice should apply to this candidate target class
* @throws IllegalStateException if no {@link #setTypePattern(String)} has been set
*/
+ @Override
public boolean matches(Class clazz) {
if (this.aspectJTypePatternMatcher == null) {
throw new IllegalStateException("No 'typePattern' has been set via ctor/setter."); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java | @@ -111,6 +111,7 @@ protected AbstractAspectJAdvisorFactory() {
* is that aspects written in the code-style (AspectJ language) also have the annotation present
* when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.
*/
+ @Override
public boolean isAspect(Class<?> clazz) {
return (hasAspectAnnotation(clazz) && !compiledByAjc(clazz));
}
@@ -135,6 +136,7 @@ private boolean compiledByAjc(Class<?> clazz) {
return false;
}
+ @Override
public void validate(Class<?> aspectClass) throws AopConfigException {
// If the parent has the annotation and isn't abstract it's an error
if (aspectClass.getSuperclass().getAnnotation(Aspect.class) != null &&
@@ -309,6 +311,7 @@ public String toString() {
*/
private static class AspectJAnnotationParameterNameDiscoverer implements ParameterNameDiscoverer {
+ @Override
public String[] getParameterNames(Method method) {
if (method.getParameterTypes().length == 0) {
return new String[0];
@@ -330,6 +333,7 @@ public String[] getParameterNames(Method method) {
}
}
+ @Override
public String[] getParameterNames(Constructor ctor) {
throw new UnsupportedOperationException("Spring AOP cannot handle constructor advice");
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java | @@ -72,10 +72,12 @@ public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Cl
}
+ @Override
public Object getAspectInstance() {
return this.beanFactory.getBean(this.name);
}
+ @Override
public ClassLoader getAspectClassLoader() {
if (this.beanFactory instanceof ConfigurableBeanFactory) {
return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
@@ -85,6 +87,7 @@ public ClassLoader getAspectClassLoader() {
}
}
+ @Override
public AspectMetadata getAspectMetadata() {
return this.aspectMetadata;
}
@@ -99,6 +102,7 @@ public AspectMetadata getAspectMetadata() {
* @see org.springframework.core.Ordered
* @see org.springframework.core.annotation.Order
*/
+ @Override
public int getOrder() {
Class<?> type = this.beanFactory.getType(this.name);
if (type != null) { | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java | @@ -97,6 +97,7 @@ public InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af, Aspe
* The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change
* depending on the state of the advice.
*/
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
}
@@ -106,6 +107,7 @@ public Pointcut getPointcut() {
* are much richer. In AspectJ terminology, all a return of {@code true}
* means here is that the aspect is not a SINGLETON.
*/
+ @Override
public boolean isPerInstance() {
return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON);
}
@@ -120,17 +122,20 @@ public AspectMetadata getAspectMetadata() {
/**
* Lazily instantiate advice if necessary.
*/
+ @Override
public synchronized Advice getAdvice() {
if (this.instantiatedAdvice == null) {
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut);
}
return this.instantiatedAdvice;
}
+ @Override
public boolean isLazy() {
return this.lazy;
}
+ @Override
public synchronized boolean isAdviceInstantiated() {
return (this.instantiatedAdvice != null);
}
@@ -149,25 +154,30 @@ public AspectJExpressionPointcut getDeclaredPointcut() {
return this.declaredPointcut;
}
+ @Override
public int getOrder() {
return this.aspectInstanceFactory.getOrder();
}
+ @Override
public String getAspectName() {
return this.aspectName;
}
+ @Override
public int getDeclarationOrder() {
return this.declarationOrder;
}
+ @Override
public boolean isBeforeAdvice() {
if (this.isBeforeAdvice == null) {
determineAdviceType();
}
return this.isBeforeAdvice;
}
+ @Override
public boolean isAfterAdvice() {
if (this.isAfterAdvice == null) {
determineAdviceType();
@@ -245,6 +255,7 @@ public boolean matches(Method method, Class targetClass) {
this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass);
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
// This can match only on declared pointcut.
return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.java | @@ -42,6 +42,7 @@ public LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFa
}
+ @Override
public synchronized Object getAspectInstance() {
if (this.materialized == null) {
synchronized (this) {
@@ -57,14 +58,17 @@ public boolean isMaterialized() {
return (this.materialized != null);
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.maaif.getAspectClassLoader();
}
+ @Override
public AspectMetadata getAspectMetadata() {
return this.maaif.getAspectMetadata();
}
+ @Override
public int getOrder() {
return this.maaif.getOrder();
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java | @@ -75,13 +75,15 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
new InstanceComparator<Annotation>(
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
new Converter<Method, Annotation>() {
+ @Override
public Annotation convert(Method method) {
AspectJAnnotation<?> annotation = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
return annotation == null ? null : annotation.getAnnotation();
}
}));
comparator.addComparator(new ConvertingComparator<Method, String>(
new Converter<Method, String>() {
+ @Override
public String convert(Method method) {
return method.getName();
}
@@ -90,6 +92,7 @@ public String convert(Method method) {
}
+ @Override
public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif) {
final Class<?> aspectClass = maaif.getAspectMetadata().getAspectClass();
final String aspectName = maaif.getAspectMetadata().getAspectName();
@@ -128,6 +131,7 @@ public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif) {
private List<Method> getAdvisorMethods(Class<?> aspectClass) {
final List<Method> methods = new LinkedList<Method>();
ReflectionUtils.doWithMethods(aspectClass, new ReflectionUtils.MethodCallback() {
+ @Override
public void doWith(Method method) throws IllegalArgumentException {
// Exclude pointcuts
if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
@@ -164,6 +168,7 @@ private Advisor getDeclareParentsAdvisor(Field introductionField) {
}
+ @Override
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif,
int declarationOrderInAspect, String aspectName) {
@@ -191,6 +196,7 @@ private AspectJExpressionPointcut getPointcut(Method candidateAdviceMethod, Clas
}
+ @Override
public Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut ajexp,
MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) {
@@ -272,6 +278,7 @@ protected static class SyntheticInstantiationAdvisor extends DefaultPointcutAdvi
public SyntheticInstantiationAdvisor(final MetadataAwareAspectInstanceFactory aif) {
super(aif.getAspectMetadata().getPerClausePointcut(), new MethodBeforeAdvice() {
+ @Override
public void before(Method method, Object[] args, Object target) {
// Simply instantiate the aspect
aif.getAspectInstance(); | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java | @@ -45,6 +45,7 @@ public SimpleMetadataAwareAspectInstanceFactory(Class aspectClass, String aspect
}
+ @Override
public final AspectMetadata getAspectMetadata() {
return this.metadata;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java | @@ -47,6 +47,7 @@ public SingletonMetadataAwareAspectInstanceFactory(Object aspectInstance, String
}
+ @Override
public final AspectMetadata getAspectMetadata() {
return this.metadata;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java | @@ -126,11 +126,13 @@ public PartiallyComparableAdvisorHolder(Advisor advisor, Comparator<Advisor> com
this.comparator = comparator;
}
+ @Override
public int compareTo(Object obj) {
Advisor otherAdvisor = ((PartiallyComparableAdvisorHolder) obj).advisor;
return this.comparator.compare(this.advisor, otherAdvisor);
}
+ @Override
public int fallbackCompareTo(Object obj) {
return 0;
} | true |
Other | spring-projects | spring-framework | 94685481162a93666fc2f39b66223833a6bcb418.json | Add @Override to remaining source files
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java | @@ -75,6 +75,7 @@ public AspectJPrecedenceComparator(Comparator<? super Advisor> advisorComparator
}
+ @Override
public int compare(Object o1, Object o2) {
if (!(o1 instanceof Advisor && o2 instanceof Advisor)) {
throw new IllegalArgumentException( | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.