mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-1803 "ScopeIntercaptor null references on session serialization" apply patch submitted by Sylvain RIBEYRON.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520152 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -202,26 +202,30 @@ public class ScopeInterceptor extends AbstractInterceptor implements PreResultLi
|
||||
super();
|
||||
}
|
||||
|
||||
// Since 2.0.7. Avoid null references on session serialization (WW-1803).
|
||||
private static class NULLClass implements Serializable {
|
||||
public String toString() {
|
||||
return "NULL";
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
return obj == null || (obj instanceof NULLClass);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Object NULL = new Serializable() {
|
||||
public String toString() {
|
||||
return "NULL";
|
||||
}
|
||||
};
|
||||
private static final Object NULL = new NULLClass();
|
||||
|
||||
private static final Object nullConvert(Object o) {
|
||||
if (o == null) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (o == NULL) {
|
||||
if (o == NULL || NULL.equals(o)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
private static Map locks = new IdentityHashMap();
|
||||
|
||||
static final void lock(Object o, ActionInvocation invocation) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user