diff options
author | Alexander Kurtakov | 2017-09-09 06:14:37 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-09 06:14:37 +0000 |
commit | 5637df6a1da1030460329520dff8193ec2d0c46d (patch) | |
tree | 09202276fb683fc5622f3fd2c1be12e3a0510cd0 /org.eclipse.help.ui | |
parent | ae78d6feeb2c8a7159edcbd9249278aae99355a0 (diff) | |
download | eclipse.platform.ua-5637df6a1da1030460329520dff8193ec2d0c46d.tar.gz eclipse.platform.ua-5637df6a1da1030460329520dff8193ec2d0c46d.tar.xz eclipse.platform.ua-5637df6a1da1030460329520dff8193ec2d0c46d.zip |
Bug 520255 - Replace StringBuffer with StringBuilder in
eclipse.platform.ua
Handle help.ui and help.webapp except for cases which involved public
methods signatures although in internal classes.
Change-Id: I5256794e73b5c24f249278005d3529c17f0576f1
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.help.ui')
11 files changed, 33 insertions, 67 deletions
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java index aefe7d6b7..f286fb74b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -96,7 +96,7 @@ public class HelpActivitySupport implements IHelpActivitySupport { int loc = value.indexOf("ACTIVITY_EDITOR"); //$NON-NLS-1$ if (loc!= -1 && className!=null) { needsLiveHelp=true; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(value.substring(0, loc)); buffer.append(getActivityEditorValue(pluginId, className, embedded)); buffer.append(value.substring(loc+15)); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java index 447b1d165..6ac173a75 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -63,17 +63,11 @@ public class StyledLineWrapper implements StyledTextContent { setText(text); } - /** - * @see StyledTextContent#addTextChangeListener(TextChangeListener) - */ @Override public void addTextChangeListener(TextChangeListener l) { // do nothing } - /** - * @see StyledTextContent#getCharCount() - */ @Override public int getCharCount() { if (charCount != -1) @@ -84,9 +78,6 @@ public class StyledLineWrapper implements StyledTextContent { return charCount; } - /** - * @see StyledTextContent#getLine(int) - */ @Override public String getLine(int i) { if ((i >= lines.size()) || (i < 0)) @@ -94,9 +85,6 @@ public class StyledLineWrapper implements StyledTextContent { return lines.get(i); } - /** - * @see StyledTextContent#getLineAtOffset(int) - */ @Override public int getLineAtOffset(int offset) { if (offset >= getCharCount()) @@ -109,9 +97,6 @@ public class StyledLineWrapper implements StyledTextContent { return line; } - /** - * @see StyledTextContent#getLineCount() - */ @Override public int getLineCount() { if (lines.size() == 0) @@ -119,17 +104,11 @@ public class StyledLineWrapper implements StyledTextContent { return lines.size(); } - /** - * @see StyledTextContent#getLineDelimiter() - */ @Override public String getLineDelimiter() { return null; } - /** - * @see StyledTextContent#getOffsetAtLine(int) - */ @Override public int getOffsetAtLine(int line) { if (lines.size() == 0) @@ -140,9 +119,6 @@ public class StyledLineWrapper implements StyledTextContent { return offset; } - /** - * @see StyledTextContent#getTextRange(int, int) - */ @Override public String getTextRange(int start, int end) { int l1 = getLineAtOffset(start); @@ -150,7 +126,7 @@ public class StyledLineWrapper implements StyledTextContent { if (l1 == l2) return getLine(l1).substring(start - getOffsetAtLine(l1), end - start); - StringBuffer range = new StringBuffer(getLine(l1).substring( + StringBuilder range = new StringBuilder(getLine(l1).substring( start - getOffsetAtLine(l1))); for (int i = l1 + 1; i < l2; i++) range.append(getLine(i)); @@ -158,25 +134,16 @@ public class StyledLineWrapper implements StyledTextContent { return range.toString(); } - /** - * @see StyledTextContent#removeTextChangeListener(TextChangeListener) - */ @Override public void removeTextChangeListener(TextChangeListener arg0) { // do nothing } - /** - * @see StyledTextContent#replaceTextRange(int, int, String) - */ @Override public void replaceTextRange(int arg0, int arg1, String arg2) { // do nothing } - /** - * @see StyledTextContent#setText(String) - */ @Override public void setText(String text) { if (text == null) diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java index cef402645..86eacb9fa 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -96,7 +96,7 @@ public class InfoCenterPage extends RootScopePage { } public void store(IPreferenceStore store) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); AdaptableHelpResource[] elements = getElements(); for (int i = 0; i < elements.length; i++) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java index 66e18a753..d5fcbbea7 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 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 @@ -54,7 +54,7 @@ public class EscapeUtils { } int next = 0; - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); int index = message.indexOf('&'); while (index >= 0) { result.append(message.substring(next, index + 1)); @@ -70,7 +70,7 @@ public class EscapeUtils { if (value == null) { return null; } - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java index df697e977..8f7ff699e 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -409,7 +409,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } private String buildSearchExpression(String[] searchTerms) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for (int i = 0; i < searchTerms.length; i++) { if (buff.length() > 0) buff.append(" OR "); //$NON-NLS-1$ @@ -558,7 +558,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { private String formatHelpContext(IContext context) { String locale = Platform.getNL(); - StringBuffer sbuf = new StringBuffer(); + StringBuilder sbuf = new StringBuilder(); sbuf.append("<form>"); //$NON-NLS-1$ sbuf.append("<p>"); //$NON-NLS-1$ sbuf.append(decodeContextBoldTags(context)); @@ -653,7 +653,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { return sbuf.toString(); } - private void addCategory(StringBuffer sbuf, String category) { + private void addCategory(StringBuilder sbuf, String category) { if (category == null) category = Messages.ContextHelpPart_seeAlso; sbuf.append("<p><span color=\""); //$NON-NLS-1$ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java index eec77dd4e..5de6d501d 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -263,14 +263,14 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { BaseHelpSystem.getSearchManager().search(searchQuery, localResults, monitor); SearchHit[] hits = localResults.getSearchHits(); - updateResults(phrase, excludeContext, new StringBuffer(), hits); + updateResults(phrase, excludeContext, new StringBuilder(), hits); } void scheduleSearch(Job job) { if (runningJob != null) { runningJob.cancel(); } - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p><span color=\""); //$NON-NLS-1$ buff.append(IFormColors.TITLE); @@ -290,14 +290,15 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { } private void updateResults(final String phrase, - final IContext excludeContext, final StringBuffer buffer, + final IContext excludeContext, final StringBuilder buffer, final SearchHit[] hits) { if (getSection().isDisposed()) return; getSection().getDisplay().asyncExec(() -> doUpdateResults(phrase, excludeContext, buffer, hits)); } - private void doUpdateResults(String phrase, IContext excludeContext, StringBuffer buff, SearchHit[] hits) { + private void doUpdateResults(String phrase, IContext excludeContext, StringBuilder buff, + SearchHit[] hits) { if (runningJob != null) { runningJob.cancel(); } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java index 8ef81fa4e..baecadbb7 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -187,7 +187,7 @@ public class EngineResultSection { private void initializeText() { Bundle bundle = Platform.getBundle("org.eclipse.ui.views"); //$NON-NLS-1$ if (bundle != null) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p><a href=\""); //$NON-NLS-1$ buff.append(HREF_PROGRESS); @@ -248,7 +248,7 @@ public class EngineResultSection { public synchronized void canceling() { if (hits.size() == 0 && !searchResults.isDisposed()) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p><span color=\"summary\">");//$NON-NLS-1$ buff.append(Messages.EngineResultSection_canceling); @@ -334,7 +334,7 @@ public class EngineResultSection { void updateResults(boolean reflow) { ISearchEngineResult[] results = getResults(); updateSectionTitle(results.length); - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("<form>"); //$NON-NLS-1$ IHelpResource oldCat = null; @@ -479,7 +479,7 @@ public class EngineResultSection { return null; } - private void updateErrorStatus(StringBuffer buff) { + private void updateErrorStatus(StringBuilder buff) { int indent = 21; buff.append("<li indent=\"" + indent + "\" style=\"image\" value=\""); //$NON-NLS-1$ //$NON-NLS-2$ buff.append(ISharedImages.IMG_OBJS_ERROR_TSK); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java index a0f2828c4..176add750 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2016 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -55,7 +55,7 @@ public class HistoryScopeSet extends ScopeSet { @Override protected String encodeFileName(String name) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char c = name.charAt(i); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java index 856328b3b..eeacde6d0 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -1711,7 +1711,7 @@ public class ReusableHelpPart implements IHelpUIConstants, .getShowAllMessage(); if (message == null) return Messages.AskShowAll_message; - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); int state = STATE_START; for (int i = 0; i < message.length(); i++) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java index 8f9021e49..624d25174 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2016 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 @@ -33,7 +33,6 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout; public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { - public class ScopeObserver implements Observer { @Override @@ -98,8 +97,8 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { } private void setScopeLink(String name) { - StringBuffer buff = new StringBuffer(); - StringBuffer nameBuff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); + StringBuilder nameBuff = new StringBuilder(); nameBuff.append("</b> <a href=\"rescope\" "); //$NON-NLS-1$ if (!Platform.getWS().equals(Platform.WS_GTK)) { nameBuff.append(" alt=\""); //$NON-NLS-1$ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java index 997c3aada..1a4cd2be7 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -63,7 +63,6 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout; public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUIConstants { - public class SearchScopeObserver implements Observer { @Override @@ -366,7 +365,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo } private void updateSearchWordText() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p>"); //$NON-NLS-1$ buff.append(Messages.expression_label); |