File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/codec/language/bm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import java .util .Collections ;
2323import java .util .EnumMap ;
2424import java .util .HashSet ;
25- import java .util .Iterator ;
2625import java .util .LinkedHashSet ;
2726import java .util .List ;
2827import java .util .Locale ;
2928import java .util .Map ;
3029import java .util .Objects ;
3130import java .util .Set ;
3231import java .util .TreeMap ;
32+ import java .util .stream .Collectors ;
3333
3434import org .apache .commons .codec .language .bm .Languages .LanguageSet ;
3535import org .apache .commons .codec .language .bm .Rule .Phoneme ;
@@ -252,17 +252,8 @@ public boolean isFound() {
252252 * @param sep String to separate them with
253253 * @return a single String consisting of each element of {@code strings} interleaved by {@code sep}
254254 */
255- private static String join (final Iterable <String > strings , final String sep ) {
256- final StringBuilder sb = new StringBuilder ();
257- final Iterator <String > si = strings .iterator ();
258- if (si .hasNext ()) {
259- sb .append (si .next ());
260- }
261- while (si .hasNext ()) {
262- sb .append (sep ).append (si .next ());
263- }
264-
265- return sb .toString ();
255+ private static String join (final List <String > strings , final String sep ) {
256+ return strings .stream ().collect (Collectors .joining (sep ));
266257 }
267258
268259 private static final int DEFAULT_MAX_PHONEMES = 20 ;
You can’t perform that action at this time.
0 commit comments