diff options
author | Lars Vogel | 2016-05-04 10:58:35 +0000 |
---|---|---|
committer | Lars Vogel | 2016-05-05 09:31:13 +0000 |
commit | 6b799159067d9d904353f767b5e118ae5a437427 (patch) | |
tree | c0804d25454857d92946982e33ca6cd08e88d5be /org.eclipse.search | |
parent | ec2621e1aec5c10cbd1294bc70e854f7cf9de8b0 (diff) | |
download | eclipse.platform.text-6b799159067d9d904353f767b5e118ae5a437427.tar.gz eclipse.platform.text-6b799159067d9d904353f767b5e118ae5a437427.tar.xz eclipse.platform.text-6b799159067d9d904353f767b5e118ae5a437427.zip |
Bug 492973 - Avoid invoking inefficient new String() constructor in
eclipse.text
Change-Id: I9a45a3bd1583ca517a124ea63d70b17d37305d6a
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.search')
3 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.search/new search/org/eclipse/search/core/text/TextSearchScope.java b/org.eclipse.search/new search/org/eclipse/search/core/text/TextSearchScope.java index b91cb525375..fddbf729560 100644 --- a/org.eclipse.search/new search/org/eclipse/search/core/text/TextSearchScope.java +++ b/org.eclipse.search/new search/org/eclipse/search/core/text/TextSearchScope.java @@ -46,7 +46,7 @@ public abstract class TextSearchScope { * @return a scope the search scope */ public static TextSearchScope newSearchScope(IResource[] rootResources, Pattern fileNamePattern, boolean visitDerivedResources) { - FileNamePatternSearchScope scope= FileNamePatternSearchScope.newSearchScope(new String(), rootResources, visitDerivedResources); + FileNamePatternSearchScope scope= FileNamePatternSearchScope.newSearchScope("", rootResources, visitDerivedResources); //$NON-NLS-1$ scope.setFileNamePattern(fileNamePattern); return scope; } diff --git a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/MatchFilterSelectionDialog.java b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/MatchFilterSelectionDialog.java index 79340fd4fb4..519c1439f87 100644 --- a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/MatchFilterSelectionDialog.java +++ b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/MatchFilterSelectionDialog.java @@ -234,7 +234,7 @@ public class MatchFilterSelectionDialog extends StatusDialog { if (selectedElement != null) fDescription.setText(((MatchFilter) selectedElement).getDescription()); else - fDescription.setText(new String()); + fDescription.setText(""); //$NON-NLS-1$ } private void performFilterListCheckStateChanged() { diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java index 8942085da61..bb3dcccbae5 100644 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java +++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java @@ -369,7 +369,7 @@ public class TextSearchVisitor { // methods to the TextSearchJob class. IProgressMonitor monitor= job.getMonitor(); ReusableMatchAccess matchAccess= job.getReusableMatchAccess(); - Matcher matcher= fSearchPattern.pattern().length() == 0 ? null : fSearchPattern.matcher(new String()); + Matcher matcher= fSearchPattern.pattern().length() == 0 ? null : fSearchPattern.matcher(""); //$NON-NLS-1$ FileCharSequenceProvider fileCharSequenceProvider= new FileCharSequenceProvider(); try { @@ -484,7 +484,7 @@ public class TextSearchVisitor { } } } finally { - matchAccess.initialize(null, 0, 0, new String()); // clear references + matchAccess.initialize(null, 0, 0, ""); // clear references //$NON-NLS-1$ } } |