mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Fix Stanza.overrideExtension(ExtensionElement)
Also fixes SMACK-818.
This commit is contained in:
parent
458d8d98b6
commit
0e31bc8f73
1 changed files with 4 additions and 1 deletions
|
@ -394,7 +394,10 @@ public abstract class Stanza implements TopLevelStreamElement {
|
||||||
public ExtensionElement overrideExtension(ExtensionElement extension) {
|
public ExtensionElement overrideExtension(ExtensionElement extension) {
|
||||||
if (extension == null) return null;
|
if (extension == null) return null;
|
||||||
synchronized (packetExtensions) {
|
synchronized (packetExtensions) {
|
||||||
ExtensionElement removedExtension = removeExtension(extension);
|
// Note that we need to use removeExtension(String, String) here. If would use
|
||||||
|
// removeExtension(ExtensionElement) then we would remove based on the equality of ExtensionElement, which
|
||||||
|
// is not what we want in this case.
|
||||||
|
ExtensionElement removedExtension = removeExtension(extension.getElementName(), extension.getNamespace());
|
||||||
addExtension(extension);
|
addExtension(extension);
|
||||||
return removedExtension;
|
return removedExtension;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue