Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-09 05:19:16 +0000
committerAlexander Kurtakov2017-09-09 05:19:16 +0000
commitb01ac61998096f896a01308f8f85cccf49eacdd5 (patch)
tree2a5d2099fb596063226054e2adbe79035d2f4ff2 /org.eclipse.ua.tests/help
parent00f7de7ddcabe81ebcdbbb15d6f8dc03c5fae8f0 (diff)
downloadeclipse.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>
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java8
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java8
9 files changed, 20 insertions, 22 deletions
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");

Back to the top