Skip to content

Commit

Permalink
WFLY-19613 Bypass immutability check when redundant.
Browse files Browse the repository at this point in the history
  • Loading branch information
pferraro committed Aug 7, 2024
1 parent 64c7525 commit fc8a193
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public Object setAttribute(String name, Object value) {
@Override
public Object getAttribute(String name) {
Object value = this.attributes.get(name);
if (!this.immutability.test(value)) {
// Bypass immutability check if session is already dirty
if (!this.dirty.get() && !this.immutability.test(value)) {
this.dirty.set(true);
}
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public Object getAttribute(String name) {

if (value != null) {
// If the object is mutable, we need to mutate this value on close
if (!this.immutability.test(value)) {
synchronized (this.updates) {
synchronized (this.updates) {
// Bypass immutability check if we are already updating this attribute
if (!this.updates.containsKey(name) && !this.immutability.test(value)) {
this.updates.put(name, value);
}
}
Expand Down

0 comments on commit fc8a193

Please sign in to comment.