diff options
author | Alexander Kurtakov | 2017-09-09 05:19:16 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-09 05:19:16 +0000 |
commit | b01ac61998096f896a01308f8f85cccf49eacdd5 (patch) | |
tree | 2a5d2099fb596063226054e2adbe79035d2f4ff2 | |
parent | 00f7de7ddcabe81ebcdbbb15d6f8dc03c5fae8f0 (diff) | |
download | eclipse.platform.ua-b01ac61998096f896a01308f8f85cccf49eacdd5.tar.gz eclipse.platform.ua-b01ac61998096f896a01308f8f85cccf49eacdd5.tar.xz eclipse.platform.ua-b01ac61998096f896a01308f8f85cccf49eacdd5.zip |
Bug 520255 - Replace StringBuffer with StringBuilder in
eclipse.platform.ua
Change-Id: Id1b13e8bb510dfdd4e4b8ff2f1f466f6b89fd513
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
17 files changed, 63 insertions, 72 deletions
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/LinkCheckServlet.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/LinkCheckServlet.java index f2edceb0a..0368ccf0e 100644 --- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/LinkCheckServlet.java +++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/LinkCheckServlet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 IBM Corporation and others. + * Copyright (c) 2009, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ public class LinkCheckServlet extends HttpServlet { throws IOException { req.setCharacterEncoding("UTF-8"); //$NON-NLS-1$ resp.setContentType("text/html; charset=UTF-8"); //$NON-NLS-1$ - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("<BODY>Link Checker</BODY>"); String response = buf.toString(); resp.getWriter().write(response); diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java index 8c7ac01a4..01ad54330 100644 --- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java +++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 IBM Corporation and others. + * Copyright (c) 2009, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,13 +25,10 @@ import org.eclipse.help.webapp.IFilter; * dynamic help view. */ public class AddScriptFilter implements IFilter { - /* - * @see IFilter#filter(HttpServletRequest, OutputStream) - */ @Override public OutputStream filter(HttpServletRequest req, OutputStream out) { String relativePath = FilterUtils.getRelativePathPrefix(req); - StringBuffer script = new StringBuffer(); + StringBuilder script = new StringBuilder(); script.append("\n<script type=\"text/javascript\" src=\""); script.append(relativePath); script.append("content/org.eclipse.ua.tests.doc/checkdoc.js\"> </script>"); //$NON-NLS-1$ diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/TocLinkChecker.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/TocLinkChecker.java index 66219c9bb..5a8064c5a 100644 --- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/TocLinkChecker.java +++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/TocLinkChecker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 IBM Corporation and others. + * Copyright (c) 2007, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -118,7 +118,7 @@ public class TocLinkChecker { } private void doAssert(List<BrokenLink> failures) { - StringBuffer message = new StringBuffer(); + StringBuilder message = new StringBuilder(); for (int i = 0; i < failures.size(); i++) { BrokenLink link = failures.get(i); message.append("Invalid link in \"" + link.getTocID() + "\": " + link.getHref() + "\n"); diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java index 06165a4bb..247603b8e 100644 --- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java +++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 IBM Corporation and others. + * Copyright (c) 2009, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ public class UATestContentProducer implements IHelpContentProducer { } private String filterNonAlpha(String input) { - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); if (c == ' ' || Character.isLetter(c)) { diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java index b9fb8e94f..0ccef862f 100644 --- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java +++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2016 IBM Corporation and others. + * Copyright (c) 2006, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -67,12 +67,9 @@ public class XMLUtil extends Assert { private static class Handler extends DefaultHandler { - private StringBuffer buf = new StringBuffer(); + private StringBuilder buf = new StringBuilder(); private EntityResolver entityResolver = new LocalEntityResolver(); - /* (non-Javadoc) - * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) - */ @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { buf.append('<'); diff --git a/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java b/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java index 6257e7509..5ab80da76 100644 --- a/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java +++ b/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 IBM Corporation and others. + * Copyright (c) 2011, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ public class CounterServlet extends HttpServlet { throws ServletException, IOException { req.setCharacterEncoding("UTF-8"); //$NON-NLS-1$ resp.setContentType("text/html; charset=UTF-8"); //$NON-NLS-1$ - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(XHTML_1); buf.append("Connter Servlet"); buf.append(XHTML_2); diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java index 3c3a522de..59f026042 100644 --- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java +++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,7 +33,7 @@ public class CheatSheetModelSerializer { * Serializes the given cheat sheet model as XML. */ public static String serialize(CheatSheet sheet) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); if (sheet == null) { buf.append("<nullCheatSheet/>\n"); @@ -52,7 +52,7 @@ public class CheatSheetModelSerializer { * Serializes the given Item with the specified indentation. */ public static String serialize(Item item, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (item == null) { buf.append(indent + "<nullItem/>\n"); } @@ -75,7 +75,7 @@ public class CheatSheetModelSerializer { * Serializes the given Action with the specified indentation. */ public static String serialize(Action action, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (action == null) { buf.append(indent + "<nullAction/>\n"); } @@ -95,7 +95,7 @@ public class CheatSheetModelSerializer { * Serializes the given String with the specified indentation. */ public static String serialize(String string, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (string == null) { buf.append(indent + "<nullString/>\n"); } @@ -111,7 +111,7 @@ public class CheatSheetModelSerializer { * Serializes the given AbstractItemExtensionElement with the specified indentation. */ public static String serialize(AbstractItemExtensionElement ext, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(indent + "<itemExtension\n"); buf.append(indent + " attributeName=\"" + ext.getAttributeName() + "\">\n"); buf.append(indent + "</itemExtension>\n"); @@ -122,7 +122,7 @@ public class CheatSheetModelSerializer { * Serializes the given PerformWhen with the specified indentation. */ public static String serialize(PerformWhen performWhen, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (performWhen == null) { buf.append(indent + "<nullPerformWhen/>\n"); } @@ -139,7 +139,7 @@ public class CheatSheetModelSerializer { * Serializes the given AbstractSubItem with the specified indentation. */ public static String serialize(AbstractSubItem subItem, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (subItem == null) { buf.append(indent + "<nullSubItem/>\n"); } @@ -179,11 +179,10 @@ public class CheatSheetModelSerializer { * Serializes the given array with the specified indentation. */ public static String serialize(Object[] array, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (array == null) { buf.append(indent + "<nullArray/>\n"); - } - else if (array.length == 0) { + } else if (array.length == 0) { buf.append(indent + "<array/>\n"); } else { @@ -228,7 +227,7 @@ public class CheatSheetModelSerializer { * Serializes the given List with the specified indentation. */ public static String serialize(List<?> list, String indent) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (list == null) { buf.append(indent + "<nullList/>\n"); } diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java index f36037681..430a4936a 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2016 IBM Corporation and others. + * Copyright (c) 2010, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ public class ParseCriteriaDefinition { // Replaces white space between ">" and "<" by a single newline private String trimWhiteSpace(String input) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); boolean betweenElements = false; for (int i = 0; i < input.length(); i++) { char next = input.charAt(i); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java index 236faa61f..8baec7e6a 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java @@ -56,7 +56,7 @@ public class DynamicXHTMLProcessorTest { private String readStream(InputStream is) throws Exception { try (InputStreamReader inputStreamReader = new InputStreamReader(is, StandardCharsets.UTF_8)) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); char[] cbuf = new char[256]; int len; do { diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java index 41f79d57d..bab5ee687 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2016 IBM Corporation and others. + * Copyright (c) 2006, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -102,7 +102,7 @@ public class IndexAssemblerTest { // Replaces white space between ">" and "<" by a single newline private String trimWhiteSpace(String input) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); boolean betweenElements = false; for (int i = 0; i < input.length(); i++) { char next = input.charAt(i); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java index 9eaafb906..68ea67a4d 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2016 IBM Corporation and others. + * Copyright (c) 2008, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,11 +30,11 @@ public class ConcurrentTocAccess { private class TocGenerator { private int[] dimensions; - private StringBuffer result; + private StringBuilder result; public String generateToc(int dimensions[]) { this.dimensions = dimensions; - result = new StringBuffer(); + result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); result.append("<?NLS TYPE=\"org.eclipse.help.toc\"?>\n"); result.append("<toc label=\"Test Toc\" >\n"); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java index 15de6424f..0743536b8 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 IBM Corporation and others. + * Copyright (c) 2009, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,7 +56,7 @@ public class RemoteTestUtils { public static String readFromURL(URL url) throws IOException { try (InputStream is = url.openStream(); InputStreamReader inputStreamReader = new InputStreamReader(is, StandardCharsets.UTF_8)) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); char[] cbuf = new char[256]; int len; do { diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java index 336d33bf1..d4f8fca66 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2016 IBM Corporation and others. + * Copyright (c) 2006, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -168,7 +168,7 @@ public class ExtraDirTest { } if (!hrefsToFind.isEmpty() || !unexpectedHrefs.isEmpty()) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("While searching for: " + searchWord + ",\n"); if (!hrefsToFind.isEmpty()) { buf.append("Some of the expected results were not found:\n"); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java index 6e335ce99..40149d960 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java @@ -67,7 +67,7 @@ public class SearchTestUtils { } if (!hrefsToFind.isEmpty() || !unexpectedHrefs.isEmpty()) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("While searching for: " + searchWord + ",\n"); if (!hrefsToFind.isEmpty()) { buf.append("Some of the expected results were not found:\n"); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java index ec823ec83..f0b746dbb 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 IBM Corporation and others. + * Copyright (c) 2009, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.ua.tests.help.util; import java.io.IOException; + import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -19,9 +20,6 @@ import javax.servlet.http.HttpServletResponse; public class LoadTestServlet extends HttpServlet { - public LoadTestServlet() { - } - /** * */ @@ -44,7 +42,7 @@ public class LoadTestServlet extends HttpServlet { } catch (NumberFormatException e) { } - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("<!--"); buf.append(value); buf.append("-->"); diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java index 2153d0c48..297315b06 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 IBM Corporation and others. + * Copyright (c) 2006, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,7 +20,7 @@ public class TocModelSerializer { private static final String EMPTY_STRING = ""; public static String serialize(IToc toc) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); buf.append(serializeAux(toc, "")); return buf.toString(); @@ -28,7 +28,7 @@ public class TocModelSerializer { private static String serializeAux(IToc toc, String indent) { if (!UAContentFilter.isFiltered(toc, HelpEvaluationContext.getContext())) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(indent + "<toc\n"); buf.append(indent + " label=\"" + toc.getLabel() + "\"\n"); buf.append(indent + " href=\"" + toc.getHref() + "\">\n"); @@ -46,7 +46,7 @@ public class TocModelSerializer { private static String serializeAux(ITopic topic, String indent) { if (!UAContentFilter.isFiltered(topic, HelpEvaluationContext.getContext())) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(indent + "<topic\n"); buf.append(indent + " label=\"" + topic.getLabel() + "\"\n"); buf.append(indent + " href=\"" + topic.getHref() + "\">\n"); diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java index fae8301ad..f24386d5d 100644 --- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java +++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,10 +34,10 @@ import org.osgi.framework.Bundle; public class IntroModelSerializer { - private StringBuffer buffer; + private StringBuilder buffer; public IntroModelSerializer(IntroModelRoot root) { - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); printModelRootInfo(root, buffer); // Root Page @@ -64,7 +64,7 @@ public class IntroModelSerializer { return url; } - private void printModelRootInfo(IntroModelRoot model, StringBuffer text) { + private void printModelRootInfo(IntroModelRoot model, StringBuilder text) { text.append("Intro Model Content:"); //$NON-NLS-1$ text.append("\n======================"); //$NON-NLS-1$ text.append("\n\nModel has valid config = " + model.hasValidConfig()); //$NON-NLS-1$ @@ -89,7 +89,7 @@ public class IntroModelSerializer { * @param text * @param root */ - private void printHomePage(AbstractIntroPage rootPage, StringBuffer text) { + private void printHomePage(AbstractIntroPage rootPage, StringBuilder text) { text.append("\n\nHOME PAGE: "); //$NON-NLS-1$ text.append("\n--------------"); //$NON-NLS-1$ text @@ -104,7 +104,7 @@ public class IntroModelSerializer { printPageStyles(rootPage, text); } - private void printPageStyles(AbstractIntroPage page, StringBuffer text) { + private void printPageStyles(AbstractIntroPage page, StringBuilder text) { text.append("\n\tpage styles are = "); //$NON-NLS-1$ String[] styles = page.getStyles(); for (String style : styles) @@ -129,7 +129,7 @@ public class IntroModelSerializer { } } - private void printPageChildren(AbstractIntroPage page, StringBuffer text) { + private void printPageChildren(AbstractIntroPage page, StringBuilder text) { text.append("\n\tpage children = " + page.getChildren().length); //$NON-NLS-1$ text.append("\n"); //$NON-NLS-1$ @@ -138,7 +138,7 @@ public class IntroModelSerializer { } private void printContainerChildren(AbstractIntroContainer container, - StringBuffer text, String indent) { + StringBuilder text, String indent) { AbstractIntroElement[] children = container.getChildren(); for (AbstractIntroElement element : children) { @@ -183,7 +183,7 @@ public class IntroModelSerializer { } } - private void printGroup(StringBuffer text, IntroGroup group, String indent) { + private void printGroup(StringBuilder text, IntroGroup group, String indent) { text.append(indent + "GROUP: id = " + group.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ text.append(indent + "label = " + group.getLabel()); //$NON-NLS-1$ @@ -192,7 +192,7 @@ public class IntroModelSerializer { printContainerChildren(group, text, indent + "\t\t"); //$NON-NLS-1$ } - private void printLink(StringBuffer text, IntroLink link, String indent) { + private void printLink(StringBuilder text, IntroLink link, String indent) { text.append(indent + "LINK: id = " + link.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ text.append(indent + "label = " + link.getLabel()); //$NON-NLS-1$ @@ -201,14 +201,14 @@ public class IntroModelSerializer { text.append(indent + "style-id = " + link.getStyleId()); //$NON-NLS-1$ } - private void printText(StringBuffer text, IntroText introText, String indent) { + private void printText(StringBuilder text, IntroText introText, String indent) { text.append(indent + "TEXT: id = " + introText.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ text.append(indent + "text = " + introText.getText()); //$NON-NLS-1$ text.append(indent + "style-id = " + introText.getStyleId()); //$NON-NLS-1$ } - private void printImage(StringBuffer text, IntroImage image, String indent) { + private void printImage(StringBuilder text, IntroImage image, String indent) { text.append(indent + "IMAGE: id = " + image.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ text.append(indent + "src = " + image.getSrc()); //$NON-NLS-1$ @@ -216,7 +216,7 @@ public class IntroModelSerializer { text.append(indent + "style-id = " + image.getStyleId()); //$NON-NLS-1$ } - private void printHtml(StringBuffer text, IntroHTML html, String indent) { + private void printHtml(StringBuilder text, IntroHTML html, String indent) { text.append(indent + "HTML: id = " + html.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ text.append(indent + "src = " + html.getSrc()); //$NON-NLS-1$ @@ -229,7 +229,7 @@ public class IntroModelSerializer { } - private void printInclude(StringBuffer text, IntroInclude include, + private void printInclude(StringBuilder text, IntroInclude include, String indent) { text.append(indent + "INCLUDE: configId = " + include.getConfigId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ @@ -237,11 +237,11 @@ public class IntroModelSerializer { text.append(indent + "merge-style = " + include.getMergeStyle()); //$NON-NLS-1$ } - private void printHead(StringBuffer text, IntroHead head, String indent) { + private void printHead(StringBuilder text, IntroHead head, String indent) { text.append(indent + "HEAD: src = " + head.getSrc()); //$NON-NLS-1$ } - private void printPageTitle(StringBuffer text, IntroPageTitle title, + private void printPageTitle(StringBuilder text, IntroPageTitle title, String indent) { text.append(indent + "TITLE: id = " + title.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ @@ -249,12 +249,12 @@ public class IntroModelSerializer { text.append(indent + "style-id = " + title.getStyleId()); //$NON-NLS-1$ } - private void printAnchor(StringBuffer text, IntroAnchor anchor, + private void printAnchor(StringBuilder text, IntroAnchor anchor, String indent) { text.append(indent + "ANCHOR: id = " + anchor.getId()); //$NON-NLS-1$ } - private void printContentProvidor(StringBuffer text, + private void printContentProvidor(StringBuilder text, IntroContentProvider provider, String indent) { text.append(indent + "CONTENT PROVIDER: id = " + provider.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ @@ -270,7 +270,7 @@ public class IntroModelSerializer { * * @param text */ - private void printPages(IntroPage[] pages, StringBuffer text) { + private void printPages(IntroPage[] pages, StringBuilder text) { for (IntroPage page : pages) { text.append("\n\nPAGE id = " + page.getId()); //$NON-NLS-1$ text.append("\n----------"); //$NON-NLS-1$ @@ -283,7 +283,7 @@ public class IntroModelSerializer { } } - private void printModelFlagTests(IntroModelRoot model, StringBuffer text) { + private void printModelFlagTests(IntroModelRoot model, StringBuilder text) { text.append("Model Flag Tests: "); //$NON-NLS-1$ text.append("\n----------------"); //$NON-NLS-1$ if (model.getPages().length == 0) { |