diff options
| author | Lars Vogel | 2017-12-15 09:21:30 +0000 |
|---|---|---|
| committer | Lars Vogel | 2017-12-15 09:48:41 +0000 |
| commit | cbc1ea0749bfac8cdf1f1a86c56e033f3c6899fa (patch) | |
| tree | e9c69a730902c70b3816a454b70512f99f9d2cda | |
| parent | 0afed29e9fab7a169ac8eaaa733c8cf8e356b9b6 (diff) | |
| download | eclipse.platform-cbc1ea0749bfac8cdf1f1a86c56e033f3c6899fa.tar.gz eclipse.platform-cbc1ea0749bfac8cdf1f1a86c56e033f3c6899fa.tar.xz eclipse.platform-cbc1ea0749bfac8cdf1f1a86c56e033f3c6899fa.zip | |
Bug 519783 - HTMLPrinter should migrate to StringBuilder I20171219-2000I20171218-2000I20171217-2000I20171216-1500I20171215-2000I20171215-0930
Change-Id: I2ad223b52c4f1d280a20160ea6f7414b4d5e6fe8
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
2 files changed, 5 insertions, 17 deletions
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLAnnotationHover.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLAnnotationHover.java index 157dd0b14..7f3003ba8 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLAnnotationHover.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLAnnotationHover.java @@ -17,9 +17,7 @@ import java.util.List; import java.util.Map; import org.eclipse.ant.internal.ui.editor.AntEditorMessages; - import org.eclipse.jface.internal.text.html.HTMLPrinter; - import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.Position; @@ -164,7 +162,7 @@ public class XMLAnnotationHover implements IAnnotationHover { * Formats a message as HTML text. */ private String formatSingleMessage(String message) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); HTMLPrinter.addPageProlog(buffer); HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message)); HTMLPrinter.addPageEpilog(buffer); @@ -175,7 +173,7 @@ public class XMLAnnotationHover implements IAnnotationHover { * Formats several message as HTML text. */ private String formatMultipleMessages(List<String> messages) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); HTMLPrinter.addPageProlog(buffer); HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(AntEditorMessages.getString("AntAnnotationHover.multipleMarkersAtThisLine"))); //$NON-NLS-1$ diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java index 1d9eb122d..a6136cd08 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java @@ -62,7 +62,7 @@ public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformati * Formats a message as HTML text. Expects the message to already be properly escaped */ private String formatMessage(String message) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); HTMLPrinter.addPageProlog(buffer); HTMLPrinter.addParagraph(buffer, message); HTMLPrinter.addPageEpilog(buffer); @@ -73,7 +73,7 @@ public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformati * Formats a message as HTML text. */ private String formatPathMessage(String[] list) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); HTMLPrinter.addPageProlog(buffer); HTMLPrinter.addSmallHeader(buffer, AntEditorTextMessages.XMLTextHover_4); HTMLPrinter.startBulletList(buffer); @@ -85,11 +85,6 @@ public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformati return buffer.toString(); } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion) - */ @Override public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { @@ -198,7 +193,7 @@ public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformati } private String formatSetMessage(String[] includes, String[] excludes) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); HTMLPrinter.addPageProlog(buffer); if (includes != null && includes.length > 0) { HTMLPrinter.addSmallHeader(buffer, AntEditorTextMessages.XMLTextHover_5); @@ -218,11 +213,6 @@ public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformati return buffer.toString(); } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int) - */ @Override public IRegion getHoverRegion(ITextViewer textViewer, int offset) { if (textViewer != null) { |
