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
1 changed files with 1 additions and 1 deletions

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
* are no packet extensions.
*/
protected synchronized CharSequence getExtensionsXML() {
protected final XmlStringBuilder getExtensionsXML() {
XmlStringBuilder xml = new XmlStringBuilder();
// Add in all standard extension sub-packets.
for (PacketExtension extension : getExtensions()) {