Skip to content

Commit ff31e4a

Browse files
author
David Bateman
committed
GUACAMOLE-2137: VaultInfo.equals and VaultInfo.hashcode must use the same logic for safe use as a HashMap key
1 parent f516e43 commit ff31e4a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extensions/guacamole-vault/modules/guacamole-vault-hv/src/main/java/org/apache/guacamole/vault/hv/conf/HvConfigurationService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ public boolean equals(Object o) {
498498
@Override
499499
public int hashCode() {
500500
// Only hash the values that can be different
501-
return Objects.hash(Uri, Token, Username, Password);
501+
if (Token == null || Token.trim().isEmpty())
502+
return Objects.hash(Uri, Username, Password);
503+
else
504+
return Objects.hash(Uri, Token);
502505
}
503506
}
504507
}

0 commit comments

Comments
 (0)