Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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