diff --git a/src/main/java/net/sf/jabref/gui/keyboard/KeyBindingsListener.java b/src/main/java/net/sf/jabref/gui/keyboard/KeyBindingsListener.java index df430c10ee8..96179aa7c44 100644 --- a/src/main/java/net/sf/jabref/gui/keyboard/KeyBindingsListener.java +++ b/src/main/java/net/sf/jabref/gui/keyboard/KeyBindingsListener.java @@ -4,6 +4,7 @@ import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Locale; +import java.util.stream.Collectors; /** * respond to grabKey and display the key binding @@ -101,14 +102,7 @@ private String getModifierText(KeyEvent evt) { modifiersList.add("meta"); } //Now build the String with all the modifier texts - String modifiersAsString = ""; - for (String s : modifiersList) { - //add a spacing if its not the first modifier to be added - if (!"".equals(modifiersAsString)) { - modifiersAsString += " "; - } - modifiersAsString += s; - } + String modifiersAsString = modifiersList.stream().collect(Collectors.joining(" ")); return modifiersAsString; } }