Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2021-01-02 11:54:21 +0000
committerAlexander Kurtakov2021-01-20 07:31:45 +0000
commit0deabf27e64cd8fef5187ba089485d9d3624fca9 (patch)
tree10b19adbc108e2cffae59d045a74ff5a0e9a7eaa
parent7eb44fa8828a38885b239cbe983cfe9e653b8780 (diff)
downloadeclipse.platform.text-0deabf27e64cd8fef5187ba089485d9d3624fca9.tar.gz
eclipse.platform.text-0deabf27e64cd8fef5187ba089485d9d3624fca9.tar.xz
eclipse.platform.text-0deabf27e64cd8fef5187ba089485d9d3624fca9.zip
doogfooding use String.join
Change-Id: I9ce80079af083da39e1abbafa91e24644f975fc3 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/FileTextSearchScope.java9
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/FileNamePatternSearchScope.java9
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java9
3 files changed, 3 insertions, 24 deletions
diff --git a/org.eclipse.search/new search/org/eclipse/search/ui/text/FileTextSearchScope.java b/org.eclipse.search/new search/org/eclipse/search/ui/text/FileTextSearchScope.java
index c526a26e3..94affc8f0 100644
--- a/org.eclipse.search/new search/org/eclipse/search/ui/text/FileTextSearchScope.java
+++ b/org.eclipse.search/new search/org/eclipse/search/ui/text/FileTextSearchScope.java
@@ -193,14 +193,7 @@ public final class FileTextSearchScope extends TextSearchScope {
return BasicElementLabels.getFilePattern("*"); //$NON-NLS-1$
}
Arrays.sort(ext);
- StringBuilder buf= new StringBuilder();
- for (int i= 0; i < ext.length; i++) {
- if (i > 0) {
- buf.append(", "); //$NON-NLS-1$
- }
- buf.append(ext[i]);
- }
- return BasicElementLabels.getFilePattern(buf.toString());
+ return BasicElementLabels.getFilePattern(String.join(", ", ext)); //$NON-NLS-1$
}
/**
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/FileNamePatternSearchScope.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/FileNamePatternSearchScope.java
index 28cd5899a..970ed9091 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/FileNamePatternSearchScope.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/FileNamePatternSearchScope.java
@@ -146,14 +146,7 @@ public class FileNamePatternSearchScope extends TextSearchScope {
public String getFileNamePatternDescription() {
String[] ext= fFileNamePatterns.toArray(new String[fFileNamePatterns.size()]);
Arrays.sort(ext);
- StringBuilder buf= new StringBuilder();
- for (int i= 0; i < ext.length; i++) {
- if (i > 0) {
- buf.append(", "); //$NON-NLS-1$
- }
- buf.append(ext[i]);
- }
- return buf.toString();
+ return String.join(", ", ext); //$NON-NLS-1$
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
index b06292f63..422d9b2b1 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
@@ -98,14 +98,7 @@ public class QuickSearchPreferences {
}
private static String encode(String[] strings) {
- StringBuilder encoded = new StringBuilder();
- for (int i = 0; i < strings.length; i++) {
- if (i>0) {
- encoded.append(", "); //$NON-NLS-1$
- }
- encoded.append(strings[i]);
- }
- return encoded.toString();
+ return String.join(", ", strings); //$NON-NLS-1$
}

Back to the top