diff --git a/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFuture.java b/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFuture.java index 5b84297388..9c7a0ec1df 100644 --- a/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFuture.java +++ b/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFuture.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import java.util.concurrent.Future; * Extend {@link Future} with the capability to accept completion callbacks. * If the future has completed when the callback is added, the callback is * triggered immediately. + * *
Inspired by {@code com.google.common.util.concurrent.ListenableFuture}. * * @author Arjen Poutsma diff --git a/spring-jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java b/spring-jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java index 5466ef2d13..bf44f8fa01 100644 --- a/spring-jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java +++ b/spring-jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,12 +50,12 @@ import org.springframework.transaction.support.TransactionSynchronizationManager * *
Application code is required to retrieve the transactional JMS Session via * {@link ConnectionFactoryUtils#getTransactionalSession} instead of a standard - * J2EE-style {@link ConnectionFactory#createConnection()} call with subsequent + * Java EE-style {@link ConnectionFactory#createConnection()} call with subsequent * Session creation. Spring's {@link org.springframework.jms.core.JmsTemplate} * will autodetect a thread-bound Session and automatically participate in it. * *
Alternatively, you can allow application code to work with the standard
- * J2EE-style lookup pattern on a ConnectionFactory, for example for legacy code
+ * Java EE-style lookup pattern on a ConnectionFactory, for example for legacy code
* that is not aware of Spring at all. In that case, define a
* {@link TransactionAwareConnectionFactoryProxy} for your target ConnectionFactory,
* which will automatically participate in Spring-managed transactions.
@@ -226,8 +226,7 @@ public class JmsTransactionManager extends AbstractPlatformTransactionManager
@Override
protected void doResume(Object transaction, Object suspendedResources) {
- JmsResourceHolder conHolder = (JmsResourceHolder) suspendedResources;
- TransactionSynchronizationManager.bindResource(getConnectionFactory(), conHolder);
+ TransactionSynchronizationManager.bindResource(getConnectionFactory(), suspendedResources);
}
@Override
diff --git a/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java
index 39233b0acd..f1bed796ba 100644
--- a/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2014 the original author or authors.
+ * Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -144,7 +144,6 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
(SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
logger.debug("Closing Hibernate Session in OpenSessionInViewInterceptor");
SessionFactoryUtils.closeSession(sessionHolder.getSession());
-
}
}
diff --git a/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java b/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java
index 5b2ff0bfb5..d44cc19109 100644
--- a/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java
+++ b/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -144,7 +144,6 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
(SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
logger.debug("Closing Hibernate Session in OpenSessionInViewInterceptor");
SessionFactoryUtils.closeSession(sessionHolder.getSession());
-
}
}
diff --git a/spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManager.java b/spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManager.java
index 81553b81d0..39805bc0ad 100644
--- a/spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManager.java
+++ b/spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -118,9 +118,7 @@ public class ContentNegotiationManager implements ContentNegotiationStrategy, Me
}
@Override
- public List This base class provides an {@code @ExceptionHandler} method for handling
* internal Spring MVC exceptions. This method returns a {@code ResponseEntity}
- * for writing to the response with a {@link HttpMessageConverter message converter}.
+ * for writing to the response with a {@link HttpMessageConverter message converter},
* in contrast to
* {@link org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
* DefaultHandlerExceptionResolver} which returns a
@@ -479,10 +479,13 @@ public abstract class ResponseEntityExceptionHandler {
HttpServletRequest request = servletRequest.getNativeRequest(HttpServletRequest.class);
HttpServletResponse response = servletRequest.getNativeResponse(HttpServletResponse.class);
if (response.isCommitted()) {
- logger.error("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]");
+ if (logger.isErrorEnabled()) {
+ logger.error("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]");
+ }
return null;
}
}
+
return handleExceptionInternal(ex, null, headers, status, webRequest);
}
diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java
index ed0aca2753..5943e02015 100644
--- a/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java
+++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2015 the original author or authors.
+ * Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext {
ThemeChangeInterceptor interceptor4 = new ThemeChangeInterceptor();
interceptor4.setParamName("theme2");
UserRoleAuthorizationInterceptor interceptor5 = new UserRoleAuthorizationInterceptor();
- interceptor5.setAuthorizedRoles(new String[] {"role1", "role2"});
+ interceptor5.setAuthorizedRoles("role1", "role2");
List