Commit 8c315b29 authored by Alex Mateescu's avatar Alex Mateescu Committed by alexm

OF-582 Changed synchronization to user_name+property_name

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13331 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8e379cb8
...@@ -206,11 +206,11 @@ public class User implements Cacheable, Externalizable, Result { ...@@ -206,11 +206,11 @@ public class User implements Cacheable, Externalizable, Result {
if (name != null && name.matches("\\s*")) { if (name != null && name.matches("\\s*")) {
name = null; name = null;
} }
if (name == null && UserManager.getUserProvider().isNameRequired()) { if (name == null && UserManager.getUserProvider().isNameRequired()) {
throw new IllegalArgumentException("User provider requires name."); throw new IllegalArgumentException("User provider requires name.");
} }
try { try {
String originalName = this.name; String originalName = this.name;
UserManager.getUserProvider().setName(username, name); UserManager.getUserProvider().setName(username, name);
...@@ -259,7 +259,7 @@ public class User implements Cacheable, Externalizable, Result { ...@@ -259,7 +259,7 @@ public class User implements Cacheable, Externalizable, Result {
if (UserManager.getUserProvider().isReadOnly()) { if (UserManager.getUserProvider().isReadOnly()) {
throw new UnsupportedOperationException("User provider is read-only."); throw new UnsupportedOperationException("User provider is read-only.");
} }
if (email != null && email.matches("\\s*")) { if (email != null && email.matches("\\s*")) {
email = null; email = null;
} }
...@@ -436,7 +436,7 @@ public class User implements Cacheable, Externalizable, Result { ...@@ -436,7 +436,7 @@ public class User implements Cacheable, Externalizable, Result {
Map<String,Object> eventParams = new HashMap<String,Object>(); Map<String,Object> eventParams = new HashMap<String,Object>();
Object answer; Object answer;
String keyString = (String) key; String keyString = (String) key;
synchronized (keyString.intern()) { synchronized (getName() + keyString.intern()) {
if (properties.containsKey(keyString)) { if (properties.containsKey(keyString)) {
String originalValue = properties.get(keyString); String originalValue = properties.get(keyString);
answer = properties.put(keyString, (String)value); answer = properties.put(keyString, (String)value);
...@@ -607,7 +607,7 @@ public class User implements Cacheable, Externalizable, Result { ...@@ -607,7 +607,7 @@ public class User implements Cacheable, Externalizable, Result {
creationDate = new Date(ExternalizableUtil.getInstance().readLong(in)); creationDate = new Date(ExternalizableUtil.getInstance().readLong(in));
modificationDate = new Date(ExternalizableUtil.getInstance().readLong(in)); modificationDate = new Date(ExternalizableUtil.getInstance().readLong(in));
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.jivesoftware.util.resultsetmanager.Result#getUID() * @see org.jivesoftware.util.resultsetmanager.Result#getUID()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment