Explorar el Código

Do not fail assertion if re-setting the same lock (#13440)

Change-Id: I2e7e9dcf8739a04583d8e42a86a1fede36011813
tags/7.1.13
Artur Signell hace 10 años
padre
commit
c121c4e5ad
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7
    2
      server/src/com/vaadin/server/VaadinService.java

+ 7
- 2
server/src/com/vaadin/server/VaadinService.java Ver fichero

@@ -521,8 +521,13 @@ public abstract class VaadinService implements Serializable {
* The lock object
*/
private void setSessionLock(WrappedSession wrappedSession, Lock lock) {
assert wrappedSession != null : "Can't set a lock for a null session";
assert wrappedSession.getAttribute(getLockAttributeName()) == null : "Changing the lock for a session is not allowed";
if (wrappedSession == null) {
throw new IllegalArgumentException(
"Can't set a lock for a null session");
}
Object currentSessionLock = wrappedSession
.getAttribute(getLockAttributeName());
assert (currentSessionLock == null || currentSessionLock == lock) : "Changing the lock for a session is not allowed";

wrappedSession.setAttribute(getLockAttributeName(), lock);
}

Cargando…
Cancelar
Guardar