Java 5 code style
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -46,7 +46,8 @@ public abstract class RequestContextHolder {
|
||||
private static final boolean jsfPresent =
|
||||
ClassUtils.isPresent("javax.faces.context.FacesContext", RequestContextHolder.class.getClassLoader());
|
||||
|
||||
private static final ThreadLocal<RequestAttributes> requestAttributesHolder = new NamedThreadLocal<RequestAttributes>("Request attributes");
|
||||
private static final ThreadLocal<RequestAttributes> requestAttributesHolder =
|
||||
new NamedThreadLocal<RequestAttributes>("Request attributes");
|
||||
|
||||
private static final ThreadLocal<RequestAttributes> inheritableRequestAttributesHolder =
|
||||
new NamedInheritableThreadLocal<RequestAttributes>("Request context");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -124,8 +124,8 @@ public abstract class WebApplicationContextUtils {
|
||||
beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
|
||||
beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
|
||||
|
||||
beanFactory.registerResolvableDependency(ServletRequest.class, new ObjectFactory() {
|
||||
public Object getObject() {
|
||||
beanFactory.registerResolvableDependency(ServletRequest.class, new ObjectFactory<ServletRequest>() {
|
||||
public ServletRequest getObject() {
|
||||
RequestAttributes requestAttr = RequestContextHolder.currentRequestAttributes();
|
||||
if (!(requestAttr instanceof ServletRequestAttributes)) {
|
||||
throw new IllegalStateException("Current request is not a servlet request");
|
||||
@@ -133,8 +133,8 @@ public abstract class WebApplicationContextUtils {
|
||||
return ((ServletRequestAttributes) requestAttr).getRequest();
|
||||
}
|
||||
});
|
||||
beanFactory.registerResolvableDependency(HttpSession.class, new ObjectFactory() {
|
||||
public Object getObject() {
|
||||
beanFactory.registerResolvableDependency(HttpSession.class, new ObjectFactory<HttpSession>() {
|
||||
public HttpSession getObject() {
|
||||
RequestAttributes requestAttr = RequestContextHolder.currentRequestAttributes();
|
||||
if (!(requestAttr instanceof ServletRequestAttributes)) {
|
||||
throw new IllegalStateException("Current request is not a servlet request");
|
||||
|
||||
Reference in New Issue
Block a user