From 66106bcd8ff15838e1f6fbf005a29179a8c2ae76 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 28 Apr 2022 11:38:26 +0200 Subject: [PATCH] Using StringBuilder instead of StringBuffer in XMLMemento Done via a JDT cleanup action --- .../Eclipse UI/org/eclipse/ui/XMLMemento.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java index ca7bb8a4c83..01ee992565c 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java @@ -78,14 +78,14 @@ public static XMLMemento createReadRoot(Reader reader) throws WorkbenchException * protocol restriction if does not exist already */ private static String getAttributeNewValue(Object attributeOldValue) { - StringBuffer strNewValue = new StringBuffer(FILE_STRING); + StringBuilder strNewValue = new StringBuilder(FILE_STRING); if (attributeOldValue instanceof String && ((String) attributeOldValue).length() != 0) { String strOldValue = (String) attributeOldValue; boolean exists = Arrays.asList(strOldValue.split(",")).stream().anyMatch(x -> x.trim().equals(FILE_STRING)); //$NON-NLS-1$ if (!exists) { strNewValue.append(", ").append(strOldValue); //$NON-NLS-1$ } else { - strNewValue = new StringBuffer(strOldValue); + strNewValue = new StringBuilder(strOldValue); } } return strNewValue.toString();