1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Change Packet.getExtensionsXML()

Remove the synchronized, as getExtensions() is properly synchronized and will
return a copy.

Return XmlStringBuilder instead of CharSequence to take advantage of
fast XmlStringBuilder.append(XmlStringBuilder).

Mark the method as final, as it should not be overwritten.
This commit is contained in:
Florian Schmaus 2014-11-05 20:25:51 +01:00
parent 10643cce7c
commit 77a4867450

View file

@ -354,7 +354,7 @@ public abstract class Packet extends TopLevelStreamElement {
* @return the extension sub-packets as XML or the Empty String if there * @return the extension sub-packets as XML or the Empty String if there
* are no packet extensions. * are no packet extensions.
*/ */
protected synchronized CharSequence getExtensionsXML() { protected final XmlStringBuilder getExtensionsXML() {
XmlStringBuilder xml = new XmlStringBuilder(); XmlStringBuilder xml = new XmlStringBuilder();
// Add in all standard extension sub-packets. // Add in all standard extension sub-packets.
for (PacketExtension extension : getExtensions()) { for (PacketExtension extension : getExtensions()) {